소스 검색

Updated structure

Yentl Van Tendeloo 8 년 전
부모
커밋
301fc86333
4개의 변경된 파일132개의 추가작업 그리고 1개의 파일을 삭제
  1. 128 0
      integration/test_mvc.py
  2. 4 1
      models/petrinet_ports.mvc
  3. 0 0
      models/plant_PW.mvc
  4. 0 0
      models/plant_model.mvc

+ 128 - 0
integration/test_mvc.py

@@ -2131,3 +2131,131 @@ class TestModelverseCore(unittest.TestCase):
                      ]),
                 "Ready for command...",
             ]))
+
+    def test_process_powerwindow(self):
+        self.assertTrue(run_file(all_files,
+            [ "root", "root", "root", 
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "ReachabilityGraph",
+                    ] + get_model_constructor(open("integration/code/reachability_graph.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "PetriNet",
+                    ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "Encapsulated_PetriNet",
+                    ] + get_model_constructor(open("models/petrinet_ports.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "Requirement",
+                    ] + get_model_constructor(open("models/requirements.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "PW_Plant",
+                    ] + get_model_constructor(open("models/plant_PW.mvc", "r").read()) + [
+                "model_add",
+                    "PW_Plant",
+                    "plant_model",
+                    ] + get_model_constructor(open("models/plant_model.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "PW_Environment",
+                    ] + get_model_constructor(open("models/environment_PW.mvc", "r").read()) + [
+                "model_add",
+                    "PW_Plant",
+                    "environment_model",
+                    ] + get_model_constructor(open("models/environment_model.mvc", "r").read()) + [
+                "model_add",
+                    "SimpleClassDiagrams",
+                    "PW_Control",
+                    ] + get_model_constructor(open("models/control_PW.mvc", "r").read()) + [
+                "model_add",
+                    "PW_Plant",
+                    "control_model",
+                    ] + get_model_constructor(open("models/control_model.mvc", "r").read()) + [
+                "model_list",
+                "transformation_add_MT_language",
+                "PetriNet",
+                "Encapsulated_PetriNet",
+                "PW_Plant",
+                "PW_Environment",
+                "PW_Control",
+                "ReachabilityGraph",
+                "",
+                "All_RAM",
+                "transformation_add_MT",
+                    "All_RAM",
+                    "",
+                    "PW_Plant",
+                    "PW_Control",
+                    "PW_Environment",
+                    "",
+                    "initialize_PN",
+                    ] + get_model_constructor(open("models/initialize_all.mvc", "r").read()) + [
+                "transformation_add_MANUAL",
+                    "Requirement",
+                    "PW_Plant",
+                    "",
+                    "PW_Plant",
+                    "",
+                    "refine_Plant",
+                "transformation_add_MT",
+                    "All_RAM",
+                    "PW_Plant",
+                    "",
+                    "Encapsulated_PetriNet",
+                    "",
+                    "Plant2EPN",
+                    ] + get_model_constructor(open("models/plant_to_EPN", "r").read()) + [
+                "transformation_add_AL",
+                    "PetriNet",
+                    "",
+                    "ReachabilityGraph",
+                    "",
+                    "reachability_analyse",
+                    ] + get_constructor(open("integration/code/reachability.alc", "r").read()) + [
+                "transformation_add_MT",
+                    "All_RAM",
+                    "ReachabilityGraph",
+                    "",
+                    "",
+                    "reachability_print",
+                    ] + get_model_constructor(open("integration/code/reachabilitygraph_print.mvc", "r").read()) + [
+                "model_list",
+            ],
+            [   # bootup phase
+                "Desired username for admin user?",
+                "Desired password for admin user?",
+                "Please repeat the password",
+                "Passwords match!",
+                "Welcome to the Model Management Interface v2.0!",
+                "Use the 'help' command for a list of possible commands",
+                "Ready for command...",
+                # model_add * 10
+                ] + [   "Creating new model!",
+                        "Model type?",
+                        "Model name?",
+                        "Waiting for model constructors...",
+                        "Model upload success!",
+                        "Ready for command...", ] * 10 + [
+                # model_list
+                model_list |
+                set([
+                     "  PetriNet : SimpleClassDiagrams",
+                     "  Encapsulated_PetriNet : SimpleClassDiagrams",
+                     "  PW_Plant : SimpleClassDiagrams",
+                     "  PW_Environment : SimpleClassDiagrams",
+                     "  PW_Control : SimpleClassDiagrams",
+                     "  plant_model : PW_Plant",
+                     "  control_model : PW_Control",
+                     "  environment_model : PW_Environment",
+                     "  Requirement : SimpleClassDiagrams",
+                     "  ReachabilityGraph : SimpleClassDiagrams",]),
+                "Ready for command...",
+                # transformation_add_MT_language
+                "Formalisms to include (terminate with empty string)?",
+                "Name of the RAMified transformation metamodel?",
+                "Ready for command...",
+            ]))

+ 4 - 1
models/petrinet_ports.mvc

@@ -1,3 +1,5 @@
+include "primitives.alh"
+
 SimpleClassDiagrams PetriNetsPorts {
     SimpleAttribute Integer{
         constraint = $
@@ -6,6 +8,7 @@ SimpleClassDiagrams PetriNetsPorts {
                     return "OK"!
                 else:
                     return "Integer has non-integer value"!
+            $
     }
 
     SimpleAttribute String{
@@ -22,7 +25,7 @@ SimpleClassDiagrams PetriNetsPorts {
         constraint = $
             String function constraint(model : Element, name : String):
                 if (is_physical_string(model["model"][name])):
-                    if (boolean_or(value_eq(model["model"][name], "transition"), value_eq(model["model"][name], "place"))):
+                    if (bool_or(value_eq(model["model"][name], "transition"), value_eq(model["model"][name], "place"))):
                         return "OK"!
                     else:
                         return "PlaceOrTransition does not contain either 'place' or 'transition'"!

models/description_PW.mvc → models/plant_PW.mvc


models/description_model.mvc → models/plant_model.mvc