Skip to content

Commit 9cd5304

Browse files
authored
Merge pull request #107 from nasa/integration-candidate
Integration Candidate: 2020-06-17
2 parents 52f706b + 63b672a commit 9cd5304

29 files changed

+886
-12459
lines changed

GroundSystem.py

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def startCmdSystem():
105105
def startFDLSystem(self):
106106
selectedSpacecraft = self.getSelectedSpacecraftName()
107107
if selectedSpacecraft == 'All':
108-
subscription = ''
109108
self.DisplayErrorMessage(
110109
'Cannot open FDL manager.\nNo spacecraft selected.')
111110
else:

Guide-GroundSystem.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cFS Ground System Version 2.1.11
1+
# cFS Ground System Version 2.1.12
22

33
## cFS Ground System Info
44

Guide-GroundSystem.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cFS Ground System Version 2.1.11
1+
cFS Ground System Version 2.1.12
22

33
cFS Ground System Info:
44

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ See [Guide-GroundSystem.md](https://github.com/nasa/cFS-GroundSystem/blob/master
88

99
## Version History
1010

11+
### Development Build: 2.1.12
12+
13+
- Change all individual UI elements to table widgets. Update backend code accordingly
14+
- Temporary fix for implicit declaration of endian functions on some systems (RH/CentOs). No build errors on CentOS
15+
- See <https://github.com/nasa/cFS-GroundSystem/pull/107>
16+
1117
### Development Build: 2.1.11
1218

1319
- Default behavior is the same except adds checksum and doesn't actually require fields. Adds all the packet fields, overrides, more supported data types, etc.

Subsystems/cmdGui/CHeaderParser.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,11 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'):
103103
l = l.strip()
104104
if l and not l.startswith("#"):
105105
paths.append(l)
106-
print(f"Using header files found in {filename}")
107-
# Send paths back to caller function
108-
return paths
106+
print(f"Using header files found in {filename}")
107+
# Send paths back to caller function
108+
return paths
109109
except IOError:
110110
print("Couldn't find default file. Check command line arguments.")
111-
except:
112-
print("Unexpected error:", sys.exc_info()[0])
113111

114112
print("No header files found. Please make sure to provide the\n"
115113
"default file for loading headers (CHeaderParser-hdr-paths.txt)")
@@ -449,7 +447,7 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'):
449447
input((f"Please enter the defined value for "
450448
f"{array_name_size[1]} (0 - 128): ")))
451449
except ValueError:
452-
pass
450+
pass # Ignore non-integer and try again
453451

454452
# Add string length argument to parameter list
455453
stringLens.append(array_size)

Subsystems/cmdGui/CommandSystem.py

+29-33
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
import sys
2727
from pathlib import Path
2828

29-
from PyQt5.QtWidgets import QApplication, QDialog
29+
from PyQt5.QtWidgets import (QApplication, QDialog, QHeaderView, QPushButton,
30+
QTableWidgetItem)
3031

31-
from CommandSystemDialog import Ui_CommandSystemDialog
32+
from Ui_CommandSystemDialog import Ui_CommandSystemDialog
3233

3334
ROOTDIR = Path(sys.argv[0]).resolve().parent
3435

@@ -43,23 +44,13 @@ def __init__(self):
4344
self.setupUi(self)
4445
self.move(800, 100)
4546

46-
for n in range(21):
47-
btn = getattr(self, f"pushButton_{n}")
48-
btn.clicked.connect(lambda _, x=n: self.ProcessButtonGeneric(x))
49-
50-
for l in range(22):
51-
btn = getattr(self, f"quickButton_{l+1}")
52-
btn.clicked.connect(lambda _, x=l: self.ProcessQuickButton(x))
53-
5447
#
5548
# Processes 'Display Page' button
5649
#
5750
def ProcessButtonGeneric(self, idx):
5851
if cmdPageIsValid[idx]:
59-
lePID = getattr(self, f'lineEditPktId_{idx}')
60-
leAddr = getattr(self, f'lineEdit_{idx}')
61-
pktId = lePID.text()
62-
address = leAddr.text()
52+
pktId = self.tblCmdSys.item(idx, 1).text()
53+
address = self.tblCmdSys.item(idx, 2).text()
6354
launch_string = (
6455
f'python3 {ROOTDIR}/{cmdClass[0]} '
6556
f'--title=\"{cmdPageDesc[idx]}\" --pktid={pktId} '
@@ -87,10 +78,8 @@ def checkParams(idx):
8778
def ProcessQuickButton(self, idx):
8879
if cmdPageIsValid[idx] and quickIndices[idx] >= 0:
8980
qIdx = quickIndices[idx]
90-
lePID = getattr(self, f'lineEditPktId_{idx}')
91-
leAddr = getattr(self, f'lineEdit_{idx}')
92-
pktId = lePID.text()
93-
address = leAddr.text()
81+
pktId = self.tblCmdSys.item(idx, 1).text()
82+
address = self.tblCmdSys.item(idx, 2).text()
9483

9584
# if requires parameters
9685
if self.checkParams(qIdx):
@@ -128,6 +117,7 @@ def ProcessQuickButton(self, idx):
128117
#
129118
app = QApplication(sys.argv)
130119
Command = CommandSystem()
120+
tbl = Command.tblCmdSys
131121

132122
#
133123
# Read in the contents of the telemetry packet definition
@@ -141,7 +131,7 @@ def ProcessQuickButton(self, idx):
141131
reader = csv.reader(cmdfile, skipinitialspace=True)
142132
for cmdRow in reader:
143133
try:
144-
if cmdRow[0][0] != '#':
134+
if not cmdRow[0].startswith('#'):
145135
cmdPageIsValid.append(True)
146136
cmdPageDesc.append(cmdRow[0])
147137
cmdPageDefFile.append(cmdRow[1])
@@ -161,7 +151,7 @@ def ProcessQuickButton(self, idx):
161151
#
162152
# Mark the remaining values as invalid
163153
#
164-
for j in range(i, 22):
154+
for _ in range(i, 22):
165155
cmdPageAppid.append(0)
166156
cmdPageIsValid.append(False)
167157

@@ -190,24 +180,30 @@ def ProcessQuickButton(self, idx):
190180
#
191181
# fill the data fields on the page
192182
#
193-
for k in range(22):
194-
subsysBrowser = getattr(Command, f'SubsysBrowser_{k}')
183+
for k, desc in enumerate(cmdPageDesc):
195184
if cmdPageIsValid[k]:
196-
lineEditPktId = getattr(Command, f'lineEditPktId_{k}')
197-
lineEditAddress = getattr(Command, f'lineEdit_{k}')
198-
quickButton = getattr(Command, f'quickButton_{k+1}')
199-
subsysBrowser.setText(cmdPageDesc[k])
200-
lineEditPktId.setText(hex(cmdPageAppid[k]))
201-
lineEditAddress.setText(cmdPageAddress[k])
185+
tbl.insertRow(k)
186+
for col, text in enumerate(
187+
(desc, hex(cmdPageAppid[k]), cmdPageAddress[k])):
188+
tblItem = QTableWidgetItem(text)
189+
tbl.setItem(k, col, tblItem)
190+
tblBtn = QPushButton("Display Page")
191+
tblBtn.clicked.connect(
192+
lambda _, x=k: Command.ProcessButtonGeneric(x))
193+
tbl.setCellWidget(k, 3, tblBtn)
202194
quickIdx = -1
203195
try:
204-
quickIdx = subsys.index(cmdPageDesc[k])
205-
quickButton.setText(quickCmd[quickIdx])
196+
quickIdx = subsys.index(desc)
206197
except ValueError:
207-
pass
198+
pass # Ignore quick button
199+
else:
200+
quickBtn = QPushButton(quickCmd[quickIdx])
201+
quickBtn.clicked.connect(
202+
lambda _, x=k: Command.ProcessQuickButton(x))
203+
tbl.setCellWidget(k, 4, quickBtn)
208204
quickIndices.append(quickIdx)
209-
else:
210-
subsysBrowser.setText("(unused)")
205+
tbl.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
206+
tbl.horizontalHeader().setStretchLastSection(True)
211207

212208
#
213209
# Display the page

0 commit comments

Comments
 (0)