Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec53e627db |
2
hush.sh
2
hush.sh
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush.sh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush_g1.sh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush_g2.sh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush_g3.sh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush_o2.sh"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
cd /proscan/bd/applications/hush/hla/1.8.1
|
||||
cd /proscan/bd/applications/hush/hla/1.8.2
|
||||
|
||||
# For use if script is sourced rather than executed
|
||||
appNameDefault="hush_pif.sh"
|
||||
|
||||
46
src/gui.py
46
src/gui.py
@@ -419,7 +419,7 @@ class AppGui(QWidget):
|
||||
|
||||
#for sect in self.simple_sector_list:
|
||||
# self.is_sector_standby(sect)
|
||||
|
||||
|
||||
self.timer_awake = QTimer()
|
||||
self.timer_awake.timeout.connect(self.update_awake_alarm_message)
|
||||
self.timer_awake.start(10000)
|
||||
@@ -428,6 +428,19 @@ class AppGui(QWidget):
|
||||
|
||||
def update_awake_alarm_message(self):
|
||||
|
||||
#No alarm in day shift
|
||||
def in_operation_range():
|
||||
current_time = datetime.now().time()
|
||||
#given_time_start = datetime.strptime("07:00AM", "I:%M%p").time()
|
||||
#given_time_stop = datetime.strptime("05:30PM", "I:%M%p").time()
|
||||
given_time_start = datetime.strptime("07:00", "%H:%M").time()
|
||||
given_time_stop = datetime.strptime("17:00", "%H:%M").time()
|
||||
|
||||
if given_time_start <= current_time <= given_time_stop:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def what_alarm(sect, plot_only=False):
|
||||
alarm_val = 0
|
||||
pvdata = self.cafe.getPVCache(
|
||||
@@ -447,8 +460,12 @@ class AppGui(QWidget):
|
||||
datet = date2 if date1 < date2 else date1
|
||||
|
||||
self.simple_tdiff[idx] = self.time_difference(datet)
|
||||
|
||||
if in_operation_range():
|
||||
self.simple_alarm[idx].setStyleSheet(self.no_alarm_sss)
|
||||
alarm_val = 0
|
||||
|
||||
if self.simple_tdiff[idx][0] > int(
|
||||
elif self.simple_tdiff[idx][0] > int(
|
||||
self.input_parameters['alarmMajor']):
|
||||
self.simple_alarm[idx].setStyleSheet(self.alarm_major_sss)
|
||||
alarm_val = 2
|
||||
@@ -484,18 +501,21 @@ class AppGui(QWidget):
|
||||
self.simple_alarm[idx].setText(' Active ')
|
||||
alarm_val = 0
|
||||
|
||||
#elif 'SH' in sect:
|
||||
# continue
|
||||
|
||||
|
||||
else:
|
||||
alarm_val = what_alarm(sect)
|
||||
|
||||
|
||||
#if in_operation_range():
|
||||
# alarm_val = 0
|
||||
# self.simple_alarm[idx].setStyleSheet(self.no_alarm_sss)
|
||||
|
||||
pv = self.settings.data[sect]['alarm']
|
||||
if not self.input_parameters["simulation"]:
|
||||
stat = self.cafe.set(pv, alarm_val)
|
||||
if stat != self.cyca.ECAFE_NOWTACCESS:
|
||||
self.check_status(_pymodule, 'set', pv, stat, _line())
|
||||
#print(pv, sect, alarm_val)
|
||||
if 'Controlroom' in self.assigned_master:
|
||||
stat = self.cafe.set(pv, alarm_val)
|
||||
if stat != self.cyca.ECAFE_NOWTACCESS:
|
||||
self.check_status(_pymodule, 'set', pv, stat, _line())
|
||||
#print(pv, sect, alarm_val)
|
||||
|
||||
|
||||
date1 = self.simple_t0[idx]
|
||||
@@ -537,8 +557,12 @@ class AppGui(QWidget):
|
||||
|
||||
self.simple_alarm[idx].setText(self.alarm_text + str(
|
||||
int(self.simple_tdiff[idx][0])) + ' min ')
|
||||
|
||||
|
||||
|
||||
alarm_val = what_alarm('SH', plot_only=True)
|
||||
#if in_operation_range():
|
||||
# alarm_val = 0
|
||||
|
||||
pv = self.settings.data['SH']['alarm']
|
||||
if not self.input_parameters["simulation"]:
|
||||
stat = self.cafe.set(pv, alarm_val)
|
||||
|
||||
24
src/t.py
Normal file
24
src/t.py
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
def in_range():
|
||||
current_time = datetime.now().time()
|
||||
#given_time_start = datetime.strptime("07:00AM", "I:%M%p").time()
|
||||
#given_time_stop = datetime.strptime("05:30PM", "I:%M%p").time()
|
||||
given_time_start = datetime.strptime("07:00", "%H:%M").time()
|
||||
given_time_stop = datetime.strptime("17:00", "%H:%M").time()
|
||||
|
||||
if given_time_start <= current_time <= given_time_stop:
|
||||
print("in range")
|
||||
return True
|
||||
else:
|
||||
print(current_time)
|
||||
print(given_time_stop)
|
||||
|
||||
|
||||
|
||||
if in_range():
|
||||
print("in range")
|
||||
else:
|
||||
print("not in range")
|
||||
|
||||
Reference in New Issue
Block a user