As part of my attempt to get my head round the workings of JMRI I have put together several simple layouts on which to test the working of sensors, turnouts etc.. I often need to set all the sensors to the INACTIVE state at startup and have found a simple way of doing just that using a Jython script.
Start of Day Routine
Sets all sensors to INACTIVE
class SoD(jmri.jmrit.automat.AbstractAutomaton) :
self.sen = sensors.getSystemNameList()
print "Setting sensors INACTIVE"
for s in self.sen:
return 0 # one shot, do not loop