Browse Source

fixes for epics monitor

Matze 5 years ago
parent
commit
367287fa24
2 changed files with 30 additions and 18 deletions
  1. 6 3
      KCG/widgets/epics_widget.py
  2. 24 15
      epics.cfg

+ 6 - 3
KCG/widgets/epics_widget.py

@@ -446,8 +446,10 @@ class EpicsWidget(kcgw.KCGWidgets):
 
 
 
-    def monitorPV(self, pvname=None, value=None, char_value=None, **kw):
-        self.monitorPVList[str(pvname)] = [str(pvname), char_value]
+    def monitorPV(self, pvname=None, value=None, char_value=None, clearname="", **kw):
+        if clearname != "":
+            self.monitorPVList[str(pvname)] = [clearname, char_value]
+        self.monitorPVList[str(pvname)][1] = char_value
         self.updateMonitor()
 
     def updateMonitor(self):
@@ -464,8 +466,9 @@ class EpicsWidget(kcgw.KCGWidgets):
                 try:
                     if caget(item[1]) != None:
                         self.pvList.append(item[1])
+                        self.monitorPV(item[1], char_value=caget(item[1]), clearname=item[0])
                         epics.camonitor(item[1], callback=self.monitorPV)
-                        self.monitorPV(item[1], char_value=caget(item[1]))
+                        
                 except:
                     logging.info('epics add Failed', item[1])
                     pass

+ 24 - 15
epics.cfg

@@ -1,18 +1,27 @@
 [EPICS]
-# These are PVs that will be possible to insert into log files
-# This variable is to be a list consisting of touples of three entries,
-# the first ist the Text that describes the value and the second is the EPICS PV that
-# holds that value. The third sets the PV to be by default aktivated for logging
 epics_log_entry_pvs = [
-    ("Beam Energy (GeV)", "A:SR:BeamInfo:01:Energy", "True"),
-    ("Beam Current (mA)", "A:SR:BeamInfo:01:Current", "True"),
-    ("Beam Lifetime (s)", "A:SR:BeamInfo:01:Lifetime", "False"),
-    ("Beam Lifetime (H:M:S)", "A:SR:BeamInfo:01:Lifetime:String", "False"),
-    ("Injection Rate (mA/s)", "A:SR:BeamInfo:01:InjRate", "False"),
-    ("Injection Rate (mA/5s)", "A:SR:BeamInfo:01:InjRate:5s", "False"),
-    ("Fill Number", "A:SR:OperationStatus:01:FillNumber", "True")
-    ]
-# This pv is used to determine if epics pvs are accessible
+	('Beam Energy (GeV)', 'A:SR:BeamInfo:01:Energy', 'True', 'True'),
+	('Beam Current (mA)', 'A:SR:BeamInfo:01:Current', 'True', 'True'),
+	('Beam Lifetime (s)', 'A:SR:BeamInfo:01:Lifetime', 'False', 'True'),
+	('Beam Lifetime (H:M:S)', 'A:SR:BeamInfo:01:Lifetime:String', 'True', 'True'),
+	('Injection Rate (mA/s)', 'A:SR:BeamInfo:01:InjRate', 'False', 'True'),
+	('Injection Rate (mA/5s)', 'A:SR:BeamInfo:01:InjRate:5s', 'False', 'False'),
+	('Fill Number', 'A:SR:OperationStatus:01:FillNumber', 'True', 'True'),
+	('Voltage (kV)', 'A:SR:RF:01:AccVoltage', 'True', 'True'),
+	('Synchrotronfrequency1 (kHz)', 'A:SR:BBB:01:Z:SRAM:PEAKFREQ1', 'False', 'True'),
+	('Synchrotronfrequency2 (kHz)', 'A:SR:BBB:01:Z:SRAM:PEAKFREQ2', 'False', 'True'),
+	('Squeeze Steps', 'A:SR:FuncGen:01:PulseSum', 'False', 'True'),
+	('LLRF S2 FM Readback', 'A:SR-S2:LLRF:01:FM:Readback', 'False', 'True'),
+   ('LLRF S4 FM Readback', 'A:SR-S4:LLRF:01:FM:Readback', 'False', 'True'),
+   ('LLRF S2 PhaseDelta', 'A:SR-S2:LLRF:01:PhaseDelta', 'False', 'True'),
+   ('LLRF S4 PhaseDelta', 'A:SR-S4:LLRF:01:PhaseDelta', 'False', 'True'),
+	('LLRF S2 VoltageDelta', 'A:SR-S2:LLRF:01:VoltageDelta', 'False', 'True'),
+   ('LLRF S4 VoltageDelta', 'A:SR-S4:LLRF:01:VoltageDelta', 'False', 'True'),
+   ('LLRF S2 mod on', 'A:SR-S2:LLRF:01:BRD1:RAMP:ADDR:RDBK', 'False', 'True'),
+   ('LLRF S4 mod on', 'A:SR-S4:LLRF:01:BRD1:RAMP:ADDR:RDBK', 'False', 'True'),
+   ('Scraper Top Position', 'A:SR-S2:Scraper:01:Top:Position:Readback', 'False', 'True'),
+   ('Scraper Bottom Position', 'A:SR-S2:Scraper:01:Bottom:Position:Readback', 'False', 'True')
+	]
 epics_test_pv = "A:SR:BeamInfo:01:Current"
-# Path to your epics base installation
-epics_base_path = "/opt/epics/base/"
+epics_base_path = "/opt/epics/base/"
+