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
38 changes: 24 additions & 14 deletions java/devicebeans/src/main/java/DeviceInputs.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class DeviceInputs extends DeviceComponent
private JTextField valuesTF[], fieldsTF[][];
private JLabel labels[];
int numParameters[], numFields[];
private int numInputChildren = 0;
public DeviceInputs()
{
}
Expand All @@ -41,17 +40,18 @@ protected void initializeData(String data, boolean is_on)
JPanel jp = new JPanel();
jp.setLayout(new GridLayout(numInputs, 1));
int currInputNid = currNid + 1;
try {
int children = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_CHILDREN\')");
int members = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_MEMBERS\')");
numInputChildren = children + members;
}catch(Exception exc)
{
System.out.println("Error getting number of input children");
}
for(int i = 0; i < numInputs; i++)
{
try {
int numInputChildren = 0;
try {
int children = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_CHILDREN\')");
int members = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_MEMBERS\')");
numInputChildren = children + members;
}catch(Exception exc)
{
System.out.println("Error getting number of input children");
}
try {
numParameters[i] = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid+6)+",\'NUMBER_OF_CHILDREN\')");
}catch(Exception exc)
{
Expand Down Expand Up @@ -114,6 +114,15 @@ protected void displayData(String data, boolean is_on)
int currInputNid = baseNid + offsetNid + 1;
for(int inputIdx = 0; inputIdx < numInputs; inputIdx++)
{
int numInputChildren = 0;
try {
int children = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_CHILDREN\')");
int members = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_MEMBERS\')");
numInputChildren = children + members;
}catch(Exception exc)
{
System.out.println("Error getting number of input children");
}
try {
valuesTF[inputIdx].setText(subtree.getDataExpr(currInputNid + 4));
}catch(Exception exc)
Expand All @@ -138,10 +147,11 @@ public void apply() throws Exception
int currInputNid = baseNid + offsetNid + 1;
for(int inputIdx = 0; inputIdx < numInputs; inputIdx++)
{
try {
int children = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_CHILDREN\')");
int members = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_MEMBERS\')");
numInputChildren = children + members;
int numInputChildren = 0;
try {
int children = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_CHILDREN\')");
int members = subtree.getInt("GETNCI("+subtree.getFullPath(currInputNid)+",\'NUMBER_OF_MEMBERS\')");
numInputChildren = children + members;
}catch(Exception exc)
{
System.out.println("Error getting number of input children");
Expand Down
24 changes: 20 additions & 4 deletions java/jdevices/src/main/java/MARTE2_SIMULINK_DTTSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ private void initComponents() {
deviceButtons1 = new DeviceButtons();
jPanel2 = new javax.swing.JPanel();
deviceField1 = new DeviceField();
deviceField2 = new DeviceField();
deviceField3 = new DeviceField();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
deviceInputs1 = new DeviceInputs();
Expand All @@ -41,7 +43,7 @@ private void initComponents() {
setDeviceTitle("DTT Simularot");
setDeviceType("MARTE2_SIMULINK_DTT");
setHeight(500);
setWidth(400);
setWidth(700);
getContentPane().add(deviceButtons1, java.awt.BorderLayout.PAGE_END);

deviceField1.setIdentifier("");
Expand All @@ -50,25 +52,37 @@ private void initComponents() {
deviceField1.setOffsetNid(3);
jPanel2.add(deviceField1);

deviceField2.setIdentifier("");
deviceField2.setLabelString("Time Div.:");
deviceField2.setNumCols(4);
deviceField2.setOffsetNid(253);
jPanel2.add(deviceField2);

deviceField3.setIdentifier("");
deviceField3.setLabelString("Write CPU Mask: ");
deviceField3.setNumCols(4);
deviceField3.setOffsetNid(120);
jPanel2.add(deviceField3);

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

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

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

jTabbedPane1.addTab("Inputs", jPanel1);

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

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

jTabbedPane1.addTab("Outputs", jPanel3);

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

deviceParameters1.setNumParameters(1);
deviceParameters1.setNumParameters(3);
deviceParameters1.setOffsetNid(4);
deviceParameters1.setParameterOffset(4);
jPanel4.add(deviceParameters1, java.awt.BorderLayout.CENTER);
Expand All @@ -82,6 +96,8 @@ private void initComponents() {
// Variables declaration - do not modify//GEN-BEGIN:variables
private DeviceButtons deviceButtons1;
private DeviceField deviceField1;
private DeviceField deviceField2;
private DeviceField deviceField3;
private DeviceInputs deviceInputs1;
private DeviceOutputs deviceOutputs1;
private DeviceParameters deviceParameters1;
Expand Down
83 changes: 83 additions & 0 deletions java/jdevices/src/main/java/MARTE2_SIMULINK_DTT_VSSetup.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* 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_VSSetup extends DeviceSetup {

/**
* Creates new form MARTE2_SIMULINK_DTT_VSSetup
*/
public MARTE2_SIMULINK_DTT_VSSetup() {
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();
deviceField2 = new DeviceField();
deviceField3 = new DeviceField();
jTabbedPane1 = new javax.swing.JTabbedPane();
deviceInputs1 = new DeviceInputs();
deviceOutputs1 = new DeviceOutputs();

setDeviceProvider("localhost:8100");
setDeviceTitle("DTT VS Control");
setDeviceType("MARTE2_SIMULINK_DTT_VS");
setHeight(400);
setWidth(800);
getContentPane().add(deviceButtons1, java.awt.BorderLayout.PAGE_END);

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

deviceField2.setIdentifier("");
deviceField2.setLabelString("Time Div.: ");
deviceField2.setNumCols(4);
deviceField2.setOffsetNid(54);
jPanel1.add(deviceField2);

deviceField3.setIdentifier("");
deviceField3.setLabelString("Write CPU Mask: ");
deviceField3.setNumCols(6);
deviceField3.setOffsetNid(44);
jPanel1.add(deviceField3);

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

deviceInputs1.setOffsetNid(17);
jTabbedPane1.addTab("Inputs", deviceInputs1);
jTabbedPane1.addTab("Outputs", deviceOutputs1);

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 DeviceField deviceField2;
private DeviceField deviceField3;
private DeviceInputs deviceInputs1;
private DeviceOutputs deviceOutputs1;
private javax.swing.JPanel jPanel1;
private javax.swing.JTabbedPane jTabbedPane1;
// End of variables declaration//GEN-END:variables
}
26 changes: 21 additions & 5 deletions java/jdevices/src/main/resources/MARTE2_SIMULINK_DTTSetup.form
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Property name="deviceTitle" type="java.lang.String" value="DTT Simularot"/>
<Property name="deviceType" type="java.lang.String" value="MARTE2_SIMULINK_DTT"/>
<Property name="height" type="int" value="500"/>
<Property name="width" type="int" value="400"/>
<Property name="width" type="int" value="700"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
Expand All @@ -21,7 +21,7 @@
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,2,-76"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
Expand Down Expand Up @@ -50,6 +50,22 @@
<Property name="offsetNid" type="int" value="3"/>
</Properties>
</Component>
<Component class="DeviceField" name="deviceField2">
<Properties>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Time Div.:"/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="253"/>
</Properties>
</Component>
<Component class="DeviceField" name="deviceField3">
<Properties>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Write CPU Mask: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="120"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
Expand All @@ -74,7 +90,7 @@
<SubComponents>
<Container class="DeviceInputs" name="deviceInputs1">
<Properties>
<Property name="offsetNid" type="int" value="23"/>
<Property name="offsetNid" type="int" value="26"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
Expand All @@ -99,7 +115,7 @@
<SubComponents>
<Container class="DeviceOutputs" name="deviceOutputs1">
<Properties>
<Property name="offsetNid" type="int" value="104"/>
<Property name="offsetNid" type="int" value="114"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
Expand All @@ -124,7 +140,7 @@
<SubComponents>
<Container class="DeviceParameters" name="deviceParameters1">
<Properties>
<Property name="numParameters" type="int" value="1"/>
<Property name="numParameters" type="int" value="3"/>
<Property name="offsetNid" type="int" value="4"/>
<Property name="parameterOffset" type="int" value="4"/>
</Properties>
Expand Down
108 changes: 108 additions & 0 deletions java/jdevices/src/main/resources/MARTE2_SIMULINK_DTT_VSSetup.form
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.2" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="deviceProvider" type="java.lang.String" value="localhost:8100"/>
<Property name="deviceTitle" type="java.lang.String" value="DTT VS Control"/>
<Property name="deviceType" type="java.lang.String" value="MARTE2_SIMULINK_DTT_VS"/>
<Property name="height" type="int" value="400"/>
<Property name="width" type="int" value="800"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,2,2"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="DeviceButtons" name="deviceButtons1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Last"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="First"/>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
<Component class="DeviceField" name="deviceField1">
<Properties>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Timebase: "/>
<Property name="numCols" type="int" value="25"/>
<Property name="offsetNid" type="int" value="3"/>
</Properties>
</Component>
<Component class="DeviceField" name="deviceField2">
<Properties>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Time Div.: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="54"/>
</Properties>
</Component>
<Component class="DeviceField" name="deviceField3">
<Properties>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Write CPU Mask: "/>
<Property name="numCols" type="int" value="6"/>
<Property name="offsetNid" type="int" value="44"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
<Container class="DeviceInputs" name="deviceInputs1">
<Properties>
<Property name="offsetNid" type="int" value="17"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Inputs">
<Property name="tabTitle" type="java.lang.String" value="Inputs"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
<Container class="DeviceOutputs" name="deviceOutputs1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="Outputs">
<Property name="tabTitle" type="java.lang.String" value="Outputs"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
Loading