Files
x04sa-es2/script/local.py
T
2018-01-25 10:31:44 +01:00

32 lines
808 B
Python

###################################################################################################
# Deployment specific global definitions - executed after startup.py
###################################################################################################
DIODE_SETTLING_TIME = 0.01 #10ms
#Devices
run("devices/SimulatedDiode")
add_device(SimulatedDiode("scd_sim"), True)
scd_sim.polling=500
scd_sim.set_center(1.0, 1.0)
#This ios to force read from the device - and not use monitor cache
#scd.setTrustedMonitor(False)
#Builtin functions
def enforce_monotonic(array):
"""
Make sure array has no repeated values
"""
for i in range(1,len(array)):
if abs(array[i] - array[i-1])< 0.0001:
array[i] = array[i-1] + 0.0000001
return array