Commit 3e79e254 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #13892. Make comments more helpful

parent 51d91a13
class Command(object):
'''
Enum for commands passed to presenters
'''
ProcessAll = 1
ClearAll = 2
......@@ -21,5 +21,6 @@ class MainViewPresenter(object):
table_of_runs = self._main_view.get_run_table()
self._main_view.set_processing()
else:
# TODO more command driven processing options
pass
class ReductionSettings(object):
'''
TODO:
Reduction settings model. Holds all the in-memory settings.
'''
pass
......@@ -4,12 +4,15 @@ from PyQt4 import QtGui
from ui_ansto_sans import Ui_WindowSansAnsto
from view.main_view import MainView
from scripts.Interface.ui.sans.ansto.main_view_presenter import MainViewPresenter
from main_view_presenter import MainViewPresenter
from command import Command
class SansBatchGuiMetaClass(type(MainView), type(QtGui.QMainWindow)):
pass
class SANSBatchGui(MainView, QtGui.QMainWindow, Ui_WindowSansAnsto):
__metaclass__ = SansBatchGuiMetaClass
def __init__(self):
"""
......@@ -17,19 +20,24 @@ class SANSBatchGui(MainView, QtGui.QMainWindow, Ui_WindowSansAnsto):
"""
super(QtGui.QMainWindow, self).__init__()
self.setupUi(self)
# Create the presenter/controller for the UI
self._presenter = MainViewPresenter(self)
# For the click processing event
self.btn_reduce.clicked.connect(self.on_reduce)
def on_reduce(self):
# Update the presenter.
self._presenter.notify(Command.ProcessAll)
def setup_layout(self):
return True
def set_processing(self):
print "Processing!"
# TODO modal dialogs etc
print "Processing Runs"
def get_run_table(self):
# TODO Get all run information
return None
import abc
class ReductionSettingsService(object):
__metaclass__ = abc.ABCMeta
'''
TODO. Service to load and save reduction information.
The abstracts us from either the ISIS SANS file or the ANSTO
reduction settings file.
'''
pass
......@@ -2,11 +2,12 @@ import abc
class MainView(object):
#__metaclass__ = abc.ABCMeta
__metaclass__ = abc.ABCMeta
#@abc.abstractmethod
@abc.abstractmethod
def get_run_table(self):
pass
@abc.abstractmethod
def set_processing(self):
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment