Cleans up files

This commit is contained in:
Patrick McDonagh
2016-10-20 20:14:39 -05:00
parent 956effd9b0
commit 84eafaf8ea
71 changed files with 0 additions and 3748 deletions

View File

@@ -1,68 +0,0 @@
class Channel():
def read(self):
valData = u800.readMicroTag(self.device_addr, self.tag)
if valData:
nowVal = valData[0]
if self.map_obj:
nowVal = self.map_obj[nowVal]
self.data_type = valData[1]
if (self.data_type == "BOOL") or (type(nowVal) is str) or (type(nowVal) is str):
if self.last_value == "":
self.sendFn(self.name, nowVal, 0)
self.last_time_uploaded = time.time()
self.last_value = nowVal
elif (not (self.last_value == nowVal)) or ((time.time() - self.last_time_uploaded) > self.max_time_between_uploads):
self.sendFn(self.name, nowVal, 0)
self.last_time_uploaded = time.time()
self.last_value = nowVal
elif (self.data_type == "REAL") or (self.data_type[-3:] == "INT"):
if self.last_value == "":
self.sendFn(self.name, nowVal, 0)
self.last_time_uploaded = time.time()
self.last_value = nowVal
elif (abs(self.last_value - nowVal) > self.change_threshold) or ((time.time() - self.last_time_uploaded) > self.max_time_between_uploads):
self.sendFn(self.name, nowVal, 0)
self.last_time_uploaded = time.time()
self.last_value = nowVal
return True
return False
def __init__(self, name, tag, max_time_between_uploads, sendFn, change_threshold=0.0, e300_param=False, writeable=False, map_obj=None):
global addr
self.name = name
self.tag = tag
self.data_type = ''
self.last_value = ''
self.last_time_uploaded = 0
self.change_threshold = change_threshold
self.max_time_between_uploads = int(max_time_between_uploads)
self.sendFn = sendFn
self.device_addr = addr
self.writeable = bool(writeable)
self.map_obj = map_obj
self.e300_param = e300_param
self.read()
def write(self, val, handshake=None, handshake_val=None):
if self.writeable:
if not self.e300_param:
if handshake is None:
if u800.writeMicroTag(self.device_addr, self.tag, val):
self.sendFn(self.name, val, time.time())
self.last_value = val
return True
else:
return False
else:
return u800.writeMicroTag(self.device_addr, self.tag, val, handshake=handshake, handshake_val=handshake_val)
else:
if u800.writeMicroTag(self.device_addr, self.tag, val):
if u800.writeMicroTag(self.device_addr, "write_E300", 1):
self.sendFn(self.name, val, time.time())
self.last_value = val
return True
return False
else:
print("NOT ALLOWED TO WRITE TO {}".format(self.name))
return False

View File

@@ -1,32 +0,0 @@
cfg_AlarmDowntimeSec
cfg_AlarmLockoutLimit
cfg_AlarmRecoverSeconds
cfg_DHSensorDistToIntake
cfg_DHSensorPressureOffset
cfg_FluidSpecificGravity
cfg_Manual_Frequency
cfg_PID_Flow
cfg_PID_FlowSP
cfg_PID_IntakePressure
cfg_PID_IntakePressureSP
cfg_PID_Manual
cfg_PID_ManualSP
cfg_PID_TubingPressure
cfg_PID_TubingPressureSP
cfg_PumpOffDowntimeSec
cmd_ResetAlarms
cmd_Restart
cmd_Run
cmd_Start
cmd_Stop
VFD_MotorNPAmps
VFD_MotorNPHertz
VFD_MotorNPHorsepower
VFD_MotorNPOLFactor
VFD_MotorNPRPM
VFD_MotorNPVolts
VFD_MotorPoles