Feature Requested:
Have the CPU_meter change change color at various alarm levels. These alarm levels have been set at 2/3 maximum for Minor alarm (yellow) and 9/10 maximum for Major alarm (red).
Implementation:
Rather than hand code each EPICS .db file to add the alarm files each time we rebuild the front ends, I decided to modify it at the source (since it strikes me as a generally useful alarm level for all front end codes).
First, I modified the feCodeGen.pl script.
I changed
print EPICS "OUTVARIABLE FEC\_$dcuId\_CPU_METER epicsOutput.cpuMeter int ai 0 field(HOPR,\"$rate\") field(LOPR,\"0\")\n";
to
print EPICS "OUTVARIABLE FEC\_$dcuId\_CPU_METER epicsOutput.cpuMeter int ai 0 field(HOPR,\"$rate\") field(LOPR,\"0\") field(HIGH,\"$two_thirds_rate\") field(HSV,\"MINOR\") field(HIHI,\"$ nine_tenths_rate\") field(HHSV,\"MAJOR\")\n";
I added the following two lines just before it as well:
$two_thirds_rate = int($rate * 2 / 3);
$nine_tenths_rate = int($rate * 9 / 10);
However, only the first four fields were actually added to the database file. Apparently fmseq.pl, which populated the database, was hard coded to only handle up to 4 fields.
I modified the fmseq.pl script in /opt/rtcds/caltech/c1/core/advLigoRTS/src/epics/util/ so as to be able to handle up to 6 field values when writing EPICS .db files.
This change was accomplished by simply changing the following line
($junk, $v_name, $v_var, $v_type, $ve_type, $v_init, $v_efield1, $v_efield2, $v_efield3, $v_efield4 ) = split(/\s+/, $_);
to
($junk, $v_name, $v_var, $v_type, $ve_type, $v_init, $v_efield1, $v_efield2, $v_efield3, $v_efield4, $v_efield5, $v_efield6 ) = split(/\s+/, $_);
everywhere it occurred. There were something like 10 instances of it. Also, I added the two lines
$vardb .= " $v_efield5\n";
$vardb .= " $v_efield6\n";
after each set of
$vardb .= " $v_efield1\n";
$vardb .= " $v_efield2\n";
$vardb .= " $v_efield3\n";
$vardb .= " $v_efield4\n";
Lastly, I modified the CPU_METER bar graph on the C1SUS_DEFAULTNAME.adl screen (located in /opt/rtcds/caltech/c1/medm/master/) to use alarm levels, and then ran generate_master_screens.py.
|