minimal simulator working
authorMark Tearle <mtearle@ucc.asn.au>
Sun, 27 Jun 2004 11:24:37 +0000 (11:24 +0000)
committerMark Tearle <mtearle@ucc.asn.au>
Sun, 27 Jun 2004 11:24:37 +0000 (11:24 +0000)
virtualvend/vvend.py

index 4f64af0..3f38cb5 100644 (file)
@@ -240,7 +240,12 @@ Mark Tearle, June 2004
      self.do_send("102 Vend all motors complete")
   
   def do_vend(self,command):
-     self.do_send("153 Home sensors failing")
+     fail = None
+     if fail:
+       self.do_send("153 Home sensors failing")
+     else:
+        self.insert("Vending ",command)
+       self.do_send("100 Vend successful")
     
   def do_display(self,string):
      display = self.wTree.get_widget("label1")
@@ -252,6 +257,11 @@ Mark Tearle, June 2004
   def do_silence(self,command):
      pass
 
+  def do_switches(self):
+     pass
+
+  def do_pong(self):
+     self.do_send("000 PONG!\n")
 
   def handle_command(self, command):
      command = string.upper(command)
@@ -260,16 +270,20 @@ Mark Tearle, June 2004
        self.do_help()
      elif string.find(command, "ABOUT",0) == 0:
        self.do_about()
+     elif string.find(command, "PING",0) == 0:
+       self.do_pong()
      elif string.find(command, "VALL",0) == 0:
        self.do_vend_all()
      elif string.find(command, "V",0) == 0:
        self.do_vend(command)
      elif string.find(command, "B",0) == 0:
        self.do_beep(command)
-     elif string.find(command, "S",0) == 0:
+     elif string.find(command, "C",0) == 0:
        self.do_silence(command)
+     elif string.find(command, "S",0) == 0:
+       self.do_switches()
      elif string.find(command, "D",0) == 0:
-       self.do_display(command[1:-1])
+       self.do_display(command[1:])
      self.do_prompt()
        
 

UCC git Repository :: git.ucc.asn.au