Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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.pim = common.Pim(self)
        self.check_1 = Check(stage=0, parent=self)
        self.check_2 = Check(stage=1, parent=self)
        self.check_3 = Check(stage=2, parent=self)
        self.check_4 = Check(stage=3, parent=self)
        self.check_5 = Check(stage=4, parent=self)
        self.check_6 = Check(stage=5, parent=self)
        self.check_7 = Check(stage=6, parent=self)
        self.check_8 = Check(stage=7, parent=self)
        self.show_result = ShowResult(parent=self)

        self.setInitialState(self.start)
        self.start.addTransition(self.pim)
        self.pim.addTransition(ctrl.server_updated, self.pim)
        self.pim.addTransition(self.pim.done, self.check_1)
        self.check_1.addTransition(self.check_1.finished, self.check_2)
        self.check_2.addTransition(self.check_2.finished, self.check_3)
        self.check_3.addTransition(self.check_3.finished, self.check_4)
        self.check_4.addTransition(self.check_4.finished, self.check_5)
        self.check_5.addTransition(self.check_5.finished, self.check_6)
        self.check_6.addTransition(self.check_6.finished, self.check_7)
        self.check_7.addTransition(self.check_7.finished, self.check_8)
        self.check_8.addTransition(self.check_8.finished, self.show_result)
        self.show_result.addTransition(ctrl.button['yes'].clicked, self.finish)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    def __init__(self, controller: Controller, menu_state: QState):
        super().__init__(parent=controller.stm)
        global ctrl
        ctrl = controller
        common: Common = Common(controller=ctrl)
        self.finish = QFinalState(self)
        self.addTransition(self.finished, menu_state)
        menu = ctrl.menu.menu['БТП 020']
        self.addTransition(ctrl.button['back'].clicked, self.finish)
        menu_state.addTransition(menu.button['Подготовка'].clicked, self)

        self.start = Start(self)
        self.ppm = common.Ppm(self)
        self.install_ku = InstallKU(self)
        self.ku_215 = common.KU215(self)
        self.pim = common.Pim(self)
        self.tank = common.Tank(state='СБРОС', parent=self)
        self.el_breaking = common.ElBreaking(self)
        self.speed_60 = common.Speed60(self)
        self.set_bto = SetBTO(self)
        self.connect_btp = ConnectBTP(self)
        self.enable_menu = EnableMenu(self)

        self.setInitialState(self.start)
        self.start.addTransition(self.install_ku)
        self.install_ku.addTransition(ctrl.button['yes'].clicked, self.ku_215)
        self.ku_215.addTransition(ctrl.switch['ku 215'].high_value, self.ppm)
        self.ppm.addTransition(ctrl.server_updated, self.ppm)
        self.ppm.addTransition(self.ppm.done, self.pim)
        self.pim.addTransition(ctrl.server_updated, self.pim)
        self.pim.addTransition(self.pim.done, self.tank)
        self.tank.addTransition(ctrl.switch_with_neutral['tank'].state_two,
                                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.set_bto)
        self.set_bto.addTransition(ctrl.button['yes'].clicked,
                                   self.connect_btp)
        self.connect_btp.addTransition(ctrl.button['yes'].clicked,
                                       self.enable_menu)
        self.enable_menu.addTransition(self.finish)
Exemplo n.º 7
0
    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)