Skip to content

Commit

Permalink
addressed issue #25
Browse files Browse the repository at this point in the history
  • Loading branch information
jirhiker committed Sep 18, 2018
1 parent 44d0688 commit 269ef63
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion wellpy/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ def load_qc_data(self):
else:
information(None, 'No records required QC for this point id: "{}"'.format(self.selected_qc_point_id.name))

def set_head_visibility(self, state):
try:
plot = self._plots['HEAD']
plot.visible = state
plot.request_redraw()
except KeyError:
pass

def _add_head(self, plot, cxs, hs):
foreign_plot = create_line_plot((cxs, hs), color='blue')
left, bottom = add_default_axes(foreign_plot)
Expand All @@ -300,7 +308,7 @@ def _add_head(self, plot, cxs, hs):
foreign_plot.index_mapper = plot.index_mapper

plot.add(foreign_plot)

self._plots['HEAD'] = foreign_plot
self._broadcast_zoom(plot, foreign_plot)

def _broadcast_zoom(self, plot, foreign_plot):
Expand Down
7 changes: 6 additions & 1 deletion wellpy/tasks/panes.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class QCPane(TraitsDockPane):

load_qc_button = Button('Refresh QC Needed')
dclicked = Event
head_visible = Bool(True)

def _dclicked_fired(self):
self.model.load_qc_data()
Expand All @@ -208,6 +209,9 @@ def _apply_qc_button_fired(self):
def _load_qc_button_fired(self):
self.model.load_qc()

def _head_visible_changed(self, new):
self.model.set_head_visibility(new)

def traits_view(self):
pa = PointIDAdapter()
pa.columns = pa.columns[:1]
Expand All @@ -220,7 +224,8 @@ def traits_view(self):
dg = UItem('deviations', editor=TabularEditor(adapter=DeviationAdapter()))

v = View(VGroup(HGroup(UItem('pane.apply_qc_button'),
UItem('pane.load_qc_button')),
UItem('pane.load_qc_button'),
Item('pane.head_visible', label='Show Head')),
pg, dg))
return v

Expand Down

0 comments on commit 269ef63

Please sign in to comment.