Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddingAindBehaviorTaskLogicModel #1223

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/foraging_gui/Dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from PyQt5.QtWidgets import QApplication, QDialog, QVBoxLayout, QHBoxLayout, QMessageBox, QGridLayout
from PyQt5.QtWidgets import QLabel, QDialogButtonBox,QFileDialog,QInputDialog, QLineEdit
from PyQt5 import QtWidgets, uic, QtGui
from PyQt5.QtCore import QThreadPool,Qt, QAbstractTableModel, QItemSelectionModel, QObject, QTimer
from PyQt5.QtCore import QThreadPool,Qt, QAbstractTableModel, QItemSelectionModel, QObject, QTimer, pyqtSignal
from PyQt5.QtSvg import QSvgWidget

from foraging_gui.MyFunctions import Worker
Expand Down Expand Up @@ -2215,7 +2215,7 @@ def _SelectRigMetadata(self,rig_metadata_file=None):

class AutoTrainDialog(QDialog):
'''For automatic training'''

trainingStageChanged = pyqtSignal(str) # signal to indicate training stage has changed
def __init__(self, MainWindow, parent=None):
super().__init__(parent)
uic.loadUi('AutoTrain.ui', self)
Expand Down Expand Up @@ -2651,12 +2651,12 @@ def _override_curriculum_clicked(self, state):
def _update_stage_to_apply(self):
if self.checkBox_override_stage.isChecked():
self.stage_in_use = self.comboBox_override_stage.currentText()

logger.info(f"Stage overridden to: {self.stage_in_use}")
elif self.last_session is not None:
self.stage_in_use = self.last_session['next_stage_suggested']
else:
self.stage_in_use = 'unknown training stage'

self.pushButton_apply_auto_train_paras.setText(
f"Apply and lock\n"
+ '\n'.join(get_curriculum_string(self.curriculum_in_use).split('(')).strip(')')
Expand All @@ -2665,7 +2665,7 @@ def _update_stage_to_apply(self):

logger.info(f"Current stage to apply: {self.stage_in_use} @"
f"{get_curriculum_string(self.curriculum_in_use)}")
self.trainingStageChanged.emit(self.stage_in_use)
def _apply_curriculum(self):
# Check if a curriculum is selected
if not hasattr(self, 'selected_curriculum') or self.selected_curriculum is None:
Expand Down Expand Up @@ -2885,10 +2885,10 @@ def _set_training_parameters(self, paras_dict, if_apply_and_lock=False):

# Set warmup to off first so that all AutoTrain parameters
# can be correctly registered in WarmupBackup if warmup is turned on later
if paras_dict and paras_dict['warmup'] != self.MainWindow.warmup.currentText():
if paras_dict and paras_dict['warmup'] != self.MainWindow.behavior_task_logic_model.task_parameters.warmup:
widgets_changed.update(
{self.MainWindow.warmup:
self.MainWindow.warmup.currentText()
self.MainWindow.behavior_task_logic_model.task_parameters.warmup
}
) # Track the changes

Expand Down
Loading