Moved Flow library

This commit is contained in:
Cavallium 2018-09-27 19:23:46 +02:00
parent 5aa703c0cf
commit 5a65086421
28 changed files with 152 additions and 7 deletions

View File

@ -15,6 +15,11 @@
<description>WarpPI Calculator core project</description> <description>WarpPI Calculator core project</description>
<dependencies> <dependencies>
<dependency>
<groupId>it.cavallium</groupId>
<artifactId>warppi-flow</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> <dependency>
<groupId>it.unimi.dsi</groupId> <groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId> <artifactId>fastutil</artifactId>

32
flow/.classpath Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

1
flow/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

23
flow/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>warppi-flow</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

52
flow/pom.xml Normal file
View File

@ -0,0 +1,52 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>it.cavallium</groupId>
<artifactId>warppi</artifactId>
<version>${project.version}</version>
</parent>
<artifactId>warppi-flow</artifactId>
<packaging>bundle</packaging>
<name>WarpPI Flow Library</name>
<description>WarpPI Flow library project</description>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>it.cavallium.warppi.*</Export-Package>
<Bundle-SymbolicName>warppi-flow</Bundle-SymbolicName>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -3,8 +3,6 @@ package it.cavallium.warppi.flow;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import it.cavallium.warppi.Engine;
public class IntervalsManager { public class IntervalsManager {
private static List<ObservableInterval> intervals = new LinkedList<>(); private static List<ObservableInterval> intervals = new LinkedList<>();
@ -37,8 +35,8 @@ public class IntervalsManager {
e.printStackTrace(); e.printStackTrace();
} }
}); });
Engine.getPlatform().setThreadDaemon(t); t.setDaemon(true);
Engine.getPlatform().setThreadName(t, "Intervals Manager"); t.setName("Intervals Manager");
t.start(); t.start();
} }
} }

View File

@ -1,7 +1,5 @@
package it.cavallium.warppi.flow; package it.cavallium.warppi.flow;
import it.cavallium.warppi.Engine;
public class ObservableInterval extends Observable<Long> { public class ObservableInterval extends Observable<Long> {
private final long interval; private final long interval;
volatile boolean running; volatile boolean running;
@ -48,7 +46,7 @@ public class ObservableInterval extends Observable<Long> {
} catch (final InterruptedException e) {} } catch (final InterruptedException e) {}
timeThread = null; timeThread = null;
}); });
Engine.getPlatform().setThreadName(timeThread, "ObservableTimer"); timeThread.setName("ObservableTimer");
timeThread.start(); timeThread.start();
running = true; running = true;
} }

View File

@ -0,0 +1,35 @@
package it.cavallium.warppi;
import junit.framework.Assert;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest extends TestCase {
/**
* Create the test case
*
* @param testName
* name of the test case
*/
public AppTest(final String testName) {
super(testName);
}
/**
* @return the suite of tests being tested
*/
public static Test suite() {
return new TestSuite(AppTest.class);
}
/**
* Rigourous Test :-)
*/
public void testApp() {
Assert.assertTrue(true);
}
}

View File

@ -39,6 +39,7 @@
<modules> <modules>
<module>core</module> <module>core</module>
<module>flow</module>
<module>rules</module> <module>rules</module>
<module>hardware</module> <module>hardware</module>
<module>desktop</module> <module>desktop</module>