Maracas main application. More...
#include <wxMaracasApp02.h>
Public Member Functions | |
bool | OnInit () |
int | OnExit () |
Private Attributes | |
marInterface * | _mar |
Maracas main application.
Definition at line 41 of file wxMaracasApp02.h.
int wxMaracasApp02::OnExit | ( | ) |
Definition at line 241 of file wxMaracasApp02.cxx.
References _mar.
bool wxMaracasApp02::OnInit | ( | ) |
Definition at line 108 of file wxMaracasApp02.cxx.
References _mar, getExecutablePath(), marInterface::loadParameters(), MAR_DEFAULT_FILE_DICTIONARY, MAR_DEFAULT_FILE_PARAMETERS, and marInterface::SetParamFileName().
00109 { 00110 #ifdef __WXGTK__ 00111 //See http://www.wxwindows.org/faqgtk.htm#locale 00112 setlocale(LC_NUMERIC, "C"); 00113 #endif 00114 /* 00115 #ifdef __WXDEBUG__ 00116 //static wxLogWindow * myLogWindow=new wxLogWindow(NULL,"Log Window",false,false); 00117 static wxLogWindow * myLogWindow=new wxLogWindow(NULL,"Log Window",true,false); 00118 wxLog::SetActiveTarget(myLogWindow); 00119 myLogWindow->ClearTraceMasks(); 00120 #endif 00121 wxLogDebug("---------------------------------------------------"); 00122 wxLogDebug("----------- Initialising application"); 00123 */ 00124 // int nSize=_MAX_PATH; 00125 // LPTSTR lpFilename=(LPTSTR) (new char[nSize]); 00126 // GetModuleFileName(NULL,lpFilename,nSize); 00127 // wxString moduleFileName( lpFilename ); 00128 00129 wxString moduleFileName = getExecutablePath(); 00130 00131 wxString paramFileName=moduleFileName.BeforeLast( wxChar(92) ) // caracter '\' 00132 +wxString( wxChar(92) ) 00133 +wxString( MAR_DEFAULT_FILE_PARAMETERS , wxConvUTF8 ); 00134 wxString dictionaryFileName=moduleFileName.BeforeLast( wxChar(92) ) 00135 +wxString( wxChar(92) ) 00136 +wxString( MAR_DEFAULT_FILE_DICTIONARY, wxConvUTF8 ); 00137 00138 // Initialize MARACAS 00139 _mar = new marInterface(); 00140 00141 _mar->SetParamFileName( (const char*)(paramFileName.mb_str()) ); 00142 _mar->loadParameters(); 00143 00144 /* 00145 // Initialize MARACASCT 00146 _marCT = new marInterfaceCT(); 00147 _marCT->SetParamFileName(paramFileName.c_str()); 00148 _marCT->loadParameters(); 00149 */ 00150 00151 // EED ILPD 00152 00153 //EED 4 oct 2006 00154 // _mar->SetDicom( new marGdcmDicomILPD( _mar->_parameters ) ); 00155 00156 // _marCT->SetDicom( new marGdcmDicomILPD( _marCT->getParameters() ) ); 00157 // _mar->SetDicom( new marGdcmDicom( _mar->_parameters ) ); 00158 00159 /* 00160 //-- 00161 // Create the main frame window 00162 wxMaracasFrame02* frame = new wxMaracasFrame02( ( wxFrame* )NULL, -1 , _mar, _marCT, (const char*)dictionaryFileName.mb_str()); 00163 frame->Show( true ); 00164 frame->Maximize( ); 00165 this->SetTopWindow( frame ); 00166 00167 00168 //If no dir was set for DICOM force user to set it ! 00169 wxString dirHome = _mar->_parameters->getStringParam( 00170 marParameters::e_dicom_images_directory ); 00171 if( dirHome == "NO_DIRECTORY" || dirHome == "") 00172 { 00173 // _mar->_parameters->setStringParam( 00174 // marParameters::e_dicom_images_directory, "c:\\temp" ); 00175 00176 wxDirDialog dialog( frame, "Choose a DICOM directory...", 00177 ( !dirHome.IsEmpty( ) )? dirHome: wxGetHomeDir( ) ); 00178 00179 if( dialog.ShowModal( ) == wxID_OK ) 00180 { 00181 _mar->_parameters->setStringParam( 00182 marParameters::e_dicom_images_directory, dialog.GetPath( ) ); 00183 _marCT->getParameters()->setStringParam( 00184 marParameters::e_dicom_images_directory, dialog.GetPath( ) ); 00185 00186 00187 } 00188 00189 } 00190 else 00191 { 00192 _marCT->getParameters()->setStringParam( 00193 marParameters::e_dicom_images_directory, dirHome ); 00194 00195 } 00196 00197 00198 wxCommandEvent cmd; 00199 frame->OnLoadPatientData( cmd ); 00200 _mar->saveParameters( ); 00201 _marCT->saveParameters( ); 00202 //EED initialized=true; 00203 00204 00205 // PS -> #ifndef DXMM 00206 // PS -> // GO ! 00207 // PS -> SetExitOnFrameDelete(true); 00208 // PS -> m_pFrame->Show( true ); 00209 // PS -> #else 00210 // SetExitOnFrameDelete(true); 00211 // PS -> #endif 00212 //-- 00213 */ 00214 00215 //-- 00216 00217 string tmpstring = (const char*) (dictionaryFileName.mb_str()); 00218 wxMaracasFrame03 *frame03 = new wxMaracasFrame03( (wxFrame*) NULL, -1 , _mar, (char*)tmpstring.c_str() ); 00219 frame03->SetTitle(_T("Maracas - Evaluation version 1 July 2008 - Use limited to the research team - (Creatis-LRMN,Uniandes)")); 00220 00221 frame03->Show( true ); 00222 frame03->Maximize( ); 00223 this->SetTopWindow( frame03 ); 00224 //-- 00225 00226 /* 00227 wxDateTime date; 00228 int year=date.GetCurrentYear(); 00229 int month=date.GetCurrentMonth()+1; 00230 if (!((year==2006) && (month==01))) 00231 { 00232 wxMessageDialog msg(frame03, "ERROR EED:1010", "Message box", wxOK ); 00233 msg.ShowModal(); 00234 return false; 00235 } 00236 */ 00237 00238 return( true ); 00239 }
marInterface* wxMaracasApp02::_mar [private] |
Definition at line 54 of file wxMaracasApp02.h.