Hallo Robert,
Am 20.02.2017 um 15:18 schrieb Robert Helling: > Stefan, > >> On 20.02.2017, at 15:02, Stefan Fuchs <sfu...@gmx.de >> <mailto:sfu...@gmx.de>> wrote: >> >> Now I identified the next hurdle: Is there somewhere the curve >> cylinder pressure versus dive time for every specific cylinder? Or >> how could I create it for a specific cylinder id? I found that this >> is neither in struct cylinder_t, nor in dive or divecomputer. I think >> this somehow works with the struct sample and is created at the >> moment when the profile is finally created. >> What I need to do are two things: >> 1. Get the cylinder pressure for "my" "lastbottomdp" which is a >> struct divedatapoint *. In fact I need the pressure at time >> lastbottomdp.time >> 2. If this value is smaller than the minimum gas result I need to go >> back on the time axis and find the point in time when cylinder >> pressure goes below minimum gas. At this time I like to put the >> event/warning icon. > > the problem is that for computers that don’t have gas information, the > interpolation of cylinder pressures is only done at the plot stage. > The information is in struct plot_data which you find in profile.h, in > particular in cylinderindex and pressure[2] (to access the latter > there is a macro, for usage see profile.c. Strictly speaking, that is > to handle the CCR case which you want to avoid anyway but it’s better > to use this as an accessor). > Hmmm... plot_data is rather difficult to access from planner.c. Or do I miss any easy way to do this? > And as I said: I think it’s cleaner to add an event to the dive rather > than plot directly to the profile. Simply use > > structevent*add_event(structdivecomputer*dc,unsignedinttime,inttype,intflags,intvalue,constchar*name) > Yes, clear. For a test I created a dummy event @25min in this way: add_event(&dive->dc, 60*25, SAMPLE_EVENT_AIRTIME, 0, 0, "Minimum gas exceeded"); When looking for add_event I stumbled across s.th.: I know that one has to be careful where and when it is ok to translate the name of an event. But my guess is that for this event (line 195, diveprofileitem.cpp) we would be allowed to translate it: add_event(&displayed_dive.dc, entry->sec, SAMPLE_EVENT_CEILING, -1, max / 1000, "planned waypoint above ceiling"); What do you think? Ok to change this to: add_event(&displayed_dive.dc, entry->sec, SAMPLE_EVENT_CEILING, -1, max / 1000, translate("gettextFromC", "Planned waypoint above ceiling")); And then there is another one in planner.c where I'm not sure: add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change"); Best regards Stefan -- Stefan Fuchs E-Mail: sfu...@gmx.de <mailto:sfu...@gmx.de>
_______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface