Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions deploy/packaging/debian/rfxdevices.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_RFXMODEL.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_RTSM.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_DTT.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_DTT_PCS.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_FLUXMAP.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_GENERIC.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_LEV_CTRLR.py
Expand All @@ -68,6 +70,8 @@
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_STREAM_IN_A.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SUPERVISOR.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SWTRIG.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_UDP_RECEIVER.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_UDP_SENDER.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_BREAKDOWN.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_COMMON.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_CONFIG.py
Expand Down
4 changes: 4 additions & 0 deletions deploy/packaging/redhat/rfxdevices.noarch
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_RFXMODEL.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_RTSM.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_DTT.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_DTT_PCS.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_FLUXMAP.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_GENERIC.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SIMULINK_LEV_CTRLR.py
Expand All @@ -69,6 +71,8 @@
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_STREAM_IN_A.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SUPERVISOR.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_SWTRIG.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_UDP_RECEIVER.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE2_UDP_SENDER.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_BREAKDOWN.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_COMMON.py
./usr/local/mdsplus/pydevices/RfxDevices/MARTE_CONFIG.py
Expand Down
5 changes: 4 additions & 1 deletion java/devicebeans/src/main/java/DeviceInputs.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ protected void initializeData(String data, boolean is_on)
inputName = "";
}
JPanel jp1 = new JPanel();
jp1.setBorder(new TitledBorder(inputName));
TitledBorder titledBorder = new TitledBorder(inputName);
titledBorder.setTitleColor(Color.red);
jp1.setBorder(titledBorder);

jp1.setLayout(new GridLayout(1 + numFields[i],1));
JPanel jp2 = new JPanel();
jp2.setLayout(new BorderLayout());
Expand Down
63 changes: 62 additions & 1 deletion java/devicebeans/src/main/java/DeviceOutputs.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import java.awt.*;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.event.*;
import java.util.*;

import javax.swing.*;
import static javax.swing.TransferHandler.COPY_OR_MOVE;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
Expand All @@ -11,6 +14,32 @@
public class DeviceOutputs extends DeviceComponent
{

class FromTransferHandler extends TransferHandler
{
String path;
public FromTransferHandler(String path)
{
this.path = path;
}
@Override
public Transferable createTransferable(JComponent comp)
{
try
{
return new StringSelection(path);
}
catch (final Exception exc)
{
return null;
}
}

@Override
public int getSourceActions(JComponent comp)
{
return COPY_OR_MOVE;
}
}
private JScrollPane scrollP;
private int numOutputs;
private JTextField segLensTF[], streamNamesTF[];
Expand All @@ -35,6 +64,7 @@ protected void initializeData(String data, boolean is_on)
int currOutNid = currNid + 7;
//Count number of actual outputs (i.e. for which nSamomes and streamName make sense
numItems = 0;
int numBusItems = 0;
for(int outIdx = 0; outIdx < numOutputs; outIdx++)
{
int numChildren, numMembers, numPars, numFields;
Expand All @@ -57,15 +87,18 @@ protected void initializeData(String data, boolean is_on)
if(numFields == 0)
numItems += 1; //no structure
else
{
numItems += numFields;
numBusItems++;
}
currOutNid += 1 + numChildren + numMembers + 2 * numPars + 8 * numFields;
}
segLensTF = new JTextField[numItems];
streamNamesTF = new JTextField[numItems];
segLenNids = new int[numItems];
streamNameNids = new int[numItems];
JPanel jp = new JPanel();
jp.setLayout(new GridLayout(numItems, 1));
jp.setLayout(new GridLayout(numItems+numBusItems, 1));
currOutNid = currNid + 7;
int currItem = 0;
for(int outIdx = 0; outIdx < numOutputs; outIdx++)
Expand Down Expand Up @@ -107,6 +140,21 @@ protected void initializeData(String data, boolean is_on)
}
else
{
JLabel busLabel = new JLabel(outName);
busLabel.setForeground(Color.red);
try {
busLabel.setTransferHandler(new FromTransferHandler(subtree.getFullPath(currOutNid)+":VALUE"));
}catch(Exception exc){System.err.println(exc);}
MouseListener listener = new MouseAdapter() {
public void mousePressed(MouseEvent me)
{
JComponent comp = (JComponent)me.getSource();
TransferHandler handler = comp.getTransferHandler();
handler.exportAsDrag(comp, me, TransferHandler.COPY);
}
};
busLabel.addMouseListener(listener);
jp.add(busLabel);
for(int fieldIdx = 0; fieldIdx < numFields; fieldIdx++)
{
int fieldNid = currOutNid + numChildren +numMembers +1 + 2 * numPars + 8 * fieldIdx;
Expand All @@ -123,6 +171,19 @@ protected void initializeData(String data, boolean is_on)
jp1.add(segLensTF[currItem] = new JTextField(10));
jp1.add(new JLabel("Stream name: "));
jp1.add(streamNamesTF[currItem] = new JTextField(10));

try {
jp1.setTransferHandler(new FromTransferHandler(subtree.getFullPath(currOutNid)+".FIELDS."+fieldName+":VALUE"));
}catch(Exception exc){System.err.println(exc);}
listener = new MouseAdapter() {
public void mousePressed(MouseEvent me)
{
JComponent comp = (JComponent)me.getSource();
TransferHandler handler = comp.getTransferHandler();
handler.exportAsDrag(comp, me, TransferHandler.COPY);
}
};
jp1.addMouseListener(listener);
jp.add(jp1);
currItem++;
}
Expand Down
94 changes: 94 additions & 0 deletions java/jdevices/src/main/java/MARTE2_SIMULINK_DTTSetup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author mdsplus
*/
public class MARTE2_SIMULINK_DTTSetup extends DeviceSetup {

/**
* Creates new form MARTE2_SIMULINK_DTTSetup
*/
public MARTE2_SIMULINK_DTTSetup() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

deviceButtons1 = new DeviceButtons();
jPanel2 = new javax.swing.JPanel();
deviceField1 = new DeviceField();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
deviceInputs1 = new DeviceInputs();
jPanel3 = new javax.swing.JPanel();
deviceOutputs1 = new DeviceOutputs();
jPanel4 = new javax.swing.JPanel();
deviceParameters1 = new DeviceParameters();

setDeviceProvider("localhost:8100");
setDeviceTitle("DTT Simularot");
setDeviceType("MARTE2_SIMULINK_DTT");
setHeight(500);
setWidth(400);
getContentPane().add(deviceButtons1, java.awt.BorderLayout.PAGE_END);

deviceField1.setIdentifier("");
deviceField1.setLabelString("Timebase");
deviceField1.setNumCols(20);
deviceField1.setOffsetNid(3);
jPanel2.add(deviceField1);

getContentPane().add(jPanel2, java.awt.BorderLayout.PAGE_START);

jPanel1.setLayout(new java.awt.BorderLayout());

deviceInputs1.setOffsetNid(23);
jPanel1.add(deviceInputs1, java.awt.BorderLayout.CENTER);

jTabbedPane1.addTab("Inputs", jPanel1);

jPanel3.setLayout(new java.awt.BorderLayout());

deviceOutputs1.setOffsetNid(104);
jPanel3.add(deviceOutputs1, java.awt.BorderLayout.CENTER);

jTabbedPane1.addTab("Outputs", jPanel3);

jPanel4.setLayout(new java.awt.BorderLayout());

deviceParameters1.setNumParameters(1);
deviceParameters1.setOffsetNid(4);
deviceParameters1.setParameterOffset(4);
jPanel4.add(deviceParameters1, java.awt.BorderLayout.CENTER);

jTabbedPane1.addTab("Parameters", jPanel4);

getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents


// Variables declaration - do not modify//GEN-BEGIN:variables
private DeviceButtons deviceButtons1;
private DeviceField deviceField1;
private DeviceInputs deviceInputs1;
private DeviceOutputs deviceOutputs1;
private DeviceParameters deviceParameters1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JTabbedPane jTabbedPane1;
// End of variables declaration//GEN-END:variables
}
77 changes: 77 additions & 0 deletions java/jdevices/src/main/java/MARTE2_SIMULINK_DTT_PCSSetup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author mdsplus
*/
public class MARTE2_SIMULINK_DTT_PCSSetup extends DeviceSetup {

/**
* Creates new form MARTE2_SIMULINK_DTT_PCSSetup
*/
public MARTE2_SIMULINK_DTT_PCSSetup() {
initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

deviceButtons1 = new DeviceButtons();
jPanel1 = new javax.swing.JPanel();
deviceField1 = new DeviceField();
jTabbedPane1 = new javax.swing.JTabbedPane();
deviceInputs1 = new DeviceInputs();
deviceOutputs1 = new DeviceOutputs();
deviceParameters1 = new DeviceParameters();

setDeviceProvider("localhost:8100");
setDeviceTitle("DTT Controller");
setDeviceType("MARTE2_SIMULINK_DTT_PCS");
setHeight(400);
setUpdateEvent("");
setWidth(500);
getContentPane().add(deviceButtons1, java.awt.BorderLayout.PAGE_END);

deviceField1.setIdentifier("");
deviceField1.setLabelString("Timebase: ");
deviceField1.setNumCols(20);
deviceField1.setOffsetNid(3);
jPanel1.add(deviceField1);

getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);

deviceInputs1.setOffsetNid(20);
jTabbedPane1.addTab("Inputs", deviceInputs1);

deviceOutputs1.setOffsetNid(181);
jTabbedPane1.addTab("Outputs", deviceOutputs1);

deviceParameters1.setNumParameters(1);
deviceParameters1.setOffsetNid(4);
deviceParameters1.setParameterOffset(4);
jTabbedPane1.addTab("Parameters", deviceParameters1);

getContentPane().add(jTabbedPane1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents


// Variables declaration - do not modify//GEN-BEGIN:variables
private DeviceButtons deviceButtons1;
private DeviceField deviceField1;
private DeviceInputs deviceInputs1;
private DeviceOutputs deviceOutputs1;
private DeviceParameters deviceParameters1;
private javax.swing.JPanel jPanel1;
private javax.swing.JTabbedPane jTabbedPane1;
// End of variables declaration//GEN-END:variables
}
Loading