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