From 2a0d305e838c2fd15874efeae89359f544adb1f9 Mon Sep 17 00:00:00 2001 From: steve.greedy Date: Fri, 10 Aug 2018 09:04:08 +0100 Subject: [PATCH] Modifications to file path structure --- GUI/SW1/SRC/ABOUT.cpp | 24 ++++++++++++++---------- GUI/SW1/SRC/ABOUT.h | 5 ++++- GUI/SW1/SRC/BUNDLEBLDR.cpp | 28 +++++++++++++++++++++++++--- GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp | 3 +++ GUI/SW1/SRC/COAXIAL.cpp | 41 ++++++++++++++++++----------------------- GUI/SW1/SRC/COAXIAL.h | 7 ++++++- GUI/SW1/SRC/CYLINDRICAL.cpp | 99 ++++++++++++++++++--------------------------------------------------------------------------------- GUI/SW1/SRC/CYLINDRICAL.h | 3 ++- GUI/SW1/SRC/DCONN.cpp | 40 +++++++++++++++++----------------------- GUI/SW1/SRC/DCONN.h | 37 ++++++------------------------------- GUI/SW1/SRC/EXPORT_SPICE.cpp | 4 ++-- GUI/SW1/SRC/FLEXCABLE.cpp | 82 +++++++++++++++++++++------------------------------------------------------------- GUI/SW1/SRC/FLEXCABLE.h | 1 + GUI/SW1/SRC/OVERSHIELD.cpp | 39 +++++++++++++++++++++++++++++---------- GUI/SW1/SRC/OVERSHIELD.h | 37 ++++++------------------------------- GUI/SW1/SRC/SPACEWIRE.cpp | 37 ++++++++++++++++++------------------- GUI/SW1/SRC/SPACEWIRE.h | 3 ++- GUI/SW1/SRC/SPICEMODEL.cpp | 9 +++++++-- GUI/SW1/SRC/SPICEMODEL.h | 1 + GUI/SW1/SRC/SW1_GUI.depend | 631 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------- GUI/SW1/SRC/SW1_GUI.layout | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ GUI/SW1/SRC/SW1_GUIMain.cpp | 307 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------- GUI/SW1/SRC/SW1_GUIMain.h | 9 ++++++--- GUI/SW1/SRC/TP.cpp | 46 +++++++++++++++++++--------------------------- GUI/SW1/SRC/TP.h | 3 ++- GUI/SW1/SRC/TWINAX.cpp | 30 ++++++++++++++++++------------ GUI/SW1/SRC/TWINAX.h | 3 ++- GUI/SW1/SRC/UTP.cpp | 102 +++++++++++++++++++----------------------------------------------------------------------------------- GUI/SW1/SRC/UTP.h | 3 ++- 29 files changed, 1191 insertions(+), 565 deletions(-) diff --git a/GUI/SW1/SRC/ABOUT.cpp b/GUI/SW1/SRC/ABOUT.cpp index 22ae81b..7fcc166 100644 --- a/GUI/SW1/SRC/ABOUT.cpp +++ b/GUI/SW1/SRC/ABOUT.cpp @@ -45,16 +45,15 @@ #include //(*InternalHeaders(ABOUT) -#include #include -#include #include //*) //(*IdInit(ABOUT) const long ABOUT::ID_STATICBITMAP1 = wxNewId(); -const long ABOUT::ID_TEXTCTRL2 = wxNewId(); +const long ABOUT::ID_PANEL1 = wxNewId(); const long ABOUT::ID_TEXTCTRL1 = wxNewId(); +const long ABOUT::ID_TEXTCTRL2 = wxNewId(); //*) BEGIN_EVENT_TABLE(ABOUT,wxDialog) @@ -73,25 +72,30 @@ ABOUT::ABOUT(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& siz Create(parent, wxID_ANY, _("ABOUT SACAMOS"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY")); FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0); BoxSizer1 = new wxBoxSizer(wxVERTICAL); - StaticBitmap1 = new wxStaticBitmap(this, ID_STATICBITMAP1, wxBitmap(wxImage(_T("resources//Sacamos_About.png"))), wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1")); - BoxSizer1->Add(StaticBitmap1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("BUILD")); - TextCtrl2 = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_AUTO_URL, wxDefaultValidator, _T("ID_TEXTCTRL2")); - StaticBoxSizer1->Add(TextCtrl2, 1, wxALL|wxEXPAND, 5); - BoxSizer1->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND, 5); + Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxSize(400,137), wxTAB_TRAVERSAL, _T("ID_PANEL1")); + StaticBitmap1 = new wxStaticBitmap(Panel1, ID_STATICBITMAP1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER, _T("ID_STATICBITMAP1")); + BoxSizer1->Add(Panel1, 1, wxALL|wxEXPAND, 5); StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("LICENSE")); TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_AUTO_URL|wxTE_WORDWRAP, wxDefaultValidator, _T("ID_TEXTCTRL1")); StaticBoxSizer2->Add(TextCtrl1, 1, wxALL|wxEXPAND, 5); BoxSizer1->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND, 5); + StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("BUILD")); + TextCtrl2 = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_AUTO_URL, wxDefaultValidator, _T("ID_TEXTCTRL2")); + StaticBoxSizer1->Add(TextCtrl2, 1, wxALL|wxEXPAND, 5); + BoxSizer1->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND, 5); FlexGridSizer1->Add(BoxSizer1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); SetSizer(FlexGridSizer1); FlexGridSizer1->Fit(this); FlexGridSizer1->SetSizeHints(this); - Connect(ID_TEXTCTRL2,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&ABOUT::OnTextCtrl2Text); Connect(ID_TEXTCTRL1,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&ABOUT::OnTextCtrl1Text); + Connect(ID_TEXTCTRL2,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&ABOUT::OnTextCtrl2Text); Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&ABOUT::OnInit); //*) + + StaticBitmap1->SetBitmap(wxBitmap(wxImage(_T("resources/Sacamos_About.png")))); + + } ABOUT::~ABOUT() diff --git a/GUI/SW1/SRC/ABOUT.h b/GUI/SW1/SRC/ABOUT.h index 6abba8b..2f4394e 100644 --- a/GUI/SW1/SRC/ABOUT.h +++ b/GUI/SW1/SRC/ABOUT.h @@ -44,6 +44,7 @@ //(*Headers(ABOUT) #include #include +#include #include #include //*) @@ -57,6 +58,7 @@ class ABOUT: public wxDialog //(*Declarations(ABOUT) wxStaticBitmap* StaticBitmap1; + wxPanel* Panel1; wxTextCtrl* TextCtrl2; wxTextCtrl* TextCtrl1; //*) @@ -68,8 +70,9 @@ class ABOUT: public wxDialog //(*Identifiers(ABOUT) static const long ID_STATICBITMAP1; - static const long ID_TEXTCTRL2; + static const long ID_PANEL1; static const long ID_TEXTCTRL1; + static const long ID_TEXTCTRL2; //*) private: diff --git a/GUI/SW1/SRC/BUNDLEBLDR.cpp b/GUI/SW1/SRC/BUNDLEBLDR.cpp index 1aa35cf..a0c503e 100644 --- a/GUI/SW1/SRC/BUNDLEBLDR.cpp +++ b/GUI/SW1/SRC/BUNDLEBLDR.cpp @@ -1433,9 +1433,21 @@ void BUNDLEBLDR::WriteBundleFile(wxString fileName) if (cableFile.is_open()) { cableFile << "#MOD_cable_lib_dir" << "\n"; - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; + + #ifdef UNIX + cableFile <GetCount() << " #Number of cables in bundle, cable list follows\n"; bundle_list = bundle_root; @@ -1526,11 +1538,21 @@ void BUNDLEBLDR::OnButton2Click(wxCommandEvent& event) WriteBundleFile (TextCtrl1->GetValue()); + //std::stringstream stream; + + #ifdef UNIX + std::stringstream stream; + stream << "./cable_bundle_model_builder" + << " " + << MODname + "/BUNDLE/" + << fileName ; + #else std::stringstream stream; stream << "\"..\\BIN\\cable_bundle_model_builder.exe\"" << " " - << "..\\" + MODname + "\\BUNDLE\\" + << "..\\" + MODname + "\\CABLE\\" << fileName ; + #endif system(stream.str().c_str()); diff --git a/GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp b/GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp index 797e212..14aa0d7 100644 --- a/GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp +++ b/GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp @@ -116,6 +116,9 @@ void draw_bundle(wxPanel *Panel, wxString Path, wxString bundle_to_draw) bundleFile >> xCoord; bundleFile >> yCoord; + + yCoord = -1.0 * yCoord; + std::getline(bundleFile, bundle_str); //Read to end of line std::ifstream cableFile; diff --git a/GUI/SW1/SRC/COAXIAL.cpp b/GUI/SW1/SRC/COAXIAL.cpp index 4a47e2f..b72e795 100644 --- a/GUI/SW1/SRC/COAXIAL.cpp +++ b/GUI/SW1/SRC/COAXIAL.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -307,9 +307,19 @@ COAXIAL::COAXIAL(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& Connect(ID_coaxCLOSE,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&COAXIAL::OncoaxCLOSEClick); Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&COAXIAL::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&COAXIAL::OnPanel1LeftDClick,0,this); - //Connect(wxEVT_PAINT,(wxObjectEventFunction)&COAXIAL::OnPaint); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&COAXIAL::OnInit); + Connect(wxEVT_PAINT,(wxObjectEventFunction)&COAXIAL::OnPaint); //*) +} +COAXIAL::~COAXIAL() +{ + //(*Destroy(COAXIAL) + //*) +} + +void COAXIAL::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&COAXIAL::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&COAXIAL::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&COAXIAL::OnHighlightSchematic, this); @@ -321,19 +331,10 @@ COAXIAL::COAXIAL(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&COAXIAL::OnHighlightSchematic, this); } -COAXIAL::~COAXIAL() -{ - //(*Destroy(COAXIAL) - //*) -} - -/* void COAXIAL::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); } -*/ - void COAXIAL::SetPathToMOD(wxString Path, wxString Name) { @@ -355,7 +356,6 @@ void COAXIAL::OnButton1Click(wxCommandEvent& event) return; } - check_is_empty(TextCtrl4, &IsError); check_is_empty(TextCtrl5, &IsError); check_is_empty(TextCtrl6, &IsError); @@ -393,18 +393,18 @@ void COAXIAL::OnButton1Click(wxCommandEvent& event) void COAXIAL::OnButton2Click(wxCommandEvent& event) { wxString fileName = TextCtrl1->GetValue(); - wxString fullFileName; - - fullFileName = pathToMOD + "\\CABLE\\" + fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -560,7 +560,7 @@ void COAXIAL::WriteCableFile(wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -890,12 +890,7 @@ void COAXIAL::OnCheckBox2Click(wxCommandEvent& event) } } -/* void COAXIAL::EditExistingCable() { Close(); } -*/ - - - diff --git a/GUI/SW1/SRC/COAXIAL.h b/GUI/SW1/SRC/COAXIAL.h index 4025568..91a9bf1 100644 --- a/GUI/SW1/SRC/COAXIAL.h +++ b/GUI/SW1/SRC/COAXIAL.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -106,6 +106,9 @@ class COAXIAL: public wxDialog void WriteCableFile(wxString); + void EditExistingCable(); + bool EDIT_EXISTING; + void paintNow(); void render(wxDC& dc); void coaxialSchematic(); @@ -275,6 +278,8 @@ class COAXIAL: public wxDialog void OnCheckBox2Click(wxCommandEvent& event); void OnTextCtrl15Text(wxCommandEvent& event); void OnTextCtrl16Text(wxCommandEvent& event); + void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/CYLINDRICAL.cpp b/GUI/SW1/SRC/CYLINDRICAL.cpp index b1c9a81..0ff3a02 100644 --- a/GUI/SW1/SRC/CYLINDRICAL.cpp +++ b/GUI/SW1/SRC/CYLINDRICAL.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -165,16 +165,9 @@ CYLINDRICAL::CYLINDRICAL(wxWindow* parent,wxWindowID id,const wxPoint& pos,const Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&CYLINDRICAL::OnButton3Click); Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&CYLINDRICAL::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&CYLINDRICAL::OnPanel1LeftDClick,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&CYLINDRICAL::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&CYLINDRICAL::OnPaint); //*) - - TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); - TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); - TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); - TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); - CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); - - } CYLINDRICAL::~CYLINDRICAL() @@ -184,6 +177,15 @@ CYLINDRICAL::~CYLINDRICAL() } +void CYLINDRICAL::OnInit(wxInitDialogEvent& event) +{ + TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); + TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); + TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); + TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); + CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&CYLINDRICAL::OnHighlightSchematic, this); +} + void CYLINDRICAL::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); @@ -216,15 +218,7 @@ void CYLINDRICAL::OnButton1Click(wxCommandEvent& event) check_is_empty(TextCtrl3, &IsError); check_is_empty(TextCtrl4, &IsError); - if (CheckBox1->GetValue()){ -// check_is_empty(TextCtrl6, &IsError); -// check_is_empty(TextCtrl7, &IsError); -// check_is_empty(TextCtrl8, &IsError); -// check_is_empty(TextCtrl9, &IsError); -// check_is_empty(TextCtrl10, &IsError); - } - else - { + if (!CheckBox1->GetValue()){ check_is_empty(TextCtrl5, &IsError); } @@ -242,24 +236,24 @@ void CYLINDRICAL::OnButton2Click(wxCommandEvent& event) { wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - //<< "..\\MOD\\CABLE\\" // relative path to MOD + command_line << stream.str().c_str(); - system(stream.str().c_str()); + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); run_status->ShowModal(); Button1->Enable(); - } void CYLINDRICAL::OnButton3Click(wxCommandEvent& event) @@ -305,37 +299,6 @@ void CYLINDRICAL::OnTextCtrl5Text(wxCommandEvent& event) check_is_positive (TextCtrl5, &IsError); } -//void CYLINDRICAL::OnTextCtrl6Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl6, &IsError); -// check_is_positive (TextCtrl6, &IsError); -//} -// -//void CYLINDRICAL::OnTextCtrl7Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl7, &IsError); -//} -// -//void CYLINDRICAL::OnTextCtrl8Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl8, &IsError); -//} -// -//void CYLINDRICAL::OnTextCtrl9Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl9, &IsError); -//} -// -//void CYLINDRICAL::OnTextCtrl10Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl10, &IsError); -//} - void CYLINDRICAL::OnCheckBox1Click(wxCommandEvent& event) { if (CheckBox1->GetValue()) @@ -357,24 +320,6 @@ void CYLINDRICAL::OnCheckBox1Click(wxCommandEvent& event) } winFD_ESR->Destroy(); } -// if (CheckBox1->GetValue()) -// { -// TextCtrl5->Disable(); -// TextCtrl6->Enable(); -// TextCtrl7->Enable(); -// TextCtrl8->Enable(); -// TextCtrl9->Enable(); -// TextCtrl10->Enable(); -// } -// else -// { -// TextCtrl5->Enable(); -// TextCtrl6->Disable(); -// TextCtrl7->Disable(); -// TextCtrl8->Disable(); -// TextCtrl9->Disable(); -// TextCtrl10->Disable(); -// } } void CYLINDRICAL::WriteCableFile (wxString fileName) @@ -382,7 +327,7 @@ void CYLINDRICAL::WriteCableFile (wxString fileName) ofstream cableFile; - wxString fullFileName = pathToMOD + "\\CABLE\\" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -400,12 +345,6 @@ void CYLINDRICAL::WriteCableFile (wxString fileName) cableFile <<"1 \t\t\t# number of frequency dependent parameters\n"; if (CheckBox1->GetValue()){ -// cableFile << "# Dielectric relative permittivity model follows\n"; -// cableFile << TextCtrl6->GetValue() <<" # w normalisation constant\n"; -// cableFile << TextCtrl7->GetValue() <<" # a order, a coefficients follow below\n"; -// cableFile << TextCtrl8->GetValue() <<" \n"; -// cableFile << TextCtrl9->GetValue() <<" # b order, b coefficients follow below\n"; -// cableFile << TextCtrl10->GetValue() <<" \n"; cableFile << "# Dielectric relative permittivity model follows\n"; cableFile << FD_ESR6 <<"\t # w normalisation constant\n"; cableFile << FD_ESR7 <<"\t # a order, a coefficients follow below\n"; @@ -549,5 +488,3 @@ void CYLINDRICAL::EditExistingCable() { Close(); } - - diff --git a/GUI/SW1/SRC/CYLINDRICAL.h b/GUI/SW1/SRC/CYLINDRICAL.h index b11e0d5..35524ee 100644 --- a/GUI/SW1/SRC/CYLINDRICAL.h +++ b/GUI/SW1/SRC/CYLINDRICAL.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -171,6 +171,7 @@ class CYLINDRICAL: public wxDialog void OnTextCtrl1Text(wxCommandEvent& event); void OnPanel1LeftDClick(wxMouseEvent& event); void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/DCONN.cpp b/GUI/SW1/SRC/DCONN.cpp index fb1234b..b09502f 100644 --- a/GUI/SW1/SRC/DCONN.cpp +++ b/GUI/SW1/SRC/DCONN.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -164,22 +164,11 @@ DCONN::DCONN(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& siz Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DCONN::OnButton1Click); Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DCONN::OnButton2Click); Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DCONN::OnButton3Click); -/* Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&DCONN::OnPanel1Paint,0,this); -*/ Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&DCONN::OnPanel1LeftDClick,0,this); - -/* + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&DCONN::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&DCONN::OnPaint); -*/ - //*) - - TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); - TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); - TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); - TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); - } DCONN::~DCONN() @@ -189,14 +178,20 @@ DCONN::~DCONN() } -/* +void DCONN::OnInit(wxInitDialogEvent& event) +{ + TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); + TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); + TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); + TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&DCONN::OnHighlightSchematic, this); +} + + void DCONN::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); } -*/ - void DCONN::SetPathToMOD(wxString Path, wxString Name) { @@ -246,15 +241,17 @@ void DCONN::OnButton2Click(wxCommandEvent& event) //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line);; // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -330,7 +327,7 @@ void DCONN::WriteCableFile(wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -595,10 +592,7 @@ void DCONN::OnCheckBox2Click(wxCommandEvent& event) WriteCableFile (TextCtrl1->GetValue()); } -/* void DCONN::EditExistingCable() { Close(); } - -*/ diff --git a/GUI/SW1/SRC/DCONN.h b/GUI/SW1/SRC/DCONN.h index 3b44a70..bc811b3 100644 --- a/GUI/SW1/SRC/DCONN.h +++ b/GUI/SW1/SRC/DCONN.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -72,32 +72,6 @@ using namespace std; #define PI 3.141592653589793 -class dconnSchematicPane : public wxPanel -{ - -public: - dconnSchematicPane(wxFrame* parent); - - void paintEvent(wxPaintEvent & evt); - void paintNow(); - - void render(wxDC& dc); - - // some useful events - /* - void mouseMoved(wxMouseEvent& event); - void mouseDown(wxMouseEvent& event); - void mouseWheelMoved(wxMouseEvent& event); - void mouseReleased(wxMouseEvent& event); - void rightClick(wxMouseEvent& event); - void mouseLeftWindow(wxMouseEvent& event); - void keyPressed(wxKeyEvent& event); - void keyReleased(wxKeyEvent& event); - */ - - DECLARE_EVENT_TABLE() -}; - class DCONN: public wxDialog { public: @@ -111,13 +85,12 @@ class DCONN: public wxDialog void WriteCableFile(wxString); - void paintNow(); - void render(wxDC& dc); + void EditExistingCable(); + bool EDIT_EXISTING; + void dconnSchematic(); void OnHighlightSchematic(wxCommandEvent & event); - dconnSchematicPane *drawPane; - wxString MESH_PARAM1; wxString MESH_PARAM2; @@ -183,6 +156,8 @@ class DCONN: public wxDialog void OnPanel1LeftDClick(wxMouseEvent& event); void OnComboBox1Selected(wxCommandEvent& event); void OnCheckBox2Click(wxCommandEvent& event); + void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/EXPORT_SPICE.cpp b/GUI/SW1/SRC/EXPORT_SPICE.cpp index baf92da..2f03d4c 100644 --- a/GUI/SW1/SRC/EXPORT_SPICE.cpp +++ b/GUI/SW1/SRC/EXPORT_SPICE.cpp @@ -172,9 +172,9 @@ void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) size_t i; for (i = 0; i Connect(wxEVT_PAINT,(wxObjectEventFunction)&FLEXCABLE::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&FLEXCABLE::OnPanel1LeftDClick,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&FLEXCABLE::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&FLEXCABLE::OnPaint); //*) - - TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); - TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); - TextCtrl12->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); - TextCtrl14->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); - CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); - Grid1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); } @@ -236,6 +230,17 @@ FLEXCABLE::~FLEXCABLE() //*) } + +void FLEXCABLE::OnInit(wxInitDialogEvent& event) +{ + TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); + TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); + TextCtrl12->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); + TextCtrl14->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); + CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); + Grid1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&FLEXCABLE::OnHighlightSchematic, this); +} + void FLEXCABLE::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); @@ -266,16 +271,7 @@ void FLEXCABLE::OnButton1Click(wxCommandEvent& event) check_is_empty(TextCtrl13, &IsError); check_is_empty(TextCtrl14, &IsError); - if (CheckBox1->GetValue()) - { -// check_is_empty(TextCtrl7, &IsError); -// check_is_empty(TextCtrl8, &IsError); -// check_is_empty(TextCtrl9, &IsError); -// check_is_empty(TextCtrl10, &IsError); -// check_is_empty(TextCtrl11, &IsError); - } - - else + if (!CheckBox1->GetValue()) { check_is_empty(TextCtrl12, &IsError); } @@ -310,28 +306,24 @@ void FLEXCABLE::OnCheckBox1Click(wxCommandEvent& event) } winFD_ESR->Destroy(); - -// TextCtrl7->Enable(); -// TextCtrl8->Enable(); -// TextCtrl9->Enable(); -// TextCtrl10->Enable(); -// TextCtrl11->Enable(); - } void FLEXCABLE::OnButton2Click(wxCommandEvent& event) { //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -400,39 +392,6 @@ void FLEXCABLE::OnTextCtrl12Text(wxCommandEvent& event) check_is_positive(TextCtrl2, &IsError); } -//void FLEXCABLE::OnTextCtrl7Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl7, &IsError); -// check_is_positive(TextCtrl7, &IsError); -//} -// -//void FLEXCABLE::OnTextCtrl8Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl8, &IsError); -// check_is_positive(TextCtrl8, &IsError); -//} -// -//void FLEXCABLE::OnTextCtrl9Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl9, &IsError); -//} -// -//void FLEXCABLE::OnTextCtrl10Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric(TextCtrl10, &IsError); -// check_is_positive(TextCtrl10, &IsError); -//} - -//void FLEXCABLE::OnTextCtrl11Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl11, &IsError); -//} - void FLEXCABLE::OnTextCtrl13Text(wxCommandEvent& event) { int IsError = 0; @@ -458,7 +417,7 @@ void FLEXCABLE::WriteCableFile (wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -936,3 +895,4 @@ void FLEXCABLE::OnCheckBox3Click(wxCommandEvent& event) } WriteCableFile (TextCtrl1->GetValue()); } + diff --git a/GUI/SW1/SRC/FLEXCABLE.h b/GUI/SW1/SRC/FLEXCABLE.h index 7c0be62..dd516fc 100644 --- a/GUI/SW1/SRC/FLEXCABLE.h +++ b/GUI/SW1/SRC/FLEXCABLE.h @@ -198,6 +198,7 @@ class FLEXCABLE: public wxDialog void OnTextCtrl13TextEnter(wxCommandEvent& event); void OnGrid1CellLeftClick(wxGridEvent& event); void OnCheckBox3Click1(wxCommandEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/OVERSHIELD.cpp b/GUI/SW1/SRC/OVERSHIELD.cpp index a85ae21..7db8450 100644 --- a/GUI/SW1/SRC/OVERSHIELD.cpp +++ b/GUI/SW1/SRC/OVERSHIELD.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -175,26 +175,36 @@ OVERSHIELD::OVERSHIELD(wxWindow* parent,wxWindowID id,const wxPoint& pos,const w Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&OVERSHIELD::OnButton3Click); Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&OVERSHIELD::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&OVERSHIELD::OnPanel1LeftDClick,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&OVERSHIELD::OnInit); + Connect(wxEVT_PAINT,(wxObjectEventFunction)&OVERSHIELD::OnPaint); //*) +} +OVERSHIELD::~OVERSHIELD() +{ + //(*Destroy(OVERSHIELD) + //*) +} + + +void OVERSHIELD::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&OVERSHIELD::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&OVERSHIELD::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&OVERSHIELD::OnHighlightSchematic, this); TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&OVERSHIELD::OnHighlightSchematic, this); } -OVERSHIELD::~OVERSHIELD() +void OVERSHIELD::OnPaint(wxPaintEvent& event) { - //(*Destroy(OVERSHIELD) - //*) + if (EDIT_EXISTING==true) EditExistingCable(); } + void OVERSHIELD::SetPathToMOD(wxString Path, wxString Name) { - pathToMOD << Path; MODname << Name; - } void OVERSHIELD::OnButton1Click(wxCommandEvent& event) @@ -241,15 +251,17 @@ void OVERSHIELD::OnButton2Click(wxCommandEvent& event) //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -320,7 +332,7 @@ void OVERSHIELD::WriteCableFile (wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -433,3 +445,10 @@ void OVERSHIELD::OnPanel1LeftDClick(wxMouseEvent& event) { overshieldSchematic(); } + +void OVERSHIELD::EditExistingCable() +{ + Close(); +} + + diff --git a/GUI/SW1/SRC/OVERSHIELD.h b/GUI/SW1/SRC/OVERSHIELD.h index bb69c03..18751ef 100644 --- a/GUI/SW1/SRC/OVERSHIELD.h +++ b/GUI/SW1/SRC/OVERSHIELD.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -67,33 +67,6 @@ using namespace std; - -class overshieldSchematicPane : public wxPanel -{ - -public: - overshieldSchematicPane(wxFrame* parent); - - void paintEvent(wxPaintEvent & evt); - void paintNow(); - - void render(wxDC& dc); - - // some useful events - /* - void mouseMoved(wxMouseEvent& event); - void mouseDown(wxMouseEvent& event); - void mouseWheelMoved(wxMouseEvent& event); - void mouseReleased(wxMouseEvent& event); - void rightClick(wxMouseEvent& event); - void mouseLeftWindow(wxMouseEvent& event); - void keyPressed(wxKeyEvent& event); - void keyReleased(wxKeyEvent& event); - */ - - DECLARE_EVENT_TABLE() -}; - class OVERSHIELD: public wxDialog { public: @@ -108,12 +81,12 @@ class OVERSHIELD: public wxDialog void WriteCableFile(wxString); - void paintNow(); - void render(wxDC& dc); + void EditExistingCable(); + bool EDIT_EXISTING; + void overshieldSchematic(); void OnHighlightSchematic(wxCommandEvent & event); - overshieldSchematicPane *drawPane; //(*Declarations(OVERSHIELD) wxStaticText* StaticText9; @@ -183,6 +156,8 @@ class OVERSHIELD: public wxDialog void OnTextCtrl9Text(wxCommandEvent& event); void OnPanel1Paint(wxPaintEvent& event); void OnPanel1LeftDClick(wxMouseEvent& event); + void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/SPACEWIRE.cpp b/GUI/SW1/SRC/SPACEWIRE.cpp index e8f5501..ee1b8ea 100644 --- a/GUI/SW1/SRC/SPACEWIRE.cpp +++ b/GUI/SW1/SRC/SPACEWIRE.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -358,9 +358,20 @@ SPACEWIRE::SPACEWIRE(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxS Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SPACEWIRE::OnButton1Click); Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SPACEWIRE::OnButton2Click); Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SPACEWIRE::OnButton3Click); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&SPACEWIRE::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&SPACEWIRE::OnPaint); //*) +} +SPACEWIRE::~SPACEWIRE() +{ + //(*Destroy(SPACEWIRE) + //*) +} + + +void SPACEWIRE::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&SPACEWIRE::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&SPACEWIRE::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&SPACEWIRE::OnHighlightSchematic, this); @@ -380,12 +391,6 @@ SPACEWIRE::SPACEWIRE(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxS CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&SPACEWIRE::OnHighlightSchematic, this); } -SPACEWIRE::~SPACEWIRE() -{ - //(*Destroy(SPACEWIRE) - //*) -} - void SPACEWIRE::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); @@ -492,13 +497,6 @@ void SPACEWIRE::OnCheckBox1Click(wxCommandEvent& event) FD_Fmin = winFD_ESR->TextCtrl17->GetValue(); FD_Fmax = winFD_ESR->TextCtrl18->GetValue(); FD_Num = winFD_ESR->TextCtrl19->GetValue(); - - -// FD_ORDER = winFD_ESR->TextCtrl11->GetValue(); -// FD_lin = winFD_ESR->RadioButton1->GetValue(); -// FD_Fmin = winFD_ESR->TextCtrl12->GetValue(); -// FD_Fmax = winFD_ESR->TextCtrl12->GetValue(); -// FD_Num = winFD_ESR->TextCtrl12->GetValue(); } winFD_ESR->Destroy(); } @@ -510,17 +508,17 @@ void SPACEWIRE::OnButton2Click(wxCommandEvent& event) //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); - ifstream runStatus; + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -861,7 +859,7 @@ void SPACEWIRE::WriteCableFile (wxString fileName) ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -1651,3 +1649,4 @@ void SPACEWIRE::EditExistingCable() { Close(); } + diff --git a/GUI/SW1/SRC/SPACEWIRE.h b/GUI/SW1/SRC/SPACEWIRE.h index d36d190..df92288 100644 --- a/GUI/SW1/SRC/SPACEWIRE.h +++ b/GUI/SW1/SRC/SPACEWIRE.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -304,6 +304,7 @@ class SPACEWIRE: public wxDialog void OnCheckBox3Click(wxCommandEvent& event); void OnTextCtrl28Text(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/SPICEMODEL.cpp b/GUI/SW1/SRC/SPICEMODEL.cpp index 47f034b..01f642d 100644 --- a/GUI/SW1/SRC/SPICEMODEL.cpp +++ b/GUI/SW1/SRC/SPICEMODEL.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -284,6 +284,7 @@ SPICEMODEL::SPICEMODEL(wxWindow* parent,wxWindowID id,const wxPoint& pos,const w Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SPICEMODEL::OnButton2Click); Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SPICEMODEL::OnButton3Click); Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&SPICEMODEL::OnPanel1Paint,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&SPICEMODEL::OnInit); //*) } @@ -293,6 +294,10 @@ SPICEMODEL::~SPICEMODEL() //*) } +void SPICEMODEL::OnInit(wxInitDialogEvent& event) +{ +} + void SPICEMODEL::SetPathToMOD(wxString Path, wxString Name) { PathToMOD << Path; @@ -388,7 +393,7 @@ void SPICEMODEL::OnButton2Click(wxCommandEvent& event) //wxString fineName = fileName; std::stringstream stream; - stream << "\"..\\BIN\\spice_cable_bundle_model_builder.exe\"" + stream << "\"..\\BIN\\spice_cable_bundle_model_builder\"" << " " << "..\\" + MODname + "\\SPICE\\" << fileName; diff --git a/GUI/SW1/SRC/SPICEMODEL.h b/GUI/SW1/SRC/SPICEMODEL.h index f286394..a587c28 100644 --- a/GUI/SW1/SRC/SPICEMODEL.h +++ b/GUI/SW1/SRC/SPICEMODEL.h @@ -218,6 +218,7 @@ class SPICEMODEL: public wxDialog void OnNotebook1PageChanged(wxNotebookEvent& event); void OnNotebook1PageChanged1(wxNotebookEvent& event); void OnTextCtrl13Text1(wxCommandEvent& event); + void OnInit(wxInitDialogEvent& event); //*) void PopulateTheDirectoryTree ( wxString); diff --git a/GUI/SW1/SRC/SW1_GUI.depend b/GUI/SW1/SRC/SW1_GUI.depend index 2c326ad..9972a6a 100644 --- a/GUI/SW1/SRC/SW1_GUI.depend +++ b/GUI/SW1/SRC/SW1_GUI.depend @@ -5541,23 +5541,22 @@ -1512938044 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\about.cpp +1533748199 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\about.cpp "ABOUT.h" - - -1502693582 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\about.h +1533746579 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\about.h + -1530399384 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\bundle_schematic.cpp +1530874924 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\bundle_schematic.cpp "BUNDLE_SCHEMATIC.h" 1502693582 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\bundle_schematic.h @@ -5569,7 +5568,7 @@ -1530740294 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\bundlebldr.cpp +1533124608 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\bundlebldr.cpp "BUNDLEBLDR.h" "PLACE_CABLE.h" "MESH_LAPLACE.h" @@ -5666,14 +5665,14 @@ -1530175204 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\coaxial.cpp +1533825182 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\coaxial.cpp "COAXIAL.h" -1514832982 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\coaxial.h +1533825101 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\coaxial.h @@ -5712,13 +5711,13 @@ -1530723822 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\cylindrical.cpp +1533825320 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\cylindrical.cpp "CYLINDRICAL.h" -1530723822 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\cylindrical.h +1533823895 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\cylindrical.h @@ -5735,13 +5734,13 @@ -1530716864 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\dconn.cpp +1533829935 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\dconn.cpp "DCONN.h" -1514918482 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\dconn.h +1533829856 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\dconn.h @@ -5760,7 +5759,7 @@ -1508706938 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\export_spice.cpp +1530874672 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\export_spice.cpp "EXPORT_SPICE.h" @@ -5838,7 +5837,7 @@ "dos.h" -1530740316 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\mesh_laplace.cpp +1530802204 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\mesh_laplace.cpp "MESH_LAPLACE.h" 1530714886 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\mesh_param.cpp @@ -5847,13 +5846,13 @@ -1514917242 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\overshield.cpp +1531159069 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\overshield.cpp "OVERSHIELD.h" -1514918530 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\overshield.h +1533829967 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\overshield.h @@ -5882,13 +5881,13 @@ -1530724588 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spacewire.cpp +1533827895 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spacewire.cpp "SPACEWIRE.h" -1530724620 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spacewire.h +1533827965 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spacewire.h @@ -5909,7 +5908,7 @@ -1509492344 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spicemodel.cpp +1533827776 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spicemodel.cpp "SPICEMODEL.h" @@ -5922,7 +5921,7 @@ -1509486246 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spicemodel.h +1533827724 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\spicemodel.h @@ -5950,7 +5949,7 @@ 1502693570 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\sw1_guiapp.h -1514922396 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.h +1533743085 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.h @@ -5986,7 +5985,7 @@ -1530719970 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\twinax.h +1533827355 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\twinax.h @@ -6008,7 +6007,7 @@ -1530722668 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\utp.h +1533825911 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\utp.h @@ -6030,7 +6029,7 @@ -1530722646 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\tp.h +1533825961 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\tp.h @@ -6052,7 +6051,7 @@ -1530714758 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\flexcable.h +1533827985 c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\flexcable.h @@ -6074,22 +6073,19 @@ -1514923368 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.cpp +1533810128 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.cpp "SW1_GUIMain.h" - - - -1530724216 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\tp.cpp +1533826466 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\tp.cpp "TP.h" -1530721192 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\twinax.cpp +1533827512 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\twinax.cpp "TWINAX.h" @@ -6098,15 +6094,584 @@ 1502693568 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\utilities.cpp "UTILITIES.h" -1530724000 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\utp.cpp +1533825916 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\utp.cpp "UTP.h" -1530797567 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\flexcable.cpp +1533829809 source:c:\users\eezsg\desktop\sacamos_july_2018\02\local_sw1\flexcable.cpp "FLEXCABLE.h" +1512938044 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\about.cpp + "ABOUT.h" + + + + + + + + +1502693582 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\about.h + + + + + +1530874924 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\bundle_schematic.cpp + "BUNDLE_SCHEMATIC.h" + +1502693582 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\bundle_schematic.h + + + + + + + + +1533124608 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\bundlebldr.cpp + "BUNDLEBLDR.h" + "PLACE_CABLE.h" + "MESH_LAPLACE.h" + + + + + + + + + + + +1530739988 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\bundlebldr.h + + + + + + + + + + + + + + + "FileSelectorCtrl.h" + "UTILITIES.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + + + +1502693578 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fileselectorctrl.h + "wx/treectrl.h" + "wx/dialog.h" + "wx/dirdlg.h" + "wx/choice.h" + +1502693568 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\utilities.h + + + + + +1502693576 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\mesh_laplace.h + + + + + + + + + + + +1530714876 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\mesh_param.h + + + + + + "UTILITIES.h" + +1502693574 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\run_status.h + + + + + + + + +1502693576 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\place_cable.h + + + + + + +1530399132 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\cable_schematic.cpp + "CABLE_SCHEMATIC.h" + +1502693580 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\cable_schematic.h + + + + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\coaxial.cpp + "COAXIAL.h" + + + + + +1514832982 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\coaxial.h + + + + + + + + + + + + "UTILITIES.h" + "FD_ESR.h" + "FD_ZT.h" + "RUN_STATUS.h" + + + + +1530719644 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_esr.h + + + + + + + + + "UTILITIES.h" + +1502693578 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_zt.h + + + + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\dconn.cpp + "DCONN.h" + + + + +1514918482 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\dconn.h + + + + + + + + + + + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + "UTILITIES.h" + + + + +1530874672 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\export_spice.cpp + "EXPORT_SPICE.h" + + + +1508706152 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\export_spice.h + + + + + + + + + +1530719662 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_esr.cpp + "FD_ESR.h" + + + + +1530724392 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_esr_sw.cpp + "FD_ESR_SW.h" + "UTILITIES.h" + + + + +1530724366 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_esr_sw.h + + + + + + + + + +1502693578 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fd_zt.cpp + "FD_ZT.h" + + + +1502693578 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\fileselectorctrl.cpp + "wx/wxprec.h" + "wx/generic/dirctrlg.h" + "FileSelectorCtrl.h" + "wx/hash.h" + "wx/intl.h" + "wx/log.h" + "wx/utils.h" + "wx/button.h" + "wx/icon.h" + "wx/settings.h" + "wx/msgdlg.h" + "wx/choice.h" + "wx/textctrl.h" + "wx/layout.h" + "wx/sizer.h" + "wx/textdlg.h" + "wx/gdicmn.h" + "wx/image.h" + "wx/module.h" + "wx/filename.h" + "wx/filefn.h" + "wx/imaglist.h" + "wx/tokenzr.h" + "wx/dir.h" + "wx/artprov.h" + "wx/mimetype.h" + "wx/statline.h" + "wx/osx/private.h" + + "wx/msw/winundef.h" + "wx/volume.h" + + "dos.h" + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\flexcable.cpp + "FLEXCABLE.h" + + + + +1530714758 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\flexcable.h + + + + + + + + + + + + + "UTILITIES.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + "FD_ESR.h" + + + + +1530802204 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\mesh_laplace.cpp + "MESH_LAPLACE.h" + +1530714886 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\mesh_param.cpp + "MESH_PARAM.h" + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\overshield.cpp + "OVERSHIELD.h" + + + + +1514918530 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\overshield.h + + + + + + + + + "MESH_LAPLACE.h" + "UTILITIES.h" + "RUN_STATUS.h" + + + + +1502693576 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\place_cable.cpp + "PLACE_CABLE.h" + + + +1502693574 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\resource.rc + "wx/msw/wx.rc" + +1502693574 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\run_status.cpp + "RUN_STATUS.h" + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\spacewire.cpp + "SPACEWIRE.h" + + + + +1530724620 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\spacewire.h + + + + + + + + + + + + "FD_ESR_SW.h" + "UTILITIES.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\spicemodel.cpp + "SPICEMODEL.h" + + + + + + + + + + + +1509486246 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\spicemodel.h + + + + + + + + + + + + + + + "FileSelectorCtrl.h" + "BUNDLE_SCHEMATIC.h" + "RUN_STATUS.h" + "UTILITIES.h" + +1502693570 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\sw1_guiapp.cpp + "SW1_GUIApp.h" + "SW1_GUIMain.h" + + +1502693570 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\sw1_guiapp.h + + +1514922396 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.h + + + + + + + + + + + + + + + "FileSelectorCtrl.h" + "ABOUT.h" + "CYLINDRICAL.h" + "COAXIAL.h" + "TWINAX.h" + "UTP.h" + "TP.h" + "SPACEWIRE.h" + "OVERSHIELD.h" + "FLEXCABLE.h" + "DCONN.h" + "BUNDLEBLDR.h" + "SPICEMODEL.h" + "CABLE_SCHEMATIC.h" + "BUNDLE_SCHEMATIC.h" + "EXPORT_SPICE.h" + "UTILITIES.h" + + + + +1530723822 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\cylindrical.h + + + + + + + + + + "FD_ESR.h" + "UTILITIES.h" + "RUN_STATUS.h" + + + + +1530719970 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\twinax.h + + + + + + + + + + + + + "FD_ESR.h" + "UTILITIES.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + + + + +1530722668 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\utp.h + + + + + + + + + + + + "FD_ESR.h" + "UTILITIES.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "RUN_STATUS.h" + + + + + +1530722646 c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\tp.h + + + + + + + + + + + + + "FD_ESR.h" + "MESH_LAPLACE.h" + "MESH_PARAM.h" + "UTILITIES.h" + "RUN_STATUS.h" + + + + +1514923368 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\sw1_guimain.cpp + "SW1_GUIMain.h" + + + + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\tp.cpp + "TP.h" + + + + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\twinax.cpp + "TWINAX.h" + + + + +1502693568 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\utilities.cpp + "UTILITIES.h" + +1531159069 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\utp.cpp + "UTP.h" + + + + +1531158573 source:c:\users\eezsg\desktop\desktop\sacamos_july_2018\02\local_sw1\cylindrical.cpp + "CYLINDRICAL.h" + + + + diff --git a/GUI/SW1/SRC/SW1_GUI.layout b/GUI/SW1/SRC/SW1_GUI.layout index 3ed6e4d..98b633c 100644 --- a/GUI/SW1/SRC/SW1_GUI.layout +++ b/GUI/SW1/SRC/SW1_GUI.layout @@ -2,34 +2,69 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + - + - + - + - + @@ -37,74 +72,89 @@ - + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + - + - + - + - + - + - + diff --git a/GUI/SW1/SRC/SW1_GUIMain.cpp b/GUI/SW1/SRC/SW1_GUIMain.cpp index 6c27d06..68e5e20 100644 --- a/GUI/SW1/SRC/SW1_GUIMain.cpp +++ b/GUI/SW1/SRC/SW1_GUIMain.cpp @@ -44,11 +44,8 @@ //(*InternalHeaders(SW1_GUIFrame) -#include -#include #include #include -#include #include //*) @@ -124,11 +121,6 @@ SW1_GUIFrame::SW1_GUIFrame(wxWindow* parent,wxWindowID id) wxMenu* Menu2; Create(parent, wxID_ANY, _("SACAMOS"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY")); - { - wxIcon FrameIcon; - FrameIcon.CopyFromBitmap(wxBitmap(wxImage(_T("resources//spacewire_schematic_64x64.ico")))); - SetIcon(FrameIcon); - } FlexGridSizer1 = new wxFlexGridSizer(1, 2, 0, 5); FlexGridSizer1->AddGrowableCol(1); FlexGridSizer1->AddGrowableRow(0); @@ -137,10 +129,10 @@ SW1_GUIFrame::SW1_GUIFrame(wxWindow* parent,wxWindowID id) StaticBoxSizer1->Add(Panel1, 1, wxALL|wxEXPAND, 5); FlexGridSizer1->Add(StaticBoxSizer1, 0, wxALL|wxEXPAND, 5); StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, wxEmptyString); - Panel2 = new wxPanel(this, ID_PANEL2, wxDefaultPosition, wxSize(600,600), wxSIMPLE_BORDER|wxTAB_TRAVERSAL, _T("ID_PANEL2")); + Panel2 = new wxPanel(this, ID_PANEL2, wxDefaultPosition, wxSize(600,600), wxSIMPLE_BORDER|wxTAB_TRAVERSAL|wxFULL_REPAINT_ON_RESIZE, _T("ID_PANEL2")); Panel2->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION)); Panel2->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - StaticBitmap1 = new wxStaticBitmap(Panel2, ID_STATICBITMAP1, wxBitmap(wxImage(_T("resources//Sacamos_Logo_v2.png"))), wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE, _T("ID_STATICBITMAP1")); + StaticBitmap1 = new wxStaticBitmap(Panel2, ID_STATICBITMAP1, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE, _T("ID_STATICBITMAP1")); StaticBoxSizer2->Add(Panel2, 1, wxALL|wxEXPAND, 5); FlexGridSizer1->Add(StaticBoxSizer2, 2, wxALL|wxEXPAND, 5); SetSizer(FlexGridSizer1); @@ -205,8 +197,8 @@ SW1_GUIFrame::SW1_GUIFrame(wxWindow* parent,wxWindowID id) Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&SW1_GUIFrame::OnPanel1Paint,0,this); Panel2->Connect(wxEVT_PAINT,(wxObjectEventFunction)&SW1_GUIFrame::OnPanel2Paint,0,this); - Connect(ID_CREATEMOD,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::onCreateMOD); - Connect(ID_SELECTMOD,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::onSelectMOD); + Connect(ID_CREATEMOD,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnCreateMOD); + Connect(ID_SELECTMOD,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnSelectMOD); Connect(ID_MENUITEM1,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnQuit); Connect(ID_CYLINDRICAL,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnCYLINDRICAL); Connect(ID_COAX,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnCOAXIAL); @@ -223,14 +215,21 @@ SW1_GUIFrame::SW1_GUIFrame(wxWindow* parent,wxWindowID id) Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&SW1_GUIFrame::OnAbout); //*) + // Set frame icon here + wxIcon FrameIcon; + FrameIcon.CopyFromBitmap(wxBitmap(wxImage(_T("resources/spacewire_schematic_64x64.ico")))); + SetIcon(FrameIcon); + + // Set main image + StaticBitmap1->SetBitmap(wxBitmap(wxImage(_T("resources/Sacamos_Logo_v2.png")))); + // Disable Top Menu Items Until MOD location is chosen MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Cable Model")),false); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Bundle Model")),false); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Spice Model")),false); - allowResize = 0; - - StatusBar1 -> SetStatusText(wxT("Ready")); + // Set status bar message text + StatusBar1 -> SetStatusText(wxT("Please Select MOD Directory")); } SW1_GUIFrame::~SW1_GUIFrame() @@ -252,7 +251,7 @@ void SW1_GUIFrame::OnAbout(wxCommandEvent& event) about->ShowModal(); } -void SW1_GUIFrame::onSelectMOD(wxCommandEvent& event) +void SW1_GUIFrame::OnSelectMOD(wxCommandEvent& event) { // Create a new wxDirDialog dialog wxDirDialog* dirDialog = new wxDirDialog(this); @@ -263,15 +262,15 @@ void SW1_GUIFrame::onSelectMOD(wxCommandEvent& event) if (dirDialog->ShowModal() == wxID_OK) { wxString selectedFile = dirDialog->GetPath(); + + SelectedFile = dirDialog->GetPath(); PathToMOD << dirDialog->GetPath(); // Show the selected folder in the status bar - SetStatusText(selectedFile, 0); + SetStatusText(SelectedFile, 0); - PopulateTheDirectoryTree (selectedFile); + PopulateTheDirectoryTree (SelectedFile); } - - allowResize = 1; dirDialog->Destroy(); wxStringTokenizer tkz(PathToMOD, wxT("\\")); @@ -280,10 +279,9 @@ void SW1_GUIFrame::onSelectMOD(wxCommandEvent& event) { MODname = tkz.GetNextToken(); } - } -void SW1_GUIFrame::onCreateMOD(wxCommandEvent& event) +void SW1_GUIFrame::OnCreateMOD(wxCommandEvent& event) { // Create a new wxDirDialog dialog wxDirDialog* dirDialog = new wxDirDialog(this); @@ -302,34 +300,32 @@ void SW1_GUIFrame::onCreateMOD(wxCommandEvent& event) { MODname = tkz.GetNextToken(); } - wxString folder, dirName; folder = PathToMOD + "/CABLE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, 0); folder = PathToMOD + "/BUNDLE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, 0); folder = PathToMOD + "/SPICE"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, 0); folder = PathToMOD + "/SPICE/SYMBOL"; dirName = folder; if (!wxDirExists(dirName)) - wxMkdir(dirName, 0); + wxMkdir(dirName, 0); wxMenuBar* MenuBar1 = GetMenuBar(); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Cable Model")),true); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Bundle Model")),true); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Spice Model")),true); - } dirDialog->Destroy(); } @@ -340,7 +336,6 @@ void SW1_GUIFrame::PopulateTheDirectoryTree ( wxString RootFolder) Panel1->GetSize(&size_h, &size_v ); if (tree != NULL) - tree->Destroy(); tree = (wxSpecificDirCtrl *) NULL; @@ -348,103 +343,276 @@ void SW1_GUIFrame::PopulateTheDirectoryTree ( wxString RootFolder) tree = new wxSpecificDirCtrl (Panel1, -1, RootFolder, wxDefaultPosition, wxSize(size_h,size_v), - wxSIMPLE_BORDER,//wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, - wxEmptyString, 0, + wxSIMPLE_BORDER, + "*.cable_spec;*.bundle_spec;*.spice_model_spec", 0, _T("Directory Listing")); + //Connect tree item activated e.g. single click and tree item selected e.g. double click events + Connect(tree->GetTreeCtrl()->GetId(),wxEVT_COMMAND_TREE_SEL_CHANGED , (wxObjectEventFunction) (wxEventFunction)(wxCommandEventFunction) &SW1_GUIFrame::OnTreeSelection); Connect(tree->GetTreeCtrl()->GetId(),wxEVT_COMMAND_TREE_ITEM_ACTIVATED, (wxObjectEventFunction) (wxEventFunction)(wxCommandEventFunction) &SW1_GUIFrame::OnTreeSelectionChanged); - //SetButtonState_FolderSelected(); + //Activate Menu Items Once MOD Selected wxMenuBar* MenuBar1 = GetMenuBar(); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Cable Model")),true); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Bundle Model")),true); MenuBar1->EnableTop(MenuBar1->FindMenu(_("&Spice Model")),true); - } -void SW1_GUIFrame::OnTreeSelectionChanged(wxTreeEvent& evt) +void SW1_GUIFrame::OnTreeSelection(wxTreeEvent& evt) { wxFileName fname (tree->GetFilePath()); wxString File_Path = fname.GetPath(); - wxString File_FUllName = fname.GetFullName(); + wxString File_FullName = fname.GetFullName(); wxString File_FullNamePath = fname.GetFullPath(); StaticBitmap1->Hide(); - if(File_FUllName.substr(File_FUllName.find_last_of(".") + 1) == "cable_spec") { + SetStatusText(File_FullName, 0); + if(File_FullName.substr(File_FullName.find_last_of(".") + 1) == "cable_spec") + { draw_cable(Panel2,File_FullNamePath, 0, 0); } else - if(File_FUllName.substr(File_FUllName.find_last_of(".") + 1) == "bundle_spec") { + if(File_FullName.substr(File_FullName.find_last_of(".") + 1) == "bundle_spec") + { draw_bundle(Panel2, PathToMOD, File_FullNamePath); } } -void SW1_GUIFrame::OnCYLINDRICAL(wxCommandEvent& event) + +void SW1_GUIFrame::OnTreeSelectionChanged(wxTreeEvent& evt) { + wxFileName fname (tree->GetFilePath()); + wxString File_Path = fname.GetPath(); + wxString File_FullName = fname.GetFullName(); + wxString File_FullNamePath = fname.GetFullPath(); + + SetStatusText(File_FullName, 0); + + StaticBitmap1->Hide(); + + if(File_FullName.substr(File_FullName.find_last_of(".") + 1) == "cable_spec") + { + std::ifstream cableFile; + cableFile.open (File_FullNamePath); + + std::string str; - CYLINDRICAL *cylindrical = new CYLINDRICAL(this); - cylindrical->SetPathToMOD(PathToMOD, MODname); - cylindrical->ShowModal(); + std::getline(cableFile, str); + std::getline(cableFile, str); + std::getline(cableFile, str); + + if (str == "Cylindrical") + { + Edit = true; + CreateCable ("Cylindrical", File_FullName, Edit); + } + + if (str == "Coax") + { + Edit = true; + CreateCable ("Coaxial", File_FullName, Edit); + } + + if (str == "Twinax") + { + Edit = true; + CreateCable ("Twinax", File_FullName, Edit); + } + + if (str == "Twisted_pair") + { + Edit = true; + CreateCable ("UTP", File_FullName, Edit); + } + + if (str == "Shielded_twisted_pair") + { + Edit = true; + CreateCable ("TP", File_FullName, Edit); + } + + if (str == "Spacewire") + { + Edit = true; + CreateCable ("Spacewire", File_FullName, Edit); + } + + if (str == "Overshield") + { + Edit = true; + CreateCable ("Overshield", File_FullName, Edit); + } + + if (str == "Dconnector") + { + Edit = true; + CreateCable ("Dsub", File_FullName, Edit); + } + + if (str == "Flex_cable") + { + Edit = true; + CreateCable ("Flexcable", File_FullName, Edit); + } + } +} + +void SW1_GUIFrame::CreateCable(wxString CableType, wxString CableFile, bool Edit) +{ + int cable; + + if (CableType == "Cylindrical") cable = 1; + if (CableType == "Coaxial") cable = 2; + if (CableType == "Twinax") cable = 3; + if (CableType == "UTP") cable = 4; + if (CableType == "TP") cable = 5; + if (CableType == "Spacewire") cable = 6; + if (CableType == "Overshield") cable = 7; + if (CableType == "Flexcable") cable = 8; + if (CableType == "Dsub") cable = 9; + + switch (cable) + { + case 1: + { + CYLINDRICAL *cylindrical = new CYLINDRICAL(this); + cylindrical->SetPathToMOD(PathToMOD, MODname); + cylindrical->EDIT_EXISTING = Edit; + cylindrical->ShowModal(); + break; + } + + case 2: + { + COAXIAL *coaxial = new COAXIAL(this); + coaxial->SetPathToMOD(PathToMOD, MODname); + coaxial->EDIT_EXISTING = Edit; + coaxial->ShowModal(); + break; + } + + case 3: + { + TWINAX *twinax = new TWINAX(this); + twinax->SetPathToMOD(PathToMOD, MODname); + twinax->EDIT_EXISTING = Edit; + twinax->ShowModal(); + break; + } + + case 4: + { + UTP *utp = new UTP(this); + utp->SetPathToMOD(PathToMOD, MODname); + utp->EDIT_EXISTING = Edit; + utp->ShowModal(); + break; + } + + case 5: + { + TP *tp = new TP(this); + tp->SetPathToMOD(PathToMOD, MODname); + tp->EDIT_EXISTING = Edit; + tp->ShowModal(); + break; + } + + case 6: + { + SPACEWIRE *spacewire = new SPACEWIRE(this); + spacewire->SetPathToMOD(PathToMOD, MODname); + spacewire->EDIT_EXISTING = Edit; + spacewire->ShowModal(); + break; + } + + case 7: + { + OVERSHIELD *overshield = new OVERSHIELD(this); + overshield->SetPathToMOD(PathToMOD, MODname); + overshield->EDIT_EXISTING = Edit; + overshield->ShowModal(); + break; + } + + case 8: + { + FLEXCABLE *flexcable = new FLEXCABLE(this); + flexcable->SetPathToMOD(PathToMOD, MODname); + flexcable->EDIT_EXISTING = Edit; + flexcable->ShowModal(); + break; + } + + + case 9: + { + DCONN *dsub = new DCONN(this); + dsub->SetPathToMOD(PathToMOD, MODname); + dsub->EDIT_EXISTING = Edit; + dsub->ShowModal(); + break; + } + } +} + +void SW1_GUIFrame::OnCYLINDRICAL(wxCommandEvent& event) +{ + Edit = false; + CreateCable ("Cylindrical", "", Edit); } void SW1_GUIFrame::OnCOAXIAL(wxCommandEvent& event) { - COAXIAL *coaxial = new COAXIAL(this); - coaxial->SetPathToMOD(PathToMOD, MODname); - coaxial->ShowModal(); + Edit = false; + CreateCable ("Coaxial", "", Edit); } void SW1_GUIFrame::OnTWINAX(wxCommandEvent& event) { - TWINAX *twinax = new TWINAX(this); - twinax->SetPathToMOD(PathToMOD, MODname); - twinax->ShowModal(); + Edit = false; + CreateCable ("Twinax", "", Edit); } void SW1_GUIFrame::OnUTP(wxCommandEvent& event) { - UTP *utp = new UTP(this); - utp->SetPathToMOD(PathToMOD, MODname); - utp->ShowModal(); + Edit = false; + CreateCable ("UTP", "", Edit); } void SW1_GUIFrame::OnTP(wxCommandEvent& event) { - TP *tp = new TP(this); - tp->SetPathToMOD(PathToMOD, MODname); - tp->ShowModal(); + Edit = false; + CreateCable ("TP", "", Edit); } void SW1_GUIFrame::OnSPACEWIRE(wxCommandEvent& event) { - SPACEWIRE *spacewire = new SPACEWIRE(this); - spacewire->SetPathToMOD(PathToMOD, MODname); - spacewire->ShowModal(); + Edit = false; + CreateCable ("Spacewire", "", Edit); } void SW1_GUIFrame::OnOVERSHIELD(wxCommandEvent& event) { - OVERSHIELD *overshield = new OVERSHIELD(this); - overshield->SetPathToMOD(PathToMOD, MODname); - overshield->ShowModal(); + Edit = false; + CreateCable ("Overshield", "", Edit); } void SW1_GUIFrame::OnFLEXCABLE(wxCommandEvent& event) { - FLEXCABLE *flexcable = new FLEXCABLE(this); - flexcable->SetPathToMOD(PathToMOD, MODname); - flexcable->ShowModal(); + Edit = false; + CreateCable ("Flexcable", "", Edit); } void SW1_GUIFrame::OnDSUB(wxCommandEvent& event) { - DCONN *dsub = new DCONN(this); - dsub->SetPathToMOD(PathToMOD, MODname); - dsub->ShowModal(); + Edit = false; + CreateCable ("Dsub", "", Edit); } void SW1_GUIFrame::OnNEWBUNDLE(wxCommandEvent& event) @@ -470,11 +638,14 @@ void SW1_GUIFrame::OnEXPORTSPICE(wxCommandEvent& event) void SW1_GUIFrame::OnPanel1Paint(wxPaintEvent& event) { - + if (tree != NULL){ + int size_h, size_v; + Panel1->GetSize(&size_h, &size_v ); + tree->SetSize(size_h,size_v); + } } + void SW1_GUIFrame::OnPanel2Paint(wxPaintEvent& event) { } - - diff --git a/GUI/SW1/SRC/SW1_GUIMain.h b/GUI/SW1/SRC/SW1_GUIMain.h index 4c2c8ac..8750caf 100644 --- a/GUI/SW1/SRC/SW1_GUIMain.h +++ b/GUI/SW1/SRC/SW1_GUIMain.h @@ -99,18 +99,21 @@ class SW1_GUIFrame: public wxFrame void PopulateTheDirectoryTree ( wxString ); void OnTreeSelectionChanged ( wxTreeEvent& evt ); + void OnTreeSelection ( wxTreeEvent& evt ); + void CreateCable (wxString, wxString, bool); wxSpecificDirCtrl *tree; wxString PathToMOD; + wxString SelectedFile; wxString MODname; - int allowResize; + bool Edit; //(*Handlers(SW1_GUIFrame) void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); - void onSelectMOD(wxCommandEvent& event); + void OnSelectMOD(wxCommandEvent& event); void OnCOAXIAL(wxCommandEvent& event); void OnPanel1Paint(wxPaintEvent& event); void OnPanel2Paint(wxPaintEvent& event); @@ -128,7 +131,7 @@ class SW1_GUIFrame: public wxFrame void OnPanel1Resize(wxSizeEvent& event); void OnResize(wxSizeEvent& event); void OnPanel1RightDClick(wxMouseEvent& event); - void onCreateMOD(wxCommandEvent& event); + void OnCreateMOD(wxCommandEvent& event); void OnEXPORTSPICE(wxCommandEvent& event); void OnClose(wxCloseEvent& event); //*) diff --git a/GUI/SW1/SRC/TP.cpp b/GUI/SW1/SRC/TP.cpp index b252d43..f957f94 100644 --- a/GUI/SW1/SRC/TP.cpp +++ b/GUI/SW1/SRC/TP.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -326,9 +326,19 @@ TP::TP(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) Panel4->Connect(wxEVT_PAINT,(wxObjectEventFunction)&TP::OnPanel4Paint,0,this); Panel4->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&TP::OnPanel4LeftDClick,0,this); Panel4->Connect(wxEVT_MOUSEWHEEL,(wxObjectEventFunction)&TP::OnPanel4MouseWheel,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&TP::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&TP::OnPaint); //*) +} + +TP::~TP() +{ + //(*Destroy(TP) + //*) +} +void TP::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TP::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TP::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TP::OnHighlightSchematic, this); @@ -342,12 +352,6 @@ TP::TP(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TP::OnHighlightSchematic, this); } -TP::~TP() -{ - //(*Destroy(TP) - //*) -} - void TP::OnPaint(wxPaintEvent& event) { if (EDIT_EXISTING==true) EditExistingCable(); @@ -425,13 +429,11 @@ void TP::OnButton1Click(wxCommandEvent& event) void TP::OnCheckBox1Click(wxCommandEvent& event) { - //TextCtrl2->Disable(); - //TextCtrl3->Disable(); + TextCtrl10->Disable(); + TextCtrl11->Disable(); FD_ESR *winFD_ESR = new FD_ESR(this); - //winFD_ESR->formtype = 1; - if ( winFD_ESR->ShowModal() == wxID_OK ) { FD_ESR1 = winFD_ESR->TextCtrl1->GetValue(); @@ -463,17 +465,18 @@ void TP::OnButton2Click(wxCommandEvent& event) clean_temp_files(); wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); - //ifstream runStatus; + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -492,8 +495,6 @@ void TP::OnButton2Click(wxCommandEvent& event) file = wxFindFirstFile(pattern); - - while ( !file.empty()) { wxString meshfile = file; @@ -519,7 +520,6 @@ void TP::OnButton2Click(wxCommandEvent& event) void TP::OnButton3Click(wxCommandEvent& event) { //clean up directory - wxMessageBox("Please fix highlighted errors" , _("HELP3")); clean_temp_files(); Close(); } @@ -701,7 +701,7 @@ void TP::WriteCableFile (wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -802,12 +802,8 @@ void TP::WriteCableFile (wxString fileName) if (CheckBox3->GetValue()) { - //cableFile << "Laplace_boundary_constant\n"; - //cableFile << MESH_PARAM1 <<"\n"; cableFile << "Laplace_surface_mesh_constant\n"; cableFile << MESH_PARAM2 <<"\n"; - //cableFile << "max_mesh_edge_length\n"; - //cableFile << MESH_PARAM3 <<"\n"; CheckBox3 ->SetValue(false); } @@ -1132,8 +1128,6 @@ void TP::OnNotebook1PageChanging(wxNotebookEvent& event) tpSchematic(); } - - void TP::OnCheckBox3Click(wxCommandEvent& event) { if (CheckBox3->GetValue()) @@ -1146,9 +1140,7 @@ void TP::OnCheckBox3Click(wxCommandEvent& event) if ( winMESH_PARAM->ShowModal() == wxID_OK ) { - //MESH_PARAM1 = winMESH_PARAM->TextCtrl1->GetValue(); MESH_PARAM2 = winMESH_PARAM->TextCtrl2->GetValue(); - //MESH_PARAM3 = winMESH_PARAM->TextCtrl3->GetValue(); } winMESH_PARAM->Destroy(); } diff --git a/GUI/SW1/SRC/TP.h b/GUI/SW1/SRC/TP.h index 5ca6fd6..57c8c3e 100644 --- a/GUI/SW1/SRC/TP.h +++ b/GUI/SW1/SRC/TP.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -278,6 +278,7 @@ class TP: public wxDialog void OnTextCtrl18Text(wxCommandEvent& event); void OnCheckBox4Click(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/TWINAX.cpp b/GUI/SW1/SRC/TWINAX.cpp index c76949b..973ea2b 100644 --- a/GUI/SW1/SRC/TWINAX.cpp +++ b/GUI/SW1/SRC/TWINAX.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -334,9 +334,19 @@ TWINAX::TWINAX(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& s Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TWINAX::OnButton2Click); Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&TWINAX::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&TWINAX::OnPanel1LeftDClick,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&TWINAX::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&TWINAX::OnPaint); //*) +} +TWINAX::~TWINAX() +{ + //(*Destroy(TWINAX) + //*) +} + +void TWINAX::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TWINAX::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TWINAX::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TWINAX::OnHighlightSchematic, this); @@ -350,11 +360,6 @@ TWINAX::TWINAX(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& s CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&TWINAX::OnHighlightSchematic, this); } -TWINAX::~TWINAX() -{ - //(*Destroy(TWINAX) - //*) -} void TWINAX::OnPaint(wxPaintEvent& event) { @@ -434,15 +439,18 @@ void TWINAX::OnButton3Click(wxCommandEvent& event) //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line); // Display Run Status RUN_STATUS *run_status = new RUN_STATUS(this); @@ -690,7 +698,7 @@ void TWINAX::WriteCableFile (wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -1180,5 +1188,3 @@ void TWINAX::EditExistingCable() { Close(); } - - diff --git a/GUI/SW1/SRC/TWINAX.h b/GUI/SW1/SRC/TWINAX.h index b682a4d..c3e11d1 100644 --- a/GUI/SW1/SRC/TWINAX.h +++ b/GUI/SW1/SRC/TWINAX.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -278,6 +278,7 @@ class TWINAX: public wxDialog void OnTextCtrl18Text(wxCommandEvent& event); void OnCheckBox4Click(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() diff --git a/GUI/SW1/SRC/UTP.cpp b/GUI/SW1/SRC/UTP.cpp index 79a5a23..82a7aa8 100644 --- a/GUI/SW1/SRC/UTP.cpp +++ b/GUI/SW1/SRC/UTP.cpp @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -207,27 +207,27 @@ UTP::UTP(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&UTP::OnPanel1Paint,0,this); Panel1->Connect(wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&UTP::OnPanel1LeftDClick,0,this); Panel1->Connect(wxEVT_MOUSEWHEEL,(wxObjectEventFunction)&UTP::OnPanel1MouseWheel,0,this); + Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&UTP::OnInit); Connect(wxEVT_PAINT,(wxObjectEventFunction)&UTP::OnPaint); //*) +} + +UTP::~UTP() +{ + //(*Destroy(UTP) + //*) +} +void UTP::OnInit(wxInitDialogEvent& event) +{ TextCtrl2->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); TextCtrl3->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); TextCtrl4->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); TextCtrl5->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); -// TextCtrl6->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); -// TextCtrl7->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); -// TextCtrl8->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); -// TextCtrl9->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); -// TextCtrl10->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); TextCtrl11->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); CheckBox1->Bind(wxEVT_SET_FOCUS,(wxObjectEventFunction)&UTP::OnHighlightSchematic, this); } -UTP::~UTP() -{ - //(*Destroy(UTP) - //*) -} void UTP::OnPaint(wxPaintEvent& event) { @@ -259,15 +259,7 @@ void UTP::OnButton1Click(wxCommandEvent& event) check_is_empty(TextCtrl4, &IsError); check_is_empty(TextCtrl5, &IsError); - if (CheckBox1->GetValue()) - { -// check_is_empty(TextCtrl6, &IsError); -// check_is_empty(TextCtrl7, &IsError); -// check_is_empty(TextCtrl8, &IsError); -// check_is_empty(TextCtrl9, &IsError); -// check_is_empty(TextCtrl10, &IsError); - } - else + if (!CheckBox1->GetValue()) { check_is_empty(TextCtrl11, &IsError); } @@ -291,11 +283,6 @@ void UTP::OnButton1Click(wxCommandEvent& event) void UTP::OnCheckBox1Click(wxCommandEvent& event) { TextCtrl11->Disable(); -// TextCtrl6->Enable(); -// TextCtrl7->Enable(); -// TextCtrl8->Enable(); -// TextCtrl9->Enable(); -// TextCtrl10->Enable(); FD_ESR *winFD_ESR = new FD_ESR(this); @@ -303,12 +290,6 @@ void UTP::OnCheckBox1Click(wxCommandEvent& event) if ( winFD_ESR->ShowModal() == wxID_OK ) { -// FD_ESR1 = winFD_ESR->TextCtrl1->GetValue(); -// FD_ESR2 = winFD_ESR->TextCtrl2->GetValue(); -// FD_ESR3 = winFD_ESR->TextCtrl3->GetValue(); -// FD_ESR4 = winFD_ESR->TextCtrl4->GetValue(); -// FD_ESR5 = winFD_ESR->TextCtrl5->GetValue(); - FD_ESR6 = winFD_ESR->TextCtrl6->GetValue(); FD_ESR7 = winFD_ESR->TextCtrl7->GetValue(); FD_ESR8 = winFD_ESR->TextCtrl8->GetValue(); @@ -322,7 +303,6 @@ void UTP::OnCheckBox1Click(wxCommandEvent& event) FD_Fmin = winFD_ESR->TextCtrl12->GetValue(); FD_Fmax = winFD_ESR->TextCtrl12->GetValue(); FD_Num = winFD_ESR->TextCtrl12->GetValue(); - } winFD_ESR->Destroy(); @@ -331,19 +311,21 @@ void UTP::OnCheckBox1Click(wxCommandEvent& event) void UTP::OnButton2Click(wxCommandEvent& event) { //clean up directory - clean_temp_files(); + clean_temp_files(); // in case any mesh files lurk //CABLE BUIDER wxString fileName = TextCtrl1->GetValue(); - wxString fineName = fileName; + wxString command_line; std::stringstream stream; - stream << "\"..\\BIN\\cable_model_builder.exe\"" + stream << "cable_model_builder" << " " << "..\\" + MODname + "\\CABLE\\" << fileName ; - system(stream.str().c_str()); + command_line << stream.str().c_str(); + + wxExecute (command_line); ifstream runStatus; @@ -355,7 +337,6 @@ void UTP::OnButton2Click(wxCommandEvent& event) if (CheckBox2->GetValue()) { - wxString pattern (("*.msh.vtk")) ; wxString file; @@ -381,7 +362,6 @@ void UTP::OnButton2Click(wxCommandEvent& event) file = wxFindNextFile(); } - CheckBox3->Enable(); } } @@ -445,42 +425,12 @@ void UTP::OnTextCtrl11Text(wxCommandEvent& event) check_is_numeric_list(TextCtrl11, &IsError); } -//void UTP::OnTextCtrl6Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl6, &IsError); -//} -// -//void UTP::OnTextCtrl7Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl7, &IsError); -//} -// -//void UTP::OnTextCtrl8Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl8, &IsError); -//} -// -//void UTP::OnTextCtrl9Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl9, &IsError); -//} -// -//void UTP::OnTextCtrl10Text(wxCommandEvent& event) -//{ -// int IsError = 0; -// check_is_numeric_list(TextCtrl10, &IsError); -//} - void UTP::WriteCableFile (wxString fileName) { ofstream cableFile; - wxString fullFileName = pathToMOD + "//CABLE//" + fileName + ".cable_spec"; + wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; cableFile.open (fullFileName); @@ -506,13 +456,6 @@ void UTP::WriteCableFile (wxString fileName) cableFile << FD_ESR8 <<"\n"; cableFile << FD_ESR9 <<"\t # b order, b coefficients follow below\n"; cableFile << FD_ESR10 <<"\n"; - -// cableFile << "# Dielectric relative permittivity model follows\n"; -// cableFile << TextCtrl6->GetValue() <<" \t# w normalisation constant\n"; -// cableFile << TextCtrl7->GetValue() <<" \t# a order, a coefficients follow below\n"; -// cableFile << TextCtrl8->GetValue() <<" \n"; -// cableFile << TextCtrl9->GetValue() <<" \t# b order, b coefficients follow below\n"; -// cableFile << TextCtrl10->GetValue() <<" \n"; } else{ @@ -551,12 +494,8 @@ void UTP::WriteCableFile (wxString fileName) if (CheckBox3->GetValue()) { - //cableFile << "laplace_boundary_constant\n"; - //cableFile << MESH_PARAM1 <<"\n"; cableFile << "laplace_surface_mesh_constant\n"; cableFile << MESH_PARAM2 <<"\n"; - //cableFile << "max_mesh_edge_length\n"; - //cableFile << MESH_PARAM3 <<"\n"; CheckBox3 ->SetValue(false); } @@ -730,9 +669,7 @@ void UTP::OnCheckBox3Click(wxCommandEvent& event) if ( winMESH_PARAM->ShowModal() == wxID_OK ) { - //MESH_PARAM1 = winMESH_PARAM->TextCtrl1->GetValue(); MESH_PARAM2 = winMESH_PARAM->TextCtrl2->GetValue(); - //MESH_PARAM3 = winMESH_PARAM->TextCtrl3->GetValue(); } winMESH_PARAM->Destroy(); } @@ -759,4 +696,3 @@ void UTP::EditExistingCable() { Close(); } - diff --git a/GUI/SW1/SRC/UTP.h b/GUI/SW1/SRC/UTP.h index a0283d6..46ad8bb 100644 --- a/GUI/SW1/SRC/UTP.h +++ b/GUI/SW1/SRC/UTP.h @@ -4,7 +4,7 @@ // It was developed by the University of Nottingham and the Netherlands Aerospace // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. // -// Copyright (C) 2015 - 2017 University of Nottingham +// Copyright (C) 2015 - 2018 University of Nottingham // // SACAMOS is free software: you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the Free Software @@ -205,6 +205,7 @@ class UTP: public wxDialog void OnPanel1MouseWheel(wxMouseEvent& event); void OnComboBox1Selected(wxCommandEvent& event); void OnPaint(wxPaintEvent& event); + void OnInit(wxInitDialogEvent& event); //*) DECLARE_EVENT_TABLE() -- libgit2 0.21.2