-
Notifications
You must be signed in to change notification settings - Fork 3
Remote devel #73
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
Draft
paskino
wants to merge
28
commits into
master
Choose a base branch
from
remote_devel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Remote devel #73
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
cd6afc8
created dialogs.py added browsing remote filesystem
paskino 2f963db
reset the remote settings checkbox
paskino 4e9d200
allows copy from the remote to local
paskino cf3fb23
update progress dialog
paskino 61b3c08
revert tempfile.tempdir change
paskino cd35b9c
added remote workdir selection
paskino e6c47e7
work in progress to push dvc config to remote
paskino effa417
about ok
paskino a2f563e
up to zip dvc config and transfer to remote
paskino 7fc1624
up to unzip on remote
paskino 6dc4823
first working run on the remote
paskino 654e111
fix indent
paskino a5dde6c
some updates
paskino 8272d53
retrieves the results from remote
paskino d14e18e
graph window partially populated
paskino 566fef6
Merge remote-tracking branch 'origin' into remote_devel
paskino ac2124c
added comments on remote transfer of files
paskino 5bdd97d
Merge remote-tracking branch 'origin' into remote_devel
paskino e1fd2b6
fix check for local run
paskino 43d680e
Fixes error in displaying DVC results (#78)
lauramurgatroyd a77789f
Merge branch 'remote_devel' of github.com:TomographicImaging/iDVC int…
paskino 0807b92
make local dvc analysis work again
paskino d5b62ba
Merge remote-tracking branch 'origin' into remote_devel
paskino 42a1fa2
Merge branch 'master' into remote_devel
paskino 3fa4ec3
Merge remote-tracking branch 'origin' into remote_devel
paskino ce11634
Merge branch 'master' into remote_devel
paskino 3544e94
Merge branch 'master' into remote_devel
paskino 645fafe
Merge branch 'master' into remote_devel
paskino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| from PySide2 import QtCore, QtGui, QtWidgets | ||
| from PySide2.QtWidgets import QCheckBox, QLabel, QDoubleSpinBox, QFrame, QVBoxLayout, QDialogButtonBox, QPushButton, QDialog | ||
| from PySide2.QtCore import Qt | ||
| import vtk | ||
| from brem.ui import RemoteServerSettingDialog | ||
| from eqt.ui import UIFormFactory | ||
|
|
||
| class SettingsWindow(QDialog): | ||
|
|
||
| def __init__(self, parent): | ||
| super(SettingsWindow, self).__init__(parent) | ||
|
|
||
| self.parent = parent | ||
|
|
||
| self.setWindowTitle("Settings") | ||
|
|
||
| self.dark_checkbox = QCheckBox("Dark Mode") | ||
|
|
||
| self.copy_files_checkbox = QCheckBox("Allow a copy of the image files to be stored. ") | ||
| self.vis_size_label = QLabel("Maximum downsampled image size (GB): ") | ||
| self.vis_size_entry = QDoubleSpinBox() | ||
|
|
||
| self.vis_size_entry.setMaximum(64.0) | ||
| self.vis_size_entry.setMinimum(0.01) | ||
| self.vis_size_entry.setSingleStep(0.01) | ||
|
|
||
| if self.parent.settings.value("vis_size") is not None: | ||
| self.vis_size_entry.setValue(float(self.parent.settings.value("vis_size"))) | ||
|
|
||
| else: | ||
| self.vis_size_entry.setValue(1.0) | ||
|
|
||
|
|
||
| if self.parent.settings.value("dark_mode") is not None: | ||
| if self.parent.settings.value("dark_mode") == "true": | ||
| self.dark_checkbox.setChecked(True) | ||
| else: | ||
| self.dark_checkbox.setChecked(False) | ||
| else: | ||
| self.dark_checkbox.setChecked(True) | ||
|
|
||
| separator = QFrame() | ||
| separator.setFrameShape(QFrame.HLine) | ||
| separator.setFrameShadow(QFrame.Raised) | ||
| self.adv_settings_label = QLabel("Advanced") | ||
|
|
||
|
|
||
| self.gpu_label = QLabel("Please set the size of your GPU memory.") | ||
| self.gpu_size_label = QLabel("GPU Memory (GB): ") | ||
| self.gpu_size_entry = QDoubleSpinBox() | ||
|
|
||
|
|
||
| if self.parent.settings.value("gpu_size") is not None: | ||
| self.gpu_size_entry.setValue(float(self.parent.settings.value("gpu_size"))) | ||
|
|
||
| else: | ||
| self.gpu_size_entry.setValue(1.0) | ||
|
|
||
| self.gpu_size_entry.setMaximum(64.0) | ||
| self.gpu_size_entry.setMinimum(0.00) | ||
| self.gpu_size_entry.setSingleStep(0.01) | ||
| self.gpu_checkbox = QCheckBox("Use GPU for volume render. (Recommended) ") | ||
| self.gpu_checkbox.setChecked(True) #gpu is default | ||
| if self.parent.settings.value("volume_mapper") == "cpu": | ||
| self.gpu_checkbox.setChecked(False) | ||
|
|
||
| if hasattr(self.parent, 'copy_files'): | ||
| self.copy_files_checkbox.setChecked(self.parent.copy_files) | ||
|
|
||
| self.layout = QVBoxLayout(self) | ||
| self.layout.addWidget(self.dark_checkbox) | ||
| self.layout.addWidget(self.copy_files_checkbox) | ||
| self.layout.addWidget(self.vis_size_label) | ||
| self.layout.addWidget(self.vis_size_entry) | ||
| self.layout.addWidget(separator) | ||
| self.layout.addWidget(self.adv_settings_label) | ||
| self.layout.addWidget(self.gpu_checkbox) | ||
| self.layout.addWidget(self.gpu_label) | ||
| self.layout.addWidget(self.gpu_size_label) | ||
| self.layout.addWidget(self.gpu_size_entry) | ||
|
|
||
| # configure remote server settings | ||
| remote_separator = QFrame() | ||
| remote_separator.setFrameShape(QFrame.HLine) | ||
| remote_separator.setFrameShadow(QFrame.Raised) | ||
| fw = UIFormFactory.getQWidget(parent=self) | ||
|
|
||
| self.remote_button_entry = QPushButton(self) | ||
| self.remote_button_entry.setText("Open Preferences") | ||
| self.remote_button_entry.clicked.connect(self.openConfigRemote) | ||
| fw.addWidget(self.remote_button_entry, 'Configure remote settings', 'remote_preferences') | ||
| cb = QCheckBox(self) | ||
| cb.setChecked(self.parent.connection_details is not None) | ||
| fw.addWidget(cb, 'Connect to remote server', 'connect_to_remote') | ||
| self.fw = fw | ||
| for k,v in fw.widgets.items(): | ||
| print ("fw", k) | ||
| # add to layout | ||
| self.layout.addWidget(remote_separator) | ||
| self.layout.addWidget(fw) | ||
|
|
||
| self.buttons = QDialogButtonBox( | ||
| QDialogButtonBox.Save | QDialogButtonBox.Cancel, | ||
| Qt.Horizontal, self) | ||
| self.layout.addWidget(self.buttons) | ||
| self.buttons.accepted.connect(self.accept) | ||
| self.buttons.rejected.connect(self.quit) | ||
|
|
||
| def accept(self): | ||
| #self.parent.settings.setValue("settings_chosen", 1) | ||
| if self.dark_checkbox.isChecked(): | ||
| self.parent.settings.setValue("dark_mode", True) | ||
| else: | ||
| self.parent.settings.setValue("dark_mode", False) | ||
| self.parent.SetAppStyle() | ||
|
|
||
| if self.copy_files_checkbox.isChecked(): | ||
| self.parent.copy_files = 1 # save for this session | ||
| self.parent.settings.setValue("copy_files", 1) #save for next time we open app | ||
| else: | ||
| self.parent.copy_files = 0 | ||
| self.parent.settings.setValue("copy_files", 0) | ||
|
|
||
| if self.gpu_checkbox.isChecked(): | ||
| self.parent.settings.setValue("volume_mapper", "gpu") | ||
| self.parent.vis_widget_3D.volume_mapper = vtk.vtkSmartVolumeMapper() | ||
| else: | ||
| self.parent.settings.setValue("volume_mapper", "cpu") | ||
|
|
||
| self.parent.settings.setValue("gpu_size", float(self.gpu_size_entry.value())) | ||
| self.parent.settings.setValue("vis_size", float(self.vis_size_entry.value())) | ||
|
|
||
| if self.parent.settings.value("first_app_load") != "False": | ||
| self.parent.CreateSessionSelector("new window") | ||
| self.parent.settings.setValue("first_app_load", "False") | ||
|
|
||
| # if remote is checked | ||
| statusBar = self.parent.statusBar() | ||
| if self.fw.widgets['connect_to_remote_field'].isChecked(): | ||
| self.parent.connection_details = self.connection_details | ||
| statusBar.showMessage("Connected to {}@{}:{}".format( | ||
| self.connection_details['username'], | ||
| self.connection_details['server_name'], | ||
| self.connection_details['server_port']) | ||
| ) | ||
| else: | ||
| statusBar.clearMessage() | ||
| self.parent.connection_details = None | ||
| self.close() | ||
|
|
||
|
|
||
| #print(self.parent.settings.value("copy_files")) | ||
| def quit(self): | ||
| if self.parent.settings.value("first_app_load") != "False": | ||
| self.parent.CreateSessionSelector("new window") | ||
| self.parent.settings.setValue("first_app_load", "False") | ||
| self.close() | ||
|
|
||
| def openConfigRemote(self): | ||
|
|
||
| dialog = RemoteServerSettingDialog(self,port=None, | ||
| host=None, | ||
| username=None, | ||
| private_key=None) | ||
| dialog.Ok.clicked.connect(lambda: self.getConnectionDetails(dialog)) | ||
| dialog.exec() | ||
|
|
||
| def getConnectionDetails(self, dialog): | ||
| for k,v in dialog.connection_details.items(): | ||
| print (k,v) | ||
| self.connection_details = dialog.connection_details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearly this is a hack. Possibly we don't want to save a log file? Or we should have another temporary directory/file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary would be best