class SpectraSettingsController(DialogController): item_config = ItemConfig().setMenuPath("View/Plot Settings").setTitle( "Spectrogram Settings").addSupportedData( DataType.SPECTROGRAM).addSupportedViewer(ViewerType.MPL) def setupContent(self, content_widget: QWidget): self._ui = Ui_SpectraSettings() self._ui.setupUi(content_widget) def onDataChanged(self, viewer_ctrl: ViewerController): model: CallistoModel = viewer_ctrl.model self._ui.vmin_check.setChecked(model.vmin is not None) if model.vmin: self._ui.vmin_spin.setValue(model.vmin) self._ui.vmax_check.setChecked(model.vmax is not None) if model.vmax: self._ui.vmax_spin.setValue(model.vmax) self._ui.substract_background_check.setChecked( model.substract_background) self._ui.linear_check.setChecked(model.linear) self._ui.color_bar_check.setChecked(model.colorbar) def modifyData(self, data_model: CallistoModel) -> DataModel: data_model.vmin = self._ui.vmin_spin.value( ) if self._ui.vmin_check.isChecked() else None data_model.vmax = self._ui.vmax_spin.value( ) if self._ui.vmax_check.isChecked() else None data_model.substract_background = self._ui.substract_background_check.isChecked( ) data_model.linear = self._ui.linear_check.isChecked() data_model.colorbar = self._ui.color_bar_check.isChecked() return data_model
class QueryCallistoActionController(ActionController): item_config = ItemConfig().setMenuPath( "File/Open Spectrogram/Callisto/Query") content_ctrl: ContentController = RequiredFeature(ContentController.name) def onAction(self): dlg = QDialog() ui = Ui_QueryCallisto() ui.setupUi(dlg) now = QDateTime.currentDateTimeUtc() ui.start_time.setDateTime(now.addSecs(-2 * 60 * 60)) ui.end_time.setDateTime(now.addSecs(-1.50 * 60 * 60)) if dlg.exec_(): start_time = ui.start_time.dateTime().toString( QtCore.Qt.ISODate).replace("T", " ") end_time = ui.end_time.dateTime().toString( QtCore.Qt.ISODate).replace("T", " ") executeLongRunningTask( CallistoSpectrogram.from_range, [ui.instrument.currentText(), start_time, end_time], "Downloading", self._openSpectrogram) def _openSpectrogram(self, spectrogram): viewer_ctrl = CallistoViewerController.fromSpectrogram(spectrogram) self.content_ctrl.addViewerController(viewer_ctrl)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("History").setMenuPath( "Edit/Undo").addSupportedData(DataType.ANY).addSupportedViewer( ViewerType.ANY).setShortcut(QtGui.QKeySequence("Ctrl+Z"))
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Rotate").setMenuPath("Edit/Rotate").addSupportedViewer( ViewerType.ANY).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Download Results").setOrientation( QtCore.Qt.BottomDockWidgetArea)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Change DB Settings")
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Open SV Project")
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Data Manager").setTitle( "Data Manager")
def item_config(self) -> ItemConfig: return ItemConfig()
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath( "Help/Calculate SNR").addSupportedViewer( ViewerType.MPL).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath( "Edit/Crop To Current View").addSupportedViewer( ViewerType.MPL).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Wavelet Filter").setMenuPath("Tools/Wavelet Filter").addSupportedData( DataType.MAP).addSupportedData(DataType.PLAIN_2D).addSupportedViewer(ViewerType.ANY)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Highlight Values").setMenuPath( "Tools/Highlight Values").addSupportedData( DataType.MAP).addSupportedViewer(ViewerType.MPL)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("Help/Error Log").setTitle( "Error Log").setOrientation(QtCore.Qt.BottomDockWidgetArea)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Value Adjustment").setMenuPath( "Tools/Adjust Data").addSupportedData( DataType.MAP).addSupportedViewer(ViewerType.ANY)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("Edit/Composite Map/Coalign").addSupportedViewer( ViewerType.ANY).addSupportedData(DataType.MAP_COMPOSITE)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Open SunPy Composite Map/From Active")
def item_config(self) -> ItemConfig: return ItemConfig().addSupportedViewer( ViewerType.MPL).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Event Download Tool").setMenuPath("File/HEK")
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Contrast Adjustment").setMenuPath("Tools/Contrast").addSupportedViewer( ViewerType.MPL).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Save As..").addSupportedData( DataType.ANY).addSupportedViewer(ViewerType.ANY)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Profile").setMenuPath( "Tools/Profile").addSupportedData(DataType.MAP).addSupportedViewer( ViewerType.MPL)
def item_config(self) -> ItemConfig: return ItemConfig().setMenuPath("File/Export/FITS").addSupportedData( DataType.MAP).addSupportedViewer(ViewerType.ANY)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Select Coloramap").setMenuPath( "Edit/Change Colormap").addSupportedViewer( ViewerType.MPL).addSupportedData( DataType.MAP).addSupportedData(DataType.PLAIN_2D)
def item_config(self) -> ItemConfig: return ItemConfig().addSupportedData(DataType.ANY).addSupportedViewer(ViewerType.MPL).setMenuPath( "View/Plot Settings").setTitle("NDCube Plot Settings")
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Download Tool").setMenuPath( "File/Download Data")
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Normalization").setMenuPath( "Edit/Normalization").addSupportedViewer( ViewerType.MPL).addSupportedData(DataType.MAP)
def item_config(self) -> ItemConfig: return ItemConfig().setTitle("Composite Map Settings").setMenuPath( "View/Composite Map/Settings").addSupportedData( DataType.MAP_COMPOSITE).addSupportedViewer(ViewerType.ANY)