From 9b607932cd9144edcbcb5201735b48167f195b47 Mon Sep 17 00:00:00 2001 From: Mark Tearle Date: Sun, 27 Jun 2004 11:24:37 +0000 Subject: [PATCH] minimal simulator working --- virtualvend/vvend.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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() -- 2.20.1