Fix MsgTxt being broken
Some checks failed
Example Action / Lint (push) Successful in 2s
Example Action / BuildAndTest (push) Failing after 9s

This commit is contained in:
2026-02-26 14:27:32 +01:00
parent 9f0a97cf60
commit 37b1e4b593
2 changed files with 10 additions and 5 deletions

View File

@@ -50,9 +50,11 @@ record(longin, "$(INSTR)$(NAME):CHANNELS")
field(DISP, 1)
}
record(stringin, "$(INSTR)$(NAME):MsgTxt")
record(waveform, "$(INSTR)$(NAME):MsgTxt")
{
field(DESC, "Miscellanous messages")
field(FTVL, "CHAR")
field(NELM, 40)
}
record(bi, "$(INSTR)$(NAME):IS_LOWRATE")
@@ -267,9 +269,9 @@ record(aSub, "$(INSTR)$(NAME):EMULATION")
field(FTVE, "DOUBLE")
field(OUTF, "$(INSTR)$(NAME):IS_LOWRATE PP")
field(FTVF, "ULONG")
field(OUTF, "$(INSTR)$(NAME):MsgTxt PP")
field(FTVF, "CHAR")
field(NEVF, 40)
field(OUTG, "$(INSTR)$(NAME):MsgTxt PP")
field(FTVG, "CHAR")
field(NOVG, 40)
}
#######################

View File

@@ -153,6 +153,9 @@ static long processEmulatedCounter(struct aSubRecord *psub)
epicsUInt32* is_low_rate_out = (epicsUInt32*)psub->valf;
epicsOldString* msg_txt_out = (epicsOldString*)psub->valg;
/* Always update the whole string */
psub->nevg = psub->novg = 40;
/* Always no matter what, handle the rate */
/* - Calculate average rate */
spc->average_rate = (spc->proton_rate + spc->prev_proton_rate) / 2;
@@ -202,7 +205,7 @@ static long processEmulatedCounter(struct aSubRecord *psub)
} else if (((spc->status == COUNTING || spc->status == LOW_RATE)
&& spc->command_trig == PAUSE) ||
(spc->status == PAUSED && spc->command_trig == NONE)) {
strcpy(*msg_txt_out, "Stopping!");
strcpy(*msg_txt_out, "Paused!");
/* We are counting or at low rate and received pause.
* Also we are paused but have received no command, this
* is probably slightly inaccurate but simplifies things.*/