Tom, I'm not sure whether I've just discovered a bug, or if I'm doing something wrong, but I've got a problem with tool diameters.
This is my code for loading values into the tooltable-
Code: Select all
foreach(Tool t in CF.Tools)
{
ComboBox_Tools.Items.Add(new ComboBoxItem { Content = t.ToolID.ToString() + "-" + t.Comment });
KM.CoordMotion.Interpreter.SetupParams.SetTool(it, t.SlotID, t.ToolID, t.Length, t.Diameter, t.XOffset, t.YOffset);
TextBox_Debug.AppendText("\r\nTool i:" + it + " slot:" + t.SlotID + " id:" + t.ToolID + " len:" + t.Length + " dia:" + t.Diameter + " xoff:" + t.XOffset + " yoff:" + t.YOffset);
it++;
}
Which results in the following in my debug output-
Code: Select all
Tool i:0 slot:1 id:1 len:2 dia:0.1 xoff:0 yoff:0
Tool i:1 slot:2 id:2 len:0 dia:2 xoff:0 yoff:0
Tool i:2 slot:3 id:3 len:2 dia:3 xoff:0 yoff:0
Tool i:3 slot:3 id:4 len:0.4 dia:4 xoff:0 yoff:0
Tool i:4 slot:3 id:5 len:0.5 dia:0 xoff:0 yoff:0
Tool i:5 slot:4 id:104 len:0 dia:0 xoff:0 yoff:0
Tool i:6 slot:4 id:105 len:0 dia:0 xoff:0 yoff:0
Now I dump the values back out using the following code -
Code: Select all
for (int i = 0; i <= 127; i++)
{
int slot = 0, id = 0;
double len = 0, dia = 0, xoff = 0, yoff = 0;
KM.CoordMotion.Interpreter.SetupParams.GetTool(i, ref slot, ref id, ref len, ref dia, ref xoff, ref yoff);
if(slot !=0 || id !=0 || len!=0)
TextBox_Debug.AppendText("\r\nTool i:" + i + " slot:" + slot + " id:" + id + " len:" + len + " dia:" + dia + " xoff:" + xoff + " yoff:" + yoff);
}
Which results in this debug output-
Code: Select all
Tool i:0 slot:1 id:1 len:2 dia:1 xoff:0 yoff:0
Tool i:1 slot:2 id:2 len:0 dia:1 xoff:0 yoff:0
Tool i:2 slot:3 id:3 len:2 dia:2 xoff:0 yoff:0
Tool i:3 slot:3 id:4 len:0.4 dia:0 xoff:0 yoff:0
Tool i:4 slot:3 id:5 len:0.5 dia:0 xoff:0 yoff:0
Tool i:5 slot:4 id:104 len:0 dia:0 xoff:0 yoff:0
Tool i:6 slot:4 id:105 len:0 dia:0 xoff:0 yoff:0
The tool diameters for tools 1,2 and 3, are not what was stored into the tool table.
Any ideas?