32 lines
808 B
Python
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
|
|
|