<d1b2>
<fredzo_72653> @azonenberg is there a way to have the waveform start at T=0 but display the yellow arrow at T+x to show the scope's trigger point ? I tries to different combinations of m_triggerPhase and m_startFemtoseconds values but with no luck so far. If not I can simply revert @josHua 's change, but I figured it could be nice to visually show the actual scope's trigger point.
dingwat has quit [Quit: Connection closed for inactivity]
<d1b2>
<azonenberg> yes, that is the intent
<d1b2>
<azonenberg> the yellow arrow is supposed to be the trigger offset relative to the start of the waveform
<d1b2>
<azonenberg> you probably have to add half the capture length to the trigger offset or something
<d1b2>
<fredzo_72653> OK thx for the feedback, I'll run more tests tonight when I've the scope with me. What I experienced so far is that m_startFemtoseconds has no impact on the position of the waveform re T=0 but m_triggerPhase does (positionning T=0 at the trigger point when set to x-origin value returned by the scope (which is a negative value when trigger point is in the middle of the screen))
<d1b2>
<azonenberg> startTimestamp / startFemtoseconds are the wall clock time of the waveform
<d1b2>
<azonenberg> integer and fractional part respectively
<d1b2>
<azonenberg> this is provided by the scope's clock if it has one, and by the driver using local system time if not
<d1b2>
<azonenberg> And is used for things like waveform history and markers
<d1b2>
<azonenberg> triggerPhase is a fine precision horizontal shift for the waveform. Normally for most scopes, this is set to a +/- <1 sample value
<d1b2>
<azonenberg> and is used for trigger interpolation
<d1b2>
<azonenberg> the only time it's usually more than one sample in either direction is for deskewing multiple scopes
<d1b2>
<azonenberg> GetTriggerOffset() and SetTriggerOffset() most likely need to add a delta to work properly
<d1b2>
<azonenberg> Look at what the Siglent driver does, for example
<d1b2>
<azonenberg> c++ //Result comes back in scientific notation double sec; sscanf(reply.c_str(), "%le", &sec); m_triggerOffset = static_cast<int64_t>(round(sec * FS_PER_SECOND)); //Convert from midpoint to start point int64_t rate = GetSampleRate(); int64_t halfdepth = GetSampleDepth() / 2; int64_t halfwidth = static_cast<int64_t>(round(FS_PER_SECOND * halfdepth / rate)); m_triggerOffset = halfwidth - m_triggerOffset;
<d1b2>
<fredzo_72653> OK that makes more sense, I was looking in the wrong place 🙂
<d1b2>
<azonenberg> There should be fairly good comments describing this in the Oscilloscope and Waveform class headers
<d1b2>
<azonenberg> (we really need good browsable developer docs)
<d1b2>
<fredzo_72653> @azonenberg , it took me a bit longer than expected because there also was a bug on GetSampleRate() method, but it should now be fixed ! 🔼
azonenberg has quit [Remote host closed the connection]
azonenberg has joined #scopehal
azonenberg has quit [Remote host closed the connection]