Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-07-24 04:02:08 -0400
committerrbrooks2010-07-24 04:02:08 -0400
commit4ed8bddc791fda93940f238c5135556a07041dc0 (patch)
tree64a118285c5006c3a38320dbb2d374e8ea72a061 /plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse
parent542cc7344d3f129d64e47f547384297c8e1b1f43 (diff)
downloadorg.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.gz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.tar.xz
org.eclipse.osee-4ed8bddc791fda93940f238c5135556a07041dc0.zip
converted all line terminators to unix style
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java126
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java112
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java70
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java64
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java76
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java138
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java116
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java354
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java68
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java96
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java36
11 files changed, 628 insertions, 628 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java
index 4dfc84def2..6da97c56a7 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java
@@ -8,73 +8,73 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux;
-
+package org.eclipse.osee.ote.ui.mux;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.ote.service.IOteClientService;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class MuxToolPlugin extends AbstractUIPlugin {
-
- private ServiceTracker oteClientServiceTracker;
-
- // The shared instance.
- private static MuxToolPlugin plugin;
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class MuxToolPlugin extends AbstractUIPlugin {
+
+ private ServiceTracker oteClientServiceTracker;
+
+ // The shared instance.
+ private static MuxToolPlugin plugin;
+
+
+ public static String PLUGIN_ID = "org.eclipse.osee.ote.ui.mux";
+ /**
+ * The constructor.
+ */
+ public MuxToolPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ oteClientServiceTracker = new ServiceTracker(context,
+ IOteClientService.class.getName(), null);
+ oteClientServiceTracker.open();
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ oteClientServiceTracker.close();
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static MuxToolPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(
+ "org.eclipse.osee.ote.ui.mux", path);
+ }
- public static String PLUGIN_ID = "org.eclipse.osee.ote.ui.mux";
- /**
- * The constructor.
- */
- public MuxToolPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- oteClientServiceTracker = new ServiceTracker(context,
- IOteClientService.class.getName(), null);
- oteClientServiceTracker.open();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- oteClientServiceTracker.close();
- }
-
- /**
- * Returns the shared instance.
- */
- public static MuxToolPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in
- * relative path.
- *
- * @param path
- * the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(
- "org.eclipse.osee.ote.ui.mux", path);
- }
-
- public IOteClientService getOteClientService() {
- return (IOteClientService) oteClientServiceTracker.getService();
- }
-}
+ public IOteClientService getOteClientService() {
+ return (IOteClientService) oteClientServiceTracker.getService();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java
index cb70f826a0..3dc89eec92 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java
@@ -8,59 +8,59 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.datatable;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author Ky Komadino
- */
-public class DataNode {
- RowNode row1, row2, row3, row4;
- byte[] temp;
-
- public DataNode() {
- row1 = new RowNode();
- row2 = new RowNode();
- row3 = new RowNode();
- row4 = new RowNode();
- temp = new byte[16];
- }
-
- public RowNode getRow(int row) {
- switch (row) {
- case 1: return row1;
- case 2: return row2;
- case 3: return row3;
- case 4: return row4;
- default: return row1;
- }
- }
-
- public synchronized void setData(ByteBuffer data) {
- // discard header bytes
- if (data.remaining() <= 15)
- return;
- else {
- temp = new byte[15];
- data.get(temp, 0, 15);
- }
-
- int copySize = data.remaining() >= 16 ? 16 : data.remaining();
- temp = new byte[copySize];
- data.get(temp, 0, copySize);
- row1.setData(temp);
- copySize = data.remaining() >= 16 ? 16 : data.remaining();
- temp = new byte[copySize];
- data.get(temp, 0, copySize);
- row2.setData(temp);
- copySize = data.remaining() >= 16 ? 16 : data.remaining();
- temp = new byte[copySize];
- data.get(temp, 0, copySize);
- row3.setData(temp);
- copySize = data.remaining() >= 16 ? 16 : data.remaining();
- temp = new byte[copySize];
- data.get(temp, 0, copySize);
- row4.setData(temp);
- }
-}
+package org.eclipse.osee.ote.ui.mux.datatable;
+
+import java.nio.ByteBuffer;
+
+/**
+ * @author Ky Komadino
+ */
+public class DataNode {
+ RowNode row1, row2, row3, row4;
+ byte[] temp;
+
+ public DataNode() {
+ row1 = new RowNode();
+ row2 = new RowNode();
+ row3 = new RowNode();
+ row4 = new RowNode();
+ temp = new byte[16];
+ }
+
+ public RowNode getRow(int row) {
+ switch (row) {
+ case 1: return row1;
+ case 2: return row2;
+ case 3: return row3;
+ case 4: return row4;
+ default: return row1;
+ }
+ }
+
+ public synchronized void setData(ByteBuffer data) {
+ // discard header bytes
+ if (data.remaining() <= 15)
+ return;
+ else {
+ temp = new byte[15];
+ data.get(temp, 0, 15);
+ }
+
+ int copySize = data.remaining() >= 16 ? 16 : data.remaining();
+ temp = new byte[copySize];
+ data.get(temp, 0, copySize);
+ row1.setData(temp);
+ copySize = data.remaining() >= 16 ? 16 : data.remaining();
+ temp = new byte[copySize];
+ data.get(temp, 0, copySize);
+ row2.setData(temp);
+ copySize = data.remaining() >= 16 ? 16 : data.remaining();
+ temp = new byte[copySize];
+ data.get(temp, 0, copySize);
+ row3.setData(temp);
+ copySize = data.remaining() >= 16 ? 16 : data.remaining();
+ temp = new byte[copySize];
+ data.get(temp, 0, copySize);
+ row4.setData(temp);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java
index ecf660a108..14038af831 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java
@@ -8,38 +8,38 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.datatable;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osee.ote.ui.mux.model.DatawordModel;
-
-/**
- * @author Ky Komadino
- *
- */
-public class DatawordContentProvider implements IStructuredContentProvider {
- private final static Object[] EMPTY_ARRAY = new Object[0];
- private Viewer viewer;
-
- public void refresh() {
- viewer.refresh();
- }
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- viewer = v;
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- if (parent instanceof DatawordModel) {
- return ((DatawordModel)parent).getChildren();
- }
- else {
- return EMPTY_ARRAY;
- }
- }
-
-}
+package org.eclipse.osee.ote.ui.mux.datatable;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ote.ui.mux.model.DatawordModel;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class DatawordContentProvider implements IStructuredContentProvider {
+ private final static Object[] EMPTY_ARRAY = new Object[0];
+ private Viewer viewer;
+
+ public void refresh() {
+ viewer.refresh();
+ }
+
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ viewer = v;
+ }
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object parent) {
+ if (parent instanceof DatawordModel) {
+ return ((DatawordModel)parent).getChildren();
+ }
+ else {
+ return EMPTY_ARRAY;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java
index 96d294b1e6..c493b914ee 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java
@@ -8,35 +8,35 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.datatable;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Ky Komadino
- *
- */
-public class DatawordLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object obj, int index) {
- if (obj != null && obj instanceof RowNode) {
- if (index >= 0 && index <= 7)
- return String.valueOf(((RowNode)obj).getDataword(index));
- else
- return "";
- }
- else
- return "";
- }
-
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
-
- public String getText(Object obj) {
- return ((MessageNode)obj).getName();
- }
-
-}
+package org.eclipse.osee.ote.ui.mux.datatable;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class DatawordLabelProvider extends LabelProvider implements ITableLabelProvider {
+ public String getColumnText(Object obj, int index) {
+ if (obj != null && obj instanceof RowNode) {
+ if (index >= 0 && index <= 7)
+ return String.valueOf(((RowNode)obj).getDataword(index));
+ else
+ return "";
+ }
+ else
+ return "";
+ }
+
+ public Image getColumnImage(Object obj, int index) {
+ return getImage(obj);
+ }
+
+ public String getText(Object obj) {
+ return ((MessageNode)obj).getName();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java
index 4a29aba47b..0fd69ec9bc 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java
@@ -8,41 +8,41 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.datatable;
-
-/**
- * @author Ky Komadino
- *
- */
-public class RowNode {
- private byte[] databytes;
- private int numDatabytes;
-
- public RowNode() {
- databytes = new byte[16];
- numDatabytes = 0;
- }
-
- public synchronized void setData(byte[] data) {
- numDatabytes = data.length;
- for (int i = 0; i < data.length && i < databytes.length; i++)
- databytes[i] = data[i];
- }
-
- public synchronized void setDataword(int data, int index) {
- databytes[index * 2] = (byte)((data & 0x0000FF00) >> 8);
- databytes[index * 2 + 1] = (byte)(data & 0x000000FF);
- }
-
- public synchronized byte getDatabyte(int index) {
- return databytes[index];
- }
-
- public synchronized String getDataword(int index) {
- if (numDatabytes > index * 2 + 1)
- return String.format("%02X%02X", (short)(databytes[index * 2] & 0x00FF),
- (short)(databytes[index * 2 + 1] & 0x00FF));
- else
- return "";
- }
-}
+package org.eclipse.osee.ote.ui.mux.datatable;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class RowNode {
+ private byte[] databytes;
+ private int numDatabytes;
+
+ public RowNode() {
+ databytes = new byte[16];
+ numDatabytes = 0;
+ }
+
+ public synchronized void setData(byte[] data) {
+ numDatabytes = data.length;
+ for (int i = 0; i < data.length && i < databytes.length; i++)
+ databytes[i] = data[i];
+ }
+
+ public synchronized void setDataword(int data, int index) {
+ databytes[index * 2] = (byte)((data & 0x0000FF00) >> 8);
+ databytes[index * 2 + 1] = (byte)(data & 0x000000FF);
+ }
+
+ public synchronized byte getDatabyte(int index) {
+ return databytes[index];
+ }
+
+ public synchronized String getDataword(int index) {
+ if (numDatabytes > index * 2 + 1)
+ return String.format("%02X%02X", (short)(databytes[index * 2] & 0x00FF),
+ (short)(databytes[index * 2 + 1] & 0x00FF));
+ else
+ return "";
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java
index 0605164dff..c0632fba09 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java
@@ -8,72 +8,72 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.model;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.util.HashMap;
-import org.eclipse.osee.ote.ui.mux.datatable.DataNode;
-
-/**
- * @author Ky Komadino
- *
- */
-public class DatawordModel {
- private final static Object[] EMPTY_ARRAY = new Object[0];
- private HashMap<String, DataNode> dataNodes;
- private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer();
- private String currentNode = null;
-
- public DatawordModel() {
- dataNodes = new HashMap<String, DataNode>();
- };
-
- /**
- * @param muxId - message ID
- * @param node - node to add to list
- */
- public void addNode(String muxId, DataNode node) {
- dataNodes.put(muxId, node);
- }
-
- /**
- *
- * @param node - currently selected node
- */
- public void setCurrentNode(String node) {
- currentNode = node;
- }
-
- /**
- * @return - values in list
- */
- public Object[] getChildren() {
- if (currentNode != null) {
- DataNode node = dataNodes.get(currentNode);
- Object nodes[] = new Object[] {node.getRow(1), node.getRow(2), node.getRow(3), node.getRow(4)};
- return nodes;
- }
- return EMPTY_ARRAY;
- }
-
- public void removeDatawords() {
- dataNodes.clear();
- }
-
- public void onDataAvailable(ByteBuffer data) {
- buffer.clear();
- buffer.append(String.format("%02d", ((short)(data.array()[1] & 0x00F8)) >> 3));
- final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R';
- buffer.append(transmitReceive);
- buffer.append(String.format("%02d", (((short)(data.array()[1] & 0x0003)) << 3) +
- (((short)(data.array()[2] & 0x00E0)) >> 5)));
- String muxId = buffer.flip().toString();
- DataNode receiveData = dataNodes.get(muxId);
- if (receiveData == null) {
- receiveData = new DataNode();
- addNode(muxId, receiveData);
- }
- receiveData.setData(data);
- }
-}
+package org.eclipse.osee.ote.ui.mux.model;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.util.HashMap;
+import org.eclipse.osee.ote.ui.mux.datatable.DataNode;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class DatawordModel {
+ private final static Object[] EMPTY_ARRAY = new Object[0];
+ private HashMap<String, DataNode> dataNodes;
+ private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer();
+ private String currentNode = null;
+
+ public DatawordModel() {
+ dataNodes = new HashMap<String, DataNode>();
+ };
+
+ /**
+ * @param muxId - message ID
+ * @param node - node to add to list
+ */
+ public void addNode(String muxId, DataNode node) {
+ dataNodes.put(muxId, node);
+ }
+
+ /**
+ *
+ * @param node - currently selected node
+ */
+ public void setCurrentNode(String node) {
+ currentNode = node;
+ }
+
+ /**
+ * @return - values in list
+ */
+ public Object[] getChildren() {
+ if (currentNode != null) {
+ DataNode node = dataNodes.get(currentNode);
+ Object nodes[] = new Object[] {node.getRow(1), node.getRow(2), node.getRow(3), node.getRow(4)};
+ return nodes;
+ }
+ return EMPTY_ARRAY;
+ }
+
+ public void removeDatawords() {
+ dataNodes.clear();
+ }
+
+ public void onDataAvailable(ByteBuffer data) {
+ buffer.clear();
+ buffer.append(String.format("%02d", ((short)(data.array()[1] & 0x00F8)) >> 3));
+ final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R';
+ buffer.append(transmitReceive);
+ buffer.append(String.format("%02d", (((short)(data.array()[1] & 0x0003)) << 3) +
+ (((short)(data.array()[2] & 0x00E0)) >> 5)));
+ String muxId = buffer.flip().toString();
+ DataNode receiveData = dataNodes.get(muxId);
+ if (receiveData == null) {
+ receiveData = new DataNode();
+ addNode(muxId, receiveData);
+ }
+ receiveData.setData(data);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java
index e6a95a39c2..a0ca16e7ed 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java
@@ -8,61 +8,61 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.model;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.util.Collection;
-import java.util.HashMap;
-import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode;
-
-/**
- * @author Ky Komadino
- */
-public class MessageModel {
- private HashMap<String, MessageNode> messageNodes;
- private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer();
-
- public MessageModel() {
- messageNodes = new HashMap<String, MessageNode>();
- };
-
- /**
- * @param muxId - message ID
- * @param node - node to add to list
- */
- public void addNode(String muxId, MessageNode node) {
- messageNodes.put(muxId, node);
- }
-
- /**
- * @return - values in list
- */
- public Collection<MessageNode> getChildren() {
- return messageNodes.values();
- }
-
- public void removeMessages() {
- messageNodes.clear();
- }
-
- public void onDataAvailable(ByteBuffer data) {
- // if this is the "T" side of an RT-RT message, then discard
- if ((data.array()[1] & 0x04) >> 2 == 1 && data.array()[3] != 0 && data.array()[4] != 0)
- return;
-
- buffer.clear();
- buffer.append(String.format("%02d", ((short)(data.array()[1] & 0x00F8)) >> 3));
- final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R';
- buffer.append(transmitReceive);
- buffer.append(String.format("%02d", (((short)(data.array()[1] & 0x0003)) << 3) +
- (((short)(data.array()[2] & 0x00E0)) >> 5)));
- String muxId = buffer.flip().toString();
- MessageNode receiveMessage = messageNodes.get(muxId);
- if (receiveMessage == null) {
- receiveMessage = new MessageNode(muxId);
- addNode(muxId, receiveMessage);
- }
- receiveMessage.setData(data);
- }
-}
+package org.eclipse.osee.ote.ui.mux.model;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.util.Collection;
+import java.util.HashMap;
+import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode;
+
+/**
+ * @author Ky Komadino
+ */
+public class MessageModel {
+ private HashMap<String, MessageNode> messageNodes;
+ private final CharBuffer buffer = ByteBuffer.allocate(16).asCharBuffer();
+
+ public MessageModel() {
+ messageNodes = new HashMap<String, MessageNode>();
+ };
+
+ /**
+ * @param muxId - message ID
+ * @param node - node to add to list
+ */
+ public void addNode(String muxId, MessageNode node) {
+ messageNodes.put(muxId, node);
+ }
+
+ /**
+ * @return - values in list
+ */
+ public Collection<MessageNode> getChildren() {
+ return messageNodes.values();
+ }
+
+ public void removeMessages() {
+ messageNodes.clear();
+ }
+
+ public void onDataAvailable(ByteBuffer data) {
+ // if this is the "T" side of an RT-RT message, then discard
+ if ((data.array()[1] & 0x04) >> 2 == 1 && data.array()[3] != 0 && data.array()[4] != 0)
+ return;
+
+ buffer.clear();
+ buffer.append(String.format("%02d", ((short)(data.array()[1] & 0x00F8)) >> 3));
+ final char transmitReceive = (data.array()[1] & 0x04) >> 2 == 1 ? 'T' : 'R';
+ buffer.append(transmitReceive);
+ buffer.append(String.format("%02d", (((short)(data.array()[1] & 0x0003)) << 3) +
+ (((short)(data.array()[2] & 0x00E0)) >> 5)));
+ String muxId = buffer.flip().toString();
+ MessageNode receiveMessage = messageNodes.get(muxId);
+ if (receiveMessage == null) {
+ receiveMessage = new MessageNode(muxId);
+ addNode(muxId, receiveMessage);
+ }
+ receiveMessage.setData(data);
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java
index df5cedc0c8..dbaa383193 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java
@@ -8,180 +8,180 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.msgtable;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-
-/**
- * @author Ky Komadino
- */
-public class MessageNode {
- private final String name;
- private int rt;
- private String rtRt;
- private int transmitReceive;
- private int subaddress;
- private int wordCount;
- private String statusWord;
- private String emulation;
- private String bus;
- private int activity;
- private int errCount;
- private String errType;
- private CharBuffer temp = ByteBuffer.allocate(32).asCharBuffer();
-
- public MessageNode(String muxId) {
- this.name = muxId;
- }
-
- /**
- *
- * @param data - raw mux data from 1553 driver
- */
- public synchronized void setData(ByteBuffer data) {
- if (data.array()[3] == 0 && data.array()[4] == 0) { // not an RT-RT msg
- rt = ((short)(data.array()[1] & 0x00F8)) >> 3;
- transmitReceive = ((short)(data.array()[1] & 0x0004)) >> 2;
- subaddress = (((short)(data.array()[1] & 0x0003)) << 3) + (((short)(data.array()[2] & 0x00E0)) >> 5);
- temp.clear();
- temp.append(String.format(" "));
- rtRt = temp.flip().toString();
- }
- else { // is an RT-RT msg, reference the "T" side datawords
- rt = ((short)(data.array()[3] & 0x00F8)) >> 3;
- transmitReceive = ((short)(data.array()[3] & 0x0004)) >> 2;
- subaddress = (((short)(data.array()[3] & 0x0003)) << 3) + (((short)(data.array()[4] & 0x00E0)) >> 5);
- temp.clear();
- temp.append(String.format("%02d", ((short)(data.array()[3] & 0x00F8)) >> 3));
- temp.append((data.array()[3] & 0x0004) >> 2 == 1 ? 'T' : 'R');
- temp.append(String.format("%02d", (((short)(data.array()[3] & 0x0003)) << 3) +
- (((short)(data.array()[4] & 0x00E0)) >> 5)));
- rtRt = temp.flip().toString();
- }
-
- if (subaddress == 0 || subaddress == 31)
- wordCount = (short)(data.array()[2] & 0x001F) >= 16 ? 1 : 0;
- else
- wordCount = (short)(data.array()[2] & 0x001F) == 0 ? 32 : (short)(data.array()[2] & 0x001F);
-
- temp.clear();
- temp.append(String.format("0x%02X%02X", data.array()[5], data.array()[6]));
- statusWord = temp.flip().toString();
-
- temp.clear();
- switch (((short)(data.array()[9] & 0x00C0)) >> 6) {
- case 1: temp.append("-/B");
- break;
- case 2: temp.append("A/-");
- break;
- case 3: temp.append("A/B");
- break;
- default: temp.append("MON");
- }
- emulation = temp.flip().toString();
-
- temp.clear();
- if ((short)(data.array()[10] & 0x0008) == 0)
- temp.append(String.format("PRI"));
- else
- temp.append(String.format("SEC"));
- bus = temp.flip().toString();
-
- activity++;
-
- temp.clear();
- if ((short)(data.array()[10] & 0x0080) == 0) {
- temp.append(" ");
- }
- else {
- errCount++;
- temp.append("NO RESPONSE");
- }
- errType = temp.flip().toString();
- }
-
- /**
- * @return Returns the activity.
- */
- public synchronized int getActivity() {
- return activity;
- }
-
- /**
- * @return Returns the bus.
- */
- public synchronized String getBus() {
- return bus.toString();
- }
-
- /**
- * @return Returns the emulation.
- */
- public synchronized String getEmulation() {
- return emulation.toString();
- }
-
- /**
- * @return Returns the errCount.
- */
- public synchronized int getErrCount() {
- return errCount;
- }
-
- /**
- * @return Returns the errType.
- */
- public synchronized String getErrType() {
- return errType.toString();
- }
-
- /**
- * @return Returns the name.
- */
- public synchronized String getName() {
- return name;
- }
-
- /**
- * @return Returns the rt.
- */
- public synchronized int getRt() {
- return rt;
- }
-
- /**
- * @return Returns the rtRt.
- */
- public synchronized String getRtRt() {
- return rtRt.toString();
- }
-
- /**
- * @return Returns the statusWord.
- */
- public synchronized String getStatusWord() {
- return statusWord.toString();
- }
-
- /**
- * @return Returns the subaddress.
- */
- public synchronized int getSubaddress() {
- return subaddress;
- }
-
- /**
- * @return Returns the transmitReceive.
- */
- public synchronized int getTransmitReceive() {
- return transmitReceive;
- }
-
- /**
- * @return Returns the wordCount.
- */
- public synchronized int getWordCount() {
- return wordCount;
- }
-}
+package org.eclipse.osee.ote.ui.mux.msgtable;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+
+/**
+ * @author Ky Komadino
+ */
+public class MessageNode {
+ private final String name;
+ private int rt;
+ private String rtRt;
+ private int transmitReceive;
+ private int subaddress;
+ private int wordCount;
+ private String statusWord;
+ private String emulation;
+ private String bus;
+ private int activity;
+ private int errCount;
+ private String errType;
+ private CharBuffer temp = ByteBuffer.allocate(32).asCharBuffer();
+
+ public MessageNode(String muxId) {
+ this.name = muxId;
+ }
+
+ /**
+ *
+ * @param data - raw mux data from 1553 driver
+ */
+ public synchronized void setData(ByteBuffer data) {
+ if (data.array()[3] == 0 && data.array()[4] == 0) { // not an RT-RT msg
+ rt = ((short)(data.array()[1] & 0x00F8)) >> 3;
+ transmitReceive = ((short)(data.array()[1] & 0x0004)) >> 2;
+ subaddress = (((short)(data.array()[1] & 0x0003)) << 3) + (((short)(data.array()[2] & 0x00E0)) >> 5);
+ temp.clear();
+ temp.append(String.format(" "));
+ rtRt = temp.flip().toString();
+ }
+ else { // is an RT-RT msg, reference the "T" side datawords
+ rt = ((short)(data.array()[3] & 0x00F8)) >> 3;
+ transmitReceive = ((short)(data.array()[3] & 0x0004)) >> 2;
+ subaddress = (((short)(data.array()[3] & 0x0003)) << 3) + (((short)(data.array()[4] & 0x00E0)) >> 5);
+ temp.clear();
+ temp.append(String.format("%02d", ((short)(data.array()[3] & 0x00F8)) >> 3));
+ temp.append((data.array()[3] & 0x0004) >> 2 == 1 ? 'T' : 'R');
+ temp.append(String.format("%02d", (((short)(data.array()[3] & 0x0003)) << 3) +
+ (((short)(data.array()[4] & 0x00E0)) >> 5)));
+ rtRt = temp.flip().toString();
+ }
+
+ if (subaddress == 0 || subaddress == 31)
+ wordCount = (short)(data.array()[2] & 0x001F) >= 16 ? 1 : 0;
+ else
+ wordCount = (short)(data.array()[2] & 0x001F) == 0 ? 32 : (short)(data.array()[2] & 0x001F);
+
+ temp.clear();
+ temp.append(String.format("0x%02X%02X", data.array()[5], data.array()[6]));
+ statusWord = temp.flip().toString();
+
+ temp.clear();
+ switch (((short)(data.array()[9] & 0x00C0)) >> 6) {
+ case 1: temp.append("-/B");
+ break;
+ case 2: temp.append("A/-");
+ break;
+ case 3: temp.append("A/B");
+ break;
+ default: temp.append("MON");
+ }
+ emulation = temp.flip().toString();
+
+ temp.clear();
+ if ((short)(data.array()[10] & 0x0008) == 0)
+ temp.append(String.format("PRI"));
+ else
+ temp.append(String.format("SEC"));
+ bus = temp.flip().toString();
+
+ activity++;
+
+ temp.clear();
+ if ((short)(data.array()[10] & 0x0080) == 0) {
+ temp.append(" ");
+ }
+ else {
+ errCount++;
+ temp.append("NO RESPONSE");
+ }
+ errType = temp.flip().toString();
+ }
+
+ /**
+ * @return Returns the activity.
+ */
+ public synchronized int getActivity() {
+ return activity;
+ }
+
+ /**
+ * @return Returns the bus.
+ */
+ public synchronized String getBus() {
+ return bus.toString();
+ }
+
+ /**
+ * @return Returns the emulation.
+ */
+ public synchronized String getEmulation() {
+ return emulation.toString();
+ }
+
+ /**
+ * @return Returns the errCount.
+ */
+ public synchronized int getErrCount() {
+ return errCount;
+ }
+
+ /**
+ * @return Returns the errType.
+ */
+ public synchronized String getErrType() {
+ return errType.toString();
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public synchronized String getName() {
+ return name;
+ }
+
+ /**
+ * @return Returns the rt.
+ */
+ public synchronized int getRt() {
+ return rt;
+ }
+
+ /**
+ * @return Returns the rtRt.
+ */
+ public synchronized String getRtRt() {
+ return rtRt.toString();
+ }
+
+ /**
+ * @return Returns the statusWord.
+ */
+ public synchronized String getStatusWord() {
+ return statusWord.toString();
+ }
+
+ /**
+ * @return Returns the subaddress.
+ */
+ public synchronized int getSubaddress() {
+ return subaddress;
+ }
+
+ /**
+ * @return Returns the transmitReceive.
+ */
+ public synchronized int getTransmitReceive() {
+ return transmitReceive;
+ }
+
+ /**
+ * @return Returns the wordCount.
+ */
+ public synchronized int getWordCount() {
+ return wordCount;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java
index ed527f6029..efdfc06664 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java
@@ -8,37 +8,37 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.msgtable;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.osee.ote.ui.mux.model.MessageModel;
-
-/**
- * @author Ky Komadino
- *
- */
-public class MuxMsgContentProvider implements IStructuredContentProvider {
- private final static Object[] EMPTY_ARRAY = new Object[0];
- private Viewer viewer;
-
- public void refresh() {
- viewer.refresh();
- }
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- viewer = v;
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object parent) {
- if (parent instanceof MessageModel) {
- return ((MessageModel)parent).getChildren().toArray();
- }
- else {
- return EMPTY_ARRAY;
- }
- }
-}
+package org.eclipse.osee.ote.ui.mux.msgtable;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ote.ui.mux.model.MessageModel;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class MuxMsgContentProvider implements IStructuredContentProvider {
+ private final static Object[] EMPTY_ARRAY = new Object[0];
+ private Viewer viewer;
+
+ public void refresh() {
+ viewer.refresh();
+ }
+
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ viewer = v;
+ }
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object parent) {
+ if (parent instanceof MessageModel) {
+ return ((MessageModel)parent).getChildren().toArray();
+ }
+ else {
+ return EMPTY_ARRAY;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java
index c619d1e550..aeaec4a54d 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java
@@ -8,51 +8,51 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.msgtable;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @author Ky Komadino
- *
- */
-public class MuxMsgLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object obj, int index) {
- if (obj != null && obj instanceof MessageNode) {
- switch (index) {
- case 0:
- return ((MessageNode)obj).getName();
- case 1:
- return ((MessageNode)obj).getRtRt();
- case 2:
- return String.valueOf(((MessageNode)obj).getWordCount());
- case 3:
- return ((MessageNode)obj).getStatusWord();
- case 4:
- return ((MessageNode)obj).getEmulation();
- case 5:
- return ((MessageNode)obj).getBus();
- case 6:
- return String.valueOf(((MessageNode)obj).getActivity());
- case 7:
- return String.valueOf(((MessageNode)obj).getErrCount());
- case 8:
- return ((MessageNode)obj).getErrType();
- default:
- return "";
- }
- }
- else
- return "";
- }
-
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
-
- public String getText(Object obj) {
- return ((MessageNode)obj).getName();
- }
-}
+package org.eclipse.osee.ote.ui.mux.msgtable;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Ky Komadino
+ *
+ */
+public class MuxMsgLabelProvider extends LabelProvider implements ITableLabelProvider {
+ public String getColumnText(Object obj, int index) {
+ if (obj != null && obj instanceof MessageNode) {
+ switch (index) {
+ case 0:
+ return ((MessageNode)obj).getName();
+ case 1:
+ return ((MessageNode)obj).getRtRt();
+ case 2:
+ return String.valueOf(((MessageNode)obj).getWordCount());
+ case 3:
+ return ((MessageNode)obj).getStatusWord();
+ case 4:
+ return ((MessageNode)obj).getEmulation();
+ case 5:
+ return ((MessageNode)obj).getBus();
+ case 6:
+ return String.valueOf(((MessageNode)obj).getActivity());
+ case 7:
+ return String.valueOf(((MessageNode)obj).getErrCount());
+ case 8:
+ return ((MessageNode)obj).getErrType();
+ default:
+ return "";
+ }
+ }
+ else
+ return "";
+ }
+
+ public Image getColumnImage(Object obj, int index) {
+ return getImage(obj);
+ }
+
+ public String getText(Object obj) {
+ return ((MessageNode)obj).getName();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java
index f3b9978834..115f5dd683 100644
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java
+++ b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java
@@ -8,21 +8,21 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ote.ui.mux.view;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener;
-import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation;
-
-/**
- * @author Ken J. Aguilar
- *
- */
-public interface IRegistrationListener extends Remote, IInstrumentationRegistrationListener {
-
- void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException;
-
- void onDeregistered(String name) throws RemoteException;
-}
+package org.eclipse.osee.ote.ui.mux.view;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener;
+import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation;
+
+/**
+ * @author Ken J. Aguilar
+ *
+ */
+public interface IRegistrationListener extends Remote, IInstrumentationRegistrationListener {
+
+ void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException;
+
+ void onDeregistered(String name) throws RemoteException;
+}

Back to the top