-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debugging WP generation from STPNC file
- Loading branch information
salamb
committed
Jan 15, 2016
1 parent
538572a
commit ec6b784
Showing
14 changed files
with
241 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "Exec.h" | ||
#include"stdafx.h" | ||
WP^ Exec::getParent(){ return parent; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#include "MtConnector.h" | ||
|
||
|
||
#include"stdafx.h" | ||
MtConnector::MtConnector() | ||
{ | ||
startedPush=false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,88 @@ | ||
#include "ToolPath.h"; | ||
#include "ToolPath.h" | ||
#include"stdafx.h" | ||
|
||
/* | ||
ToolPath^ ToolPath::nextPath(){ | ||
if(parent!=nullptr){ | ||
return dynamic_cast<ToolPath^>(dynamic_cast<WS^>(parent)->getPath(getIndex()+1)); | ||
return (parent)->getPath(getIndex()+1); | ||
|
||
}else{ | ||
|
||
Console::WriteLine("Error path is not nested in a WS"); | ||
return nullptr;} | ||
return nullptr; | ||
} | ||
*/ | ||
|
||
|
||
ToolPath::ToolPath(WS^ p, bool rapid, double f, double s, __int64 in, __int64 ID) { | ||
parent = p; | ||
isRapid = rapid; | ||
feedrate = f; | ||
spindleSpeed = s; | ||
index = in; | ||
id = ID; | ||
|
||
} | ||
WS^ ToolPath::getWS() { return parent; } | ||
__int64 ToolPath::getId(){ return id; } | ||
__int64 ToolPath::getIndex() { return index; } | ||
|
||
ToolPath^ ToolPath::nextPath(bool % newWP, bool% newWS) { | ||
ToolPath^temp =nextPath(); | ||
Exec^ tempExec; | ||
if (temp != nullptr) { | ||
newWP = false; | ||
newWS = false; | ||
return temp; | ||
} | ||
else { | ||
WS^ tempWS = getWS(); | ||
ToolPath^ nextToolPath = nullptr; | ||
List<WP^>^path = getWS()->pathtoRoot(); | ||
for (int i = 0; i<path->Count; i++) { | ||
nextToolPath = recurseToNextToolPath(path[i], tempWS->getIndex()); | ||
|
||
|
||
} | ||
} | ||
} | ||
|
||
ToolPath^ ToolPath::recurseToNextToolPath(WP^ current, __int64 startIndexAfter) { | ||
ToolPath^ result = nullptr; | ||
for (int i = startIndexAfter + 1; i<current->getExecutableCount(); i++) { | ||
result = recurseToolPath(current->getExecutable(i)); | ||
if (result != nullptr) { | ||
return result; | ||
} | ||
} | ||
|
||
|
||
} | ||
ToolPath^ ToolPath::recurseToolPath(Exec^ current) { | ||
WS^ tempWS = nullptr; | ||
WP^ tempWP = nullptr; | ||
WP^ tempWP2; | ||
if (current->isWP()) { | ||
tempWP = dynamic_cast<WP^>(current); | ||
} | ||
else { | ||
tempWS = dynamic_cast<WS^>(current); | ||
} | ||
if (tempWS != nullptr) { | ||
if (tempWS->getPathCount()>0) { | ||
return tempWS->getPath(0); | ||
|
||
} | ||
} | ||
if (tempWP != nullptr) { | ||
for (int i = 0; i<tempWP->getExecutableCount(); i++) { | ||
|
||
return recurseToolPath(tempWP->getExecutable(i)); | ||
|
||
|
||
} | ||
|
||
|
||
} | ||
return nullptr; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include"WP.h" | ||
#include"stdafx.h" | ||
|
||
Exec^ WP::getExecutable(__int64 i){ if (i<getExecutableCount()) { return execList[i]; } }; | ||
void WP::addExecutable(Exec^ e) { execList->Add(e); }; | ||
|
||
__int64 WP::getExecutableCount() { return execList->Count; }; | ||
|
||
WP::WP(String^ n, __int64 ID, __int64 in, WP^p) :Exec(n, ID, in, p, true) { | ||
execList = gcnew List<Exec^>(); | ||
}; | ||
|
||
|
||
ToolPath ^ WP::firstPath(WP^ root) { | ||
if (root == nullptr) { | ||
root = this; | ||
} | ||
Exec^tempExec; | ||
WP^ tempWP; | ||
WS^ tempWS; | ||
for (int i = 0; i<root->getExecutableCount(); i++) { | ||
tempExec = root->getExecutable(i); | ||
if (tempExec->isWP()) { | ||
tempWP = dynamic_cast<WP^>(tempExec); | ||
return firstPath(tempWP); | ||
} | ||
else { | ||
tempWS = dynamic_cast<WS^>(tempWS); | ||
return tempWS->getPath(0); | ||
|
||
} | ||
|
||
|
||
} | ||
return nullptr; | ||
|
||
}; |
Oops, something went wrong.