Skip to content

Commit

Permalink
Feature:Add MARTe2 execution without building configuration
Browse files Browse the repository at this point in the history
- Added MARTE2_SUPERVISOR method startMarteStraight that does not breate MARTe2 configuration file
- Fixed offsets in MARTE2_NI6368 device setup
  • Loading branch information
GabrieleManduchi committed Apr 29, 2022
1 parent 1f2e95f commit abb9507
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 37 deletions.
36 changes: 18 additions & 18 deletions java/jdevices/src/main/java/MARTE2_NI6368Setup.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void initComponents() {
deviceChoice14 = new DeviceChoice();
deviceField17 = new DeviceField();

setDeviceProvider("scdevail:8100");
setDeviceProvider("localhost:8100");
setDeviceTitle("MARTe2 NI 6368 ADC Setup");
setDeviceType("MARTE2_NI6368");
setHeight(400);
Expand Down Expand Up @@ -163,7 +163,7 @@ private void initComponents() {
deviceField6.setIdentifier("");
deviceField6.setLabelString("Samples");
deviceField6.setNumCols(4);
deviceField6.setOffsetNid(70);
deviceField6.setOffsetNid(72);
jPanel5.add(deviceField6);

deviceField7.setIdentifier("");
Expand All @@ -190,14 +190,14 @@ private void initComponents() {
deviceChoice7.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice7.setIdentifier("");
deviceChoice7.setLabelString("Input Range: ");
deviceChoice7.setOffsetNid(77);
deviceChoice7.setOffsetNid(80);
deviceChoice7.setUpdateIdentifier("");
jPanel7.add(deviceChoice7);

deviceField10.setIdentifier("");
deviceField10.setLabelString("Seg. Len: ");
deviceField10.setNumCols(4);
deviceField10.setOffsetNid(72);
deviceField10.setOffsetNid(74);
jPanel7.add(deviceField10);

jPanel6.add(jPanel7);
Expand All @@ -208,14 +208,14 @@ private void initComponents() {
deviceChoice8.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice8.setIdentifier("");
deviceChoice8.setLabelString("Input Range: ");
deviceChoice8.setOffsetNid(91);
deviceChoice8.setOffsetNid(95);
deviceChoice8.setUpdateIdentifier("");
jPanel8.add(deviceChoice8);

deviceField11.setIdentifier("");
deviceField11.setLabelString("Seg. Len: ");
deviceField11.setNumCols(4);
deviceField11.setOffsetNid(86);
deviceField11.setOffsetNid(89);
jPanel8.add(deviceField11);

jPanel6.add(jPanel8);
Expand All @@ -226,14 +226,14 @@ private void initComponents() {
deviceChoice9.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice9.setIdentifier("");
deviceChoice9.setLabelString("Input Range: ");
deviceChoice9.setOffsetNid(105);
deviceChoice9.setOffsetNid(110);
deviceChoice9.setUpdateIdentifier("");
jPanel9.add(deviceChoice9);

deviceField12.setIdentifier("");
deviceField12.setLabelString("Seg. Len: ");
deviceField12.setNumCols(4);
deviceField12.setOffsetNid(100);
deviceField12.setOffsetNid(104);
jPanel9.add(deviceField12);

jPanel6.add(jPanel9);
Expand All @@ -244,14 +244,14 @@ private void initComponents() {
deviceChoice10.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice10.setIdentifier("");
deviceChoice10.setLabelString("Input Range: ");
deviceChoice10.setOffsetNid(119);
deviceChoice10.setOffsetNid(125);
deviceChoice10.setUpdateIdentifier("");
jPanel10.add(deviceChoice10);

deviceField13.setIdentifier("");
deviceField13.setLabelString("Seg. Len: ");
deviceField13.setNumCols(4);
deviceField13.setOffsetNid(114);
deviceField13.setOffsetNid(119);
jPanel10.add(deviceField13);

jPanel6.add(jPanel10);
Expand All @@ -262,14 +262,14 @@ private void initComponents() {
deviceChoice11.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice11.setIdentifier("");
deviceChoice11.setLabelString("Input Range: ");
deviceChoice11.setOffsetNid(133);
deviceChoice11.setOffsetNid(140);
deviceChoice11.setUpdateIdentifier("");
jPanel11.add(deviceChoice11);

deviceField14.setIdentifier("");
deviceField14.setLabelString("Seg. Len: ");
deviceField14.setNumCols(4);
deviceField14.setOffsetNid(128);
deviceField14.setOffsetNid(134);
jPanel11.add(deviceField14);

jPanel6.add(jPanel11);
Expand All @@ -280,14 +280,14 @@ private void initComponents() {
deviceChoice12.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice12.setIdentifier("");
deviceChoice12.setLabelString("Input Range: ");
deviceChoice12.setOffsetNid(147);
deviceChoice12.setOffsetNid(155);
deviceChoice12.setUpdateIdentifier("");
jPanel12.add(deviceChoice12);

deviceField15.setIdentifier("");
deviceField15.setLabelString("Seg. Len: ");
deviceField15.setNumCols(4);
deviceField15.setOffsetNid(142);
deviceField15.setOffsetNid(149);
jPanel12.add(deviceField15);

jPanel6.add(jPanel12);
Expand All @@ -298,14 +298,14 @@ private void initComponents() {
deviceChoice13.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice13.setIdentifier("");
deviceChoice13.setLabelString("Input Range: ");
deviceChoice13.setOffsetNid(161);
deviceChoice13.setOffsetNid(170);
deviceChoice13.setUpdateIdentifier("");
jPanel13.add(deviceChoice13);

deviceField16.setIdentifier("");
deviceField16.setLabelString("Seg. Len: ");
deviceField16.setNumCols(4);
deviceField16.setOffsetNid(156);
deviceField16.setOffsetNid(164);
jPanel13.add(deviceField16);

jPanel6.add(jPanel13);
Expand All @@ -316,14 +316,14 @@ private void initComponents() {
deviceChoice14.setChoiceItems(new String[] {"1.", "2.", "5.", "10."});
deviceChoice14.setIdentifier("");
deviceChoice14.setLabelString("Input Range: ");
deviceChoice14.setOffsetNid(175);
deviceChoice14.setOffsetNid(185);
deviceChoice14.setUpdateIdentifier("");
jPanel14.add(deviceChoice14);

deviceField17.setIdentifier("");
deviceField17.setLabelString("Seg. Len: ");
deviceField17.setNumCols(4);
deviceField17.setOffsetNid(170);
deviceField17.setOffsetNid(179);
jPanel14.add(deviceField17);

jPanel6.add(jPanel14);
Expand Down
36 changes: 18 additions & 18 deletions java/jdevices/src/main/resources/MARTE2_NI6368Setup.form
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<Form version="1.7" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="deviceProvider" type="java.lang.String" value="scdevail:8100"/>
<Property name="deviceProvider" type="java.lang.String" value="localhost:8100"/>
<Property name="deviceTitle" type="java.lang.String" value="MARTe2 NI 6368 ADC Setup"/>
<Property name="deviceType" type="java.lang.String" value="MARTE2_NI6368"/>
<Property name="height" type="int" value="400"/>
Expand Down Expand Up @@ -327,7 +327,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Samples"/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="70"/>
<Property name="offsetNid" type="int" value="72"/>
</Properties>
</Component>
<Component class="DeviceField" name="deviceField7">
Expand Down Expand Up @@ -392,7 +392,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="77"/>
<Property name="offsetNid" type="int" value="80"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -401,7 +401,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="72"/>
<Property name="offsetNid" type="int" value="74"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -432,7 +432,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="91"/>
<Property name="offsetNid" type="int" value="95"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -441,7 +441,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="86"/>
<Property name="offsetNid" type="int" value="89"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -472,7 +472,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="105"/>
<Property name="offsetNid" type="int" value="110"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -481,7 +481,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="100"/>
<Property name="offsetNid" type="int" value="104"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -512,7 +512,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="119"/>
<Property name="offsetNid" type="int" value="125"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -521,7 +521,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="114"/>
<Property name="offsetNid" type="int" value="119"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -552,7 +552,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="133"/>
<Property name="offsetNid" type="int" value="140"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -561,7 +561,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="128"/>
<Property name="offsetNid" type="int" value="134"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -592,7 +592,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="147"/>
<Property name="offsetNid" type="int" value="155"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -601,7 +601,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="142"/>
<Property name="offsetNid" type="int" value="149"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -632,7 +632,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="161"/>
<Property name="offsetNid" type="int" value="170"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -641,7 +641,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="156"/>
<Property name="offsetNid" type="int" value="164"/>
</Properties>
</Component>
</SubComponents>
Expand Down Expand Up @@ -672,7 +672,7 @@
</Property>
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Input Range: "/>
<Property name="offsetNid" type="int" value="175"/>
<Property name="offsetNid" type="int" value="185"/>
<Property name="updateIdentifier" type="java.lang.String" value=""/>
</Properties>
</Component>
Expand All @@ -681,7 +681,7 @@
<Property name="identifier" type="java.lang.String" value=""/>
<Property name="labelString" type="java.lang.String" value="Seg. Len: "/>
<Property name="numCols" type="int" value="4"/>
<Property name="offsetNid" type="int" value="170"/>
<Property name="offsetNid" type="int" value="179"/>
</Properties>
</Component>
</SubComponents>
Expand Down
10 changes: 9 additions & 1 deletion pydevices/RfxDevices/MARTE2_SUPERVISOR.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ def buildConfiguration(self):
confText += ' Class = ReferenceContainer\n'
confText += ' +IDLE_MDSPLUS_TIMER = {\n'
confText += ' Class = LinuxTimer\n'
confText += ' SleepNature = "Busy"\n'
confText += ' SleepNature = "Default"\n'
confText += ' Signals = {\n'
confText += ' Counter = {\n'
confText += ' Type = uint32\n'
Expand Down Expand Up @@ -578,6 +578,13 @@ def startMarte(self):
time.sleep(4)
self.gotorun()

def startMarteStraight(self):
stateName = self.state_1_name.data()
subprocess.Popen(['$MARTE_DIR/Playground.sh -f /tmp/'+self.getNode(
'name').data()+'_marte_configuration.cfg -m StateMachine:START '+stateName], shell=True)
time.sleep(4)
self.gotorun()

def gotorun(self):
marteName = self.getNode('name').data()
eventString1 = 'StateMachine:GOTORUN'
Expand Down Expand Up @@ -674,6 +681,7 @@ def check(self):
gamInstance = gamClass(currGamNid)
gamInstances.append(gamInstance)
except:
print(traceback.format_exc())
return 'Cannot get Device list for tread '+str(thread)+' of state '+str(state)
for gamInstance in gamInstances:
try:
Expand Down

0 comments on commit abb9507

Please sign in to comment.