From cc67dbf0d2708ce4235cf49d8bca96909b249dda Mon Sep 17 00:00:00 2001 From: manduchi Date: Fri, 29 Apr 2022 10:49:45 +0200 Subject: [PATCH] Feature:Add MARTe2 execution without building configuration - Added MARTE2_SUPERVISOR method startMarteStraight that does not breate MARTe2 configuration file - Fixed offsets in MARTE2_NI6368 device setup --- .../src/main/java/MARTE2_NI6368Setup.java | 36 +++++++++---------- .../main/resources/MARTE2_NI6368Setup.form | 36 +++++++++---------- pydevices/RfxDevices/MARTE2_SUPERVISOR.py | 10 +++++- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/java/jdevices/src/main/java/MARTE2_NI6368Setup.java b/java/jdevices/src/main/java/MARTE2_NI6368Setup.java index 0104bbfaf0..b571d30dbf 100644 --- a/java/jdevices/src/main/java/MARTE2_NI6368Setup.java +++ b/java/jdevices/src/main/java/MARTE2_NI6368Setup.java @@ -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); @@ -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(""); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); @@ -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); diff --git a/java/jdevices/src/main/resources/MARTE2_NI6368Setup.form b/java/jdevices/src/main/resources/MARTE2_NI6368Setup.form index 1473b66382..e6fc4cfdb8 100644 --- a/java/jdevices/src/main/resources/MARTE2_NI6368Setup.form +++ b/java/jdevices/src/main/resources/MARTE2_NI6368Setup.form @@ -2,7 +2,7 @@
- + @@ -327,7 +327,7 @@ - + @@ -392,7 +392,7 @@ - + @@ -401,7 +401,7 @@ - + @@ -432,7 +432,7 @@ - + @@ -441,7 +441,7 @@ - + @@ -472,7 +472,7 @@ - + @@ -481,7 +481,7 @@ - + @@ -512,7 +512,7 @@ - + @@ -521,7 +521,7 @@ - + @@ -552,7 +552,7 @@ - + @@ -561,7 +561,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -601,7 +601,7 @@ - + @@ -632,7 +632,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -672,7 +672,7 @@ - + @@ -681,7 +681,7 @@ - + diff --git a/pydevices/RfxDevices/MARTE2_SUPERVISOR.py b/pydevices/RfxDevices/MARTE2_SUPERVISOR.py index 3418c9a1f6..8a3fecb24f 100644 --- a/pydevices/RfxDevices/MARTE2_SUPERVISOR.py +++ b/pydevices/RfxDevices/MARTE2_SUPERVISOR.py @@ -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' @@ -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' @@ -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: