Example #1
0
def test_state():
    import os
    import sys
    from PyQt5.QtWidgets import QApplication
    from PyQt5.uic import loadUi
    from ai2.tools.fsm_editor.model import FsmModel

    app = QApplication(sys.argv)
    app_model = FsmModel()
    app_model.default_init()
    path = os.path.join(os.path.dirname(__file__),
                        "../../../res/gui/fsm_state_list_dialog.ui")
    w = loadUi(path)

    headers = ("state name", "uid")
    attrs = ("name", "uid")
    list_vm = MultiColumnListModel(app_model.event, attrs, headers)
    dialog = ListEditPanelVM(list_vm, app_model.state, app_model.add_state,
                             app_model.remove_event, w)
    ret = dialog.run()
    print(ret)
Example #2
0
def test_state():
    import os
    import sys
    from PyQt5.QtWidgets import QApplication
    from PyQt5.uic import loadUi
    from ai2.tools.fsm_editor.model import FsmModel

    app = QApplication(sys.argv)
    app_model = FsmModel()
    app_model.default_init()
    path = os.path.join(os.path.dirname(__file__), "../../../res/gui/fsm_state_list_dialog.ui")
    w = loadUi(path)

    headers = ("state name", "uid")
    attrs = ("name", "uid")
    list_vm = MultiColumnListModel(app_model.event, attrs, headers)
    dialog = ListEditPanelVM(
        list_vm,
        app_model.state,
        app_model.add_state,
        app_model.remove_event,
        w)
    ret = dialog.run()
    print(ret)
Example #3
0
 def action_new_handler(self):
     tmp_path = self.find_non_existing_name()
     m = FsmModel()
     m.default_init()
     vm = InstanceVM(m, self, tmp_path)
     vm.set_modified(True)
Example #4
0
 def action_new_handler(self):
     tmp_path = self.find_non_existing_name()
     m = FsmModel()
     m.default_init()
     vm = InstanceVM(m, self, tmp_path)
     vm.set_modified(True)