Commit 1bcf33cb65518ef66a7394d4267907a2c33bb8b3

Authored by Steve Greedy
1 parent 63d077aa

Modifications to file path structure

Modifications to file path structure
GUI/SW1/SRC/COAXIAL.cpp
@@ -395,11 +395,14 @@ void COAXIAL::OnButton2Click(wxCommandEvent& event) @@ -395,11 +395,14 @@ void COAXIAL::OnButton2Click(wxCommandEvent& event)
395 wxString fileName = TextCtrl1->GetValue(); 395 wxString fileName = TextCtrl1->GetValue();
396 wxString command_line; 396 wxString command_line;
397 397
  398 + wxString separator(wxFileName::GetPathSeparator());
  399 +
398 std::stringstream stream; 400 std::stringstream stream;
399 401
400 - stream << "cable_model_builder" 402 + stream <<"." + separator
  403 + << "cable_model_builder"
401 << " " 404 << " "
402 - << "..\\" + MODname + "\\CABLE\\" 405 + << ".." + separator + MODname + separator + "CABLE" + separator
403 << fileName ; 406 << fileName ;
404 407
405 command_line << stream.str().c_str(); 408 command_line << stream.str().c_str();
@@ -559,8 +562,9 @@ void COAXIAL::OnTextCtrl16Text(wxCommandEvent&amp; event) @@ -559,8 +562,9 @@ void COAXIAL::OnTextCtrl16Text(wxCommandEvent&amp; event)
559 void COAXIAL::WriteCableFile(wxString fileName) 562 void COAXIAL::WriteCableFile(wxString fileName)
560 { 563 {
561 ofstream cableFile; 564 ofstream cableFile;
  565 + wxString separator(wxFileName::GetPathSeparator());
562 566
563 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 567 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
564 568
565 cableFile.open (fullFileName); 569 cableFile.open (fullFileName);
566 570
@@ -569,7 +573,7 @@ void COAXIAL::WriteCableFile(wxString fileName) @@ -569,7 +573,7 @@ void COAXIAL::WriteCableFile(wxString fileName)
569 573
570 // minimum requirements for type Coax 574 // minimum requirements for type Coax
571 cableFile <<"# MOD_cable_lib_dir \n"; 575 cableFile <<"# MOD_cable_lib_dir \n";
572 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 576 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
573 cableFile <<"Coax\n"; 577 cableFile <<"Coax\n";
574 cableFile <<"2 \t#number of conductors \n"; 578 cableFile <<"2 \t#number of conductors \n";
575 cableFile <<"6 \t#number of parameters \n"; 579 cableFile <<"6 \t#number of parameters \n";
GUI/SW1/SRC/CYLINDRICAL.cpp
@@ -238,11 +238,14 @@ void CYLINDRICAL::OnButton2Click(wxCommandEvent&amp; event) @@ -238,11 +238,14 @@ void CYLINDRICAL::OnButton2Click(wxCommandEvent&amp; event)
238 wxString fileName = TextCtrl1->GetValue(); 238 wxString fileName = TextCtrl1->GetValue();
239 wxString command_line; 239 wxString command_line;
240 240
  241 + wxString separator(wxFileName::GetPathSeparator());
  242 +
241 std::stringstream stream; 243 std::stringstream stream;
242 244
243 - stream << "cable_model_builder" 245 + stream <<"." + separator
  246 + << "cable_model_builder"
244 << " " 247 << " "
245 - << "..\\" + MODname + "\\CABLE\\" 248 + << ".." + separator + MODname + separator + "CABLE" + separator
246 << fileName ; 249 << fileName ;
247 250
248 command_line << stream.str().c_str(); 251 command_line << stream.str().c_str();
@@ -326,8 +329,9 @@ void CYLINDRICAL::WriteCableFile (wxString fileName) @@ -326,8 +329,9 @@ void CYLINDRICAL::WriteCableFile (wxString fileName)
326 { 329 {
327 330
328 ofstream cableFile; 331 ofstream cableFile;
  332 + wxString separator(wxFileName::GetPathSeparator());
329 333
330 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 334 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
331 335
332 cableFile.open (fullFileName); 336 cableFile.open (fullFileName);
333 337
@@ -335,7 +339,7 @@ void CYLINDRICAL::WriteCableFile (wxString fileName) @@ -335,7 +339,7 @@ void CYLINDRICAL::WriteCableFile (wxString fileName)
335 { 339 {
336 // minimum requirements for type Cylindrical 340 // minimum requirements for type Cylindrical
337 cableFile <<"# MOD_cable_lib_dir \n"; 341 cableFile <<"# MOD_cable_lib_dir \n";
338 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 342 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
339 cableFile <<"Cylindrical\n"; 343 cableFile <<"Cylindrical\n";
340 cableFile <<"1 #number of conductors \n"; 344 cableFile <<"1 #number of conductors \n";
341 cableFile <<"3 #number of parameters \n"; 345 cableFile <<"3 #number of parameters \n";
GUI/SW1/SRC/DCONN.cpp
@@ -243,10 +243,14 @@ void DCONN::OnButton2Click(wxCommandEvent&amp; event) @@ -243,10 +243,14 @@ void DCONN::OnButton2Click(wxCommandEvent&amp; event)
243 wxString fileName = TextCtrl1->GetValue(); 243 wxString fileName = TextCtrl1->GetValue();
244 wxString command_line; 244 wxString command_line;
245 245
  246 + wxString separator(wxFileName::GetPathSeparator());
  247 +
246 std::stringstream stream; 248 std::stringstream stream;
247 - stream << "cable_model_builder" 249 +
  250 + stream <<"." + separator
  251 + << "cable_model_builder"
248 << " " 252 << " "
249 - << "..\\" + MODname + "\\CABLE\\" 253 + << ".." + separator + MODname + separator + "CABLE" + separator
250 << fileName ; 254 << fileName ;
251 255
252 command_line << stream.str().c_str(); 256 command_line << stream.str().c_str();
@@ -327,7 +331,9 @@ void DCONN::WriteCableFile(wxString fileName) @@ -327,7 +331,9 @@ void DCONN::WriteCableFile(wxString fileName)
327 { 331 {
328 ofstream cableFile; 332 ofstream cableFile;
329 333
330 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 334 + wxString separator(wxFileName::GetPathSeparator());
  335 +
  336 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
331 337
332 cableFile.open (fullFileName); 338 cableFile.open (fullFileName);
333 339
@@ -335,7 +341,7 @@ void DCONN::WriteCableFile(wxString fileName) @@ -335,7 +341,7 @@ void DCONN::WriteCableFile(wxString fileName)
335 { 341 {
336 // minimum requirements for type Cylindrical 342 // minimum requirements for type Cylindrical
337 cableFile <<"# MOD_cable_lib_dir \n"; 343 cableFile <<"# MOD_cable_lib_dir \n";
338 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 344 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
339 cableFile <<"Dconnector\n"; 345 cableFile <<"Dconnector\n";
340 cableFile <<"10 #number of conductors \n"; 346 cableFile <<"10 #number of conductors \n";
341 cableFile <<"4 #number of parameters \n"; 347 cableFile <<"4 #number of parameters \n";
GUI/SW1/SRC/FLEXCABLE.cpp
@@ -314,11 +314,14 @@ void FLEXCABLE::OnButton2Click(wxCommandEvent&amp; event) @@ -314,11 +314,14 @@ void FLEXCABLE::OnButton2Click(wxCommandEvent&amp; event)
314 wxString fileName = TextCtrl1->GetValue(); 314 wxString fileName = TextCtrl1->GetValue();
315 wxString command_line; 315 wxString command_line;
316 316
  317 + wxString separator(wxFileName::GetPathSeparator());
  318 +
317 std::stringstream stream; 319 std::stringstream stream;
318 320
319 - stream << "cable_model_builder" 321 + stream <<"." + separator
  322 + << "cable_model_builder"
320 << " " 323 << " "
321 - << "..\\" + MODname + "\\CABLE\\" 324 + << ".." + separator + MODname + separator + "CABLE" + separator
322 << fileName ; 325 << fileName ;
323 326
324 command_line << stream.str().c_str(); 327 command_line << stream.str().c_str();
@@ -417,7 +420,9 @@ void FLEXCABLE::WriteCableFile (wxString fileName) @@ -417,7 +420,9 @@ void FLEXCABLE::WriteCableFile (wxString fileName)
417 { 420 {
418 ofstream cableFile; 421 ofstream cableFile;
419 422
420 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 423 + wxString separator(wxFileName::GetPathSeparator());
  424 +
  425 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
421 426
422 cableFile.open (fullFileName); 427 cableFile.open (fullFileName);
423 428
@@ -440,7 +445,7 @@ void FLEXCABLE::WriteCableFile (wxString fileName) @@ -440,7 +445,7 @@ void FLEXCABLE::WriteCableFile (wxString fileName)
440 if (cableFile.is_open()) 445 if (cableFile.is_open())
441 { 446 {
442 cableFile <<"# MOD_cable_lib_dir \n"; 447 cableFile <<"# MOD_cable_lib_dir \n";
443 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 448 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
444 cableFile <<"flex_cable\n"; 449 cableFile <<"flex_cable\n";
445 cableFile << n_conductors <<" #number of conductors \n"; 450 cableFile << n_conductors <<" #number of conductors \n";
446 cableFile << n_parameters <<" #number of parameters \n"; 451 cableFile << n_parameters <<" #number of parameters \n";
GUI/SW1/SRC/OVERSHIELD.cpp
@@ -253,10 +253,14 @@ void OVERSHIELD::OnButton2Click(wxCommandEvent&amp; event) @@ -253,10 +253,14 @@ void OVERSHIELD::OnButton2Click(wxCommandEvent&amp; event)
253 wxString fileName = TextCtrl1->GetValue(); 253 wxString fileName = TextCtrl1->GetValue();
254 wxString command_line; 254 wxString command_line;
255 255
  256 + wxString separator(wxFileName::GetPathSeparator());
  257 +
256 std::stringstream stream; 258 std::stringstream stream;
257 - stream << "cable_model_builder" 259 +
  260 + stream <<"." + separator
  261 + << "cable_model_builder"
258 << " " 262 << " "
259 - << "..\\" + MODname + "\\CABLE\\" 263 + << ".." + separator + MODname + separator + "CABLE" + separator
260 << fileName ; 264 << fileName ;
261 265
262 command_line << stream.str().c_str(); 266 command_line << stream.str().c_str();
@@ -332,7 +336,9 @@ void OVERSHIELD::WriteCableFile (wxString fileName) @@ -332,7 +336,9 @@ void OVERSHIELD::WriteCableFile (wxString fileName)
332 { 336 {
333 ofstream cableFile; 337 ofstream cableFile;
334 338
335 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 339 + wxString separator(wxFileName::GetPathSeparator());
  340 +
  341 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
336 342
337 cableFile.open (fullFileName); 343 cableFile.open (fullFileName);
338 344
@@ -340,7 +346,7 @@ void OVERSHIELD::WriteCableFile (wxString fileName) @@ -340,7 +346,7 @@ void OVERSHIELD::WriteCableFile (wxString fileName)
340 { 346 {
341 // minimum requirements for type Cylindrical 347 // minimum requirements for type Cylindrical
342 cableFile <<"# MOD_cable_lib_dir \n"; 348 cableFile <<"# MOD_cable_lib_dir \n";
343 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 349 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
344 cableFile <<"Overshield\n"; 350 cableFile <<"Overshield\n";
345 cableFile <<"1 /t#number of conductors \n"; 351 cableFile <<"1 /t#number of conductors \n";
346 cableFile <<"3 /t#number of parameters \n"; 352 cableFile <<"3 /t#number of parameters \n";
GUI/SW1/SRC/SPACEWIRE.cpp
@@ -510,14 +510,16 @@ void SPACEWIRE::OnButton2Click(wxCommandEvent&amp; event) @@ -510,14 +510,16 @@ void SPACEWIRE::OnButton2Click(wxCommandEvent&amp; event)
510 wxString fileName = TextCtrl1->GetValue(); 510 wxString fileName = TextCtrl1->GetValue();
511 wxString command_line; 511 wxString command_line;
512 512
  513 + wxString separator(wxFileName::GetPathSeparator());
  514 +
513 std::stringstream stream; 515 std::stringstream stream;
514 - stream << "cable_model_builder" 516 +
  517 + stream <<"." + separator
  518 + << "cable_model_builder"
515 << " " 519 << " "
516 - << "..\\" + MODname + "\\CABLE\\" 520 + << ".." + separator + MODname + separator + "CABLE" + separator
517 << fileName ; 521 << fileName ;
518 522
519 - command_line << stream.str().c_str();  
520 -  
521 wxExecute (command_line); 523 wxExecute (command_line);
522 524
523 // Display Run Status 525 // Display Run Status
@@ -859,7 +861,9 @@ void SPACEWIRE::WriteCableFile (wxString fileName) @@ -859,7 +861,9 @@ void SPACEWIRE::WriteCableFile (wxString fileName)
859 861
860 ofstream cableFile; 862 ofstream cableFile;
861 863
862 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 864 + wxString separator(wxFileName::GetPathSeparator());
  865 +
  866 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
863 867
864 cableFile.open (fullFileName); 868 cableFile.open (fullFileName);
865 869
@@ -868,7 +872,7 @@ void SPACEWIRE::WriteCableFile (wxString fileName) @@ -868,7 +872,7 @@ void SPACEWIRE::WriteCableFile (wxString fileName)
868 872
869 // minimum requirements for type Coax 873 // minimum requirements for type Coax
870 cableFile <<"# MOD_cable_lib_dir \n"; 874 cableFile <<"# MOD_cable_lib_dir \n";
871 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 875 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
872 cableFile <<"Spacewire\n"; 876 cableFile <<"Spacewire\n";
873 cableFile <<"13 \t#number of conductors \n"; 877 cableFile <<"13 \t#number of conductors \n";
874 cableFile <<"13 \t#number of parameters \n"; 878 cableFile <<"13 \t#number of parameters \n";
GUI/SW1/SRC/SW1_GUIMain.cpp
@@ -273,7 +273,9 @@ void SW1_GUIFrame::OnSelectMOD(wxCommandEvent&amp; event) @@ -273,7 +273,9 @@ void SW1_GUIFrame::OnSelectMOD(wxCommandEvent&amp; event)
273 } 273 }
274 dirDialog->Destroy(); 274 dirDialog->Destroy();
275 275
276 - wxStringTokenizer tkz(PathToMOD, wxT("\\")); 276 + wxString separator(wxFileName::GetPathSeparator());
  277 +
  278 + wxStringTokenizer tkz(PathToMOD, separator);
277 279
278 while (tkz.HasMoreTokens()) 280 while (tkz.HasMoreTokens())
279 { 281 {
GUI/SW1/SRC/TP.cpp
@@ -467,11 +467,14 @@ void TP::OnButton2Click(wxCommandEvent&amp; event) @@ -467,11 +467,14 @@ void TP::OnButton2Click(wxCommandEvent&amp; event)
467 wxString fileName = TextCtrl1->GetValue(); 467 wxString fileName = TextCtrl1->GetValue();
468 wxString command_line; 468 wxString command_line;
469 469
  470 + wxString separator(wxFileName::GetPathSeparator());
  471 +
470 std::stringstream stream; 472 std::stringstream stream;
471 473
472 - stream << "cable_model_builder" 474 + stream <<"." + separator
  475 + << "cable_model_builder"
473 << " " 476 << " "
474 - << "..\\" + MODname + "\\CABLE\\" 477 + << ".." + separator + MODname + separator + "CABLE" + separator
475 << fileName ; 478 << fileName ;
476 479
477 command_line << stream.str().c_str(); 480 command_line << stream.str().c_str();
@@ -701,7 +704,9 @@ void TP::WriteCableFile (wxString fileName) @@ -701,7 +704,9 @@ void TP::WriteCableFile (wxString fileName)
701 { 704 {
702 ofstream cableFile; 705 ofstream cableFile;
703 706
704 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 707 + wxString separator(wxFileName::GetPathSeparator());
  708 +
  709 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
705 710
706 cableFile.open (fullFileName); 711 cableFile.open (fullFileName);
707 712
@@ -710,7 +715,7 @@ void TP::WriteCableFile (wxString fileName) @@ -710,7 +715,7 @@ void TP::WriteCableFile (wxString fileName)
710 715
711 // minimum requirements for type Coax 716 // minimum requirements for type Coax
712 cableFile <<"# MOD_cable_lib_dir \n"; 717 cableFile <<"# MOD_cable_lib_dir \n";
713 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 718 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
714 cableFile <<"Shielded_twisted_pair\n"; 719 cableFile <<"Shielded_twisted_pair\n";
715 cableFile <<"3 \t#number of conductors \n"; 720 cableFile <<"3 \t#number of conductors \n";
716 cableFile <<"8 \t#number of parameters \n"; 721 cableFile <<"8 \t#number of parameters \n";
GUI/SW1/SRC/TWINAX.cpp
@@ -441,13 +441,17 @@ void TWINAX::OnButton3Click(wxCommandEvent&amp; event) @@ -441,13 +441,17 @@ void TWINAX::OnButton3Click(wxCommandEvent&amp; event)
441 wxString fileName = TextCtrl1->GetValue(); 441 wxString fileName = TextCtrl1->GetValue();
442 wxString command_line; 442 wxString command_line;
443 443
  444 + wxString separator(wxFileName::GetPathSeparator());
  445 +
444 std::stringstream stream; 446 std::stringstream stream;
445 447
446 - stream << "cable_model_builder" 448 + stream <<"." + separator
  449 + << "cable_model_builder"
447 << " " 450 << " "
448 - << "..\\" + MODname + "\\CABLE\\" 451 + << ".." + separator + MODname + separator + "CABLE" + separator
449 << fileName ; 452 << fileName ;
450 453
  454 +
451 command_line << stream.str().c_str(); 455 command_line << stream.str().c_str();
452 456
453 wxExecute (command_line); 457 wxExecute (command_line);
@@ -698,7 +702,9 @@ void TWINAX::WriteCableFile (wxString fileName) @@ -698,7 +702,9 @@ void TWINAX::WriteCableFile (wxString fileName)
698 { 702 {
699 ofstream cableFile; 703 ofstream cableFile;
700 704
701 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 705 + wxString separator(wxFileName::GetPathSeparator());
  706 +
  707 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
702 708
703 cableFile.open (fullFileName); 709 cableFile.open (fullFileName);
704 710
@@ -707,7 +713,7 @@ void TWINAX::WriteCableFile (wxString fileName) @@ -707,7 +713,7 @@ void TWINAX::WriteCableFile (wxString fileName)
707 713
708 // minimum requirements for type Twinax 714 // minimum requirements for type Twinax
709 cableFile <<"# MOD_cable_lib_dir \n"; 715 cableFile <<"# MOD_cable_lib_dir \n";
710 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 716 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
711 cableFile <<"Twinax\n"; 717 cableFile <<"Twinax\n";
712 cableFile <<"3 \t#number of conductors \n"; 718 cableFile <<"3 \t#number of conductors \n";
713 cableFile <<"8 \t#number of parameters \n"; 719 cableFile <<"8 \t#number of parameters \n";
GUI/SW1/SRC/UTP.cpp
@@ -317,10 +317,14 @@ void UTP::OnButton2Click(wxCommandEvent&amp; event) @@ -317,10 +317,14 @@ void UTP::OnButton2Click(wxCommandEvent&amp; event)
317 wxString fileName = TextCtrl1->GetValue(); 317 wxString fileName = TextCtrl1->GetValue();
318 wxString command_line; 318 wxString command_line;
319 319
  320 + wxString separator(wxFileName::GetPathSeparator());
  321 +
320 std::stringstream stream; 322 std::stringstream stream;
321 - stream << "cable_model_builder" 323 +
  324 + stream <<"." + separator
  325 + << "cable_model_builder"
322 << " " 326 << " "
323 - << "..\\" + MODname + "\\CABLE\\" 327 + << ".." + separator + MODname + separator + "CABLE" + separator
324 << fileName ; 328 << fileName ;
325 329
326 command_line << stream.str().c_str(); 330 command_line << stream.str().c_str();
@@ -430,7 +434,9 @@ void UTP::WriteCableFile (wxString fileName) @@ -430,7 +434,9 @@ void UTP::WriteCableFile (wxString fileName)
430 434
431 ofstream cableFile; 435 ofstream cableFile;
432 436
433 - wxString fullFileName = pathToMOD + "/CABLE/" + fileName + ".cable_spec"; 437 + wxString separator(wxFileName::GetPathSeparator());
  438 +
  439 + wxString fullFileName = pathToMOD + separator + "CABLE" + separator + fileName + ".cable_spec";
434 440
435 cableFile.open (fullFileName); 441 cableFile.open (fullFileName);
436 442
@@ -438,7 +444,7 @@ void UTP::WriteCableFile (wxString fileName) @@ -438,7 +444,7 @@ void UTP::WriteCableFile (wxString fileName)
438 { 444 {
439 // minimum requirements for type UTP 445 // minimum requirements for type UTP
440 cableFile <<"# MOD_cable_lib_dir \n"; 446 cableFile <<"# MOD_cable_lib_dir \n";
441 - cableFile <<"../"<< MODname <<"/CABLE/"<<"\n"; 447 + cableFile <<".." << separator << MODname << separator << "CABLE" << separator <<"\n";
442 cableFile <<"Twisted_pair\n"; 448 cableFile <<"Twisted_pair\n";
443 cableFile <<"2 \t#number of conductors \n"; 449 cableFile <<"2 \t#number of conductors \n";
444 cableFile <<"4 \t#number of parameters \n"; 450 cableFile <<"4 \t#number of parameters \n";