Commit 3d24aeb120829236b6ab1f46bad41d135765d88d
1 parent
4b3c72cf
Exists in
master
and in
3 other branches
Modification to system calls
Add wxEXEC_SYNC to account for machine dependent delays in writing run_status
Showing
16 changed files
with
74 additions
and
164 deletions
Show diff stats
GUI/SW1/SRC/BUNDLEBLDR.cpp
| ... | ... | @@ -423,7 +423,6 @@ void BUNDLEBLDR::PopulateTheDirectoryTree (wxString Path) |
| 423 | 423 | "*.cable_spec", 0, |
| 424 | 424 | _T("Directory Listing")); |
| 425 | 425 | |
| 426 | - // JIB | |
| 427 | 426 | Connect(tree->GetTreeCtrl()->GetId(),wxEVT_COMMAND_TREE_ITEM_ACTIVATED, (wxObjectEventFunction) (wxEventFunction)(wxCommandEventFunction) &BUNDLEBLDR::OnTreeSelectionChanged); |
| 428 | 427 | |
| 429 | 428 | |
| ... | ... | @@ -559,6 +558,8 @@ void BUNDLEBLDR::FormatPanel(double maxDimension) |
| 559 | 558 | |
| 560 | 559 | void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxString rot) |
| 561 | 560 | { |
| 561 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 562 | + | |
| 562 | 563 | double xCoord, yCoord, rotation, maxDimension; |
| 563 | 564 | |
| 564 | 565 | x.ToDouble(&xCoord); |
| ... | ... | @@ -573,7 +574,7 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 573 | 574 | wxClientDC dc(Panel1); |
| 574 | 575 | |
| 575 | 576 | std::stringstream stream; |
| 576 | - stream <<PathToMOD <<"\\CABLE\\"<<cable; | |
| 577 | + stream << PathToMOD << separator << "CABLE"<< separator << cable; | |
| 577 | 578 | |
| 578 | 579 | cable = (stream.str().c_str()); |
| 579 | 580 | |
| ... | ... | @@ -587,28 +588,11 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 587 | 588 | std::getline(cableFile, str); |
| 588 | 589 | |
| 589 | 590 | float scaleFactor = (size_h/2 * 1.0); |
| 590 | - //float maxHdimension; | |
| 591 | - //float maxVdimension; | |
| 592 | - //float maxDimension; | |
| 593 | - | |
| 594 | - //maxDimension = 0.015; //metres | |
| 595 | 591 | |
| 596 | 592 | wxString maxXY = TextCtrl8->GetValue(); |
| 597 | 593 | |
| 598 | 594 | maxXY.ToDouble(&maxDimension); |
| 599 | 595 | |
| 600 | -// wxString scale; | |
| 601 | -// scale << maxDimension/2.0; | |
| 602 | - | |
| 603 | -// dc.SetTextForeground(*wxBLUE); | |
| 604 | -// | |
| 605 | -// dc.DrawLine( size_h/2, size_v-50, size_h-size_h/4, size_v-50 ); | |
| 606 | -// dc.DrawLine( size_h/2, size_v-50, size_h/2, size_v-40 ); | |
| 607 | -// dc.DrawLine( size_h-size_h/4, size_v-50, size_h-size_h/4, size_v-40 ); | |
| 608 | -// | |
| 609 | -// dc.DrawText("scale (m)", (size_h/2+50), size_v-70); | |
| 610 | -// dc.DrawText(scale, (size_h/2+55), size_v-40); | |
| 611 | - | |
| 612 | 596 | if (str.compare("Cylindrical") == 0 ){ |
| 613 | 597 | |
| 614 | 598 | std::getline(cableFile, str); |
| ... | ... | @@ -654,8 +638,6 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 654 | 638 | |
| 655 | 639 | float inner_conductor_Scaledradius, shield_Scaledradius, outer_Scaledinsulation, shield_Scaledthickness, scaledxCoord, scaledyCoord; |
| 656 | 640 | |
| 657 | - //scaleFactor = (size_h * 0.5); | |
| 658 | - | |
| 659 | 641 | outer_Scaledinsulation = (outer_insulation/maxDimension)*scaleFactor; |
| 660 | 642 | shield_Scaledthickness = (shield_thickness/maxDimension)*scaleFactor; |
| 661 | 643 | shield_Scaledradius = (shield_radius/maxDimension)*scaleFactor; |
| ... | ... | @@ -1096,8 +1078,6 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 1096 | 1078 | cableFile >> conductor_rows; |
| 1097 | 1079 | std::getline(cableFile, str); //Read to end of line |
| 1098 | 1080 | |
| 1099 | - //float scaleFactor = (size_h/dielectric_width) * 0.6; | |
| 1100 | - | |
| 1101 | 1081 | float scaled_dielectric_width, scaled_dielectric_height, scaledxCoord, scaledyCoord; |
| 1102 | 1082 | |
| 1103 | 1083 | float dx1,dy1,dx2,dy2,dx3,dy3,dx4,dy4, tempx, tempy, rotation_rad; |
| ... | ... | @@ -1113,14 +1093,6 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 1113 | 1093 | float s = sin(rotation_rad); |
| 1114 | 1094 | float c = cos(rotation_rad); |
| 1115 | 1095 | |
| 1116 | -// wxString point; | |
| 1117 | -// | |
| 1118 | -// point<< tempx <<", "<<tempy; | |
| 1119 | -// wxMessageBox("P1" ,point ); | |
| 1120 | -// point = ""; | |
| 1121 | - | |
| 1122 | - //Draw dielectric | |
| 1123 | - //point 1 | |
| 1124 | 1096 | dx1 = -scaled_dielectric_width/2; |
| 1125 | 1097 | dy1 = scaled_dielectric_height/2; |
| 1126 | 1098 | |
| ... | ... | @@ -1169,12 +1141,6 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 1169 | 1141 | dc.DrawLine(dx3, dy3, dx4, dy4); |
| 1170 | 1142 | dc.DrawLine(dx4, dy4, dx1, dy1); |
| 1171 | 1143 | |
| 1172 | - //dc.DrawRectangle(wxPoint(size_h/2-scaled_dielectric_width/2, size_v/2-scaled_dielectric_height/2), wxSize(scaled_dielectric_width, scaled_dielectric_height)); | |
| 1173 | - | |
| 1174 | - //dc.DrawLine(dx2, dy2, dx4, dy4); | |
| 1175 | - | |
| 1176 | - //dc.DrawRectangle(wxPoint(size_h/2-scaled_dielectric_width/2, size_v/2-scaled_dielectric_height/2), wxSize(scaled_dielectric_width, scaled_dielectric_height)); | |
| 1177 | - | |
| 1178 | 1144 | float offset_x, offset_y, width, height,separation, conductors; |
| 1179 | 1145 | |
| 1180 | 1146 | for (int i = 0; i < conductor_rows;i++){ |
| ... | ... | @@ -1258,83 +1224,12 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 1258 | 1224 | dc.DrawLine(cx2, cy2, cx3, cy3); |
| 1259 | 1225 | dc.DrawLine(cx3, cy3, cx4, cy4); |
| 1260 | 1226 | dc.DrawLine(cx4, cy4, cx1, cy1); |
| 1261 | - | |
| 1262 | - //dc.DrawRectangle(wxPoint(x_origin+(j*(scaled_conductor_width + scaled_conductor_separation + scaled_offset_x) ), y_origin), wxSize(scaled_conductor_width,scaled_conductor_height)); | |
| 1263 | 1227 | } |
| 1264 | 1228 | } |
| 1265 | 1229 | |
| 1266 | - | |
| 1267 | - | |
| 1268 | - | |
| 1269 | - | |
| 1270 | - | |
| 1271 | - | |
| 1272 | - | |
| 1273 | - | |
| 1274 | -// float conductors, conductor_width, conductor_height, conductor_separation, dielectric_offset_x, dielectric_offset_y; | |
| 1275 | -// | |
| 1276 | -// cableFile >> conductors; | |
| 1277 | -// std::getline(cableFile, str); //Read to end of line | |
| 1278 | -// std::getline(cableFile, str); //Read to end of line | |
| 1279 | -// cableFile >> conductor_width; | |
| 1280 | -// std::getline(cableFile, str); //Read to end of line | |
| 1281 | -// cableFile >> conductor_height; | |
| 1282 | -// std::getline(cableFile, str); //Read to end of line | |
| 1283 | -// cableFile >> conductor_separation; | |
| 1284 | -// std::getline(cableFile, str); //Read to end of line | |
| 1285 | -// cableFile >> dielectric_offset_x; | |
| 1286 | -// std::getline(cableFile, str); //Read to end of line | |
| 1287 | -// cableFile >> dielectric_offset_y; | |
| 1288 | -// | |
| 1289 | -// | |
| 1290 | -// float conductor_Scaledwidth, | |
| 1291 | -// conductor_Scaledheight, | |
| 1292 | -// conductor_Scaledseparation, | |
| 1293 | -// dielectric_Scaledoffset_x, | |
| 1294 | -// //dielectric_Scaledoffset_y, | |
| 1295 | -// totalScaledWidth, | |
| 1296 | -// totalScaledHeight, | |
| 1297 | -// scaledxCoord, | |
| 1298 | -// scaledyCoord; | |
| 1299 | -// | |
| 1300 | -// | |
| 1301 | -// float totalWidth = (conductors*conductor_width)+((conductors-1) * conductor_separation)+(dielectric_offset_x * 2); | |
| 1302 | -// float totalHeight = (2 * dielectric_offset_y) + conductor_height; | |
| 1303 | -// | |
| 1304 | -// conductor_Scaledwidth = (conductor_width/maxDimension)*scaleFactor; | |
| 1305 | -// conductor_Scaledheight = (conductor_height/maxDimension)*scaleFactor; | |
| 1306 | -// conductor_Scaledseparation = (conductor_separation/maxDimension)*scaleFactor; | |
| 1307 | -// dielectric_Scaledoffset_x = (dielectric_offset_x/maxDimension)*scaleFactor; | |
| 1308 | -// //dielectric_Scaledoffset_y = (dielectric_offset_y/maxDimension)*scaleFactor; | |
| 1309 | -// totalScaledHeight = (totalHeight/maxDimension)*scaleFactor; | |
| 1310 | -// totalScaledWidth = (totalWidth/maxDimension)*scaleFactor; | |
| 1311 | -// scaledxCoord = (xCoord/maxDimension)*scaleFactor; | |
| 1312 | -// scaledyCoord = (yCoord/maxDimension)*scaleFactor; | |
| 1313 | -// | |
| 1314 | -// size_h = size_h + scaledxCoord; | |
| 1315 | -// size_v = size_v + scaledyCoord; | |
| 1316 | -// | |
| 1317 | -// dc.SetPen( wxPen( wxColor(0,0,0),1 ) ); | |
| 1318 | -// dc.SetBrush(wxBrush(*wxBLACK, wxBDIAGONAL_HATCH)); | |
| 1319 | -// dc.DrawRectangle(wxPoint(size_h/2-totalScaledWidth/2, size_v/2-totalScaledHeight/2), wxSize(totalScaledWidth,totalScaledHeight)); | |
| 1320 | -// | |
| 1321 | -// float x_origin, y_origin; | |
| 1322 | -// x_origin = (size_h/2 - totalScaledWidth/2)+dielectric_Scaledoffset_x; | |
| 1323 | -// y_origin = size_v/2 - conductor_Scaledheight/2; | |
| 1324 | -// | |
| 1325 | -// dc.SetPen( wxPen( wxColor(0,0,0),1 ) ); | |
| 1326 | -// dc.SetBrush(wxBrush(*wxBLACK, wxSOLID)); | |
| 1327 | -// | |
| 1328 | -// for(int i=0;i<conductors;i++){ | |
| 1329 | -// | |
| 1330 | -// dc.DrawRectangle(wxPoint(x_origin, y_origin), wxSize(conductor_Scaledwidth,conductor_Scaledheight)); | |
| 1331 | -// | |
| 1332 | -// x_origin = x_origin + (conductor_Scaledwidth+conductor_Scaledseparation); | |
| 1333 | -// } | |
| 1334 | - | |
| 1335 | 1230 | } |
| 1336 | 1231 | |
| 1337 | - if (str.compare("Dconnector") == 0 ){ | |
| 1232 | + if (str.compare("Dconnector") == 0 ){ | |
| 1338 | 1233 | |
| 1339 | 1234 | float conductors, conductor_radius, conductor_pitch, conductor_separation, shell_offset; |
| 1340 | 1235 | |
| ... | ... | @@ -1365,8 +1260,7 @@ void BUNDLEBLDR::DrawBundleCable(wxString cable, wxString x, wxString y, wxStrin |
| 1365 | 1260 | conductor_Scaledradius = (conductor_radius/maxDimension)*scaleFactor; |
| 1366 | 1261 | conductor_Scaledpitch = (conductor_pitch/maxDimension)*scaleFactor; |
| 1367 | 1262 | conductor_Scaledseparation = (conductor_separation/maxDimension)*scaleFactor; |
| 1368 | - //shell_Scaledoffset = (shell_offset/maxDimension)*scaleFactor; | |
| 1369 | - //total_Scaledwidth = (totalWidth/maxDimension)*scaleFactor; | |
| 1263 | + | |
| 1370 | 1264 | scaledxCoord = (xCoord/maxDimension)*scaleFactor; |
| 1371 | 1265 | scaledyCoord = (yCoord/maxDimension)*scaleFactor; |
| 1372 | 1266 | |
| ... | ... | @@ -1425,8 +1319,9 @@ void BUNDLEBLDR::OnButton1Click(wxCommandEvent& event) |
| 1425 | 1319 | void BUNDLEBLDR::WriteBundleFile(wxString fileName) |
| 1426 | 1320 | { |
| 1427 | 1321 | ofstream cableFile; |
| 1322 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 1428 | 1323 | |
| 1429 | - wxString fullFileName = PathToMOD + "\\BUNDLE\\" + fileName + ".bundle_spec"; | |
| 1324 | + wxString fullFileName = PathToMOD + separator + "BUNDLE" + separator + fileName + ".bundle_spec"; | |
| 1430 | 1325 | |
| 1431 | 1326 | cableFile.open (fullFileName); |
| 1432 | 1327 | |
| ... | ... | @@ -1434,19 +1329,11 @@ void BUNDLEBLDR::WriteBundleFile(wxString fileName) |
| 1434 | 1329 | { |
| 1435 | 1330 | cableFile << "#MOD_cable_lib_dir" << "\n"; |
| 1436 | 1331 | |
| 1437 | - #ifdef UNIX | |
| 1438 | - cableFile <<MODname <<"/CABLE/"<<"\n"; | |
| 1439 | - #else | |
| 1440 | - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; | |
| 1441 | - #endif | |
| 1332 | + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n"; | |
| 1442 | 1333 | |
| 1443 | 1334 | cableFile << "#MOD_cable_lib_dir" << "\n"; |
| 1444 | 1335 | |
| 1445 | - #ifdef UNIX | |
| 1446 | - cableFile <<MODname <<"/BUNDLE/"<<"\n"; | |
| 1447 | - #else | |
| 1448 | - cableFile <<"../"<< MODname <<"/BUNDLE/"<<"\n"; | |
| 1449 | - #endif | |
| 1336 | + cableFile <<".." << separator << MODname << separator << "BUNDLE" << separator <<"\n"; | |
| 1450 | 1337 | |
| 1451 | 1338 | cableFile << ListBox1->GetCount() << " #Number of cables in bundle, cable list follows\n"; |
| 1452 | 1339 | |
| ... | ... | @@ -1459,7 +1346,7 @@ void BUNDLEBLDR::WriteBundleFile(wxString fileName) |
| 1459 | 1346 | |
| 1460 | 1347 | cable = bundle_list->CableType; |
| 1461 | 1348 | |
| 1462 | - //Remove pesky file extension | |
| 1349 | + //Remove file extension | |
| 1463 | 1350 | size_t lastindex = cable.find_last_of("."); |
| 1464 | 1351 | wxString cable_name = cable.substr(0, lastindex); //at the moment here requires full path to file |
| 1465 | 1352 | |
| ... | ... | @@ -1536,29 +1423,26 @@ void BUNDLEBLDR::OnButton2Click(wxCommandEvent& event) |
| 1536 | 1423 | |
| 1537 | 1424 | wxString fileName = TextCtrl1->GetValue(); |
| 1538 | 1425 | |
| 1539 | - WriteBundleFile (TextCtrl1->GetValue()); | |
| 1426 | + wxString command_line; | |
| 1427 | + | |
| 1428 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 1540 | 1429 | |
| 1541 | - //std::stringstream stream; | |
| 1430 | + WriteBundleFile (TextCtrl1->GetValue()); | |
| 1542 | 1431 | |
| 1543 | - #ifdef UNIX | |
| 1544 | - std::stringstream stream; | |
| 1545 | - stream << "./cable_bundle_model_builder" | |
| 1546 | - << " " | |
| 1547 | - << MODname + "/BUNDLE/" | |
| 1548 | - << fileName ; | |
| 1549 | - #else | |
| 1550 | 1432 | std::stringstream stream; |
| 1551 | - stream << "\"..\\BIN\\cable_bundle_model_builder.exe\"" | |
| 1433 | + stream <<"." + separator | |
| 1434 | + << "cable_bundle_model_builder" | |
| 1552 | 1435 | << " " |
| 1553 | - << "..\\" + MODname + "\\CABLE\\" | |
| 1436 | + << ".." + separator + MODname + separator + "BUNDLE" + separator | |
| 1554 | 1437 | << fileName ; |
| 1555 | - #endif | |
| 1556 | 1438 | |
| 1557 | - system(stream.str().c_str()); | |
| 1439 | + command_line << stream.str().c_str(); | |
| 1440 | + | |
| 1441 | + wxExecute (command_line,wxEXEC_SYNC); | |
| 1558 | 1442 | |
| 1559 | 1443 | // Display Run Status |
| 1560 | - RUN_STATUS *run_status = new RUN_STATUS(this); | |
| 1561 | - run_status->ShowModal(); | |
| 1444 | + RUN_STATUS *run_status_bundle = new RUN_STATUS(this); | |
| 1445 | + run_status_bundle->ShowModal(); | |
| 1562 | 1446 | |
| 1563 | 1447 | //Button1->Enable(); |
| 1564 | 1448 | ... | ... |
GUI/SW1/SRC/BUNDLEBLDR.h
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | // It was developed by the University of Nottingham and the Netherlands Aerospace |
| 5 | 5 | // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. |
| 6 | 6 | // |
| 7 | -// Copyright (C) 2015 - 2017 University of Nottingham | |
| 7 | +// Copyright (C) 2015 - 2018 University of Nottingham | |
| 8 | 8 | // |
| 9 | 9 | // SACAMOS is free software: you can redistribute it and/or modify it under the |
| 10 | 10 | // terms of the GNU General Public License as published by the Free Software | ... | ... |
GUI/SW1/SRC/BUNDLE_SCHEMATIC.cpp
| ... | ... | @@ -111,14 +111,15 @@ void draw_bundle(wxPanel *Panel, wxString Path, wxString bundle_to_draw) |
| 111 | 111 | std::getline(bundleFile, bundle_str); |
| 112 | 112 | wxString cable_spec(bundle_str); |
| 113 | 113 | |
| 114 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 115 | + | |
| 114 | 116 | wxString cableFileName; |
| 115 | - cableFileName << Path <<"\\"<<"CABLE"<<"\\"<<cable_spec<<".cable_spec"; | |
| 117 | + | |
| 118 | + cableFileName << Path << separator << "CABLE" << separator <<cable_spec<<".cable_spec"; | |
| 116 | 119 | |
| 117 | 120 | bundleFile >> xCoord; |
| 118 | 121 | bundleFile >> yCoord; |
| 119 | 122 | |
| 120 | - yCoord = -1.0 * yCoord; | |
| 121 | - | |
| 122 | 123 | std::getline(bundleFile, bundle_str); //Read to end of line |
| 123 | 124 | |
| 124 | 125 | std::ifstream cableFile; | ... | ... |
GUI/SW1/SRC/BUNDLE_SCHEMATIC.h
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | // It was developed by the University of Nottingham and the Netherlands Aerospace |
| 5 | 5 | // Centre (NLR) for ESA under contract number 4000112765/14/NL/HK. |
| 6 | 6 | // |
| 7 | -// Copyright (C) 2015 - 2017 University of Nottingham | |
| 7 | +// Copyright (C) 2015 - 2018 University of Nottingham | |
| 8 | 8 | // |
| 9 | 9 | // SACAMOS is free software: you can redistribute it and/or modify it under the |
| 10 | 10 | // terms of the GNU General Public License as published by the Free Software |
| ... | ... | @@ -42,12 +42,14 @@ |
| 42 | 42 | #include <wx/panel.h> |
| 43 | 43 | #include <wx/dcclient.h> |
| 44 | 44 | #include <wx/msgdlg.h> |
| 45 | +#include <wx/filename.h> | |
| 45 | 46 | |
| 46 | 47 | // Standard Library Header Files |
| 47 | 48 | #include <iostream> |
| 48 | 49 | #include <fstream> |
| 49 | 50 | #include <sstream> |
| 50 | 51 | #include <cmath> |
| 52 | +#include <string> | |
| 51 | 53 | |
| 52 | 54 | using namespace std; |
| 53 | 55 | ... | ... |
GUI/SW1/SRC/COAXIAL.cpp
| ... | ... | @@ -407,7 +407,7 @@ void COAXIAL::OnButton2Click(wxCommandEvent& event) |
| 407 | 407 | |
| 408 | 408 | command_line << stream.str().c_str(); |
| 409 | 409 | |
| 410 | - wxExecute (command_line); | |
| 410 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 411 | 411 | |
| 412 | 412 | // Display Run Status |
| 413 | 413 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/CYLINDRICAL.cpp
| ... | ... | @@ -250,7 +250,7 @@ void CYLINDRICAL::OnButton2Click(wxCommandEvent& event) |
| 250 | 250 | |
| 251 | 251 | command_line << stream.str().c_str(); |
| 252 | 252 | |
| 253 | - wxExecute (command_line); | |
| 253 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 254 | 254 | |
| 255 | 255 | // Display Run Status |
| 256 | 256 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/DCONN.cpp
| ... | ... | @@ -255,7 +255,7 @@ void DCONN::OnButton2Click(wxCommandEvent& event) |
| 255 | 255 | |
| 256 | 256 | command_line << stream.str().c_str(); |
| 257 | 257 | |
| 258 | - wxExecute (command_line);; | |
| 258 | + wxExecute (command_line, wxEXEC_SYNC);; | |
| 259 | 259 | |
| 260 | 260 | // Display Run Status |
| 261 | 261 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/EXPORT_SPICE.cpp
| ... | ... | @@ -131,8 +131,10 @@ void EXPORT_SPICE::OnDirPickerCtrl2DirChanged(wxFileDirPickerEvent& event) |
| 131 | 131 | |
| 132 | 132 | void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) |
| 133 | 133 | { |
| 134 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 134 | 135 | |
| 135 | - wxString sacamos_sym_dir = "..\\" + MODname + "\\SPICE\\SYMBOL\\"; | |
| 136 | + //wxString sacamos_sym_dir = "..\\" + MODname + "\\SPICE\\SYMBOL\\"; | |
| 137 | + wxString sacamos_sym_dir = ".." + separator + MODname + separator +"SPICE" + separator +"SYMBOL" + separator; | |
| 136 | 138 | wxSetWorkingDirectory(sacamos_sym_dir); |
| 137 | 139 | |
| 138 | 140 | wxString file, pattern, export_notification; |
| ... | ... | @@ -158,7 +160,8 @@ void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) |
| 158 | 160 | wxString file_name = file_no_path.substr(0, lastindex); |
| 159 | 161 | |
| 160 | 162 | ng_sym_from = file_no_path; |
| 161 | - ng_sym_to = ng_sym_dir + "\\" + file_no_path; | |
| 163 | + //ng_sym_to = ng_sym_dir + "\\" + file_no_path; | |
| 164 | + ng_sym_to = ng_sym_dir + separator + file_no_path; | |
| 162 | 165 | |
| 163 | 166 | wxCopyFile(ng_sym_from, ng_sym_to); |
| 164 | 167 | |
| ... | ... | @@ -174,7 +177,8 @@ void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) |
| 174 | 177 | { |
| 175 | 178 | if (file_to_edit[i] == ("file=PATH_TO_TRANSMISSION_LINE_SUB_CIRCUITS/" + file_name + "_Ngspice.lib")) |
| 176 | 179 | { |
| 177 | - file_to_edit[i] = "file=" + pathToMOD + "\\SPICE\\" + file_name + "_Ngspice.lib"; | |
| 180 | + //file_to_edit[i] = "file=" + pathToMOD + "\\SPICE\\" + file_name + "_Ngspice.lib"; | |
| 181 | + file_to_edit[i] = "file=" + pathToMOD + separator + "SPICE" + separator + file_name + "_Ngspice.lib"; | |
| 178 | 182 | } |
| 179 | 183 | file_to_edit.Write(); |
| 180 | 184 | } |
| ... | ... | @@ -208,7 +212,8 @@ void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) |
| 208 | 212 | wxString file_name = file_no_path.substr(0, lastindex); |
| 209 | 213 | |
| 210 | 214 | lt_sym_from = file_no_path; |
| 211 | - lt_sym_to = lt_sym_dir + "\\" + file_no_path; | |
| 215 | + //lt_sym_to = lt_sym_dir + "\\" + file_no_path; | |
| 216 | + lt_sym_to = lt_sym_dir + separator + file_no_path; | |
| 212 | 217 | |
| 213 | 218 | wxCopyFile(lt_sym_from, lt_sym_to); |
| 214 | 219 | |
| ... | ... | @@ -224,7 +229,8 @@ void EXPORT_SPICE::OnButton1Click(wxCommandEvent& event) |
| 224 | 229 | { |
| 225 | 230 | if (file_to_edit[i] == ("SYMATTR ModelFile PATH_TO_TRANSMISSION_LINE_SUB_CIRCUITS/" + file_name + "_LTspice.lib")) |
| 226 | 231 | { |
| 227 | - file_to_edit[i] = "SYMATTR ModelFile " + pathToMOD + "\\SPICE\\" + file_name + "_LTspice.lib"; | |
| 232 | + //file_to_edit[i] = "SYMATTR ModelFile " + pathToMOD + "\\SPICE\\" + file_name + "_LTspice.lib"; | |
| 233 | + file_to_edit[i] = "SYMATTR ModelFile " + pathToMOD + separator + "SPICE" + separator + file_name + "_LTspice.lib"; | |
| 228 | 234 | } |
| 229 | 235 | file_to_edit.Write(); |
| 230 | 236 | } | ... | ... |
GUI/SW1/SRC/FLEXCABLE.cpp
| ... | ... | @@ -326,7 +326,7 @@ void FLEXCABLE::OnButton2Click(wxCommandEvent& event) |
| 326 | 326 | |
| 327 | 327 | command_line << stream.str().c_str(); |
| 328 | 328 | |
| 329 | - wxExecute (command_line); | |
| 329 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 330 | 330 | |
| 331 | 331 | // Display Run Status |
| 332 | 332 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/OVERSHIELD.cpp
| ... | ... | @@ -265,7 +265,7 @@ void OVERSHIELD::OnButton2Click(wxCommandEvent& event) |
| 265 | 265 | |
| 266 | 266 | command_line << stream.str().c_str(); |
| 267 | 267 | |
| 268 | - wxExecute (command_line); | |
| 268 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 269 | 269 | |
| 270 | 270 | // Display Run Status |
| 271 | 271 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/RUN_STATUS.cpp
| ... | ... | @@ -84,8 +84,6 @@ void RUN_STATUS::DisplayRunStatus() |
| 84 | 84 | wxString text; |
| 85 | 85 | wxTextFile StatusFile; |
| 86 | 86 | |
| 87 | - //int lineCount = LicenseFile.GetLineCount(); | |
| 88 | - | |
| 89 | 87 | if (StatusFile.Open(RunStatusFile)) |
| 90 | 88 | { |
| 91 | 89 | for (int i = 0; i<int(StatusFile.GetLineCount()); i++) |
| ... | ... | @@ -97,6 +95,12 @@ void RUN_STATUS::DisplayRunStatus() |
| 97 | 95 | TextCtrl1->SetValue(text); |
| 98 | 96 | } |
| 99 | 97 | |
| 98 | + if (!StatusFile.Open(RunStatusFile)) | |
| 99 | + { | |
| 100 | + DisplayRunStatus(); | |
| 101 | + } | |
| 102 | + | |
| 103 | + StatusFile.Close(); | |
| 100 | 104 | } |
| 101 | 105 | |
| 102 | 106 | ... | ... |
GUI/SW1/SRC/SPACEWIRE.cpp
| ... | ... | @@ -520,7 +520,7 @@ void SPACEWIRE::OnButton2Click(wxCommandEvent& event) |
| 520 | 520 | << ".." + separator + MODname + separator + "CABLE" + separator |
| 521 | 521 | << fileName ; |
| 522 | 522 | |
| 523 | - wxExecute (command_line); | |
| 523 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 524 | 524 | |
| 525 | 525 | // Display Run Status |
| 526 | 526 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/SPICEMODEL.cpp
| ... | ... | @@ -390,15 +390,28 @@ void SPICEMODEL::OnButton2Click(wxCommandEvent& event) |
| 390 | 390 | { |
| 391 | 391 | //SPICE CABLE BUNDLE MODEL |
| 392 | 392 | wxString fileName = TextCtrl1->GetValue(); |
| 393 | - //wxString fineName = fileName; | |
| 393 | + wxString command_line; | |
| 394 | + | |
| 395 | + wxString separator(wxFileName::GetPathSeparator()); | |
| 394 | 396 | |
| 395 | 397 | std::stringstream stream; |
| 396 | - stream << "\"..\\BIN\\spice_cable_bundle_model_builder\"" | |
| 398 | + | |
| 399 | + stream <<"." + separator | |
| 400 | + << "spice_cable_bundle_model_builder" | |
| 397 | 401 | << " " |
| 398 | - << "..\\" + MODname + "\\SPICE\\" | |
| 399 | - << fileName; | |
| 402 | + << ".." + separator + MODname + separator + "SPICE" + separator | |
| 403 | + << fileName ; | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | +// << "\"..\\BIN\\spice_cable_bundle_model_builder\"" | |
| 408 | +// << " " | |
| 409 | +// << "..\\" + MODname + "\\SPICE\\" | |
| 410 | +// << fileName; | |
| 411 | + | |
| 412 | + command_line << stream.str().c_str(); | |
| 400 | 413 | |
| 401 | - system(stream.str().c_str()); | |
| 414 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 402 | 415 | |
| 403 | 416 | RUN_STATUS *run_status = new RUN_STATUS(this); |
| 404 | 417 | run_status->ShowModal(); | ... | ... |
GUI/SW1/SRC/TP.cpp
| ... | ... | @@ -479,7 +479,7 @@ void TP::OnButton2Click(wxCommandEvent& event) |
| 479 | 479 | |
| 480 | 480 | command_line << stream.str().c_str(); |
| 481 | 481 | |
| 482 | - wxExecute (command_line); | |
| 482 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 483 | 483 | |
| 484 | 484 | // Display Run Status |
| 485 | 485 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/TWINAX.cpp
| ... | ... | @@ -454,7 +454,7 @@ void TWINAX::OnButton3Click(wxCommandEvent& event) |
| 454 | 454 | |
| 455 | 455 | command_line << stream.str().c_str(); |
| 456 | 456 | |
| 457 | - wxExecute (command_line); | |
| 457 | + wxExecute (command_line, wxEXEC_SYNC); | |
| 458 | 458 | |
| 459 | 459 | // Display Run Status |
| 460 | 460 | RUN_STATUS *run_status = new RUN_STATUS(this); | ... | ... |
GUI/SW1/SRC/UTP.cpp