GUI architecture for scientifjc workfmow spaghetti-free, - - PowerPoint PPT Presentation

gui architecture for scientifjc workfmow
SMART_READER_LITE
LIVE PREVIEW

GUI architecture for scientifjc workfmow spaghetti-free, - - PowerPoint PPT Presentation

GUI architecture for scientifjc workfmow spaghetti-free, lazy-responsive, with capture & replay Joachim Wuttke Forschungszentrum Jlich GmbH, JCNS-MLZ Garching Google image search for model view 1


slide-1
SLIDE 1

GUI architecture for scientifjc workfmow

spaghetti-free, lazy-responsive, with capture & replay

Joachim Wuttke

Forschungszentrum Jülich GmbH, JCNS-MLZ Garching

slide-2
SLIDE 2

Google image search for “model view” 1

slide-3
SLIDE 3

https://blogs.msdn.microsoft.com/erwinvandervalk 2

slide-4
SLIDE 4

Qt5 model/view classes

view is based on QAbstractItemView

  • QListView
  • QTableView
  • QTreeView

model inherits from QAbstractItemModel

  • QAbstractListModel
  • QAbstractProxyModel
  • QAbstractTableModel

3

slide-5
SLIDE 5

by Juanpe Bolivar (CppCon 2017) 4

slide-6
SLIDE 6

by Juanpe Bolivar (CppCon 2017) 5

slide-7
SLIDE 7

by Juanpe Bolivar (CppCon 2017) 6

slide-8
SLIDE 8

by Juanpe Bolivar (CppCon 2017) 7

slide-9
SLIDE 9

VIEW VIEW VIEWMODEL VIEWMODEL DATA

8

slide-10
SLIDE 10

core gui VIEW VIEW VIEWMODEL VIEWMODEL DATA

9

slide-11
SLIDE 11

core gui services VIEW VIEW VIEWMODEL VIEWMODEL LOGGER PARAMETER WRAPPERS DATA

10

slide-12
SLIDE 12

core gui services VIEW VIEWMODEL LOGGER PARAMETER WRAPPERS DATA Python API user script

11

slide-13
SLIDE 13

generated by Doxygen 12

slide-14
SLIDE 14

generated by Doxygen 13

slide-15
SLIDE 15

generated by Doxygen 14

slide-16
SLIDE 16

GUI:

qApp gMainWindow settings widgets menu triggers, toggles

= global variable Core:

gSession settings data raw reduced metadata images parameters results 15

slide-17
SLIDE 17
  • prefer plain global variables over equivalent singletons
  • prefer one global variable gSession over function calls like

f(session.Data, session.Parameters); which calls g(datafiles[iFile], parameterX , parameterZ); which calls h(datafile.metadata.A, parameterZ);

16

slide-18
SLIDE 18

How to keep this up to date?

17

slide-19
SLIDE 19

Signalling spaghetti (GUI ↔ Core) has its root in efgorts

  • to restrict Core recomputation to data that have changed,
  • to restrict GUI redrawing to Widgets that have changed.

Both are premature optimizations.

18

slide-20
SLIDE 20

Signalling spaghetti (GUI ↔ Core) has its root in efgorts

  • to restrict Core recomputation to data that have changed,
  • to restrict GUI redrawing to Widgets that have changed.

Both are premature optimizations. They do not even preclude duplication of Core computations.

18

slide-21
SLIDE 21

application view 1 view 2 data 1 data 2 data 3 data 4 parameter 19

slide-22
SLIDE 22

application view 1 view 2 data 1 data 2 data 3 data 4 parameter 20

slide-23
SLIDE 23

application view 1 view 2 data 1 data 2 data 3 data 4 parameter

declare invalid request refresh lazy evaluate

21

slide-24
SLIDE 24

GUI:

qApp gMainWindow settings widgets menu triggers, toggles request recompute

Core:

gSession settings data raw reduced metadata images parameters results request redisplay 22

slide-25
SLIDE 25

Bonus section: capture & replay

slide-26
SLIDE 26

Logging

Why?

  • to debug,
  • to profjle,
  • to document provenance,

and to replay

  • tests during development,
  • functional tests,
  • user sessions, especially upon bug reports.

Also related:

  • Undo/Redo.

23

slide-27
SLIDE 27

Logging

How? By recording

  • keyboard and mouse events,
  • interrupts,
  • user actions at widget level,
  • GUI-to-core calls.

24

slide-28
SLIDE 28

Logging

How? By recording

  • keyboard and mouse events,
  • interrupts,
  • user actions at widget level,
  • GUI-to-core calls.

24

slide-29
SLIDE 29

application

control widgets command interpreter core command stack undo/redo log file text editor

test suite

test case test case test case test case test case test case GUI action textual command user tester 25

slide-30
SLIDE 30

QAction QCheckButton QSpinBox QComboBox QTabWidget QDoubleSpinBox QLineEdit QDialog QFileDialog QcrTrigger QcrToggle QcrCheckButton QcrSpinBox QcrComboBox QcrTabWidget QcrDoubleSpinBox QcrLineEdit QcrModelessDialog QcrModalDialog QcrFileDialog QcrControl<bool> QcrControl<int> QcrControl<double> QcrControl<QString> QcrModal QcrMixin jugit.fz-juelich.de:mlz/libQCR 26