@@ -467,6 +467,13 @@ void Patcher::patchRapid(List<long long>^ pathList,STEPNCLib::AptStepMaker ^ apt
467
467
apt->Workingstep (" starting Feed" );
468
468
}
469
469
470
+
471
+ void Patcher::debugOut (STEPNCLib::AptStepMaker^apt, STEPNCLib::Finder^ find,double feed) {
472
+
473
+ Console::WriteLine (" feed {0}" , feed);
474
+
475
+ }
476
+
470
477
// given a stpnc file and a workplan within the stepnc file
471
478
// append a workplan with tool paths genereated from the xml data
472
479
// that contains tool position
@@ -475,7 +482,7 @@ void Patcher::patchRapid(List<long long>^ pathList,STEPNCLib::AptStepMaker ^ apt
475
482
void Patcher::appendPatchWorkPlan (String^partFile,String^coorFile,String^outName,String^ path,bool toInches ){
476
483
Console::WriteLine (" input \n part {0}\n xml file{1} \n path to desired workplan {2}" ,partFile,coorFile,path);
477
484
// assume all units are inches or inches per sec
478
- double max_feed=.8 ;// inches per sec
485
+ double max_feed=.3 ;// inches per sec
479
486
// get path position coordinates from the xml file with delta t in seconds at end
480
487
481
488
@@ -524,18 +531,19 @@ void Patcher::appendPatchWorkPlan(String^partFile,String^coorFile,String^outName
524
531
String ^str;
525
532
array<double >^ coor1;
526
533
array<double >^coor2;
527
-
534
+
528
535
bool startRapid=false ;
529
536
bool currentCoorisRapid=true ;
530
537
int currentTransition=0 ;
538
+ __int64 debugStep;
531
539
// Console::WriteLine("number of path coordinates {0}",coorList->Count);
532
540
// Console::WriteLine("number of transitions {0}",transitionPaths->Count);
533
541
// determine if starting position is in rapid mode or feed
534
542
if (sample->getSize ()>1 ){
535
543
coor1 = sample->getCoor (0 );
536
544
coor2= sample->getCoor (1 );
537
-
538
- if (actualFeedRate (coor1,coor2)>max_feed){
545
+
546
+ if (actualFeedRate (coor1, coor2)>max_feed){
539
547
currentCoorisRapid=true ;
540
548
541
549
@@ -547,6 +555,8 @@ void Patcher::appendPatchWorkPlan(String^partFile,String^coorFile,String^outName
547
555
if (currentCoorisRapid){
548
556
apt->Rapid ();
549
557
}else {
558
+
559
+
550
560
apt->Feedrate (max_feed);
551
561
}
552
562
}
@@ -578,7 +588,14 @@ void Patcher::appendPatchWorkPlan(String^partFile,String^coorFile,String^outName
578
588
}
579
589
580
590
}else if (currentCoorisRapid==false ){
581
-
591
+ debugStep = apt->GetCurrentWorkingstep ();
592
+ if (find->GetWorkingstepName2 (debugStep)->Contains (" WS 24" )) {
593
+ Console::WriteLine (" WS {0}" , find->GetWorkingstepName2 (debugStep));
594
+ debugOut (apt, find, actualFeed);
595
+
596
+ }
597
+
598
+
582
599
startRapid=false ;
583
600
apt->GoToXYZ (" feed" ,coor2[0 ],coor2[1 ],coor2[2 ]);
584
601
}
@@ -744,13 +761,13 @@ void Patcher::createPatchedFile(String^ partFile,String^ WPpath,String^newFileNa
744
761
745
762
746
763
747
- if (!prevCoorIsRapid) {
764
+ if (!prevCoorIsRapid&& isFeedState (pastRapids, 3 ) ) {
748
765
749
766
apt->Feedrate (currentTP->getWS ()->getMaxFeed ());
750
767
751
768
apt->SpindleSpeed (currentTP->getWS ()->getMaxSpindle ());
752
769
apt->GoToXYZ (" feed" , coor2[0 ], coor2[1 ], coor2[2 ]);
753
- }else if (prevCoorIsRapid&&! pastRapids[pastRapids-> Count - 2 ] ) {
770
+ }else if (rapidStarted ( pastRapids) ) {
754
771
755
772
currentTP = patchRapidToolPaths (apt, find, currentTP);
756
773
@@ -847,15 +864,15 @@ ToolPath ^tp2 = nullptr;
847
864
Console::WriteLine (" Transitioned to a new WS without rapiding" );
848
865
}
849
866
}
850
-
867
+ /*
851
868
if (tp1->getWS()->getIndex() >= 9) {
852
869
apt->Workingstep("Rapiding");
853
870
854
- }
871
+ }*/
855
872
List<__int64> ^temp = gcnew List<__int64>();
856
873
temp->Add (tp1->getId ());
857
874
List<double > ^loc = getAllPoints (temp, find);
858
- Console::WriteLine (" rapid starting at WS {0} index {1} coor {2} {3} {4}" , tp1->getWS ()->getName (), tp1->getIndex (), loc[0 ], loc[1 ], loc[2 ]);
875
+ // Console::WriteLine("rapid starting at WS {0} index {1} coor {2} {3} {4}", tp1->getWS()->getName(), tp1->getIndex(), loc[0], loc[1], loc[2]);
859
876
while (tp1->rapid ())
860
877
{
861
878
STPNCpath->Add (tp1->getId ());
@@ -878,11 +895,12 @@ ToolPath ^tp2 = nullptr;
878
895
}
879
896
tp1 = tp2;
880
897
}
898
+ /*
881
899
if (tp1->getWS()->getIndex() >= 9) {
882
900
apt->Workingstep("Feed");
883
901
884
902
}
885
-
903
+ */
886
904
return tp1;
887
905
}
888
906
/*
0 commit comments