Explorar o código

release 0.0.2

Claudio Gomes %!s(int64=6) %!d(string=hai) anos
pai
achega
d6b2751b48

+ 1 - 0
.gitignore

@@ -6,3 +6,4 @@
 /HintCOEngine/results-gen/
 /HintCOEngine/src-gen/
 /be.uantwerpen.cosys.ContractLang/target
+/snapshot/

+ 4 - 4
HintCOEngine/HintCO.product

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="HintCO" uid="HintCO" id="ua.ansymo.HintCO.product" application="ua.ansymo.hintco" version="0.0.1" useFeatures="false" includeLaunchers="true">
-
+<product name="HintCO" uid="HintCO" id="ua.ansymo.HintCO.product" application="ua.ansymo.hintco" version="0.0.2" useFeatures="false" includeLaunchers="true">
 
    <configIni use="default">
    </configIni>
@@ -23,12 +22,11 @@
       </win>
    </launcher>
 
-
    <vm>
    </vm>
 
-
    <plugins>
+      <plugin id="HintConfiguration"/>
       <plugin id="be.uantwerpen.cosys.ContractLang"/>
       <plugin id="com.google.guava"/>
       <plugin id="javax.xml"/>
@@ -45,6 +43,8 @@
       <plugin id="org.eclipse.equinox.registry"/>
       <plugin id="org.eclipse.osgi"/>
       <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
+      <plugin id="org.eclipse.xtend.lib"/>
+      <plugin id="org.eclipse.xtend.lib.macro"/>
       <plugin id="org.eclipse.xtext.xbase.lib"/>
       <plugin id="org.hamcrest.core"/>
       <plugin id="org.junit"/>

+ 2 - 2
HintCOEngine/META-INF/MANIFEST.MF

@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: ua.ansymo.HintCO;singleton:=true
-Bundle-Version: 0.0.1
+Bundle-Version: 0.0.2
 Bundle-ClassPath: .,
  lib/commons-compress-1.18.jar,
  lib/commons-io-2.6.jar,
@@ -23,7 +23,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Export-Package: org.intocps.fmi,
  ua.ansymo.hintco
 Bundle-ActivationPolicy: lazy
-Require-Bundle: HintConfiguration;bundle-version="0.0.1",
+Require-Bundle: HintConfiguration;bundle-version="0.0.2",
  be.uantwerpen.cosys.ContractLang;bundle-version="1.0.0",
  com.google.guava,
  org.eclipse.xtext.xbase.lib,

+ 84 - 0
HintCOEngine/examples/deploy/watertanks.xmi

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ASCII"?>
+<hintco:HintConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:hintco="ua.ansymo.hintco">
+  <candidates
+      identifier="Original"
+      stopTime="100.0"
+      stepSize="0.01"
+      outputStepSize="0.01">
+    <cosimunits
+ xsi:type="hintco:CosimUnitInstance"
+        identifier="ctrl"
+        declaration="//@csuDeclarations.0">
+      <ports
+          xsi:type="hintco:InputPortInstance"
+          identifier="wt3_level"
+
+          valueFrom="//@candidates.0/@cosimunits.2/@ports.2"/>
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="wt3_valve"
+          valueTo="//@candidates.0/@cosimunits.2/@ports.4"
+          />
+    </cosimunits>
+    <cosimunits
+ xsi:type="hintco:CosimUnitInstance"
+        identifier="wt1"
+        declaration="//@csuDeclarations.1">
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="Tank2WaterLevel"
+          />
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="Tank2OutFlow"
+          valueTo="//@candidates.0/@cosimunits.2/@ports.3"
+          />
+    </cosimunits>
+    <cosimunits
+ xsi:type="hintco:CosimUnitInstance"
+        identifier="wt2"
+        declaration="//@csuDeclarations.2">
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="puddle"
+          />
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="Tank3OutFlow"
+          />
+      <ports
+          xsi:type="hintco:OutputPortInstance"
+          identifier="level"
+          valueTo="//@candidates.0/@cosimunits.0/@ports.0"
+          />
+      <ports
+          xsi:type="hintco:InputPortInstance"
+          identifier="inFlow"
+
+          valueFrom="//@candidates.0/@cosimunits.1/@ports.1"/>
+      <ports
+          xsi:type="hintco:InputPortInstance"
+          identifier="valveControl"
+
+          valueFrom="//@candidates.0/@cosimunits.0/@ports.1"/>
+    </cosimunits>
+  </candidates>
+  <csuDeclarations
+      identifier="threewatertankcontroller2"
+      path="resources/threewatertankcontroller2.fmu"
+      guid="{8c4e810f-3df3-4a00-8276-176fa3c9f003}">
+
+  </csuDeclarations>
+  <csuDeclarations
+      identifier="threewatertank1"
+      path="resources/threewatertank1.fmu"
+      guid="{dcd729ec-423a-4a0d-8030-4c42a840abba}">
+
+  </csuDeclarations>
+  <csuDeclarations
+      identifier="threewatertank2"
+      path="resources/threewatertank2.fmu"
+      guid="{25941611-1350-4ca2-8fe8-85d9193c14fd}">
+
+  </csuDeclarations>
+</hintco:HintConfiguration>

BIN=BIN
HintCOEngine/resources/deploy/threewatertank1.fmu


BIN=BIN
HintCOEngine/resources/deploy/threewatertank2.fmu


BIN=BIN
HintCOEngine/resources/deploy/threewatertankcontroller2.fmu


+ 2 - 2
HintCOEngine/src/ua/ansymo/hintco/Main.xtend

@@ -139,9 +139,9 @@ class Main implements IApplication {
 		val f = new FileWriter("storage_test.xmi")
 		f.write('''
 		<?xml version="1.0" encoding="ASCII"?>
-		<hintco:Candidates xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:hintco="ua.ansymo.hintco">
+		<hintco:HintConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:hintco="ua.ansymo.hintco">
 		  <candidates identifier="c1"/>
-		</hintco:Candidates>
+		</hintco:HintConfiguration>
 		''')
 		f.close
 		

+ 6 - 0
HintCOEngine/test/ua/ansymo/hintco/test/ExampleTest.xtend

@@ -1,6 +1,7 @@
 package ua.ansymo.hintco.test
 
 import org.junit.Test
+import ua.ansymo.hintco.Main
 
 import static org.junit.Assert.*
 
@@ -25,4 +26,9 @@ class ExampleTest {
 		assertEquals(4, resNonNull.size)
 	}
 	
+	@Test
+	def void DiagnosticsTest(){
+		Main.run_diagnostics()
+	}
+	
 }

+ 1 - 1
HintConfiguration.edit/META-INF/MANIFEST.MF

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: HintConfiguration.edit;singleton:=true
 Automatic-Module-Name: HintConfiguration.edit
-Bundle-Version: 0.0.1
+Bundle-Version: 0.0.2
 Bundle-ClassPath: HintConfiguration.edit.jar
 Bundle-Activator: ua.ansymo.hintco.provider.HintConfigurationEditPlugin$Implementation$Activator
 Bundle-Vendor: %providerName

+ 1 - 1
HintConfiguration.editor/META-INF/MANIFEST.MF

@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: HintConfiguration.editor;singleton:=true
 Automatic-Module-Name: HintConfiguration.editor
-Bundle-Version: 0.0.1
+Bundle-Version: 0.0.2
 Bundle-ClassPath: HintConfiguration.editor.jar
 Bundle-Activator: ua.ansymo.hintco.presentation.HintConfigurationEditorPlugin$Implementation
 Bundle-Vendor: %providerName

+ 1 - 1
HintConfiguration/META-INF/MANIFEST.MF

@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: HintConfiguration;singleton:=true
-Bundle-Version: 0.0.1
+Bundle-Version: 0.0.2
 Bundle-ClassPath: .
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin

+ 14 - 0
deploy/README.md

@@ -0,0 +1,14 @@
+To run the watertanks example:
+
+```
+.\hintco.exe -s .\examples\watertanks.xmi -o output -n 1
+```
+
+Then plot with python 3:
+
+```
+python .\scripts\plot_results.py .\output\
+```
+
+Plots will be available at: [outputs](output\) 
+

BIN=BIN
deploy/hintco.exe


+ 10 - 0
deploy_examples.ps1

@@ -0,0 +1,10 @@
+$Examples = "HintCOEngine\examples\deploy"
+$Resources = "HintCOEngine\resources\deploy"
+$Scripts = "HintCOEngine\scripts"
+$Other = "deploy"
+$TargetDir = "snapshot\hintco"
+
+Copy-Item "HintCOEngine\examples\deploy\" -Destination "$TargetDir\examples" -Recurse -Force
+Copy-Item "HintCOEngine\resources\deploy\" -Destination "$TargetDir\resources" -Recurse -Force
+Copy-Item "HintCOEngine\scripts" -Destination "$TargetDir\" -Recurse -Force
+Copy-Item "deploy\*" -Destination "$TargetDir\" -Recurse -Force