浏览代码

Port to newest version of the Modelverse

Yentl Van Tendeloo 7 年之前
父节点
当前提交
ea4e872ed0
共有 6 个文件被更改,包括 509 次插入209 次删除
  1. 2 2
      classes/main_app.xml
  2. 138 17
      classes/modelverse/modelverse.xml
  3. 1 1
      classes/window/main_window.xml
  4. 362 183
      frontend.py
  5. 2 2
      models/render_OD.alc
  6. 4 4
      models/render_SCD.alc

+ 2 - 2
classes/main_app.xml

@@ -196,7 +196,7 @@
                                 </raise>
                             </onentry>
 
-                            <transition event="mv_response" target="../register_conf_bottom"/>
+                            <transition target="../register_conf_bottom"/>
                         </state>
 
                         <state id="register_conf_bottom">
@@ -207,7 +207,7 @@
                                 </raise>
                             </onentry>
 
-                            <transition event="mv_response" target="../upload_models"/>
+                            <transition target="../upload_models"/>
                         </state>
 
                         <state id="upload_models" initial="upload_MM_render">

文件差异内容过多而无法显示
+ 138 - 17
classes/modelverse/modelverse.xml


+ 1 - 1
classes/window/main_window.xml

@@ -709,7 +709,7 @@
                                 </raise>
                             </onentry>
 
-                            <transition event="mv_response" target="../../rerender_model"/>
+                            <transition target="../../rerender_model"/>
                         </state>
                     </state>
 

文件差异内容过多而无法显示
+ 362 - 183
frontend.py


+ 2 - 2
models/render_OD.alc

@@ -115,7 +115,7 @@ Boolean function main(model : Element):
 				instantiate_attribute(model, elem, "y", 3)
 				instantiate_attribute(model, elem, "lineWidth", 1)
 				instantiate_attribute(model, elem, "lineColour", "black")
-				instantiate_attribute(model, elem, "text", string_join(cast_v2s(list_read(string_split(class, "/"), 1)), " : " + cast_v2s(list_read(string_split(read_type(model, class), "/"), 1))))
+				instantiate_attribute(model, elem, "text", string_join(cast_value(list_read(string_split(class, "/"), 1)), " : " + cast_value(list_read(string_split(read_type(model, class), "/"), 1))))
 				instantiate_attribute(model, elem, "layer", 2)
 				instantiate_link(model, "rendered/contains", "", group, elem)
 
@@ -139,7 +139,7 @@ Boolean function main(model : Element):
 					instantiate_attribute(model, elem, "y", text_loc + 20)
 					instantiate_attribute(model, elem, "lineWidth", 1)
 					instantiate_attribute(model, elem, "lineColour", "black")
-					instantiate_attribute(model, elem, "text", (attr_key + " = ") + cast_v2s(attrs[attr_key]))
+					instantiate_attribute(model, elem, "text", (attr_key + " = ") + cast_value(attrs[attr_key]))
 					instantiate_attribute(model, elem, "layer", 2)
 					instantiate_link(model, "rendered/contains", "", group, elem)
 					text_loc = text_loc + 15

+ 4 - 4
models/render_SCD.alc

@@ -107,11 +107,11 @@ Boolean function main(model : Element):
 		if (element_eq(read_attribute(model, class, "lower_cardinality"), read_root())):
 			lower_card = "*"
 		else:
-			lower_card = cast_v2s(read_attribute(model, class, "lower_cardinality"))
+			lower_card = cast_value(read_attribute(model, class, "lower_cardinality"))
 		if (element_eq(read_attribute(model, class, "upper_cardinality"), read_root())):
 			upper_card = "*"
 		else:
-			upper_card = cast_v2s(read_attribute(model, class, "upper_cardinality"))
+			upper_card = cast_value(read_attribute(model, class, "upper_cardinality"))
 		multiplicities = ((("[" + lower_card) + "..") + upper_card) + "]"
 
 		elem = instantiate_node(model, "rendered/Text", "")
@@ -146,7 +146,7 @@ Boolean function main(model : Element):
 			instantiate_attribute(model, elem, "y", text_loc + 20)
 			instantiate_attribute(model, elem, "lineWidth", 1)
 			instantiate_attribute(model, elem, "lineColour", "black")
-			instantiate_attribute(model, elem, "text", (attr_key + " : ") + cast_i2s(list_read(string_split(attrs[attr_key], "/"), 1)))
+			instantiate_attribute(model, elem, "text", (attr_key + " : ") + cast_string(list_read(string_split(attrs[attr_key], "/"), 1)))
 			instantiate_attribute(model, elem, "layer", 2)
 			instantiate_link(model, "rendered/contains", "", group, elem)
 			text_loc = text_loc + 15
@@ -176,7 +176,7 @@ Boolean function main(model : Element):
 		instantiate_attribute(model, elem, "arrow", True)
 		instantiate_attribute(model, elem, "__asid", list_read(string_split(class, "/"), 1))
 		instantiate_attribute(model, elem, "layer", 0)
-		log("Found ASID " + cast_v2s(list_read(string_split(class, "/"), 1)))
+		log("Found ASID " + cast_value(list_read(string_split(class, "/"), 1)))
 		instantiate_link(model, "rendered/contains", "", group, elem)
 
 	return True!