Ali Cat
Charter Member
… Donkers of course. Cees has put me onto what turned out to be a most unusual of gauge. Check out the following code snippet.
/* If "fly again" or pause was hit (ELAPSED_SECONDS will be constant). */
if (pelement->source_var.var_value.n == TokenVarLast)
{
/* if it was "fly again" then reset the needle to maximum (on */
/* "fly again" TICK18 is the same for one scan). */
if (Tick18.var_value.n == Tick18Last)
{
NeedlePos = ZUURSTOFDRUK_MAX;
}
/* Else it was pause - return needle position so as not to
/* decrement (when paused TICK18 continues to tick - must return */
/* here or the needle will continue to move!). */
else
{
Tick18Last = Tick18.var_value.n;
return NeedlePos;
}
}
Now some of it is specific to Cees’ gauge but there is a bigger point here. What the if’s do is detect either a "fly again" or a pause. Now what are we to do with this?
Cees, just had to share this one,
AC
/* If "fly again" or pause was hit (ELAPSED_SECONDS will be constant). */
if (pelement->source_var.var_value.n == TokenVarLast)
{
/* if it was "fly again" then reset the needle to maximum (on */
/* "fly again" TICK18 is the same for one scan). */
if (Tick18.var_value.n == Tick18Last)
{
NeedlePos = ZUURSTOFDRUK_MAX;
}
/* Else it was pause - return needle position so as not to
/* decrement (when paused TICK18 continues to tick - must return */
/* here or the needle will continue to move!). */
else
{
Tick18Last = Tick18.var_value.n;
return NeedlePos;
}
}
Now some of it is specific to Cees’ gauge but there is a bigger point here. What the if’s do is detect either a "fly again" or a pause. Now what are we to do with this?
Cees, just had to share this one,
AC