1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
# data file for the Fltk User Interface Designer (fluid)
version 1.0107
header_name {.h}
code_name {.cxx}
decl {\#include <FL/Fl_File_Chooser.H>} {}
decl {\#include <FL/fl_draw.H>} {}
decl {\#include "igstkTrackerDataLogger.h"} {public
}
class TrackerDataLoggerGUI {open
} {
Function {TrackerDataLoggerGUI()} {open
} {
Fl_Window m_Window1 {
label {TimeStamp and Transform Logger}
callback {this->Quit();}
private xywh {164 198 514 89} type Double visible
} {
Fl_Output configurationFileTextField {
label {Configuration File:}
tooltip {xml configuration file} xywh {168 7 268 25} box PLASTIC_DOWN_BOX
}
Fl_Button {} {
label {...}
callback {char *fileName = fl_file_chooser("Load Configuration File", "XML Files(*.xml,*.XML)",NULL,0);
if(fileName!=NULL) //file name is copied to the text field
this->configurationFileTextField->value(fileName);}
private tooltip {open a file browser} xywh {442 7 51 25} box PLASTIC_UP_BOX
}
Fl_Button {} {
label Next
callback {std::string configurationFileName(this->configurationFileTextField->value());
if( configurationFileName.empty() )
{
ReportError( std::string( "Please select XML configuration file." ) );
}
else {
//load the settings from the xml configuration file
//and establish all the communication channels
try {
fl_cursor(FL_CURSOR_WAIT);
this->m_Logger = new TrackerDataLogger( configurationFileName );
this->m_Window1->hide();
this->m_Window2->show();
fl_cursor(FL_CURSOR_DEFAULT);
}
catch( std::exception &e )
{
ReportError( std::string( e.what() ) );
}
}}
private xywh {443 47 56 25} box PLASTIC_UP_BOX
}
Fl_Box {} {
image {IGSTK-thumbnail.gif} xywh {10 35 100 50}
}
}
Fl_Window m_Window2 {
label {OpenIGTLink Transform Broadcasting}
callback {this->Quit();}
private xywh {341 38 549 111} type Double box PLASTIC_UP_BOX color 7 selection_color 7 visible
} {
Fl_Button m_StopTrackingButton {
label {Stop Tracking}
callback {this->m_Logger->StopTracking();
this->m_StopTrackingButton->deactivate();
this->m_StartTrackingButton->activate();}
private tooltip {stop the tracking process} xywh {264 14 122 35} box PLASTIC_UP_BOX color 7 deactivate
}
Fl_Button m_StartTrackingButton {
label {Start Tracking}
callback {this->m_Logger->StartTracking();
this->m_StopTrackingButton->activate();
this->m_StartTrackingButton->deactivate();}
private tooltip {start the tracking process} xywh {118 14 122 35} box PLASTIC_UP_BOX color 7
}
Fl_Button {} {
label Quit
callback {this->Quit();}
private xywh {399 14 122 35} box PLASTIC_UP_BOX color 7
}
Fl_Box {} {
image {IGSTK-thumbnail.gif} xywh {10 50 100 50}
}
}
code {this->m_Logger = NULL;
this->hasQuitted = false;} {}
}
Function {Show()} {return_type {virtual void}
} {
code {this->m_Window1->show();} {}
}
Function {Quit()} {return_type void
} {
code {int i = fl_choice("Are you sure you want to quit?", NULL,"Yes","No");
if ( i == 1 )
{
if( this->m_Logger != NULL )
{
//the stop tracking button is active iff we are currently tracking
if( this->m_StopTrackingButton->active() )
this->m_Logger->StopTracking();
delete this->m_Logger;
}
m_Window2->hide();
this->hasQuitted = true;
exit( EXIT_SUCCESS );
}
else
{
return;
}} {}
}
Function {ReportError(const std::string &errorMessage)} {private return_type void
} {
code {fl_alert("%s", errorMessage.c_str());
fl_beep(FL_BEEP_ERROR);} {}
}
decl {TrackerDataLogger *m_Logger;} {public
}
decl {bool hasQuitted;} {}
Function {HasQuitted()} {return_type bool
} {
code {return this->hasQuitted;} {}
}
Function {~TrackerDataLoggerGUI()} {open selected return_type virtual
} {}
}
|