octave gui
Post on 02-Jun-2018
243 Views
Preview:
TRANSCRIPT
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 1/28
The Octave GUI
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 2/28
What makes a good GUI?
● Requirements for a GUI are summarized in theEN ISO !"# standard$ %hich inc&udes'
● Suita(i&it)
● *ust (e se&f+descri,tive
● -ccessi(i&it) .different means to ,erform a certaintask/
● -da,ta(i&it)
● *ust meet the user0s e1,ectations
23 There is no absolute measure to determine %hether a GUI is %e&&+done or not4 Whether thedesign of a GUI is good or not heavi&) de,ends onthe target audience4
Taken from' htt,'55%%%4ss%4com4au5
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 3/28
6esign goa&s for the Octave GUI
● 7rovide an visua& environment that is simi&ar to that of*-T8-94 :ee, care of menu structure$ shortcuts$ namingconventions4
● E1tend the visua& environment %hereever it makes sense todo that .for e1am,&e' History search/
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 4/28
What is ;t?
● ;t is an application development framework
● -n a,,&ication deve&o,ment frame%ork is aset of c&asses that he&,s deve&o,ers to createfeature+rich a,,&ications faster () ,rovidingcommon functiona&it) on a ver) a(stract &eve&
● It is common to use a,,&ication deve&o,ment
frame%orks in soft%are deve&o,ment toda)● ;t is free soft%are &icensed under the G78
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 5/28
6esign features of ;t
● <er) high a(straction &eve&
● -im for ,&atform+inde,endenc)
●
Suited for high+,erformance$ mu&timediaa,,&ications
● Eas) to &earn$ =ust a fe% re,etitive conce,ts.>&earned it once$ &earned it a&&/
● <er) good documentation$ integrated into the;t@reator I6E
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 6/28
9asic @once,ts' ;O(=ect
● *uch &ike in Aava$ ;t introduces a (asic o(=ectc&asses for a&& non+trivia& data structures';O(=ect
● 9) defau&t$ each instance of a ;O(=ect isunique$ it cannot (e co,ied
● Each ;O(=ect can (enefit from a &anguage
e1tension ;t ,rovides$ ca&&ed signals and slots
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 7/28
9asic @once,ts' ;O(=ect
● *uch &ike in Aava$ ;t introduces a (asic o(=ectc&asses for a&& non+trivia& data structures';O(=ect
● 9) defau&t$ each instance of a ;O(=ect isunique$ it cannot (e co,ied
● Each ;O(=ect can (enefit from a &anguage
e1tension ;t ,rovides$ ca&&ed signals and slots
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 8/28
9asic @once,ts' Signa&s and
S&ots● In order to ,rovide &oose cou,&ing of o(=ects .that0s adesira(&e feature in o(=ect+oriented ,rogramming/$;O(=ect can communicate via signa&s and s&ots
●
Each ;O(=ect can emit signals, ho%ever$ it does nothave an) kno%&edge a(out %ho &istens to the signa&and if it has an effect at a&&B >Cire and forget
●
Each ;O(=ect can offer s&ots4 S&ots can (econnected and disconnected to signa&s at runtime$ %ithout the need of te&&ing the ;O(=ects a(out that
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 9/28
9asic @once,ts' ;Widgets● ;Widget derives from ;O(=ect
● Widget 2 ><isua& Gagdet
● ;Widgets are usua&&) used for dis,&a)ing visua& e&ements4 -&&visua& e&ements have to have ;Widget as a (ase c&ass
● ;Widgets can (e >stacked one into another () e1,&icit&)stating a hierarch) via the parent +,arameter in the ;Widget+constructor
● Once a ,arent has (een assigned to a ;Widget$ the ,arent
cares for c&eaning u, memor) .ie4 de&eting chi&d %idgets %i&&&ead to a segfau&t/
● ;Widget %ithout a ,arent are to,+&eve&+%idgets4 The user hasto take for c&eaning u, memor)4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 10/28
9asic @once,ts' Neat&ess
integration of O,enG8● With ;G8Widget$ ;tintegrates O,enG8neat&ess&)4 ;t canmanage severa&O,enG8 dis,&a)s at
the same time4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 11/28
9asic @once,ts' 8a)outing and
St)&ing● ;Widgets can (e a&igned in horizonta& andvertica& &a)outs
● The actua& size size is determined () the size,o&ic) of each ;Widget
● 8a)outs can (e cascaded to ,rovide an) %idget &a)out that is desired
● ;Widgets can (e st)&ed &ike %e(,ages %ithregu&ar @SS
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 12/28
9asic @once,ts' ;t 6eve& Too&s
● qmake' Reads a D4,ro+,ro=ect fi&e and generates makefi&es forvarious >targets .,&atforms/4 qmake is a(&e to generate ,ro=ect fi&esfor other I6Es$ &ike for e1am,&e <isua& Studio4
● moc' *eta+O(=ect+@om,i&er4 This too& is used to ,arse source fi&es
containing ;O(=ects in order to generate g&ue code for the signa&sand s&ots s)stem4
● uic' User+Interface+@om,i&er4 Reads *8+user interface definitionsand creates @FF source code4
● &u,date' 7art of ;t0s &anguage trans&ation s)stem4 U,dates the&anguage fi&es () ,arsing the sources for the tr .44/ macro4
● &re&ease' @om,i&es &anguage fi&es that can (e shi,,ed %ith and&oaded () ;t a,,&ications4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 13/28
*inima& ;t 9ui&d 7rocess
qmake
,ro=ect4,ro
uic
%idget4ui
ui%idget4hmoc
%idget4cc moc%idget4cc %idget4h
Target
*akefi&esming%H!+make
make
nmake
9inaries
7&atform+inde,endent
7&atform+de,endent
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 14/28
6esigning a GUI %ith ;t
● ;t offers a WSIWG editor for designing GUIs' ;t6esigner
● ;t offers a ,rett) neat s)stem for &a)outs and size ,o&icies
● Once a GUI has (een designed$ it %i&& store the resu&t in an
*8+format fi&e .4ui+fi&e/● The uic+too& generates header fi&es$ these %i&& contain a %idget
c&ass that can (e su(c&assed and e1tended %ith @FF code
●
23 Combining the best of two worlds' Code generation fordesigning ,ur,oses$ writing code in order to %rite detai&ed GUI&ogic and im,&ementing e1tended features423 @ode generation and %riting code do not interfere4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 15/28
;t6esigner
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 16/28
8oca&ization
● ;t has (ui&t+in &oca&ization su,,ort4 Within ;t$ a&& userinterface strings have to (e surrounded %ith tr(...)
● With the qu,date+command the &anguage in,ut fi&es forthe s,ecified &anguages %i&& (e u,dated4
● ;t8inguist can (e used for trans&ators to do trans&ation %ithin an eas) to &earn I6E4
● With qre&ease the &anguage fi&es get com,i&ed into
distri(uta(&e >&anguage ,ackages that can (e &oaded ();t a,,&ications4
There has a&read) (een a fe% trans&ations for the GNUOctave GUI4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 17/28
GNU Octave and thread+safet)
● 7ro(&em' GNU Octave itse&f is not thread+safe$ (uta,,&ications %ith GUIs have to (e mu&tithreaded in orderto kee, the GUI res,onsive4
● So&ution #' *ake GNU Octave threadsafe4
F Often$ GNU Octave can (enefit heavi&) from s)stems that are a(&e toe1ecute mu&ti,&e threads in ,ara&&e& in hard%are
F -,,&)ing a GUI %ou&d (e eas)
+ Near&) im,ossi(&e to achieve due to &ots of g&o(a& state in GNU Octave
+ 7erformance decrease for tasks that cannot (e ,ara&&e&ized or hard%arethat does not su,,ort mu&ti,&e threads in hard%are
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 18/28
GNU Octave and thread+safet)
● 7ro(&em' GNU Octave itse&f is not thread+safe$ (uta,,&ications %ith GUIs have to (e mu&tithreaded in orderto kee, the GUI res,onsive4
● So&ution !' Seria&ize communication (et%een GNUOctave and other threads4
F *inima&+invasive a,,roach$ no modification of former GNU Octave code
F Eas) to im,&ement and understand
+ 7erformance decrease for a&& tasks$ since additiona& time in the GNUOctave thread %i&& (e s,ent4 Possible solution → se the !" forinteractive research and code development. #nce this has been done, usethe !$ #ctave C%" version to run your scripts on a larger scale.
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 19/28
Event+(ased communication
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 20/28
Events im,&emented %ithO(server+7attern
Source' htt,'55en4%iki,edia4org5%iki5Ci&e'O(server4svg
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 21/28
Integrating the command &ine
● Cormer GUIs im,&emented a ,i,e+(asedcommunication () &aunching GNU Octave asa su(,rocess4
6isadvantages'
● The GUI has to ,arse GNU Octave0s out,ut and generatein,ut B s&o% and error+,rone
● The GUI has no access to interna& dataB &imited functiona&it)
● The GUI has to reim,&ement (asica&&) a&& functiona&it)that is a&read) given () read&ine
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 22/28
GNU Octave GUI0s a,,roach
● 9ased on code from :6E0s :onso&e' Cu&&termina& emu&ation4 On Windo%s' @onso&e!a,,roach4
● Theoretica&&)$ offers the same functiona&it) asGNU Octave run in a termina& %indo%$ %ith nocom,romises on functiona&it)
●
Aohn S%ensen first came u, %ith this idea inhis GT:F5;t #ctave&'.
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 23/28
6ifferent %a)s of running octave
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 24/28
6ifferent %a)s of running octave
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 25/28
6ifferent %a)s of running octave
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 26/28
Integrated Editor
● Using ;Scinti&&a! as as ,o%erfu& editor %idget
● ;Scinti&&a! is free soft%are &icensed under theG78
● Offers a&& the standard comfort of an editor'*arker &ines$ &ine num(ers$ code fo&ding$ current &inehigh&ighting$ s)nta1 high&ighting$ auto+indent$ code+com,&etion
● Cor further Information see'
htt,'55%%%4river(ankcom,uting4co4uk5soft%are5qscinti&&a5
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 27/28
6e(ugging Interface
● Neat&ess integration of GNU Octave0sde(ugger4 It is ,ossi(&e to set (reak,oints atthe margin in the editor4
● Ste,,ing through the code can (e done %iththe usua& C#J5C##5C#! and CK commands4
● Whi&e de(ugging$ it is ,ossi(&e to track the
current state of the %orks,ace4
8/10/2019 Octave Gui
http://slidepdf.com/reader/full/octave-gui 28/28
Thank )ou for )our attentionL
top related