public static MDT.Tooling ToToolsData(this MMT.Tooling tooling) { var t = new MDT.Tooling() { Machine = Path.GetFileNameWithoutExtension(tooling.MachineFile), Tools = Path.GetFileNameWithoutExtension(tooling.ToolsFile) }; foreach (var item in tooling.Units) { t.Units.Add(item.ToData()); } return(t); }
private static bool LoadTooling(string toolingFile, out ExTooling.Tooling tooling, out ExTools.ToolSet toolSet) { toolSet = null; tooling = null; var serializer = new System.Xml.Serialization.XmlSerializer(typeof(ExTooling.Tooling)); using (var reader = new System.IO.StreamReader(toolingFile)) { tooling = (ExTooling.Tooling)serializer.Deserialize(reader); } if (tooling != null) { toolSet = GetToolSet(tooling.ToolsFile); } return((toolSet != null) && (tooling != null)); }
public static IntTooling.Tooling ToInternal(this ExTooling.Tooling tooling) { var t = new IntTooling.Tooling() { MachineFile = tooling.MachineFile, ToolsFile = tooling.ToolsFile, Units = new System.Collections.Generic.List <IntTooling.ToolingUnit>() }; foreach (var item in tooling.Units) { t.Units.Add(new IntTooling.ToolingUnit() { ToolName = item.ToolName, ToolHolderId = item.ToolHolderId }); } return(t); }