Skip to content

Commit

Permalink
Make compatible with latest ACSC library
Browse files Browse the repository at this point in the history
  • Loading branch information
petebachant committed Mar 17, 2024
1 parent bb8c4c6 commit 11df145
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 46 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- https://github.com/petebachant/daqmx/archive/refs/heads/master.zip
- https://github.com/petebachant/MicronOpt-Python/archive/refs/heads/master.zip
- https://github.com/petebachant/Nortek-Python/archive/refs/heads/master.zip
- acspy==0.0.6
- acspy==0.0.7
- pythonqwt
- nidaqmx
- pxl
Expand Down
84 changes: 39 additions & 45 deletions turbinedaq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,13 @@ def add_labels_to_statusbar(self):

def connect_to_controller(self):
try:
self.hc = acsc.openCommEthernetTCP()
self.hc = acsc.open_comm_ethernet_tcp()
except acsc.AcscError:
print("Cannot connect to ACS controller")
print("Attempting to connect to simulator")
self.label_acs_connect.setText(" Not connected to ACS controller ")
self.hc = acsc.openCommDirect()
if self.hc == acsc.INVALID:
print("Cannot connect to simulator")
else:
print("Connected to simulator")
self.label_acs_connect.setText(
" Connected to SPiiPlus simulator "
)
self.hc = acsc.open_comm_simulator()
self.label_acs_connect.setText(" Connected to SPiiPlus simulator ")
else:
self.label_acs_connect.setText(" Connected to ACS controller ")

Expand Down Expand Up @@ -1404,9 +1398,9 @@ def closeEvent(self, event):
self.pos().x(),
self.pos().y(),
]
self.settings[
"Last section index"
] = self.ui.comboBox_testPlanSection.currentIndex()
self.settings["Last section index"] = (
self.ui.comboBox_testPlanSection.currentIndex()
)
self.settings["Last tab index"] = self.ui.tabWidgetMode.currentIndex()
self.settings["Last PC name"] = self.pcid
self.settings["Last size"] = (
Expand All @@ -1415,43 +1409,43 @@ def closeEvent(self, event):
)
self.settings["FBG visible"] = self.ui.dockWidget_FBG.isVisible()
self.settings["ODiSI visible"] = self.ui.dockWidget_ODiSI.isVisible()
self.settings[
"Lateral forces visible"
] = self.ui.dockWidget_LF.isVisible()
self.settings[
"Shakedown ODiSI"
] = self.ui.checkBox_singleRunODiSI.isChecked()
self.settings["Lateral forces visible"] = (
self.ui.dockWidget_LF.isVisible()
)
self.settings["Shakedown ODiSI"] = (
self.ui.checkBox_singleRunODiSI.isChecked()
)
# TODO: Checkbox below does not exist
# self.settings[
# "Shakedown lateral forces"
# ] = self.ui.checkBox_singleRunLF.isChecked()
self.settings[
"Vectrino visible"
] = self.ui.dockWidgetVectrino.isVisible()
self.settings[
"Shakedown tow speed"
] = self.ui.doubleSpinBox_singleRun_U.value()
self.settings[
"Shakedown radius"
] = self.ui.doubleSpinBox_turbineRadius.value()
self.settings[
"Shakedown height"
] = self.ui.doubleSpinBox_turbineHeight.value()
self.settings[
"Shakedown TSR"
] = self.ui.doubleSpinBox_singleRun_tsr.value()
self.settings[
"Shakedown y/R"
] = self.ui.doubleSpinBox_singleRun_y_R.value()
self.settings[
"Shakedown z/H"
] = self.ui.doubleSpinBox_singleRun_z_H.value()
self.settings[
"Shakedown Vectrino"
] = self.ui.checkBox_singleRunVectrino.isChecked()
self.settings[
"Shakedown FBG"
] = self.ui.checkBox_singleRunFBG.isChecked()
self.settings["Vectrino visible"] = (
self.ui.dockWidgetVectrino.isVisible()
)
self.settings["Shakedown tow speed"] = (
self.ui.doubleSpinBox_singleRun_U.value()
)
self.settings["Shakedown radius"] = (
self.ui.doubleSpinBox_turbineRadius.value()
)
self.settings["Shakedown height"] = (
self.ui.doubleSpinBox_turbineHeight.value()
)
self.settings["Shakedown TSR"] = (
self.ui.doubleSpinBox_singleRun_tsr.value()
)
self.settings["Shakedown y/R"] = (
self.ui.doubleSpinBox_singleRun_y_R.value()
)
self.settings["Shakedown z/H"] = (
self.ui.doubleSpinBox_singleRun_z_H.value()
)
self.settings["Shakedown Vectrino"] = (
self.ui.checkBox_singleRunVectrino.isChecked()
)
self.settings["Shakedown FBG"] = (
self.ui.checkBox_singleRunFBG.isChecked()
)
settings_dir = os.path.dirname(self.settings_fpath)
if not os.path.isdir(settings_dir):
os.mkdir(settings_dir)
Expand Down

0 comments on commit 11df145

Please sign in to comment.