From 8b3b3947314b80de0ab47cf7f48ecdf501774921 Mon Sep 17 00:00:00 2001 From: Rolf Bork <rolf.bork@ligo.org> Date: Thu, 18 Jan 2018 22:48:40 +0000 Subject: [PATCH] Updates to DAC status screens to include FIFO status that used to go to /proc files. git-svn-id: https://redoubt.ligo-wa.caltech.edu/svn/advLigoRTS/trunk@4638 6dcd42c9-f523-4c6d-aada-af552506706e --- src/epics/util/lib/Dac.pm | 106 +++++++++++++++++++++++----------- src/epics/util/lib/Dac18.pm | 90 ++++++++++++++++++++++------- src/epics/util/lib/Dac20.pm | 92 ++++++++++++++++++++++------- src/epics/util/lib/medmGen.pm | 66 +++++++++++++++++++++ 4 files changed, 276 insertions(+), 78 deletions(-) diff --git a/src/epics/util/lib/Dac.pm b/src/epics/util/lib/Dac.pm index 1815b49dd..a8de01904 100644 --- a/src/epics/util/lib/Dac.pm +++ b/src/epics/util/lib/Dac.pm @@ -172,6 +172,7 @@ sub frontEndCode { sub createDac16Medm { + my ($medmDir,$mdlName,$site,$dcuid,$medmTarget,$dacNum) = @_; # Define colors to be sent to screen gen. my %ecolors = ( "white" => "0", @@ -189,13 +190,12 @@ sub createDac16Medm my $ii=0; - #my $fname = "$mdlName\_DAC_MONITOR_$::dacCardNum[$dacNum].adl"; my $fname = "$mdlName\_DAC_MONITOR_$dacNum.adl"; # Create MEDM File - print "creating file $medmDir\/$fname DAC 16bit\n"; + print "creating file $medmDir\/$fname \n"; open(OUTMEDM, ">$medmDir/$fname") || die "cannot open $medmDir/$fname for writing "; - my $xpos = 0; my $ypos = 0; my $width = 260; my $height = 460; + my $xpos = 0; my $ypos = 0; my $width = 235; my $height = 570; $medmdata = ("CDS::medmGen::medmGenFile") -> ($medmDir,$fname,$width,$height); # ************* Create Banner ****************************************************************************** @@ -203,72 +203,108 @@ sub createDac16Medm $height = 22; $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{blue},"","",""); # Add Display Name - $xpos = 70; $ypos = 4; $width = 120; $height = 15; + $xpos = 55; $ypos = 4; $width = 120; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"$mdlName\_DAC_MONITOR_$::dacCardNum[$dacNum]",$ecolors{white}); - # Add Time String - $xpos = 0; $ypos = 24; $width = 260; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_TIME_STRING",$ecolors{white},$ecolors{blue},"static"); # ************* Create Background ************************************************************************** # Add Background rectangles - $xpos = 0; $ypos = 45; $width = 265; $height = 400; + $xpos = 14; $ypos = 27; $width = 210; $height = 150; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 198; $width = 210; $height = 365; $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 27; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); + $xpos = 14; $ypos = 180; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); # ************* Add Text ********************************************************************************** # Add DAC top label - $xpos = 33; $ypos = 52; $width = 170; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 16bit",$ecolors{black}); + $xpos = 48; $ypos = 27; $width = 140; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 16 Bit",$ecolors{white}); # Add DAC OUT label - $xpos = 49; $ypos = 97; $width = 45; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUT",$ecolors{black}); - # Add OVERRANGE label - $xpos = 139; $ypos = 83; $width = 75; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OVERRANGE",$ecolors{black}); - # Add PER SEC label - $xpos = 119; $ypos = 97; $width = 45; $height = 15; + $xpos = 50; $ypos = 221; $width = 45; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUTPUT",$ecolors{black}); + # Add OFC OUT label + $xpos = 135; $ypos = 203; $width = 45; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OVERFLOW",$ecolors{black}); + $xpos = 109; $ypos = 221; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"PER SEC",$ecolors{black}); - # Add TOTAL label - $xpos = 171; $ypos = 97; $width = 75; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"TOTAL",$ecolors{black}); + $xpos = 161; $ypos = 221; $width = 45; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"ACCUM",$ecolors{black}); # Add DAC Channel labels - $xpos = 14; $ypos = 116; $width = 35; $height = 15; + $xpos = 15; $ypos = 240; $width = 35; $height = 15; for($ii=0;$ii<16;$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; } - # ************* Add Data Monitors *************************************************************************** - # Add Output Status Monitor - $xpos = 49; $ypos = 83; $width = 45; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); - # Add Overflow Status Monitor - $xpos = 119; $ypos = 83; $width = 20; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); - # Add DAC Data Monitors - $xpos = 49; $ypos = 115; $width = 45; $height = 15; + $xpos = 50; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<16;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 119; $ypos = 115; $width = 45; $height = 15; + $xpos = 110; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<16;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 172; $ypos = 115; $width = 75; $height = 15; + $xpos = 160; $ypos = 238; $width = 55; $height = 15; for($ii=0;$ii<16;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - print OUTMEDM "$medmdata \n"; - close OUTMEDM; - + # ************* Add Data Monitors *************************************************************************** + # Add On Line Status Monitor + $xpos = 26; $ypos = 52; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","0","0",$ecolors{green},$ecolors{red}); + # Add Watchdog Status Monitor + $xpos = 26; $ypos = 67; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); + # Add Overrange Status Monitor + $xpos = 26; $ypos = 82; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); + # Add FIFO Status Monitor + $xpos = 26; $ypos = 112; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","3","3",$ecolors{green},$ecolors{red}); + # Add FIFO EMPTY Monitor + $xpos = 58; $ypos = 132; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","5","5",$ecolors{red},$ecolors{green}); + # Add FIFO HI QTR Monitor + $xpos = 58; $ypos = 147; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","6","6",$ecolors{red},$ecolors{green}); + # Add FIFO FULL Monitor + $xpos = 58; $ypos = 162; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","7","7",$ecolors{red},$ecolors{green}); + # Add ON LINE Label + $xpos = 51; $ypos = 52; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"ON LINE",$ecolors{black}); + # Add WATCHDOG Label + $xpos = 51; $ypos = 67; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"WATCHDOG",$ecolors{black}); + # Add OVERRANGE Label + $xpos = 51; $ypos = 82; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"OVERRANGE",$ecolors{black}); + # Add FIFO STATUS Label + $xpos = 51; $ypos = 112; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FIFO STATUS",$ecolors{black}); + # Add FIFO EMPTY Label + $xpos = 81; $ypos = 132; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"EMPTY",$ecolors{black}); + # Add FIFO HI QTR Label + $xpos = 81; $ypos = 147; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"HIGH QUARTER",$ecolors{black}); + # Add FIFO FULL Label + $xpos = 81; $ypos = 162; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FULL",$ecolors{black}); + +print OUTMEDM "$medmdata \n"; +close OUTMEDM; } diff --git a/src/epics/util/lib/Dac18.pm b/src/epics/util/lib/Dac18.pm index 77351b4b1..a569bbe17 100644 --- a/src/epics/util/lib/Dac18.pm +++ b/src/epics/util/lib/Dac18.pm @@ -192,7 +192,7 @@ sub createDac18Medm print "creating file $medmDir\/$fname \n"; open(OUTMEDM, ">$medmDir/$fname") || die "cannot open $medmDir/$fname for writing "; - my $xpos = 0; my $ypos = 0; my $width = 235; my $height = 275; + my $xpos = 0; my $ypos = 0; my $width = 235; my $height = 410; $medmdata = ("CDS::medmGen::medmGenFile") -> ($medmDir,$fname,$width,$height); # ************* Create Banner ****************************************************************************** @@ -205,60 +205,108 @@ sub createDac18Medm # ************* Create Background ************************************************************************** # Add Background rectangles - $xpos = 13; $ypos = 27; $width = 210; $height = 238; + $xpos = 14; $ypos = 27; $width = 210; $height = 150; $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 198; $width = 210; $height = 200; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 27; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); + $xpos = 14; $ypos = 180; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); # ************* Add Text ********************************************************************************** # Add DAC top label - $xpos = 46; $ypos = 32; $width = 140; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 18bit",$ecolors{black}); + $xpos = 48; $ypos = 27; $width = 140; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 18bit",$ecolors{white}); # Add DAC OUT label - $xpos = 49; $ypos = 52; $width = 45; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUT",$ecolors{black}); + $xpos = 50; $ypos = 221; $width = 45; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUTPUT",$ecolors{black}); # Add OFC OUT label - $xpos = 134; $ypos = 52; $width = 45; $height = 15; + $xpos = 135; $ypos = 203; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OVERFLOW",$ecolors{black}); - $xpos = 108; $ypos = 70; $width = 45; $height = 15; + $xpos = 109; $ypos = 221; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"PER SEC",$ecolors{black}); - $xpos = 160; $ypos = 70; $width = 45; $height = 15; + $xpos = 161; $ypos = 221; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"ACCUM",$ecolors{black}); # Add DAC Channel labels - $xpos = 14; $ypos = 103; $width = 35; $height = 15; + $xpos = 15; $ypos = 240; $width = 35; $height = 15; for($ii=0;$ii<8;$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; } - # ************* Add Data Monitors *************************************************************************** - # Add Output Status Monitor - $xpos = 49; $ypos = 88; $width = 45; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); - # Add Overflow Status Monitor - $xpos = 109; $ypos = 88; $width = 45; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); - # Add DAC Data Monitors - $xpos = 49; $ypos = 102; $width = 45; $height = 15; + $xpos = 50; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 109; $ypos = 102; $width = 45; $height = 15; + $xpos = 110; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 159; $ypos = 102; $width = 55; $height = 15; + $xpos = 160; $ypos = 238; $width = 55; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } + # ************* Add Data Monitors *************************************************************************** + # Add On Line Status Monitor + $xpos = 26; $ypos = 52; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","0","0",$ecolors{green},$ecolors{red}); + # Add Watchdog Status Monitor + $xpos = 26; $ypos = 67; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); + # Add Overrange Status Monitor + $xpos = 26; $ypos = 82; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); + # Add AI Chassis WD Status Monitor + $xpos = 26; $ypos = 97; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","4","4",$ecolors{green},$ecolors{red}); + # Add FIFO Status Monitor + $xpos = 26; $ypos = 112; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","3","3",$ecolors{green},$ecolors{red}); + # Add FIFO EMPTY Monitor + $xpos = 58; $ypos = 132; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","5","5",$ecolors{red},$ecolors{green}); + # Add FIFO HI QTR Monitor + $xpos = 58; $ypos = 147; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","6","6",$ecolors{red},$ecolors{green}); + # Add FIFO FULL Monitor + $xpos = 58; $ypos = 162; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","7","7",$ecolors{red},$ecolors{green}); + # Add ON LINE Label + $xpos = 51; $ypos = 52; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"ON LINE",$ecolors{black}); + # Add WATCHDOG Label + $xpos = 51; $ypos = 67; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"WATCHDOG",$ecolors{black}); + # Add OVERRANGE Label + $xpos = 51; $ypos = 82; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"OVERRANGE",$ecolors{black}); + # Add AI CHASSIS WD Label + $xpos = 51; $ypos = 97; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"AI CHASSIS WD",$ecolors{black}); + # Add FIFO STATUS Label + $xpos = 51; $ypos = 112; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FIFO STATUS",$ecolors{black}); + # Add FIFO EMPTY Label + $xpos = 81; $ypos = 132; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"EMPTY",$ecolors{black}); + # Add FIFO HI QTR Label + $xpos = 81; $ypos = 147; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"HIGH QUARTER",$ecolors{black}); + # Add FIFO FULL Label + $xpos = 81; $ypos = 162; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FULL",$ecolors{black}); + print OUTMEDM "$medmdata \n"; close OUTMEDM; diff --git a/src/epics/util/lib/Dac20.pm b/src/epics/util/lib/Dac20.pm index 88e9cc83d..42181137c 100644 --- a/src/epics/util/lib/Dac20.pm +++ b/src/epics/util/lib/Dac20.pm @@ -171,6 +171,7 @@ sub frontEndCode { #// This code requires /lib/medmGen.pm \n\n sub createDac20Medm { + my ($medmDir,$mdlName,$site,$dcuid,$medmTarget,$dacNum) = @_; # Define colors to be sent to screen gen. my %ecolors = ( "white" => "0", @@ -193,7 +194,7 @@ sub createDac20Medm print "creating file $medmDir\/$fname \n"; open(OUTMEDM, ">$medmDir/$fname") || die "cannot open $medmDir/$fname for writing "; - my $xpos = 0; my $ypos = 0; my $width = 235; my $height = 275; + my $xpos = 0; my $ypos = 0; my $width = 235; my $height = 410; $medmdata = ("CDS::medmGen::medmGenFile") -> ($medmDir,$fname,$width,$height); # ************* Create Banner ****************************************************************************** @@ -206,62 +207,109 @@ sub createDac20Medm # ************* Create Background ************************************************************************** # Add Background rectangles - $xpos = 13; $ypos = 27; $width = 210; $height = 238; + $xpos = 14; $ypos = 27; $width = 210; $height = 150; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 198; $width = 210; $height = 200; $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{gray},"","",""); + $xpos = 14; $ypos = 27; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); + $xpos = 14; $ypos = 180; $width = 210; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenRectangle") -> ($xpos,$ypos,$width,$height,$ecolors{black},"","",""); # ************* Add Text ********************************************************************************** # Add DAC top label - $xpos = 46; $ypos = 32; $width = 140; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 20bit",$ecolors{black}); + $xpos = 48; $ypos = 27; $width = 140; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"DAC $::dacCardNum[$dacNum] - 20 Bit",$ecolors{white}); # Add DAC OUT label - $xpos = 49; $ypos = 52; $width = 45; $height = 15; - $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUT",$ecolors{black}); + $xpos = 50; $ypos = 221; $width = 45; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OUTPUT",$ecolors{black}); # Add OFC OUT label - $xpos = 134; $ypos = 52; $width = 45; $height = 15; + $xpos = 135; $ypos = 203; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"OVERFLOW",$ecolors{black}); - $xpos = 108; $ypos = 70; $width = 45; $height = 15; + $xpos = 109; $ypos = 221; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"PER SEC",$ecolors{black}); - $xpos = 160; $ypos = 70; $width = 45; $height = 15; + $xpos = 161; $ypos = 221; $width = 45; $height = 15; $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"ACCUM",$ecolors{black}); # Add DAC Channel labels - $xpos = 14; $ypos = 103; $width = 35; $height = 15; + $xpos = 15; $ypos = 240; $width = 35; $height = 15; for($ii=0;$ii<8;$ii+=2) { $medmdata .= ("CDS::medmGen::medmGenText") -> ($xpos,$ypos,$width,$height,"CH $ii",$ecolors{black}); $ypos += 40; } - # ************* Add Data Monitors *************************************************************************** - # Add Output Status Monitor - $xpos = 49; $ypos = 88; $width = 45; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); - # Add Overflow Status Monitor - $xpos = 109; $ypos = 88; $width = 45; $height = 12; - $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); - # Add DAC Data Monitors - $xpos = 49; $ypos = 102; $width = 45; $height = 15; + $xpos = 50; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OUTPUT_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 109; $ypos = 102; $width = 45; $height = 15; + $xpos = 110; $ypos = 238; $width = 45; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } - $xpos = 159; $ypos = 102; $width = 55; $height = 15; + $xpos = 160; $ypos = 238; $width = 55; $height = 15; for($ii=0;$ii<8;$ii++) { $medmdata .= ("CDS::medmGen::medmGenTextMon") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_OVERFLOW_ACC_$dacNum\_$ii",$ecolors{white},$ecolors{blue},"static"); $ypos += 20; } + # ************* Add Data Monitors *************************************************************************** + # Add On Line Status Monitor + $xpos = 26; $ypos = 52; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","0","0",$ecolors{green},$ecolors{red}); + # Add Watchdog Status Monitor + $xpos = 26; $ypos = 67; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","1","1",$ecolors{green},$ecolors{red}); + # Add Overrange Status Monitor + $xpos = 26; $ypos = 82; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","2","2",$ecolors{green},$ecolors{red}); + # Add AI Chassis WD Status Monitor + $xpos = 26; $ypos = 97; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","4","4",$ecolors{green},$ecolors{red}); + # Add FIFO Status Monitor + $xpos = 26; $ypos = 112; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","3","3",$ecolors{green},$ecolors{red}); + # Add FIFO EMPTY Monitor + $xpos = 58; $ypos = 132; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","5","5",$ecolors{red},$ecolors{green}); + # Add FIFO HI QTR Monitor + $xpos = 58; $ypos = 147; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","6","6",$ecolors{red},$ecolors{green}); + # Add FIFO FULL Monitor + $xpos = 58; $ypos = 162; $width = 12; $height = 12; + $medmdata .= ("CDS::medmGen::medmGenByte") -> ($xpos,$ypos,$width,$height,"$site\:FEC-$dcuid\_DAC_STAT_$dacNum","7","7",$ecolors{red},$ecolors{green}); + # Add ON LINE Label + $xpos = 51; $ypos = 52; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"ON LINE",$ecolors{black}); + # Add WATCHDOG Label + $xpos = 51; $ypos = 67; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"WATCHDOG",$ecolors{black}); + # Add OVERRANGE Label + $xpos = 51; $ypos = 82; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"OVERRANGE",$ecolors{black}); + # Add AI CHASSIS WD Label + $xpos = 51; $ypos = 97; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"AI CHASSIS WD",$ecolors{black}); + # Add FIFO STATUS Label + $xpos = 51; $ypos = 112; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FIFO STATUS",$ecolors{black}); + # Add FIFO EMPTY Label + $xpos = 81; $ypos = 132; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"EMPTY",$ecolors{black}); + # Add FIFO HI QTR Label + $xpos = 81; $ypos = 147; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"HIGH QUARTER",$ecolors{black}); + # Add FIFO FULL Label + $xpos = 81; $ypos = 162; $width = 100; $height = 15; + $medmdata .= ("CDS::medmGen::medmGenTextLeft") -> ($xpos,$ypos,$width,$height,"FULL",$ecolors{black}); + print OUTMEDM "$medmdata \n"; close OUTMEDM; - } diff --git a/src/epics/util/lib/medmGen.pm b/src/epics/util/lib/medmGen.pm index b6ed60bf6..0e0425790 100644 --- a/src/epics/util/lib/medmGen.pm +++ b/src/epics/util/lib/medmGen.pm @@ -122,6 +122,35 @@ text { END } +#// \b sub \b medmGenTextLeft ($xpos,$ypos,$wid,$ht,$tix,$fgc) \n +#// This sub will create an MEDM text block ************************************************* \n +#// 0 = xpos \n +#// 1 = ypos \n +#// 2 = width \n +#// 3 = height \n +#// 4 = Text string \n +#// 5 = Text color \n\n +sub medmGenTextLeft +{ +my ($xpos,$ypos,$wid,$ht,$tix,$fgc) = @_; + return <<END; +text { + object { + x=$xpos + y=$ypos + width=$wid + height=$ht + } + "basic attribute" { + clr=$fgc + } + align="horiz. left" + textix="$tix" + +} +END +} + #// \b sub \b medmGenTextDyn ($xpos,$ypos,$wid,$ht,$tix,$fgc,$mcalc,$chan) \n #// This sub will create an MEDM dynamic text block ************************************************* \n #// 0 = xpos \n @@ -191,6 +220,43 @@ byte { +END +} + +#// \b sub \b medmGenByteDown ($xpos,$ypos,$wid,$ht,$chan,$sb,$eb,$oclr,$zclr) \n +#// This sub will create an MEDM byte monitor ************************************************* \n +#// 0 = xpos \n +#// 1 = ypos \n +#// 2 = width \n +#// 3 = height \n +#// 4 = EPICS channel name \n +#// 5 = Starting bit \n +#// 6 = End bit \n +#// 7 = "1" color \n +#// 8= "0" color \n\n +sub medmGenByteDown +{ +my ($xpos,$ypos,$wid,$ht,$chan,$sb,$eb,$oclr,$zclr) = @_; + return <<END; +byte { + object { + x=$xpos + y=$ypos + width=$wid + height=$ht + } + monitor { + chan="$chan" + clr=$oclr + bclr=$zclr + } + direction="down" + sbit=$sb + ebit=$eb +} + + + END } -- GitLab