def location_prompt(self): globalwords.words['sign off'].enabled = True op_entry = prompt_digits(itext('main.location.prompt',self._location), itext('main.location.help'), 3, 3, confirm=False) if int(self._chk_digit) != int(op_entry) : prompt_only(itext('main.wrong.check.digit', str(op_entry)), True) self.next_state = LOCATION_PROMPT
def quantity_prompt(self): BACK_STOCK_CMD = 'back stock' self._bin_qty = prompt_digits(itext('main.quantity.prompt'), itext('main.quantity.prompt.help'), 1, 5, True, additional_vocab = {BACK_STOCK_CMD : False}) if self._bin_qty == BACK_STOCK_CMD: self._bin_qty = 0 self.launch(obj_factory.get(BackStockTask, self._location, self.taskRunner), self.current_state)
def request_location(self): err = self._assignmentLut.send() if err == 0: data = self._assignmentLut.get_data() self._location = data[0]['Location'] self._chk_digit = data[0]['CheckDigit'] elif err == errno.ECONNREFUSED: prompt_ready(itext('error.connection.refused'), True) self.next_state = REQUEST_LOCATION elif err == errno.ETIMEDOUT: prompt_ready(itext('error.connection.timeout'), True) self.next_state = REQUEST_LOCATION
def execute_function(self): ''' prompt for function and execute it ''' self.sign_off_allowed = True #if only 1 record returned then automatically select that function self.function = None if len(self._functions_lut) == 1: self.function = self._functions_lut[0]['number'] prompt_only(self._functions_lut[0]['description']) #else prompt user to select function else: self.function = prompt_list_lut_auth(self._functions_lut, 'number', 'description', itext('core.function.prompt'), itext('core.function.help')) self.function = str(self.function) #Execute selected function if self.function == '1': #PutAway self.launch(obj_factory.get(PutawayTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '2': #Replenishment self.launch(obj_factory.get(ReplenishmentTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function in ['3', '4', '6']: #Selection self.launch(obj_factory.get(SelectionTask, self.function, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '7': #Line Loading self.launch(obj_factory.get(LineLoadingTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '8': #Put to store self.launch(obj_factory.get(PutToStoreTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '9': #Cycle Counting self.launch(obj_factory.get(CycleCountingTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '10': #Loading self.launch(obj_factory.get(LoadingTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '11': #Back Stocking self.launch(obj_factory.get(BackstockingTask, self.taskRunner, self), EXECUTE_FUNCTIONS) elif self.function == '12': #Receiving self.launch(obj_factory.get(ReceivingTask, self.taskRunner, self), EXECUTE_FUNCTIONS) else: #Function specified not implemented prompt_ready(itext('core.function.notimplemented', str(self.function))) self.next_state = REQUEST_FUNCTIONS
def main(): itext('') # Enabling triggered scanning use_trigger_scan_vocab = get_voice_application_property('UseTriggerScanVocab') voice.log_message("Use Trigger scan vocab value is : "+use_trigger_scan_vocab) if use_trigger_scan_vocab == 'true': trigger_scan_timeout = int(get_voice_application_property('TriggerScanTimeout')) scanning.set_trigger_vocab('VLINK_SCAN_VOCAB') scanning.set_trigger_timeout(trigger_scan_timeout) server_startup(ReceivingVoiceAppHTTPServer) voicelink_startup()
def main(): itext('') #logging.debug('--main') # Enabling triggered scanning use_trigger_scan_vocab = get_voice_application_property('UseTriggerScanVocab') voice.log_message("Use Trigger scan vocab value is : "+use_trigger_scan_vocab) if use_trigger_scan_vocab == 'true': trigger_scan_timeout = int(get_voice_application_property('TriggerScanTimeout')) scanning.set_trigger_vocab('VLINK_SCAN_VOCAB') scanning.set_trigger_timeout(trigger_scan_timeout) server_startup(ReceivingVoiceAppHTTPServer) voicelink_startup()
def sign_off(self): if prompt_yes_no(itext('global.sign.off.confirm')): prompt_only(itext('global.sign.off')) self.return_to(self.name, WELCOME_PROMPT) else: globalwords.words['sign off'].enabled = True
def welcome_prompt(self): globalwords.words['sign off'].enabled = False prompt_ready(itext('main.welcome.prompt'), True)
def quantity_prompt(self): prompt_only(itext('backstock.quantity', str(self._quantity)))