def __init__(self, stage: int, parent=None): super().__init__(parent=parent) common = Common(controller=ctrl) self.ppm = common.Ppm(self) self.el_breaking = common.ElBreaking(self) self.speed_60 = common.Speed60(self) self.ku_215 = common.KU215(self) self.enter = common.Enter(state='ВР', parent=self) self.handle_position = common.HandlePosition(stage=stage, parent=self) self.check_handle_position = common.CheckHandlePosition(stage=stage, data=ctrl.btp.ku_215, parent=self) self.pressure_stabilization = common.PressureStabilization(self) self.check_ku_pressure = common.CheckKuPressure(stage=stage, parent=self) self.save_result = SaveResult(stage=stage, parent=self) self.setInitialState(self.ppm) self.ppm.addTransition(ctrl.server_updated, self.ppm) self.ppm.addTransition(self.ppm.done, self.el_breaking) self.el_breaking.addTransition(ctrl.switch['gap'].low_value, self.speed_60) self.speed_60.addTransition(ctrl.switch['gap'].low_value, self.ku_215) self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.enter) self.enter.addTransition(ctrl.switch_with_neutral['km'].state_one, self.handle_position) self.handle_position.addTransition(self.check_handle_position) self.check_handle_position.addTransition(ctrl.server_updated, self.check_handle_position) self.check_handle_position.addTransition(self.check_handle_position.done, self.pressure_stabilization) self.pressure_stabilization.addTransition(ctrl.server_updated, self.pressure_stabilization) self.pressure_stabilization.addTransition(self.pressure_stabilization.done, self.check_ku_pressure) self.check_ku_pressure.addTransition(self.save_result)
def __init__(self, controller: Controller, menu_state: QState): super().__init__(parent=controller.stm) global ctrl ctrl = controller common = Common(controller=ctrl) self.finish = QFinalState(self) self.addTransition(self.finished, menu_state) self.addTransition(ctrl.button['back'].clicked, self.finish) menu = ctrl.menu.menu['БТП 020'] menu_state.addTransition(menu.button['Замещение торможения'].clicked, self) self.start = Start(self) self.ppm = common.Ppm(self) self.el_breaking = common.ElBreaking(self) self.speed_60 = common.Speed60(self) self.ku_215 = common.KU215(self) self.pim = common.Pim(self) self.enter = common.Enter(state='- 0 -', parent=self) self.el_breaking_on = ElBreakingOn(self) self.measure = Measure(self) self.ok = Ok(self) self.ok_measure = OkMeasure(self) self.el_breaking_off = ElBreakingOff(self) self.show_result = ShowResult(self) self.setInitialState(self.start) self.start.addTransition(self.ppm) self.ppm.addTransition(ctrl.server_updated, self.ppm) self.ppm.addTransition(self.ppm.done, self.el_breaking) self.el_breaking.addTransition(ctrl.switch['el. braking'].low_value, self.speed_60) self.speed_60.addTransition(ctrl.switch['>60 km/h'].low_value, self.ku_215) self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.pim) self.pim.addTransition(ctrl.server_updated, self.pim) self.pim.addTransition(self.pim.done, self.enter) self.enter.addTransition( ctrl.switch_with_neutral['enter'].state_neutral, self.el_breaking_on) self.el_breaking_on.addTransition(ctrl.server_updated, self.el_breaking_on) self.el_breaking_on.addTransition(self.el_breaking_on.done, self.measure) self.measure.addTransition(ctrl.server_updated, self.measure) self.measure.addTransition(self.measure.done, self.ok) self.ok.addTransition(ctrl.switch['ok'].high_value, self.ok_measure) self.ok_measure.addTransition(ctrl.server_updated, self.ok_measure) self.ok_measure.addTransition(ctrl.switch['ok'].low_value, self.el_breaking_off) self.el_breaking_off.addTransition(ctrl.server_updated, self.el_breaking_off) self.el_breaking_off.addTransition(self.el_breaking_off.done, self.show_result)
def __init__(self, controller: Controller, menu_state: QState): super().__init__(parent=controller.stm) global ctrl ctrl = controller common = Common(controller=ctrl) self.finish = QFinalState(self) self.addTransition(self.finished, menu_state) self.addTransition(ctrl.button['back'].clicked, self.finish) menu = ctrl.menu.menu['БТП 020'] menu_state.addTransition(menu.button['Повышенная скорость'].clicked, self) self.start = Start(self) self.ppm = common.Ppm(self) self.el_breaking = common.ElBreaking(self) self.speed_60 = common.Speed60(self) self.ku_215 = common.KU215(self) self.pim = common.Pim(self) self.enter = common.Enter(state='- 0 -', parent=self) self.speed_on = SpeedOn(self) self.measure_fill = MeasureFill(self) self.speed_off = SpeedOff(self) self.measure_empty = MeasureEmpty(self) self.show_result = ShowResult(self) self.setInitialState(self.start) self.start.addTransition(self.ppm) self.ppm.addTransition(ctrl.server_updated, self.ppm) self.ppm.addTransition(self.ppm.done, self.ku_215) # self.el_breaking.addTransition(ctrl.switch['el. braking'].low_value, self.speed_60) # self.speed_60.addTransition(ctrl.switch['>60 km/h'].low_value, self.ku_215) self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.pim) self.pim.addTransition(ctrl.server_updated, self.pim) self.pim.addTransition(self.pim.done, self.enter) self.enter.addTransition(ctrl.switch_with_neutral['km'].state_neutral, self.speed_on) self.speed_on.addTransition(ctrl.server_updated, self.speed_on) self.speed_on.addTransition(self.speed_on.done, self.measure_fill) self.measure_fill.addTransition(ctrl.server_updated, self.measure_fill) self.measure_fill.addTransition(self.measure_fill.done, self.speed_off) self.speed_off.addTransition(ctrl.server_updated, self.speed_off) self.speed_off.addTransition(self.speed_off.done, self.measure_empty) self.measure_empty.addTransition(ctrl.server_updated, self.measure_empty) self.measure_empty.addTransition(self.measure_empty.done, self.show_result)
def __init__(self, controller: Controller, menu_state: QState): super().__init__(parent=controller.stm) global ctrl ctrl = controller common = Common(controller=ctrl) self.finish = QFinalState(self) self.addTransition(self.finished, menu_state) self.addTransition(ctrl.button['back'].clicked, self.finish) menu = ctrl.menu.menu['БТП 020'] menu_state.addTransition(menu.button['Время снижения'].clicked, self) self.start = Start(self) self.ppm = common.Ppm(self) self.el_breaking = common.ElBreaking(self) self.speed_60 = common.Speed60(self) self.ku_215 = common.KU215(self) self.enter = common.Enter(state='КУ', parent=self) self.handle_position_four = common.HandlePositionFour(self) self.handle_position_zero = HandlePositionZero(self) self.measure = Measure(self) self.show_result = ShowResult(self) self.setInitialState(self.start) self.start.addTransition(self.ppm) self.ppm.addTransition(ctrl.server_updated, self.ppm) self.ppm.addTransition(self.ppm.done, self.el_breaking) self.el_breaking.addTransition(ctrl.switch['el. braking'].low_value, self.speed_60) self.speed_60.addTransition(ctrl.switch['>60 km/h'].low_value, self.ku_215) self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.enter) self.enter.addTransition(ctrl.switch_with_neutral['enter'].state_two, self.handle_position_four) self.handle_position_four.addTransition(ctrl.server_updated, self.handle_position_four) self.handle_position_four.addTransition(self.handle_position_four.done, self.handle_position_zero) self.handle_position_zero.addTransition(ctrl.server_updated, self.handle_position_zero) self.handle_position_zero.addTransition(self.handle_position_zero.done, self.measure) self.measure.addTransition(ctrl.server_updated, self.measure) self.measure.addTransition(self.measure.done, self.show_result)
def __init__(self, controller: Controller, menu_state: QState): super().__init__(parent=controller.stm) global ctrl ctrl = controller common = Common(controller=ctrl) self.finish = QFinalState(self) self.addTransition(self.finished, menu_state) self.addTransition(ctrl.button['back'].clicked, self.finish) menu = ctrl.menu.menu['БТП 020'] menu_state.addTransition(menu.button['Герметичность'].clicked, self) self.start = Start(self) self.ppm = common.Ppm(self) self.el_breaking = common.ElBreaking(self) self.speed_60 = common.Speed60(self) self.ku_215 = common.KU215(self) self.enter = common.Enter(state='КУ', parent=self) self.handle_position_four = common.HandlePositionFour(self) self.check = Check(self) self.yes = Yes(self) self.no = No(self) self.setInitialState(self.start) self.start.addTransition(self.ppm) self.ppm.addTransition(ctrl.server_updated, self.ppm) self.ppm.addTransition(self.ppm.done, self.el_breaking) self.el_breaking.addTransition(ctrl.switch['el. braking'].low_value, self.speed_60) self.speed_60.addTransition(ctrl.switch['>60 km/h'].low_value, self.ku_215) self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.enter) self.enter.addTransition(ctrl.switch_with_neutral['enter'].state_two, self.handle_position_four) self.handle_position_four.addTransition(ctrl.server_updated, self.handle_position_four) self.handle_position_four.addTransition(self.handle_position_four.done, self.check) self.check.addTransition(ctrl.button['yes'].clicked, self.yes) self.check.addTransition(ctrl.button['no'].clicked, self.no) self.yes.addTransition(self.finish) self.no.addTransition(self.finish)