int _tmain(int argc, _TCHAR* argv[]) { char imagePath[PathLength] = "..\\data\\"; char txtPath[PathLength] = "..\\data\\moments.txt"; map<char, vector<vector<double> > > moments; bmpOpen(moments, imagePath); writeMomentsToFile(moments, txtPath); return 0; }
void MainFrame::InitializeMenus(){ //initialize main menu wxMenuBar* menuBar = new wxMenuBar(); wxMenu* fileMenu = new wxMenu(); fileMenu->Append(wxID_NEW, wxT("New Race Event\tCtrl+N"), wxT("Create a new Race Event")); fileMenu->Append(wxID_OPEN, wxT("Open Race Event\tCtrl+O"), wxT("Open an existing Race Event")); fileMenu->Append(ID_IMPORT_DATALOG, wxT("Import Datalog\tCtrl-I"),wxT("Import Datalog")); fileMenu->AppendSeparator(); fileMenu->Append(ID_NEW_CONFIG, wxT("New Configuration\tCtrl+N"), wxT("Create a new Race Capture Configuration")); fileMenu->Append(ID_OPEN_CONFIG, wxT("Open Configuration\tCtrl+O"), wxT("Open a saved Race Capture Configuration")); fileMenu->Append(ID_SAVE_CONFIG, wxT("Save Configuration\tCtrl+S"), wxT("Save the current Race Capture Configuration")); fileMenu->Append(ID_SAVE_CONFIG_AS, wxT("Save Configuration As\tCtrl+Shift+S"), wxT("Save the current Race Capture Configuration under a new file")); fileMenu->AppendSeparator(); fileMenu->Append(wxID_EXIT, wxT("Exit"), wxT("Exit the program")); menuBar->Append(fileMenu, wxT("File")); wxMenu* toolsMenu = new wxMenu(); toolsMenu->Append(ID_OPTIONS, wxT("Configurator Options")); menuBar->Append(toolsMenu, "Tools"); wxMenu* viewMenu = new wxMenu(); viewMenu->Append(ID_CONFIG_MODE, "Configuration\tF2"); viewMenu->Append(ID_ANALYSIS_MODE, "Analysis\tF3"); viewMenu->Append(ID_RUNTIME_MODE, "Sensor Monitor\tF4"); viewMenu->Append(ID_VIEW_LOGVIEWER, "Log Viewer\tF5"); viewMenu->AppendSeparator(); viewMenu->Append(ID_RESTORE_DEFAULT_VIEWS, "Restore Default View"); menuBar->Append(viewMenu, "View"); wxMenu *chartsMenu = new wxMenu(); chartsMenu->Append(ID_ADD_LINE_CHART,wxT("Line Chart")); chartsMenu->Append(ID_ADD_ANALOG_GAUGE, wxT("Analog Gauge")); chartsMenu->Append(ID_ADD_DIGITAL_GAUGE, wxT("Digital Gauge")); chartsMenu->Append(ID_ADD_GPS_VIEW, wxT("GPS View")); menuBar->Append(chartsMenu, "Charts"); wxMenu* helpMenu = new wxMenu(); helpMenu->Append(ID_HELP_OPERATION_GUIDE, wxT("Operation Guide")); helpMenu->Append(ID_HELP_INSTALL_GUIDE, wxT("Installation Guide")); helpMenu->Append(ID_HELP_DOWNLOADS, wxT("Software and Firmware Downloads")); helpMenu->AppendSeparator(); helpMenu->Append(ID_HELP_ABOUT, wxT("About Race Analyzer")); menuBar->Append(helpMenu, wxT("Help")); SetMenuBar(menuBar); //initialize tool bar wxToolBar* toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxTB_FLAT | wxTB_NODIVIDER); wxBitmap bmpNew(page_lightning_xpm); wxBitmap bmpOpen(folder_database_xpm); wxBitmap bmpGetConfig(getconfig_xpm); wxBitmap bmpWriteConfig(writeconfig_xpm); wxBitmap bmpCommitFlash(commitflash_xpm); wxBitmap bmpChart(line_chart_xpm); wxBitmap bmpRuntime(runtime_7_xpm); wxBitmap bmpImport(import_xpm); toolBar->AddTool(wxID_NEW, "", bmpNew, "Create new Race Event"); toolBar->AddTool(wxID_OPEN, "", bmpOpen, "Open a Race Event"); toolBar->AddTool(ID_IMPORT_DATALOG, "", go_bottom_xpm, "ImportDatalog"); toolBar->AddSeparator(); toolBar->AddTool(ID_CONFIG_MODE, "", wrench_xpm, "Configuration Mode"); toolBar->AddTool(ID_ANALYSIS_MODE, "", analysis_runtime2_xpm, "Analysis Mode"); toolBar->AddSeparator(); toolBar->AddTool(ID_RUNTIME_MODE, "", inspect_xpm, "Sensor Monitor"); toolBar->AddSeparator(); toolBar->Realize(); SetToolBar(toolBar); }
ToolBar::ToolBar(wxWindow *parent) :wxToolBar( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL | wxNO_BORDER ) { wxImage bmpOpen(MyApp::iconsPath+ wxT("fileopen.png" ), wxBITMAP_TYPE_PNG); m_btnOpen = this->AddTool(wxID_ANY, bmpOpen, wxT("Open")); this->AddSeparator(); wxImage bmpAxial(MyApp::iconsPath+ wxT("axial.png"), wxBITMAP_TYPE_PNG); wxImage bmpCor(MyApp::iconsPath+ wxT("cor.png"), wxBITMAP_TYPE_PNG); wxImage bmpSag(MyApp::iconsPath+ wxT("sag.png"), wxBITMAP_TYPE_PNG); wxImage bmpAlphaBlend(MyApp::iconsPath+ wxT("alphablend.png"), wxBITMAP_TYPE_PNG); m_toggleShowAxial = this->AddCheckTool( wxID_ANY, wxT("Show Axial"), bmpAxial, wxNullBitmap, wxT("Show Axial")); m_toggleShowCoronal = this->AddCheckTool( wxID_ANY, wxT( "Show Coronal" ), bmpCor, wxNullBitmap, wxT("Show Coronal")); m_toggleShowSagittal = this->AddCheckTool( wxID_ANY, wxT("Show Sagittal"), bmpSag, wxNullBitmap, wxT("Show Sagittal")); m_toggleAlphaBlending = this->AddCheckTool( wxID_ANY, wxT("Toggle Alpha Blending"), bmpAlphaBlend, wxNullBitmap, wxT("Toggle Alpha Blending")); this->AddSeparator(); wxImage bmpBox(MyApp::iconsPath+ wxT("box.png"), wxBITMAP_TYPE_PNG); wxImage bmpBoxEyeAll(MyApp::iconsPath+ wxT("box_eye_all.png"), wxBITMAP_TYPE_PNG); wxImage bmpBoxOffAll(MyApp::iconsPath+ wxT("box_off_all.png"), wxBITMAP_TYPE_PNG); wxImage bmpBoxNotAll(MyApp::iconsPath+ wxT("box_not_all.png"), wxBITMAP_TYPE_PNG); m_btnNewSelectionBox = this->AddTool( wxID_ANY, bmpBox, wxT("New Selection Box")); m_toggleShowAllSelectionObjects = this->AddCheckTool( wxID_ANY, wxT( "Toggle Show All Selection Object" ), bmpBoxEyeAll, wxNullBitmap, wxT("Toggle Show All Selection Objects")); m_toggleActivateAllSelectionObjects = this->AddCheckTool( wxID_ANY, wxT( "Toggle Activate All Selection Objects" ), bmpBoxOffAll, wxNullBitmap, wxT("Toggle Activate All Selection Objects")); m_toggleInverseSelection = this->AddCheckTool( wxID_ANY, wxT( "Toggle Inverse Fibers Selection" ), bmpBoxNotAll, wxNullBitmap, wxT("Toggle Inverse Fibers Selection")); this->AddSeparator(); wxImage bmpGridSpline(MyApp::iconsPath+ wxT("grid_spline.png"), wxBITMAP_TYPE_PNG); wxImage bmpGrid(MyApp::iconsPath+ wxT("grid.png"), wxBITMAP_TYPE_PNG); wxImage bmpView1(MyApp::iconsPath+ wxT("view1.png"), wxBITMAP_TYPE_PNG); wxImage bmpView3(MyApp::iconsPath+ wxT("view3.png"), wxBITMAP_TYPE_PNG); wxImage bmpLighting(MyApp::iconsPath+ wxT("lightbulb.png"), wxBITMAP_TYPE_PNG); m_toggleLighting = this->AddCheckTool( wxID_ANY, wxT( "Toggle Lighting" ), bmpLighting, wxNullBitmap, wxT("Toggle Lighting")); this->AddSeparator(); wxImage bmpTubes (MyApp::iconsPath+ wxT("tubes.png"), wxBITMAP_TYPE_PNG); m_toggleFakeTubes = this->AddCheckTool( wxID_ANY, wxT("Toggle Tubes"), bmpTubes, wxNullBitmap, wxT("Toggle Tubes")); this->AddSeparator(); wxImage bmpClearColor (MyApp::iconsPath+ wxT("background_color.png"), wxBITMAP_TYPE_PNG); m_toggleClearToBlack = this->AddCheckTool( wxID_ANY, wxT("Clear To Black"), bmpClearColor, wxNullBitmap, wxT("Clear To Black")); this->AddSeparator(); wxImage bmpPointer (MyApp::iconsPath+ wxT("pointer.png"), wxBITMAP_TYPE_PNG); wxImage bmpRuler (MyApp::iconsPath+ wxT("rulertool.png"), wxBITMAP_TYPE_PNG); wxImage bmpDrawer (MyApp::iconsPath+ wxT("drawertool.png"), wxBITMAP_TYPE_PNG); m_selectNormalPointer = this->AddRadioTool( wxID_ANY, wxT("Pointer" ), bmpPointer, wxNullBitmap, wxT("Pointer")); m_selectRuler = this->AddRadioTool( wxID_ANY, wxT("Ruler" ), bmpRuler, wxNullBitmap, wxT("Ruler")); m_selectDrawer = this->AddRadioTool( wxID_ANY, wxT("Drawer" ), bmpDrawer, wxNullBitmap, wxT("Drawer")); this->AddSeparator(); m_txtRuler = new wxTextCtrl(this, wxID_ANY,wxT("0.00mm (0.00mm)"), wxDefaultPosition, wxSize( 160, 24 ), wxTE_LEFT | wxTE_READONLY); m_txtRuler->SetForegroundColour(wxColour(wxT("#222222"))); m_txtRuler->SetBackgroundColour(*wxWHITE); wxFont font = m_txtRuler->GetFont(); font.SetPointSize(10); font.SetWeight(wxBOLD); m_txtRuler->SetFont(font); this->AddControl(m_txtRuler); //no wxImage, it will show the selected color m_selectColorPicker = this->AddTool(wxID_ANY, wxT("Color Picker" ), bmpClearColor, wxNullBitmap, wxITEM_NORMAL, wxT("Color Picker")); EnableTool(m_selectColorPicker->GetId(), false); wxImage bmpRound (MyApp::iconsPath+ wxT("draw_round.png"), wxBITMAP_TYPE_PNG); wxImage bmp3d (MyApp::iconsPath+ wxT("draw3D.png"), wxBITMAP_TYPE_PNG); m_toggleDrawRound = this->AddCheckTool( wxID_ANY, wxT( "Round Shape" ), bmpRound, wxNullBitmap, wxT("Round Shape")); EnableTool(m_toggleDrawRound->GetId(), false); m_toggleDraw3d = this->AddCheckTool( wxID_ANY, wxT( "Draw in 3d" ), bmp3d, wxNullBitmap, wxT("Draw in 3d")); EnableTool(m_toggleDraw3d->GetId(), false); this->AddSeparator(); wxImage bmpPen (MyApp::iconsPath+ wxT("draw_pen.png"), wxBITMAP_TYPE_PNG); wxImage bmpEraser (MyApp::iconsPath+ wxT("draw_eraser.png"), wxBITMAP_TYPE_PNG); m_selectPen = this->AddRadioTool( wxID_ANY, wxT("Use Pen" ), bmpPen, wxNullBitmap, wxT("Use Pen")); EnableTool(m_selectPen->GetId(), false); m_selectEraser = this->AddRadioTool( wxID_ANY, wxT("Use Eraser" ), bmpEraser, wxNullBitmap, wxT("Use Eraser")); EnableTool(m_selectEraser->GetId(), false); }