feature: Adding simple IO project
Also fixed the oteide build.
Change-Id: I5bd9a208d728dd7308f369dede4822f6e432c95c
Signed-off-by: Michael P. Masterson <michael.p.masterson@boeing.com>
diff --git a/org.eclipse.ote.serverclient.feature/feature.xml b/org.eclipse.ote.serverclient.feature/feature.xml
index f614f17..815557e 100644
--- a/org.eclipse.ote.serverclient.feature/feature.xml
+++ b/org.eclipse.ote.serverclient.feature/feature.xml
@@ -30,7 +30,6 @@
version="0.0.0"
unpack="false"/>
-
<plugin
id="org.eclipse.ote.services.core"
download-size="0"
@@ -52,11 +51,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.ote.simple.test.environment"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
diff --git a/org.eclipse.ote.simple.io/.classpath b/org.eclipse.ote.simple.io/.classpath
new file mode 100644
index 0000000..eca7bdb
--- /dev/null
+++ b/org.eclipse.ote.simple.io/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.ote.simple.io/.project b/org.eclipse.ote.simple.io/.project
new file mode 100644
index 0000000..323a30b
--- /dev/null
+++ b/org.eclipse.ote.simple.io/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ote.simple.io</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.ote.simple.io/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ote.simple.io/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..0c68a61
--- /dev/null
+++ b/org.eclipse.ote.simple.io/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/org.eclipse.ote.simple.io/.settings/org.eclipse.pde.core.prefs b/org.eclipse.ote.simple.io/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 0000000..f29e940
--- /dev/null
+++ b/org.eclipse.ote.simple.io/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/org.eclipse.ote.simple.io/META-INF/MANIFEST.MF b/org.eclipse.ote.simple.io/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4c02957
--- /dev/null
+++ b/org.eclipse.ote.simple.io/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Simple IO
+Bundle-SymbolicName: org.eclipse.ote.simple.io;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Service-Component: OSGI-INF/*
+Import-Package: org.eclipse.osee.ote.core,
+ org.eclipse.osee.ote.core.environment,
+ org.eclipse.osee.ote.core.environment.interfaces,
+ org.eclipse.osee.ote.message,
+ org.eclipse.osee.ote.message.data,
+ org.eclipse.osee.ote.message.elements,
+ org.eclipse.osee.ote.message.enums,
+ org.eclipse.osee.ote.message.interfaces
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.osee.framework.jdk.core,
+ org.eclipse.osee.ote.messaging.dds
diff --git a/org.eclipse.ote.simple.io/OSGI-INF/ote.simple.io.component.xml b/org.eclipse.ote.simple.io/OSGI-INF/ote.simple.io.component.xml
new file mode 100644
index 0000000..868ace3
--- /dev/null
+++ b/org.eclipse.ote.simple.io/OSGI-INF/ote.simple.io.component.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.ote.simple.io">
+ <implementation class="org.eclipse.ote.simple.io.StartSimpleIoComponent"/>
+ <reference bind="bindEnv" cardinality="1..1" interface="org.eclipse.osee.ote.core.environment.TestEnvironment" name="TestEnvironment" policy="dynamic"/>
+</scr:component>
diff --git a/org.eclipse.ote.simple.io/build.properties b/org.eclipse.ote.simple.io/build.properties
new file mode 100644
index 0000000..6210e84
--- /dev/null
+++ b/org.eclipse.ote.simple.io/build.properties
@@ -0,0 +1,5 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
+source.. = src/
diff --git a/org.eclipse.ote.simple.io/pom.xml b/org.eclipse.ote.simple.io/pom.xml
new file mode 100644
index 0000000..fb4d5bc
--- /dev/null
+++ b/org.eclipse.ote.simple.io/pom.xml
@@ -0,0 +1,17 @@
+<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>org.eclipse.ote.build</groupId>
+ <artifactId>core</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../org.eclipse.ote.build/maven/core/</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.ote.simple.io</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Eclipse OTE Simple IO (Incubation)</name>
+
+</project>
\ No newline at end of file
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleDataType.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleDataType.java
new file mode 100644
index 0000000..9ab7521
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleDataType.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io;
+
+import org.eclipse.osee.ote.message.enums.DataType;
+
+/**
+ * @author Michael P. Masterson
+ */
+public enum SimpleDataType implements DataType {
+ SIMPLE;
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ote.message.enums.DataType#getToolingDepth()
+ */
+ @Override
+ public int getToolingDepth() {
+ return 1;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ote.message.enums.DataType#getToolingBufferSize()
+ */
+ @Override
+ public int getToolingBufferSize() {
+ return 4096;
+ }
+
+}
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageData.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageData.java
new file mode 100644
index 0000000..b89306e
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageData.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io;
+
+
+import org.eclipse.osee.ote.message.Message;
+import org.eclipse.osee.ote.message.data.IMessageDataVisitor;
+import org.eclipse.osee.ote.message.data.MessageData;
+import org.eclipse.osee.ote.message.enums.DataType;
+import org.eclipse.osee.ote.messaging.dds.Data;
+
+/**
+ * Contains the byte data for the Simple Message
+ *
+ * @author Michael P. Masterson
+ */
+public class SimpleMessageData extends MessageData implements Data {
+ private final SimpleMessageHeader header;
+ private String name;
+
+
+ public SimpleMessageData(Message<?, ?, ?> msg, String typeName, String name, int dataByteSize, DataType type) {
+ super(typeName,
+ name,
+ dataByteSize + SimpleMessageHeader.HEADER_BYTE_SIZE,
+ SimpleMessageHeader.HEADER_BYTE_SIZE,
+ type);
+ header = new SimpleMessageHeader(msg, getMem().slice(0,SimpleMessageHeader.HEADER_BYTE_SIZE));
+ initializeDefaultHeaderValues();
+ this.name = name;
+ }
+
+
+ @Override
+ public int getPayloadSize() {
+ return super.getPayloadSize() - SimpleMessageHeader.HEADER_BYTE_SIZE;
+ }
+
+ public int getHeaderSize() {
+ return SimpleMessageHeader.HEADER_BYTE_SIZE;
+ }
+
+ @Override
+ public SimpleMessageHeader getMsgHeader() {
+ return header;
+ }
+
+ @Override
+ public void initializeDefaultHeaderValues() {
+ header.NAME.setNoLog(name);
+ }
+
+ @Override
+ protected boolean shouldSendData() {
+ return getMem().isDataChanged();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ote.message.data.MessageData#visit(org.eclipse.osee.ote.message.data.IMessageDataVisitor)
+ */
+ @Override
+ public void visit(IMessageDataVisitor visitor) {
+ // Intentionally empty
+ }
+
+}
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageHeader.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageHeader.java
new file mode 100644
index 0000000..4ff8d95
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageHeader.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io;
+
+import org.eclipse.osee.framework.jdk.core.util.ByteUtil;
+import org.eclipse.osee.ote.message.IMessageHeader;
+import org.eclipse.osee.ote.message.Message;
+import org.eclipse.osee.ote.message.data.HeaderData;
+import org.eclipse.osee.ote.message.data.MemoryResource;
+import org.eclipse.osee.ote.message.elements.Element;
+import org.eclipse.osee.ote.message.elements.StringElement;
+
+/**
+ * This header is a 32 character message name field
+ *
+ * @author Michael P. Masterson
+ */
+public class SimpleMessageHeader implements IMessageHeader {
+ public static final int HEADER_BYTE_SIZE = 32;
+ private HeaderData headerData;
+
+ public final StringElement NAME;
+
+ public SimpleMessageHeader(Message<?,?,?> msg, MemoryResource data) {
+ headerData = new HeaderData("SIMPLE_HEADER", data);
+
+ Object[] path = new Object[]{(msg == null ? "message" : msg.getClass().getName()), "HEADER(SIMPLE)"};
+ NAME = new StringElement(msg, "NAME", headerData, 0, 0, HEADER_BYTE_SIZE * 8 - 1);
+ NAME.addPath(path);
+ }
+
+ public byte[] getData() {
+ return headerData.toByteArray();
+ }
+
+ public String getMessageName() {
+ return NAME.getNoLog();
+ }
+
+ public String toXml() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<SimpleHeaderInfo>");
+ ByteUtil.printByteDump(builder, this.getData(), 0, HEADER_BYTE_SIZE, 8);
+ builder.append("</SimpleHeaderInfo>");
+ return builder.toString();
+ }
+
+ public Element[] getElements() {
+ return new Element[]{NAME};
+ }
+
+ public int getHeaderSize() {
+ return HEADER_BYTE_SIZE;
+ }
+
+ public void setNewBackingBuffer(byte[] data) {
+ headerData.setNewBackingBuffer(data);
+ }
+}
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageType.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageType.java
new file mode 100644
index 0000000..5ceaeda
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/SimpleMessageType.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io;
+
+import org.eclipse.osee.ote.message.Message;
+import org.eclipse.osee.ote.message.MessageSystemTestEnvironment;
+
+/**
+ * @author Michael P. Masterson
+ */
+public class SimpleMessageType extends Message<MessageSystemTestEnvironment, SimpleMessageData, SimpleMessageType>{
+
+ public SimpleMessageType(String name, int defaultByteSize, int defaultOffset, boolean isScheduled, int phase,
+ double rate) {
+ super(name, defaultByteSize, defaultOffset, isScheduled, phase, rate);
+ }
+
+}
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/StartSimpleIoComponent.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/StartSimpleIoComponent.java
new file mode 100644
index 0000000..f8a703d
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/StartSimpleIoComponent.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io;
+
+import org.eclipse.osee.ote.core.environment.TestEnvironment;
+
+/**
+ * Mostly empty for now. This will be the injection point for any Simple IO specific set up with the env
+ *
+ * @author Michael P. Masterson
+ */
+public class StartSimpleIoComponent {
+
+ public void start() {
+ System.out.println("Started Simple IO Comp");
+ }
+
+ public void bindEnv(TestEnvironment env) {
+
+ }
+}
diff --git a/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/message/HELLO_WORLD.java b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/message/HELLO_WORLD.java
new file mode 100644
index 0000000..adee697
--- /dev/null
+++ b/org.eclipse.ote.simple.io/src/org/eclipse/ote/simple/io/message/HELLO_WORLD.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ote.simple.io.message;
+
+import java.util.Collection;
+
+import org.eclipse.osee.ote.message.elements.StringElement;
+import org.eclipse.ote.simple.io.SimpleDataType;
+import org.eclipse.ote.simple.io.SimpleMessageData;
+import org.eclipse.ote.simple.io.SimpleMessageType;
+
+
+/**
+ * Simple Hello World message class intended as an example for use in the simple test environment.
+ *
+ * <table border="1">
+ * <p>
+ * <tr>
+ * <td>RATE</td>
+ * <td>50.0</td>
+ * </tr>
+ * <p>
+ * <tr>
+ * <td>DEFAULT_BYTE_SIZE</td>
+ * <td>64</td>
+ * </tr>
+ * </table>
+ *
+ * @author Michael P. Masterson
+ */
+public class HELLO_WORLD extends SimpleMessageType {
+
+ /**
+ * The string to print or log when the message is sent
+ *
+ * <table border="1">
+ * <p><tr><td>UNIT_ABBR</td><td>null</td></tr>
+ * <p><tr><td>START_BYTE</td><td>0</td></tr>
+ * <p><tr><td>MSB</td><td>0</td></tr>
+ * <p><tr><td>LSB</td><td>511</td></tr>
+ * </table>
+ */
+ public StringElement PRINT_ME;
+
+
+ public HELLO_WORLD() {
+ super("HELLO_WORLD", 64, 0, true, 0, 50.0);
+ SimpleMessageData messageData = new SimpleMessageData(this, this.getClass().getName(), getName(), getDefaultByteSize(), SimpleDataType.SIMPLE);
+ setDefaultMessageData(messageData);
+ messageData.setScheduled(true);
+ PRINT_ME = new StringElement(this, "PRINT_ME", messageData, 0, 0, 511);
+ addElements(PRINT_ME);
+
+ //set up message stuff
+ setMemSource(SimpleDataType.SIMPLE);
+
+ }
+
+ @Override
+ public void switchElementAssociation( Collection<SimpleMessageType> messages ) {
+ PRINT_ME = PRINT_ME.switchMessages(messages);
+
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.ote.simple.oteide.product.parent/pom.xml b/org.eclipse.ote.simple.oteide.product.parent/pom.xml
index 3b44c18..aa2b96c 100644
--- a/org.eclipse.ote.simple.oteide.product.parent/pom.xml
+++ b/org.eclipse.ote.simple.oteide.product.parent/pom.xml
@@ -17,10 +17,11 @@
<version>1.0.0-SNAPSHOT</version>
<modules>
- <module>../org.eclipse.ote.simple.oteide.product.load</module>
- <module>../org.eclipse.ote.simple.oteide.product.feature</module>
<module>../org.eclipse.ote.simple.oteide.product</module>
<module>../org.eclipse.ote.simple.test.environment</module>
+ <module>../org.eclipse.ote.simple.test.script</module>
+ <module>../org.eclipse.ote.simple.oteide.product.load</module>
+ <module>../org.eclipse.ote.simple.oteide.product.feature</module>
</modules>
diff --git a/org.eclipse.ote.simple.test.script/META-INF/MANIFEST.MF b/org.eclipse.ote.simple.test.script/META-INF/MANIFEST.MF
index 10dab83..900cd73 100644
--- a/org.eclipse.ote.simple.test.script/META-INF/MANIFEST.MF
+++ b/org.eclipse.ote.simple.test.script/META-INF/MANIFEST.MF
@@ -10,6 +10,7 @@
Import-Package: org.eclipse.osee.framework.jdk.core.persistence,
org.eclipse.osee.ote.core,
org.eclipse.osee.ote.core.enums,
+ org.eclipse.osee.ote.core.environment,
org.eclipse.osee.ote.core.environment.interfaces,
org.eclipse.osee.ote.core.environment.jini,
org.eclipse.osee.ote.message,