Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2013-01-16 14:42:07 -0500
committerRoberto E. Escobar2013-01-16 14:42:07 -0500
commit8a46cbffe0a4f6e1190a130c4bb4905d29d6300b (patch)
treec9480a7e1b0fc94d05ae43eefd20add0ac15f5c1 /plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse
parentf730b8dbc09a4851552f34ac0cfb7160a71cba99 (diff)
downloadorg.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.tar.gz
org.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.tar.xz
org.eclipse.osee-8a46cbffe0a4f6e1190a130c4bb4905d29d6300b.zip
feature[ats_PP77Z]: Delete the moved projects
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.java78
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java38
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java32
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java34
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java71
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java46
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java45
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java49
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java77
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java69
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java190
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java45
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java60
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java28
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java443
-rw-r--r--plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java360
16 files changed, 0 insertions, 1665 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
deleted file mode 100644
index 4348375369..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/MuxToolPlugin.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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;
-
- 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
- */
- @Override
- 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
- */
- @Override
- 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();
- }
-}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java
deleted file mode 100644
index 25ea0dbe7a..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/OteMuxImage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.osee.ote.ui.mux;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.framework.ui.swt.ImageManager;
-import org.eclipse.osee.framework.ui.swt.KeyedImage;
-
-/**
- * @author Andrew M. Finkbeiner
- */
-public enum OteMuxImage implements KeyedImage {
- MUX("1553.gif");
-
- private final String fileName;
-
- private OteMuxImage(String fileName) {
- this.fileName = fileName;
- }
-
- @Override
- public ImageDescriptor createImageDescriptor() {
- return ImageManager.createImageDescriptor(MuxToolPlugin.PLUGIN_ID, "icons", fileName);
- }
-
- @Override
- public String getImageKey() {
- return MuxToolPlugin.PLUGIN_ID + ".icons." + fileName;
- }
-}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java
deleted file mode 100644
index e09cb023ad..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/MuxViewNavigatorItem.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.osee.ote.ui.mux.actions;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.IXNavigateContainer;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
-import org.eclipse.osee.ote.ui.mux.OteMuxImage;
-
-public class MuxViewNavigatorItem implements IXNavigateContainer {
-
- public MuxViewNavigatorItem() {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public List<XNavigateItem> getNavigateItems() {
- XNavigateItem action = new XNavigateItemAction(null, new OpenMuxViewAction(), OteMuxImage.MUX, false);
- return Collections.singletonList(action);
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java
deleted file mode 100644
index ba80dd957c..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/actions/OpenMuxViewAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.osee.ote.ui.mux.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.ote.ui.mux.view.MuxView;
-import org.eclipse.ui.PlatformUI;
-
-public class OpenMuxViewAction extends Action {
-
- public OpenMuxViewAction() {
- super("Open Mux View");
- }
-
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(MuxView.VIEW_ID);
- } catch (Exception e) {
- MessageDialog.openError(Displays.getActiveShell(), "Error", "got an exception");
- }
- }
-
-}
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
deleted file mode 100644
index 445b373909..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DataNode.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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
deleted file mode 100644
index a83089ac1b..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordContentProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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();
- }
-
- @Override
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- viewer = v;
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- 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
deleted file mode 100644
index 2218d34b67..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/DatawordLabelProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 {
- @Override
- 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 "";
- }
- }
-
- @Override
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
-
- @Override
- 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
deleted file mode 100644
index a85b6d7d04..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/datatable/RowNode.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.osee.ote.ui.mux.datatable;
-
-/**
- * @author Ky Komadino
- */
-public class RowNode {
- private final 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
deleted file mode 100644
index da2ba106b5..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/DatawordModel.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 final 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
deleted file mode 100644
index cc3ffb85ee..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/model/MessageModel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 final 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
deleted file mode 100644
index afd50cbe9a..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MessageNode.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 final 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
deleted file mode 100644
index e6e0a61a4b..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgContentProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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();
- }
-
- @Override
- public void inputChanged(Viewer v, Object oldInput, Object newInput) {
- viewer = v;
- }
-
- @Override
- public void dispose() {
- }
-
- @Override
- 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
deleted file mode 100644
index a501eae246..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/msgtable/MuxMsgLabelProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 {
- @Override
- 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 "";
- }
- }
-
- @Override
- public Image getColumnImage(Object obj, int index) {
- return getImage(obj);
- }
-
- @Override
- 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
deleted file mode 100644
index 936a1013bf..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/IRegistrationListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.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 {
-
- @Override
- void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException;
-
- @Override
- void onDeregistered(String name) throws RemoteException;
-}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java
deleted file mode 100644
index 2800cc0666..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxChannelComposite.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.osee.ote.ui.mux.view;
-
-import java.nio.ByteBuffer;
-import java.rmi.RemoteException;
-import java.util.logging.Level;
-
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation;
-import org.eclipse.osee.ote.ui.mux.MuxToolPlugin;
-import org.eclipse.osee.ote.ui.mux.datatable.DatawordContentProvider;
-import org.eclipse.osee.ote.ui.mux.datatable.DatawordLabelProvider;
-import org.eclipse.osee.ote.ui.mux.datatable.RowNode;
-import org.eclipse.osee.ote.ui.mux.model.DatawordModel;
-import org.eclipse.osee.ote.ui.mux.model.MessageModel;
-import org.eclipse.osee.ote.ui.mux.msgtable.MessageNode;
-import org.eclipse.osee.ote.ui.mux.msgtable.MuxMsgContentProvider;
-import org.eclipse.osee.ote.ui.mux.msgtable.MuxMsgLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ControlEditor;
-import org.eclipse.swt.custom.TableCursor;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-
-public class MuxChannelComposite extends Composite {
-
- private TableViewer msgViewer;
- private TableViewer dataViewer;
- private MessageModel chanMsgs;
- private DatawordModel chanDwrds;
- private final int selectedChannel;
- private int selectedRt;
- private int selectedTR;
- private int selectedSubaddr;
- private IOInstrumentation muxProbe;
- private final static Color GRAY = Displays.getSystemColor(SWT.COLOR_GRAY);
- private final static Color WHITE = Displays.getSystemColor(SWT.COLOR_WHITE);
-
- public MuxChannelComposite(Composite parent, int style, int channel) {
- super(parent, style);
- createPartControl(parent);
- this.selectedChannel = channel;
- }
-
- public void setMuxProbe(IOInstrumentation muxProbe) {
- this.muxProbe = muxProbe;
- }
-
- private void createPartControl(Composite parent) {
- GridLayout chanLayout = new GridLayout(1, false);
- this.setLayout(chanLayout);
-
- msgViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
- msgViewer.setLabelProvider(new MuxMsgLabelProvider());
- msgViewer.setSorter(new ViewerSorter());
- msgViewer.setContentProvider(new MuxMsgContentProvider());
-
- createMsgTable(msgViewer);
-
- Composite bottom1 = new Composite(this, SWT.NONE);
- bottom1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- bottom1.setLayout(new GridLayout(2, false));
-
- Composite data1 = new Composite(bottom1, SWT.NONE);
- RowLayout dataLayout1 = new RowLayout(SWT.HORIZONTAL);
- data1.setLayout(dataLayout1);
-
- Composite labels1 = new Composite(data1, SWT.NONE);
- RowLayout labelLayout1 = new RowLayout(SWT.VERTICAL);
- labelLayout1.marginTop = 5;
- labelLayout1.spacing = 1;
- labels1.setLayout(labelLayout1);
- Label label1_1 = new Label(labels1, SWT.NONE);
- label1_1.setText("Datawords 1-8");
- Label label2_1 = new Label(labels1, SWT.NONE);
- label2_1.setText("Datawords 9-16");
- Label label3_1 = new Label(labels1, SWT.NONE);
- label3_1.setText("Datawords 17-24");
- Label label4_1 = new Label(labels1, SWT.NONE);
- label4_1.setText("Datawords 25-32");
-
- Composite datawords1 = new Composite(data1, SWT.NONE);
- datawords1.setLayout(new GridLayout(1, false));
- dataViewer = new TableViewer(datawords1, SWT.BORDER
- | SWT.FULL_SELECTION);
- dataViewer.setContentProvider(new DatawordContentProvider());
- dataViewer.setLabelProvider(new DatawordLabelProvider());
- createDwordTable(dataViewer);
- msgViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event
- .getSelection();
- MessageNode node = (MessageNode) selection.getFirstElement();
- if (node != null) {
- selectedRt = node.getRt();
- selectedTR = node.getTransmitReceive();
- selectedSubaddr = node.getSubaddress();
- chanDwrds.setCurrentNode(node.getName());
- }
- }
- });
- final Button reset1 = new Button(bottom1, SWT.PUSH);
- reset1.setText("Reset Display");
- reset1.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER
- | GridData.GRAB_HORIZONTAL));
- reset1.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- selectedRt = 0;
- selectedTR = 0;
- selectedSubaddr = 0;
- chanMsgs.removeMessages();
- chanDwrds.setCurrentNode(null);
- }
- });
-
- msgViewer.setInput(chanMsgs = new MessageModel());
- dataViewer.setInput(chanDwrds = new DatawordModel());
- updateColors(false);
- }
-
- private void createMsgTable(TableViewer parent) {
- final Table table = parent.getTable();
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_FILL);
- int height = table.getItemHeight() * 20;
- Rectangle trim = table.computeTrim(0, 0, 0, height);
- gridData.heightHint = trim.height;
- table.setLayoutData(gridData);
- table.setHeaderVisible(true);
- TableColumn column = new TableColumn(table, SWT.CENTER, 0);
- column.setText("Message");
- column.setWidth(70);
- column = new TableColumn(table, SWT.CENTER, 1);
- column.setText("RT-RT");
- column.setWidth(60);
- column = new TableColumn(table, SWT.CENTER, 2);
- column.setText("Word Cnt");
- column.setWidth(70);
- column = new TableColumn(table, SWT.CENTER, 3);
- column.setText("StatusWd");
- column.setWidth(70);
- column = new TableColumn(table, SWT.CENTER, 4);
- column.setText("Emulation");
- column.setWidth(70);
- column = new TableColumn(table, SWT.CENTER, 5);
- column.setText("Bus");
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 6);
- column.setText("Activity");
- column.setWidth(60);
- column = new TableColumn(table, SWT.CENTER, 7);
- column.setText("Error Cnt");
- column.setWidth(70);
- column = new TableColumn(table, SWT.CENTER, 8);
- column.setText("Error Type");
- column.setWidth(150);
-
- table.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseDown(final MouseEvent event) {
- if (event.button == 3) {
- Menu menu = new Menu(table.getShell(), SWT.POP_UP);
- MenuItem enableBoth = new MenuItem(menu, SWT.PUSH);
- enableBoth.setText("Emulate RT (Pri + Sec)");
- enableBoth.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (muxProbe != null) {
- byte[] cmd = new byte[4];
- cmd[0] = 'R'; // RT simulation cmd
- cmd[1] = (byte) selectedChannel;
- cmd[2] = (byte) selectedRt;
- cmd[3] = (byte) 3;
- try {
- muxProbe.command(cmd);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class,
- Level.WARNING,
- "MuxView unable to send RT simulation command");
- }
- }
- }
- });
- MenuItem enableA = new MenuItem(menu, SWT.PUSH);
- enableA.setText("Emulate RT (Pri Only)");
- enableA.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (muxProbe != null) {
- byte[] cmd = new byte[4];
- cmd[0] = 'R'; // RT simulation cmd
- cmd[1] = (byte) selectedChannel;
- cmd[2] = (byte) selectedRt;
- cmd[3] = (byte) 1;
- try {
- muxProbe.command(cmd);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class,
- Level.WARNING,
- "MuxView unable to send RT simulation command");
- }
- }
- }
- });
- MenuItem enableB = new MenuItem(menu, SWT.PUSH);
- enableB.setText("Emulate RT (Sec only)");
- enableB.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (muxProbe != null) {
- byte[] cmd = new byte[4];
- cmd[0] = 'R'; // RT simulation cmd
- cmd[1] = (byte) selectedChannel;
- cmd[2] = (byte) selectedRt;
- cmd[3] = (byte) 2;
- try {
- muxProbe.command(cmd);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class,
- Level.WARNING,
- "MuxView unable to send RT simulation command");
- }
- }
- }
- });
- new MenuItem(menu, SWT.SEPARATOR);
- MenuItem disableBoth = new MenuItem(menu, SWT.PUSH);
- disableBoth.setText("Monitor RT (Pri + Sec)");
- disableBoth.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- if (muxProbe != null) {
- byte[] cmd = new byte[4];
- cmd[0] = 'R'; // RT simulation cmd
- cmd[1] = (byte) selectedChannel;
- cmd[2] = (byte) selectedRt;
- cmd[3] = (byte) 0;
- try {
- muxProbe.command(cmd);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class,
- Level.WARNING,
- "MuxView unable to send RT simulation command");
- }
- }
- }
- });
-
- // draws pop up menu:
- Point pt = new Point(event.x, event.y);
- pt = table.toDisplay(pt);
- menu.setLocation(pt.x, pt.y);
- menu.setVisible(true);
- }
- }
- });
-
- }
-
- /**
- * Create the Datawords Tree
- */
- private void createDwordTable(final TableViewer parent) {
- final Table table = parent.getTable();
- GridData gridData = new GridData();
- int height = table.getItemHeight() * 2;
- Rectangle trim = table.computeTrim(0, 0, 0, height);
- gridData.heightHint = trim.height;
- table.setLayoutData(gridData);
- table.setHeaderVisible(false);
- table.setLinesVisible(true);
-
- TableColumn column = new TableColumn(table, SWT.CENTER, 0);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 1);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 2);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 3);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 4);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 5);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 6);
- column.setWidth(50);
- column = new TableColumn(table, SWT.CENTER, 7);
- column.setWidth(50);
-
- table.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
-
- final TableCursor cursor = new TableCursor(table, SWT.NONE);
- final ControlEditor editor = new ControlEditor(cursor);
- editor.grabHorizontal = true;
- editor.grabVertical = true;
-
- cursor.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- final Text text = new Text(cursor, SWT.NONE);
- text.setTextLimit(4);
- TableItem row = cursor.getRow();
- int column = cursor.getColumn();
- text.setText(row.getText(column));
- text.addKeyListener(new KeyAdapter() {
-
- @Override
- public void keyPressed(KeyEvent e) {
- // close the text editor and copy the data over
- // when the user hits "ENTER"
- if (e.character == SWT.CR) {
- TableItem row = cursor.getRow();
- int column = cursor.getColumn();
- int newVal = Integer.parseInt(
- text.getText(), 16);
- row.setText(column, text.getText());
- text.dispose();
- cursor.dispose();
- if (muxProbe != null) {
- byte[] cmd = new byte[100];
- int index = 0;
- cmd[index++] = 'S'; // set 1553 data cmd
- cmd[index++] = (byte) selectedChannel;
- cmd[index++] = (byte) selectedRt;
- cmd[index++] = (byte) selectedTR;
- cmd[index++] = (byte) selectedSubaddr;
- Object[] o = ((DatawordModel) parent
- .getInput()).getChildren();
- ((RowNode) o[table.indexOf(row)])
- .setDataword(newVal, column);
- for (Object r : o) {
- for (int i = 0; i < 16; i++) {
- cmd[index++] = ((RowNode) r)
- .getDatabyte(i);
- }
- }
- try {
- muxProbe.command(cmd);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class,
- Level.WARNING,
- "MuxView unable to send RT simulation command");
- }
- }
- }
- // close the text editor when the user hits
- // "ESC"
- if (e.character == SWT.ESC) {
- text.dispose();
- cursor.dispose();
- }
- // allow only hexadecimal characters, backspace,
- // delete,
- // left and right arrow keys
- if (e.character >= 0x30 && e.character <= 0x39
- || e.character >= 0x41
- && e.character <= 0x46
- || e.character >= 0x61
- && e.character <= 0x66
- || e.character == SWT.BS
- || (e.character == SWT.DEL && (e.stateMask & SWT.CTRL) == 0)
- || e.keyCode == SWT.ARROW_LEFT
- || e.keyCode == SWT.ARROW_RIGHT) {
- e.doit = true;
- } else {
- e.doit = false;
- }
- }
- });
- // close the text editor when the user clicks away
- text.addFocusListener(new FocusAdapter() {
- @Override
- public void focusLost(FocusEvent e) {
- text.dispose();
- cursor.dispose();
- }
- });
- editor.setEditor(text);
- text.setFocus();
- }
- });
- table.deselectAll();
- }
- });
- }
-
- void updateColors(boolean connected) {
- msgViewer.getTable().setBackground(connected ? WHITE : GRAY);
- dataViewer.getTable().setBackground(connected ? WHITE : GRAY);
- }
-
- public void refresh() {
- msgViewer.refresh();
- dataViewer.refresh();
- }
-
- public void onDataAvailable(ByteBuffer buffer) {
- chanMsgs.onDataAvailable(buffer);
- chanDwrds.onDataAvailable(buffer);
- }
-}
diff --git a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java b/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java
deleted file mode 100644
index c595718945..0000000000
--- a/plugins/org.eclipse.osee.ote.ui.mux/src/org/eclipse/osee/ote/ui/mux/view/MuxView.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.osee.ote.ui.mux.view;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.channels.DatagramChannel;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.logging.Level;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.osee.connection.service.IServiceConnector;
-import org.eclipse.osee.framework.jdk.core.util.network.PortUtil;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.ui.plugin.util.HelpUtil;
-import org.eclipse.osee.framework.ui.swt.Displays;
-import org.eclipse.osee.framework.ui.swt.PeriodicDisplayTask;
-import org.eclipse.osee.ote.core.environment.interfaces.ITestEnvironment;
-import org.eclipse.osee.ote.message.IInstrumentationRegistrationListener;
-import org.eclipse.osee.ote.message.instrumentation.IOInstrumentation;
-import org.eclipse.osee.ote.message.interfaces.ITestEnvironmentMessageSystem;
-import org.eclipse.osee.ote.service.ConnectionEvent;
-import org.eclipse.osee.ote.service.ITestConnectionListener;
-import org.eclipse.osee.ote.ui.mux.MuxToolPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained from the model. The
- * sample creates a dummy model on the fly, but a real implementation would connect to the model available either in
- * this or another plug-in (e.g. the workspace). The view is connected to the model using a content provider.
- * <p>
- * The view uses a label provider to define how model objects should be presented in the view. Each view can present the
- * same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared
- * between views in order to ensure that objects of the same type are presented in the same way everywhere.
- * <p>
- */
-
-public class MuxView extends ViewPart implements ITestConnectionListener, IInstrumentationRegistrationListener, Remote {
- private IOInstrumentation muxProbe;
- private PeriodicDisplayTask task;
- private ListenerThread thread;
- private int port;
- private final Map<Integer, MuxChannelComposite> channelComposites;
-
- private IInstrumentationRegistrationListener exportedThis;
- private TabFolder tabFolder;
-
- public static final String VIEW_ID = "osee.test.muxTool.views.MuxView";
- class NameSorter extends ViewerSorter {
- }
-
- /**
- * The constructor.
- */
- public MuxView() {
- super();
- channelComposites = new TreeMap<Integer, MuxChannelComposite>();
- }
-
- /**
- * This is a callback that will allow us to create the viewers and initialize them.
- */
- @Override
- public void createPartControl(Composite parent) {
- tabFolder = new TabFolder(parent, SWT.WRAP);
- addChannelToView(1);
- try {
- thread = new ListenerThread();
- } catch (Exception e) {
- OseeLog.log(MuxView.class, Level.SEVERE, "Mux View could not start listening thread", e);
- MessageDialog.openError(parent.getShell(), "Error", "Mux View could not initialize. See Error Log for details");
- return;
- }
- thread.start();
-
- task = new PeriodicDisplayTask(Display.getDefault(), 333) {
- @Override
- protected void update() {
- try {
- for(MuxChannelComposite mux:channelComposites.values()){
- mux.refresh();
- }
- } catch (Throwable t) {
- OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "problems refreshing viewer", t);
- stop();
- }
- }
- };
- task.start();
-
- // TODO: Change to use OteHelpContext
- HelpUtil.setHelp(parent, "mux_view", "org.eclipse.osee.ote.help.ui");
- MuxToolPlugin.getDefault().getOteClientService().addConnectionListener(this);
- }
-
-
- private MuxChannelComposite addChannelToView(int channel){
- if(!channelComposites.containsKey(channel)){
- Composite chanTabComp = new Composite(tabFolder, SWT.NONE);
- MuxChannelComposite muxChannelComposite = new MuxChannelComposite(chanTabComp, SWT.NONE, channel);
- GridLayout chanLayout = new GridLayout(1, false);
- chanTabComp.setLayout(chanLayout);
- channelComposites.put(channel, muxChannelComposite);
-
- int index = 0;
- for(MuxChannelComposite muxChannel : channelComposites.values()){
- if(muxChannelComposite == muxChannel){
- break;
- }
- index++;
- }
- TabItem chanTab = new TabItem(tabFolder, SWT.NONE, index);
- chanTab.setText("Channel "+ channel);
- chanTab.setControl(chanTabComp);
- return muxChannelComposite;
- } else {
- return null;
- }
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- @Override
- public void setFocus() {
- // msgViewer1.getControl().setFocus();
- }
-
- @Override
- public void dispose() {
- MuxToolPlugin.getDefault().getOteClientService().removeConnectionListener(this);
- ITestEnvironment env = MuxToolPlugin.getDefault().getOteClientService().getConnectedEnvironment();
- if (env != null) {
- try {
- ((ITestEnvironmentMessageSystem) env).removeInstrumentationRegistrationListener(exportedThis);
- } catch (RemoteException ex) {
- OseeLog.log(MuxView.class, Level.WARNING, "could not deregister instrumentation registration listener", ex);
- }
- IServiceConnector connector = MuxToolPlugin.getDefault().getOteClientService().getConnector();
- try {
- connector.unexport(this);
- } catch (Exception ex) {
- OseeLog.log(MuxView.class, Level.WARNING, "could not unexport this", ex);
- }
- }
- if (muxProbe != null) {
- try {
- muxProbe.unregister(thread.address);
- } catch (RemoteException ex) {
- OseeLog.log(MuxView.class, Level.WARNING, "could not disconnect from mux probe", ex);
- }
- muxProbe = null;
- }
- if (task != null) {
- task.stop();
- }
- thread.shutdown();
-
- super.dispose();
- }
-
- class ListenerThread extends Thread {
- private volatile boolean done = false;
- private final DatagramChannel channel;
- private final InetSocketAddress address;
-
- public ListenerThread() throws IOException {
- super("Mux View Listener Thread");
- channel = DatagramChannel.open();
- port = PortUtil.getInstance().getValidPort();
- address = new InetSocketAddress(InetAddress.getLocalHost(), port);
- channel.socket().bind(address);
- OseeLog.log(MuxToolPlugin.class, Level.INFO,
- "MuxView connection - host: " + address.getHostName() + " port: " + address.getPort());
- }
-
- @Override
- public void run() {
- final ByteBuffer buffer = ByteBuffer.wrap(new byte[256]);
- try {
- while (!done) {
- buffer.clear();
- channel.receive(buffer);
- buffer.flip();
- final int channel = buffer.array()[0];
- MuxChannelComposite composite = channelComposites.get(channel);
- if(composite != null){
- composite.onDataAvailable(buffer);
- } else {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
-
- @Override
- public void run() {
- MuxChannelComposite muxChannelComposite = addChannelToView(channel);
- muxChannelComposite.updateColors(true);
- muxChannelComposite.setMuxProbe(muxProbe);
- muxChannelComposite.onDataAvailable(buffer);
- }
- });
- }
- }
- } catch (InterruptedIOException e) {
- Thread.currentThread().interrupt();
- } catch (IOException e) {
- if (!isInterrupted()) {
- OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Interrupted", e);
- }
- } finally {
- try {
- channel.close();
- } catch (IOException e) {
- // do nothing
- }
- }
- }
-
- public void shutdown() {
- done = true;
- interrupt();
- try {
- thread.join(5000);
- assert !channel.isOpen();
- } catch (InterruptedException e) {
- OseeLog.log(MuxView.class, Level.SEVERE, "could not join wiht listener thread", e);
- }
- }
- }
-
- @Override
- public void onConnectionLost(IServiceConnector connector) {
- handleConnectionLostStatus();
- }
-
- @Override
- public void onPostConnect(final ConnectionEvent event) {
- final ITestEnvironmentMessageSystem environment = (ITestEnvironmentMessageSystem) event.getEnvironment();
- if (environment != null) {
- // we are connected
- try {
- exportedThis = (IInstrumentationRegistrationListener) event.getConnector().findExport(MuxView.this);
- if (exportedThis == null) {
- exportedThis = (IInstrumentationRegistrationListener) event.getConnector().export(MuxView.this);
- }
- environment.addInstrumentationRegistrationListener(exportedThis);
- } catch (Exception ex) {
- OseeLog.log(MuxView.class, Level.SEVERE, "could not register for instrumentation events", ex);
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(Displays.getActiveShell(), "Connect Error",
- "Could not register for instrumentation events. See Error Log for details");
- }
-
- });
-
- }
- }
-
- }
-
- private void detach() {
-
- }
-
- @Override
- public void onPreDisconnect(ConnectionEvent event) {
- final ITestEnvironmentMessageSystem environment = (ITestEnvironmentMessageSystem) event.getEnvironment();
- try {
- environment.removeInstrumentationRegistrationListener(exportedThis);
- } catch (RemoteException ex1) {
- OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Problem unregistering instrumentation registration listener",
- ex1);
- }
-
- if (muxProbe != null) {
- try {
- muxProbe.unregister(thread.address);
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class, Level.SEVERE, "Problem unregistering socket address", ex);
- } finally {
- muxProbe = null;
- }
- }
- handleConnectionLostStatus();
- }
-
- private void handleConnectionLostStatus() {
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- for(MuxChannelComposite mux:channelComposites.values()){
- mux.updateColors(false);
- mux.setMuxProbe(null);
- }
- // we are not connected
- if (task != null) {
- task.stop();
- }
- }
- });
- }
-
- @Override
- public void onDeregistered(String name) throws RemoteException {
- if (muxProbe != null && name.equals("MUXIO")) {
- muxProbe = null;
- handleConnectionLostStatus();
- }
- }
-
- @Override
- public void onRegistered(String name, IOInstrumentation instrumentation) throws RemoteException {
- try {
- if (muxProbe == null && name.equals("MUXIO")) {
- muxProbe = instrumentation;
- Displays.ensureInDisplayThread(new Runnable() {
- @Override
- public void run() {
- if (task != null) {
- task.start();
- }
- for(MuxChannelComposite mux:channelComposites.values()){
- mux.updateColors(true);
- mux.setMuxProbe(muxProbe);
- }
- }
-
- });
- muxProbe.register(thread.address);
-
- }
- } catch (RemoteException ex) {
- OseeLog.log(MuxToolPlugin.class, Level.SEVERE,
- "Problem registering socket address with remote instrumentation service", ex);
- }
-
- }
-}

Back to the top