From: Mark Tearle Date: Sun, 27 Jun 2004 11:24:37 +0000 (+0000) Subject: minimal simulator working X-Git-Tag: IMPORT-FROM-UCCCVS~140 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-vendserver.git;a=commitdiff_plain;h=dd2b710681ad0f63c258709fc748cf868863ac0d minimal simulator working --- diff --git a/virtualvend/vvend.py b/virtualvend/vvend.py index 4f64af0..3f38cb5 100644 --- a/virtualvend/vvend.py +++ b/virtualvend/vvend.py @@ -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()