Fixed contour naming;
only touch dependent TC objects if the tool number changed; changed formatting of intermediate path representation to be valid g-code and not use exponents.
This commit is contained in:
parent
0074f7c352
commit
d32b92d00d
|
@ -131,9 +131,12 @@ std::string Command::toGCode (void) const
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
str.precision(5);
|
str.precision(5);
|
||||||
str << Name;
|
str << Name;
|
||||||
|
char v[60];
|
||||||
for(std::map<std::string,double>::const_iterator i = Parameters.begin(); i != Parameters.end(); ++i) {
|
for(std::map<std::string,double>::const_iterator i = Parameters.begin(); i != Parameters.end(); ++i) {
|
||||||
std::string k = i->first;
|
std::string k = i->first;
|
||||||
std::string v = boost::lexical_cast<std::string>(i->second);
|
//std::string v = std::to_string(i->second); // only 6 digits
|
||||||
|
snprintf(v, sizeof(v), "%.9f", i->second);
|
||||||
|
v[sizeof(v)-1] = '\0';
|
||||||
str << " " << k << v;
|
str << " " << k << v;
|
||||||
}
|
}
|
||||||
return str.str();
|
return str.str();
|
||||||
|
|
|
@ -120,9 +120,15 @@ class ObjectContour:
|
||||||
def __setstate__(self, state):
|
def __setstate__(self, state):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def setLabel(self, obj):
|
||||||
|
if not obj.UserLabel:
|
||||||
|
obj.Label = obj.Name + " :" + obj.ToolDescription
|
||||||
|
else:
|
||||||
|
obj.Label = obj.UserLabel + " :" + obj.ToolDescription
|
||||||
|
|
||||||
def onChanged(self, obj, prop):
|
def onChanged(self, obj, prop):
|
||||||
if prop == "UserLabel":
|
if prop == "UserLabel":
|
||||||
obj.Label = obj.UserLabel + " :" + obj.ToolDescription
|
self.setLabel(obj)
|
||||||
|
|
||||||
def setDepths(proxy, obj):
|
def setDepths(proxy, obj):
|
||||||
parentJob = PathUtils.findParentJob(obj)
|
parentJob = PathUtils.findParentJob(obj)
|
||||||
|
@ -231,10 +237,7 @@ class ObjectContour:
|
||||||
obj.ToolNumber = toolLoad.ToolNumber
|
obj.ToolNumber = toolLoad.ToolNumber
|
||||||
obj.ToolDescription = toolLoad.Name
|
obj.ToolDescription = toolLoad.Name
|
||||||
|
|
||||||
if obj.UserLabel == "":
|
self.setLabel(obj)
|
||||||
obj.Label = obj.Name + " :" + obj.ToolDescription
|
|
||||||
else:
|
|
||||||
obj.Label = obj.UserLabel + " :" + obj.ToolDescription
|
|
||||||
|
|
||||||
output += "(" + obj.Label + ")"
|
output += "(" + obj.Label + ")"
|
||||||
if not obj.UseComp:
|
if not obj.UseComp:
|
||||||
|
|
|
@ -58,7 +58,6 @@ class LoadTool():
|
||||||
obj.setEditorMode('Placement', mode)
|
obj.setEditorMode('Placement', mode)
|
||||||
|
|
||||||
def execute(self, obj):
|
def execute(self, obj):
|
||||||
|
|
||||||
tool = PathUtils.getTool(obj, obj.ToolNumber)
|
tool = PathUtils.getTool(obj, obj.ToolNumber)
|
||||||
if tool is not None:
|
if tool is not None:
|
||||||
obj.Label = obj.Name + ": " + tool.Name
|
obj.Label = obj.Name + ": " + tool.Name
|
||||||
|
@ -86,9 +85,7 @@ class LoadTool():
|
||||||
obj.ViewObject.Visibility = True
|
obj.ViewObject.Visibility = True
|
||||||
|
|
||||||
def onChanged(self, obj, prop):
|
def onChanged(self, obj, prop):
|
||||||
mode = 2
|
if prop == "ToolNumber" and not 'Restore' in obj.State:
|
||||||
obj.setEditorMode('Placement', mode)
|
|
||||||
# if prop == "ToolNumber":
|
|
||||||
job = PathUtils.findParentJob(obj)
|
job = PathUtils.findParentJob(obj)
|
||||||
if job is not None:
|
if job is not None:
|
||||||
for g in job.Group:
|
for g in job.Group:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user