From: Ken C. <ke...@us...> - 2009-07-31 19:33:02
|
Update of /cvsroot/jmri/scripts/jython In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17772/jython Modified Files: RobotThrottle2.py Log Message: Fixed red stop timer error. Fixed horn button. Index: RobotThrottle2.py =================================================================== RCS file: /cvsroot/jmri/scripts/jython/RobotThrottle2.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RobotThrottle2.py 30 Jul 2009 13:07:42 -0000 1.4 --- RobotThrottle2.py 31 Jul 2009 19:32:52 -0000 1.5 *************** *** 523,527 **** def doSpeedRed(self): ! if (self.currentThrottle != None and self.currentThrottle.getSpeedSetting() != 0 and (self.redDelayTimer == None or self.redDelayTimer.isRunning == False)) : i = int(self.locoSpeedRed.text) * 0.01 self.currentThrottle.setSpeedSetting(i) --- 523,527 ---- def doSpeedRed(self): ! if (self.currentThrottle != None and self.currentThrottle.getSpeedSetting() != 0 and (self.redDelayTimer == None or self.redDelayTimer.isRunning() == False)) : i = int(self.locoSpeedRed.text) * 0.01 self.currentThrottle.setSpeedSetting(i) *************** *** 632,649 **** # handle the horn button on def whenLocoHornOn(self, event) : ! self.whenLocoHorn(event, True) return # handle the horn button off def whenLocoHornOff(self, event) : ! self.whenLocoHorn(event, False) return ! def whenLocoHorn(self, event, state) : ! self.msgText("whenLocoHorn\n") if (self.currentThrottle != None) : wasState = self.currentThrottle.getF2() self.currentThrottle.setF2(state) ! self.msgText("changed horn to: " + state + " was " + wasState + "\n") return --- 632,648 ---- # handle the horn button on def whenLocoHornOn(self, event) : ! self.doLocoHorn(event, True) return # handle the horn button off def whenLocoHornOff(self, event) : ! self.doLocoHorn(event, False) return ! def doLocoHorn(self, event, state) : if (self.currentThrottle != None) : wasState = self.currentThrottle.getF2() self.currentThrottle.setF2(state) ! self.msgText("changed horn to: " + state.toString() + " was " + wasState.toString() + "\n") return *************** *** 652,658 **** if (self.currentThrottle != None) : wasState = self.currentThrottle.getF0() ! state = self.locoHeadlight.getEnabled() self.currentThrottle.setF0(state) ! self.msgText("changed light to: " + state + " was " + wasState + "\n") return --- 651,657 ---- if (self.currentThrottle != None) : wasState = self.currentThrottle.getF0() ! state = self.locoHeadlight.isSelected() self.currentThrottle.setF0(state) ! self.msgText("changed light to: " + state.toString() + " was " + wasState.toString() + "\n") return *************** *** 661,667 **** if (self.currentThrottle != None) : wasState = self.currentThrottle.getF1() ! state = self.locoBell.getEnabled() self.currentThrottle.setF1(state) ! self.msgText("changed bell to: " + state + " was " + wasState + "\n") return --- 660,666 ---- if (self.currentThrottle != None) : wasState = self.currentThrottle.getF1() ! state = self.locoBell.isSelected() self.currentThrottle.setF1(state) ! self.msgText("changed bell to: " + state.toString() + " was " + wasState.toString() + "\n") return *************** *** 929,934 **** self.locoHorn = javax.swing.JButton("Horn") self.locoHorn.setToolTipText("Controls loco horn") ! self.locoHorn.focusGained = self.whenLocoHornOn ! self.locoHorn.focusLost = self.whenLocoHornOff # create the speed fields for a Green Flash Signal --- 928,933 ---- self.locoHorn = javax.swing.JButton("Horn") self.locoHorn.setToolTipText("Controls loco horn") ! self.locoHorn.mousePressed = self.whenLocoHornOn ! self.locoHorn.mouseReleased = self.whenLocoHornOff # create the speed fields for a Green Flash Signal |