]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network/scl/Simantics/District.scl
Make it possible to import CSV data via SCL & create models
[simantics/district.git] / org.simantics.district.network / scl / Simantics / District.scl
index 36dee3979b74ea97dbc7fc2e15fa507518332a11..8e96b518a2dbb98a548de21eb23e984adaf2ebf5 100644 (file)
@@ -82,8 +82,8 @@ translateElement elem = do
     ()
 
 importJava "org.simantics.district.network.DistrictNetworkUtil" where
-    createVertex :: Resource -> Vector Double -> Resource -> <WriteGraph, Proc> Resource
-    createEdge :: Resource -> Resource -> <WriteGraph, Proc> Resource
+    createVertex :: Resource -> Vector Double -> Double -> Resource -> <WriteGraph, Proc> Resource
+    createEdge :: Resource -> Resource -> Vector Double -> <WriteGraph, Proc> Resource
 
 """
 Tries to look for the Resource representing the configuration component
@@ -112,14 +112,14 @@ possibleMappedComponentVariable r = match possibleMappedComponent r with
 
 """
 """
-possibleMappedComponentPropertyValue :: String -> Resource -> <ReadGraph> Maybe Double
+possibleMappedComponentPropertyValue :: Serializable a => Typeable a => String -> Resource -> <ReadGraph> Maybe a
 possibleMappedComponentPropertyValue propName r = match possibleMappedComponentVariable r with
     Nothing -> Nothing
     Just mv -> possiblePropertyValue mv propName
 
 """
 """
-mappedComponentPropertyValue :: Double -> String -> Resource -> <ReadGraph> Double
+mappedComponentPropertyValue :: Serializable a => Typeable a => a -> String -> Resource -> <ReadGraph> a
 mappedComponentPropertyValue def propName r = match possibleMappedComponentVariable r with
     Nothing -> def
     Just mv -> match possiblePropertyValue mv propName with
@@ -148,3 +148,7 @@ The result list can be smaller than the input resource list, even empty.
 """
 dnElementsMappedToComponents :: [Resource] -> <ReadGraph> [Resource]
 dnElementsMappedToComponents mappedComponents = mapMaybe possibleDNElementMappedToComponent mappedComponents
+
+
+importJava "org.simantics.district.network.DistrictNetworkUtil" where
+    createNetworkDiagram :: Resource -> Resource -> String -> Resource -> Resource -> Resource -> Resource -> Resource -> <WriteGraph, Proc> Resource