diff --git a/GUI/SW1/SRC/BUNDLEBLDR.cpp b/GUI/SW1/SRC/BUNDLEBLDR.cpp index dfcbf28..d2950dd 100644 --- a/GUI/SW1/SRC/BUNDLEBLDR.cpp +++ b/GUI/SW1/SRC/BUNDLEBLDR.cpp @@ -173,7 +173,7 @@ BUNDLEBLDR::BUNDLEBLDR(wxWindow* parent,wxWindowID id,const wxPoint& pos,const w Panel4 = new wxPanel(Notebook1, ID_PANEL4, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL4")); FlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0); FlexGridSizer4->AddGrowableCol(1); - CheckBox1 = new wxCheckBox(Panel4, ID_CHECKBOX1, _("Use Ground Plane"), wxDefaultPosition, wxSize(154,13), 0, wxDefaultValidator, _T("ID_CHECKBOX1")); + CheckBox1 = new wxCheckBox(Panel4, ID_CHECKBOX1, _("Use Ground Plane"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1")); CheckBox1->SetValue(false); FlexGridSizer4->Add(CheckBox1, 1, wxALL|wxALIGN_LEFT, 5); StaticText2 = new wxStaticText(Panel4, ID_STATICTEXT2, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2")); @@ -183,7 +183,7 @@ BUNDLEBLDR::BUNDLEBLDR(wxWindow* parent,wxWindowID id,const wxPoint& pos,const w FlexGridSizer4->SetSizeHints(Panel4); Panel5 = new wxPanel(Notebook1, ID_PANEL5, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL5")); FlexGridSizer5 = new wxFlexGridSizer(0, 2, 0, 0); - CheckBox2 = new wxCheckBox(Panel5, ID_CHECKBOX2, _("Use Laplace"), wxDefaultPosition, wxSize(95,24), 0, wxDefaultValidator, _T("ID_CHECKBOX2")); + CheckBox2 = new wxCheckBox(Panel5, ID_CHECKBOX2, _("Use Laplace"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX2")); CheckBox2->SetValue(false); FlexGridSizer5->Add(CheckBox2, 1, wxALL, 5); ComboBox1 = new wxComboBox(Panel5, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX1")); @@ -287,6 +287,7 @@ BUNDLEBLDR::BUNDLEBLDR(wxWindow* parent,wxWindowID id,const wxPoint& pos,const w TextCtrl8 = new wxTextCtrl(this, ID_TEXTCTRL8, _("0.030"), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_TEXTCTRL8")); BoxSizer4->Add(TextCtrl8, 4, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SpinButton1 = new wxSpinButton(this, ID_SPINBUTTON1, wxDefaultPosition, wxDefaultSize, wxSP_VERTICAL|wxSP_ARROW_KEYS, _T("ID_SPINBUTTON1")); + SpinButton1->SetValue(50); SpinButton1->SetRange(0, 100); BoxSizer4->Add(SpinButton1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); StaticBoxSizer1->Add(BoxSizer4, 1, wxALL|wxALIGN_RIGHT, 5); @@ -335,24 +336,16 @@ void BUNDLEBLDR::OnListboxRDown(wxMouseEvent& event) strMessage = "Are you sure you wish to delete: "; strMessage = strMessage << strItem; - // We have an item in the list to delete - shall we confirm? + // Confirm cable component deletion? wxMessageDialog bb_ConfirmDelete (this, strMessage, _("Please confirm delete") ,wxYES_NO|wxCENTRE,wxDefaultPosition ); bb_ConfirmDelete.ShowModal(); - //int RetVal = bb_ConfirmDelete.GetReturnCode(); - - //if ( RetVal == wxID_YES ) - //{ - // Delete the item 'item' from the linked list - removeElement(item); - PopulateListControl(); - // And repopulate the listbox (clear it first!) - - //} - + removeElement(item); + PopulateListControl(); } else + wxMessageBox(_T("No Cable SELECTED"),_("Remove Cable Component")); event.Skip(); @@ -380,9 +373,8 @@ void BUNDLEBLDR::removeElement(int ItemIndex) Bundle *Current = bundle_root; Bundle *Previous = Current; - //Bundle *Next = bundle_root->next; - // Otherwise we look through the list for the item + // Look through the list for the item int i = 0; while( (Current!= NULL) && (i < ItemIndex) ) { @@ -464,8 +456,6 @@ void BUNDLEBLDR::OnTreeSelectionChanged(wxTreeEvent& evt) }; - winPLACE_CABLE->Destroy(); - ListBox1->Append(File_FullName); Button1->Enable(); @@ -495,14 +485,6 @@ void BUNDLEBLDR::OnCheckListBox1Toggled(wxCommandEvent& event) void BUNDLEBLDR::OnPanel1Paint(wxPaintEvent& event) { -// double maxDimension; -// -// wxString maxXY = TextCtrl8->GetValue(); -// -// maxXY.ToDouble(&maxDimension); -// -// FormatPanel(maxDimension); - DrawPanel(); } @@ -1466,7 +1448,7 @@ void BUNDLEBLDR::OnButton2Click(wxCommandEvent& event) RUN_STATUS *run_status_bundle = new RUN_STATUS(this); run_status_bundle->ShowModal(); - //Button1->Enable(); + Button1->Enable(); if (CheckBox2->GetValue()) { @@ -1496,13 +1478,12 @@ void BUNDLEBLDR::OnButton2Click(wxCommandEvent& event) file = wxFindNextFile(); } CheckBox3->Enable(); - } } void BUNDLEBLDR::OnButton3Click(wxCommandEvent& event) { - PopulateTheDirectoryTree(PathToMOD); + //PopulateTheDirectoryTree(PathToMOD); //clean up directory clean_temp_files(); Close(); diff --git a/GUI/SW1/SRC/LOGGER.cpp b/GUI/SW1/SRC/LOGGER.cpp index ffb8395..abb4511 100644 --- a/GUI/SW1/SRC/LOGGER.cpp +++ b/GUI/SW1/SRC/LOGGER.cpp @@ -70,5 +70,5 @@ void Logger::logHelper(const std::string& inMessage, const std::string& inLogLev strftime (tCurrentTime,80,"%X",tTimeNow); mOutputStream << tCurrentTime <<"\t"; - mOutputStream << inLogLevel << ": \t" << inMessage << endl; + mOutputStream << inLogLevel << ": \t" << inMessage << endl; } diff --git a/GUI/SW1/SRC/PLACE_CABLE.cpp b/GUI/SW1/SRC/PLACE_CABLE.cpp index 7a5372a..dadb859 100644 --- a/GUI/SW1/SRC/PLACE_CABLE.cpp +++ b/GUI/SW1/SRC/PLACE_CABLE.cpp @@ -93,8 +93,8 @@ PLACE_CABLE::PLACE_CABLE(wxWindow* parent,wxWindowID id,const wxPoint& pos,const StaticBoxSizer1->SetSizeHints(this); Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PLACE_CABLE::OnTextCtrl1Text); - Connect(ID_TEXTCTRL2,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PLACE_CABLE::OnTextCtrl2Text); - Connect(ID_TEXTCTRL3,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PLACE_CABLE::OnTextCtrl3Text); + Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PLACE_CABLE::OnTextCtrl2Text); + Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&PLACE_CABLE::OnTextCtrl3Text); Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PLACE_CABLE::OnButton1Click); Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&PLACE_CABLE::OnButton2Click); //*) diff --git a/GUI/SW1/SRC/SPICEMODEL.cpp b/GUI/SW1/SRC/SPICEMODEL.cpp index 36f73d1..1d89cff 100644 --- a/GUI/SW1/SRC/SPICEMODEL.cpp +++ b/GUI/SW1/SRC/SPICEMODEL.cpp @@ -622,3 +622,4 @@ void SPICEMODEL::OnNotebook1PageChanged1(wxNotebookEvent& event) void SPICEMODEL::OnTextCtrl13Text1(wxCommandEvent& event) { } + diff --git a/GUI/SW1/SRC/SPICEMODEL.h b/GUI/SW1/SRC/SPICEMODEL.h index f153fcd..06bca83 100644 --- a/GUI/SW1/SRC/SPICEMODEL.h +++ b/GUI/SW1/SRC/SPICEMODEL.h @@ -219,6 +219,7 @@ class SPICEMODEL: public wxDialog void OnNotebook1PageChanged1(wxNotebookEvent& event); void OnTextCtrl13Text1(wxCommandEvent& event); void OnInit(wxInitDialogEvent& event); + void OnNotebook1PageChanged2(wxNotebookEvent& event); //*) void PopulateTheDirectoryTree ( wxString); diff --git a/GUI/SW1/SRC/SW1_GUIApp.cpp b/GUI/SW1/SRC/SW1_GUIApp.cpp index 106e03d..6d70532 100644 --- a/GUI/SW1/SRC/SW1_GUIApp.cpp +++ b/GUI/SW1/SRC/SW1_GUIApp.cpp @@ -64,7 +64,6 @@ bool SW1_GUIApp::OnInit() string updatemessage; - Logger::instance().log(Date, Logger::kLogLevelHeader); Logger::instance().log("", Logger::kLogLevelHeader); Logger::instance().log("SACAMOS STARTED", Logger::kLogLevelHeader); @@ -98,8 +97,49 @@ bool SW1_GUIApp::OnInit() BuildFile.Close(); + wxString os_version = wxGetOsDescription(); + + wxStringTokenizer tokenizer(os_version, " "); + + wxString os_type = tokenizer.GetNextToken(); + + //(*AppInitialize + bool wxsOK = true; + wxInitAllImageHandlers(); + + + if ( wxsOK ) + { + SW1_GUIFrame* Frame = new SW1_GUIFrame(0); + + // Display splash screen + + if (splashimage.LoadFile("resources/Sacamos_About.png", wxBITMAP_TYPE_PNG)) + { + wxSplashScreen *splashscrn = new wxSplashScreen(splashimage, + wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, + 2000, Frame, wxID_ANY, wxDefaultPosition, wxDefaultSize, + wxSIMPLE_BORDER|wxSTAY_ON_TOP); + } + + if (os_type=="Windows") + { + wxYield(); + wxSleep(2); + Frame->Show(true); + } + else + { + Frame->Show(true); + wxYield(); + wxSleep(2); + } + + } + //*) + // Compare current version against latest release version - Logger::instance().log("Checking for Software Update...", Logger::kLogLevelHeader); + Logger::instance().log("Checking for Software Update...", Logger::kLogLevelInfo); wxHTTP checkupdate; @@ -129,7 +169,7 @@ bool SW1_GUIApp::OnInit() else { //fail silently & log event - Logger::instance().log("Could not connect to SACAMOS Repository", Logger::kLogLevelError); + Logger::instance().log("Could not connect to SACAMOS Repository", Logger::kLogLevelInfo); } checkupdate.Close(); @@ -161,37 +201,11 @@ bool SW1_GUIApp::OnInit() wxString myString(updatemessage); wxMessageBox(updatemessage,"Please Update"); + Logger::instance().log("SACAMOS Update Available", Logger::kLogLevelInfo); + } } - // Display splash screen -// wxBitmap splashimage; -// -// wxImage::AddHandler(new wxPNGHandler); -// -// splashimage.LoadFile(_T("resources/Sacamos_About.png"), wxBITMAP_TYPE_PNG); -// -// wxSplashScreen *splashscrn = new wxSplashScreen(splashimage, -// wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT, -// 0, NULL, -1, wxDefaultPosition, wxDefaultSize, -// wxSIMPLE_BORDER|wxSTAY_ON_TOP); -// -// wxYield(); -// wxSleep(2); -// splashscrn->Destroy(); - - //(*AppInitialize - bool wxsOK = true; - wxInitAllImageHandlers(); - - - if ( wxsOK ) - { - SW1_GUIFrame* Frame = new SW1_GUIFrame(0); - Frame->Show(); - SetTopWindow(Frame); - } - //*) return wxsOK; diff --git a/GUI/SW1/SRC/SW1_GUIApp.h b/GUI/SW1/SRC/SW1_GUIApp.h index b530c15..29065ae 100644 --- a/GUI/SW1/SRC/SW1_GUIApp.h +++ b/GUI/SW1/SRC/SW1_GUIApp.h @@ -65,10 +65,11 @@ class SW1_GUIApp : public wxApp public: virtual bool OnInit(); - std::string SACAMOS_V_NUMBER = "SPICE_CABLE_MODEL_BUILDER_version=\"v2.1.0\""; + wxBitmap splashimage; + + std::string SACAMOS_V_NUMBER = "SPICE_CABLE_MODEL_BUILDER_version=\"v3.1.0\""; std::string SACAMOS_V_DATE = "SPICE_CABLE_MODEL_BUILDER_date=\"16th April 2018\""; - //SPICE_CABLE_MODEL_BUILDER_date="16th April 2018" }; #endif // SW1_GUIAPP_H diff --git a/GUI/SW1/SRC/SW1_GUIMain.cpp b/GUI/SW1/SRC/SW1_GUIMain.cpp index 8b427e4..0b61a22 100644 --- a/GUI/SW1/SRC/SW1_GUIMain.cpp +++ b/GUI/SW1/SRC/SW1_GUIMain.cpp @@ -332,22 +332,22 @@ void SW1_GUIFrame::OnCreateMOD(wxCommandEvent& event) folder = PathToMOD + separator + "CABLE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, wxS_DIR_DEFAULT); folder = PathToMOD + separator +"BUNDLE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, wxS_DIR_DEFAULT); folder = PathToMOD + separator +"SPICE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, wxS_DIR_DEFAULT); folder = PathToMOD + separator +"SPICE" + separator + "SYMBOL"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, wxS_DIR_DEFAULT); wxMenuBar* MenuBar1 = GetMenuBar(); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Cable Model")),true); diff --git a/GUI/SW1/SRC/resources/Sacamos_About.png b/GUI/SW1/SRC/resources/Sacamos_About.png index 3a57294..d3501b1 100644 Binary files a/GUI/SW1/SRC/resources/Sacamos_About.png and b/GUI/SW1/SRC/resources/Sacamos_About.png differ -- libgit2 0.21.2