Skip to content

Commit

Permalink
Merge pull request #107 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
Integration Candidate: 2020-06-17
  • Loading branch information
astrogeco authored Jun 25, 2020
2 parents 52f706b + 63b672a commit 9cd5304
Show file tree
Hide file tree
Showing 29 changed files with 886 additions and 12,459 deletions.
1 change: 0 additions & 1 deletion GroundSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def startCmdSystem():
def startFDLSystem(self):
selectedSpacecraft = self.getSelectedSpacecraftName()
if selectedSpacecraft == 'All':
subscription = ''
self.DisplayErrorMessage(
'Cannot open FDL manager.\nNo spacecraft selected.')
else:
Expand Down
2 changes: 1 addition & 1 deletion Guide-GroundSystem.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cFS Ground System Version 2.1.11
# cFS Ground System Version 2.1.12

## cFS Ground System Info

Expand Down
2 changes: 1 addition & 1 deletion Guide-GroundSystem.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cFS Ground System Version 2.1.11
cFS Ground System Version 2.1.12

cFS Ground System Info:

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ See [Guide-GroundSystem.md](https://github.com/nasa/cFS-GroundSystem/blob/master

## Version History

### Development Build: 2.1.12

- Change all individual UI elements to table widgets. Update backend code accordingly
- Temporary fix for implicit declaration of endian functions on some systems (RH/CentOs). No build errors on CentOS
- See <https://github.com/nasa/cFS-GroundSystem/pull/107>

### Development Build: 2.1.11

- 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.
Expand Down
10 changes: 4 additions & 6 deletions Subsystems/cmdGui/CHeaderParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@ def getFileList(filename='CHeaderParser-hdr-paths.txt'):
l = l.strip()
if l and not l.startswith("#"):
paths.append(l)
print(f"Using header files found in {filename}")
# Send paths back to caller function
return paths
print(f"Using header files found in {filename}")
# Send paths back to caller function
return paths
except IOError:
print("Couldn't find default file. Check command line arguments.")
except:
print("Unexpected error:", sys.exc_info()[0])

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

# Add string length argument to parameter list
stringLens.append(array_size)
Expand Down
62 changes: 29 additions & 33 deletions Subsystems/cmdGui/CommandSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
import sys
from pathlib import Path

from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.QtWidgets import (QApplication, QDialog, QHeaderView, QPushButton,
QTableWidgetItem)

from CommandSystemDialog import Ui_CommandSystemDialog
from Ui_CommandSystemDialog import Ui_CommandSystemDialog

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

Expand All @@ -43,23 +44,13 @@ def __init__(self):
self.setupUi(self)
self.move(800, 100)

for n in range(21):
btn = getattr(self, f"pushButton_{n}")
btn.clicked.connect(lambda _, x=n: self.ProcessButtonGeneric(x))

for l in range(22):
btn = getattr(self, f"quickButton_{l+1}")
btn.clicked.connect(lambda _, x=l: self.ProcessQuickButton(x))

#
# Processes 'Display Page' button
#
def ProcessButtonGeneric(self, idx):
if cmdPageIsValid[idx]:
lePID = getattr(self, f'lineEditPktId_{idx}')
leAddr = getattr(self, f'lineEdit_{idx}')
pktId = lePID.text()
address = leAddr.text()
pktId = self.tblCmdSys.item(idx, 1).text()
address = self.tblCmdSys.item(idx, 2).text()
launch_string = (
f'python3 {ROOTDIR}/{cmdClass[0]} '
f'--title=\"{cmdPageDesc[idx]}\" --pktid={pktId} '
Expand Down Expand Up @@ -87,10 +78,8 @@ def checkParams(idx):
def ProcessQuickButton(self, idx):
if cmdPageIsValid[idx] and quickIndices[idx] >= 0:
qIdx = quickIndices[idx]
lePID = getattr(self, f'lineEditPktId_{idx}')
leAddr = getattr(self, f'lineEdit_{idx}')
pktId = lePID.text()
address = leAddr.text()
pktId = self.tblCmdSys.item(idx, 1).text()
address = self.tblCmdSys.item(idx, 2).text()

# if requires parameters
if self.checkParams(qIdx):
Expand Down Expand Up @@ -128,6 +117,7 @@ def ProcessQuickButton(self, idx):
#
app = QApplication(sys.argv)
Command = CommandSystem()
tbl = Command.tblCmdSys

#
# Read in the contents of the telemetry packet definition
Expand All @@ -141,7 +131,7 @@ def ProcessQuickButton(self, idx):
reader = csv.reader(cmdfile, skipinitialspace=True)
for cmdRow in reader:
try:
if cmdRow[0][0] != '#':
if not cmdRow[0].startswith('#'):
cmdPageIsValid.append(True)
cmdPageDesc.append(cmdRow[0])
cmdPageDefFile.append(cmdRow[1])
Expand All @@ -161,7 +151,7 @@ def ProcessQuickButton(self, idx):
#
# Mark the remaining values as invalid
#
for j in range(i, 22):
for _ in range(i, 22):
cmdPageAppid.append(0)
cmdPageIsValid.append(False)

Expand Down Expand Up @@ -190,24 +180,30 @@ def ProcessQuickButton(self, idx):
#
# fill the data fields on the page
#
for k in range(22):
subsysBrowser = getattr(Command, f'SubsysBrowser_{k}')
for k, desc in enumerate(cmdPageDesc):
if cmdPageIsValid[k]:
lineEditPktId = getattr(Command, f'lineEditPktId_{k}')
lineEditAddress = getattr(Command, f'lineEdit_{k}')
quickButton = getattr(Command, f'quickButton_{k+1}')
subsysBrowser.setText(cmdPageDesc[k])
lineEditPktId.setText(hex(cmdPageAppid[k]))
lineEditAddress.setText(cmdPageAddress[k])
tbl.insertRow(k)
for col, text in enumerate(
(desc, hex(cmdPageAppid[k]), cmdPageAddress[k])):
tblItem = QTableWidgetItem(text)
tbl.setItem(k, col, tblItem)
tblBtn = QPushButton("Display Page")
tblBtn.clicked.connect(
lambda _, x=k: Command.ProcessButtonGeneric(x))
tbl.setCellWidget(k, 3, tblBtn)
quickIdx = -1
try:
quickIdx = subsys.index(cmdPageDesc[k])
quickButton.setText(quickCmd[quickIdx])
quickIdx = subsys.index(desc)
except ValueError:
pass
pass # Ignore quick button
else:
quickBtn = QPushButton(quickCmd[quickIdx])
quickBtn.clicked.connect(
lambda _, x=k: Command.ProcessQuickButton(x))
tbl.setCellWidget(k, 4, quickBtn)
quickIndices.append(quickIdx)
else:
subsysBrowser.setText("(unused)")
tbl.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
tbl.horizontalHeader().setStretchLastSection(True)

#
# Display the page
Expand Down
Loading

0 comments on commit 9cd5304

Please sign in to comment.