From 571fa245355131b9ad011525cbb77a0e67670a26 Mon Sep 17 00:00:00 2001 From: Lucio Maranta Date: Tue, 8 May 2018 14:55:06 +0000 Subject: [PATCH] Manage magazine positions --- CMS_CORE_Application/Form1.cs | 27 +- CMS_CORE_Library/DataStructures.cs | 230 +++++--- CMS_CORE_Library/Demo/ILibraryService.cs | 14 +- CMS_CORE_Library/Demo/Models/ToolDataModel.cs | 34 +- CMS_CORE_Library/Demo/Nc_Demo.cs | 212 +++++--- CMS_CORE_Library/Fanuc/Nc_Fanuc.cs | 20 +- CMS_CORE_Library/Nc.cs | 12 +- CMS_CORE_Library/Osai/Nc_Osai.cs | 21 +- CMS_CORE_Library/Siemens/Nc_Siemens.cs | 153 +++++- .../Siemens/SiemensEdgesConfigurations.cs | 502 +++++++++--------- .../Database/DatabaseController.cs | 157 +++++- .../Database/Models/ToolsDataModel.cs | 17 +- .../Nc_Demo_Application/Nc_Demo_Db.db | Bin 77824 -> 77824 bytes .../Server/Service/ILibraryService.cs | 13 +- .../Server/Service/LibraryService.cs | 21 +- .../Views/DemoApplicationForm.Designer.cs | 264 +++++---- .../Views/DemoApplicationForm.cs | 10 +- .../Views/DemoApplicationForm.resx | 8 +- 18 files changed, 1067 insertions(+), 648 deletions(-) diff --git a/CMS_CORE_Application/Form1.cs b/CMS_CORE_Application/Form1.cs index 478af3e..686cbb8 100644 --- a/CMS_CORE_Application/Form1.cs +++ b/CMS_CORE_Application/Form1.cs @@ -81,7 +81,10 @@ namespace CMS_CORE_Application List dataTable = new List(); List shanks = new List(); List famiies = new List(); - List positions = new List(); + List positions = new List(); + List magazine = new List(); + List multiTools = new List(); + List tools = new List(); SiemensToolModel newTool = new SiemensToolModel() { FamilyName = "nuovo nome", @@ -103,7 +106,7 @@ namespace CMS_CORE_Application EdgesData = null }; - EdgeModel edge = new EdgeModel() + EdgeModel newEdge = new EdgeModel() { Id = 1, NominalLife = 22, @@ -118,7 +121,13 @@ namespace CMS_CORE_Application { "ugo", 11 } } }; - + + List newMagazine = new List() + { + new NewToolInMagazineModel{ PositionId = 1, ToolId = 1 }, + new NewToolInMagazineModel{ PositionId = 2, ToolId = 6 }, + new NewToolInMagazineModel{ PositionId = 3, ToolId = 7 }, + }; N = SetNcByType(); @@ -194,11 +203,11 @@ namespace CMS_CORE_Application // cmsError = N.PLC_WRefreshAllMessages(); cmsError = N.PLC_RHeadsData(headsTest, 1); - cmsError = N.TOOLS_RToolTable(ref dataTable); + cmsError = N.TOOLS_RToolsData(ref dataTable); cmsError = N.TOOLS_RShanksData(ref shanks); cmsError = N.TOOLS_RFamilyData(ref famiies); cmsError = N.TOOLS_RMagazinePositions(ref positions); - cmsError = N.TOOLS_WAddTool(ref newTool); + // cmsError = N.TOOLS_WAddTool(ref newTool); ShankModel shank = new ShankModel(); cmsError = N.TOOLS_WAddShank(ref shank); @@ -206,10 +215,14 @@ namespace CMS_CORE_Application { Name = "Da demo" }; - cmsError = N.TOOLS_WAddFamily(ref family); + // cmsError = N.TOOLS_WAddFamily(ref family); cmsError = N.TOOLS_RConfiguration(ref toolsConfig); // cmsError = N.TOOLS_WAddEdge(1, ref edge); - cmsError = N.TOOLS_WUpdateEdge(1, ref edge); + // cmsError = N.TOOLS_WUpdateEdge(1, ref newEdge); + + cmsError = N.TOOLS_RMagazineTools(1, ref magazine); + cmsError = N.TOOLS_RAvailableTools(ref multiTools, ref tools); + cmsError = N.TOOLS_WUpdateMagazineTools(1, newMagazine); // N.PLC_WPowerOnData(6, true); //N.PLC_RFunctionAccess(ref functionality); diff --git a/CMS_CORE_Library/DataStructures.cs b/CMS_CORE_Library/DataStructures.cs index a5da1e4..4e57868 100644 --- a/CMS_CORE_Library/DataStructures.cs +++ b/CMS_CORE_Library/DataStructures.cs @@ -423,6 +423,153 @@ namespace CMS_CORE_Library MAGAZINE_GROUND = 2 } + public enum SIEMENS_LIFE_TYPE + { + TIME = 1, + COUNT = 2, + WEAR = 4 + } + + public class SiemensToolModel + { + public int Id; + public string FamilyName; + public int ChildId; + public SIEMENS_LIFE_TYPE LifeType; + public int MagazinePositionType; + public int ToolType; + public int LeftSize; + public int RightSize; + public ROTATION Rotation; + public bool Cooling1; + public bool Cooling2; + public bool IsEnabled; + public bool IsActive; + public bool InFixedPlace; + public bool IsInhibited; + public bool IsMeasured; + public bool InChangeTool; + public bool IsInUse; + public bool PreAlarm; + public List EdgesData; + + public SiemensToolModel() + { + EdgesData = new List(); + } + } + + public class EdgeModel + { + public int Id; + public double ResidualLife; + public double NominalLife; + public double PreAlmLife; + public Dictionary EdgeAdditionalParams; + + public EdgeModel() + { + EdgeAdditionalParams = new Dictionary(); + } + } + + public class ShankModel + { + public int Id; + public string Name; + public bool IsEnabled; + public bool IsInhibited; + public bool InChangeTool; + public bool InFixedPlace; + public bool InUse; + public int LeftSize; + public int RightSize; + public int MagazinePositionType; + public List ChildsTools; + + public ShankModel() + { + ChildsTools = new List(); + } + } + + public class ShankChildModel + { + public int Id; + public int MultitoolId; + public string FamilyName; + public int ToolType; + } + + public class FamilyModel + { + public int Id; + public string Name; + public List ChildTools; + + public FamilyModel() + { + ChildTools = new List(); + } + } + + public class FamilyChildModel + { + public int Id; + public int ChildId; + public int ToolType; + } + + public class PositionsModel + { + public int Id; + public int MagazineId; + public int Type; + } + + public class EdgeConfigModel + { + public string Name; + public string Path; + } + + public abstract class MagazinePositionsModel + { + public int Id; + public int Type; + } + + public class PositionWithMultiToolModel : MagazinePositionsModel + { + public MountedMultiToolModel ShankData; + } + + public class PositionWithToolModel : MagazinePositionsModel + { + public MountedToolModel Child; + } + + public class MountedMultiToolModel + { + public int Id; + public string Name; + public List ChildsTools; + } + public class MountedToolModel + { + public int Id; + public string FamilyName; + public int ToolType; + } + + public class NewToolInMagazineModel + { + public int PositionId; + public int ToolId; + } + + + ///////////////// Tools Configuration public class FieldsConfiguration { public string Name; @@ -465,89 +612,6 @@ namespace CMS_CORE_Library public List MagazinePosConfiguration; public EdgesConfiguration EdgesConfiguration; } - - public class SiemensToolModel - { - public int Id; - public string FamilyName; - public int ChildId; - public int MagazinePositionType; - public int ToolType; - public int LeftSize; - public int RightSize; - public ROTATION Rotation; - public bool Cooling1; - public bool Cooling2; - public bool IsEnabled; - public bool IsActive; - public bool InFixedPlace; - public bool IsInhibited; - public bool IsMeasured; - public bool InChangeTool; - public bool IsInUse; - public bool PreAlarm; - public List EdgesData; - } - - public class EdgeModel - { - public int Id; - public double ResidualLife; - public double NominalLife; - public double PreAlmLife; - public Dictionary EdgeAdditionalParams; - } - - public class ShankModel - { - public int Id; - public string Name; - public bool IsEnabled; - public bool IsInhibited; - public bool InChangeTool; - public bool InFixedPlace; - public bool InUse; - public int LeftSize; - public int RightSize; - public int MagazinePositionType; - public List ChildsTools; - } - - public class ShankChildModel - { - public int Id; - public int MultitoolId; - public string FamilyName; - public int ToolType; - } - - public class FamilyModel - { - public int Id; - public string Name; - public List ChildTools; - } - - public class FamilyChildModel - { - public int Id; - public int ChildId; - public int ToolType; - } - - public class MagazinePositionsModel - { - public int Id; - public int MagazineId; - public int Type; - } - - public class EdgeConfigModel - { - public string Name; - public string Path; - } - #endregion ToolsConfig } } \ No newline at end of file diff --git a/CMS_CORE_Library/Demo/ILibraryService.cs b/CMS_CORE_Library/Demo/ILibraryService.cs index 41697af..8b288ee 100644 --- a/CMS_CORE_Library/Demo/ILibraryService.cs +++ b/CMS_CORE_Library/Demo/ILibraryService.cs @@ -210,12 +210,20 @@ namespace Nc_Demo_Application.Server.Service void DeleteShank(string id); [WebGet(UriTemplate = "tool_table/positions", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] - void GetPositions(out List positionsData); + void GetPositions(out List positionsData); [WebInvoke(Method = "PUT", UriTemplate = "tool_table/position", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] - void PutPosition(ref MagazinePositionsModel position); + void PutPosition(ref PositionsModel position); + [WebGet(UriTemplate = "tool_table/magazine/{magazineId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] + void GetMagazinePositionsWithTools(string magazineId, out List positionsData); + + [WebGet(UriTemplate = "tool_table/magazine/tools", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] + void GetToolsAndMultiTools(out List shanks, out List tools); + + [WebInvoke(Method = "PUT", UriTemplate = "tool_table/magazine/{magazineId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] + void UpdateMagazine(string magazineId, List magazine); #endregion - + } } diff --git a/CMS_CORE_Library/Demo/Models/ToolDataModel.cs b/CMS_CORE_Library/Demo/Models/ToolDataModel.cs index fea2cf0..7b652f9 100644 --- a/CMS_CORE_Library/Demo/Models/ToolDataModel.cs +++ b/CMS_CORE_Library/Demo/Models/ToolDataModel.cs @@ -31,15 +31,24 @@ namespace CMS_CORE.Demo.Models public class ShankDataModel { public int Id; - public List childsTools; + public string Name; + public bool IsEnabled; + public bool IsInhibited; + public bool InChangeTool; + public bool InFixedPlace; + public bool InUse; + public int LeftSize; + public int RightSize; + public int MagazinePositionType; + public List ChildsTools; } public class DemoShankChildModel { - public int ToolId; - public int ChildId; + public int Id; + public int MultitoolId; public string FamilyName; - public int Type; + public int ToolType; } public class DemoPositionsModel @@ -48,4 +57,21 @@ namespace CMS_CORE.Demo.Models public int MagazineId; public int Type; } + + public class DemoMagPosDataModel + { + public int Id; + public int MagazineId; + public int Type; + public bool IsMultiTool; + public ShankDataModel Shank; + public DemoMagPosChildModel ChildTools; + } + + public class DemoMagPosChildModel + { + public int Id; + public string FamilyName; + public int ToolType; + } } \ No newline at end of file diff --git a/CMS_CORE_Library/Demo/Nc_Demo.cs b/CMS_CORE_Library/Demo/Nc_Demo.cs index c7fdff0..3f06166 100644 --- a/CMS_CORE_Library/Demo/Nc_Demo.cs +++ b/CMS_CORE_Library/Demo/Nc_Demo.cs @@ -300,72 +300,7 @@ namespace CMS_CORE.Demo #region PLC High-level data - //public override CmsError PLC_RActiveMessages(ref List alarms) - //{ - // try - // { - // alarms.Clear(); - // List readValues = new List(); - - // // Read status alarm data data from memory - // CmsError cmsError = MEM_RWIntegerList(R, 0, - // ALARMS_STATUS.MemType, - // ALARMS_STATUS.Address, - // ALARMS_STATUS.Size / 4, - // ref readValues); - - // bool[] statusBits = new BitArray(readValues.ToArray()).Cast().ToArray(); - - // // Convert array into structured data - // byte alarmData = 0; - // for (int i = 0; i < statusBits.Count(); i++) - // { - // // If alarm is active - // if (statusBits[i]) - // { - // // Read data from plc - // cmsError = MEM_RWByte(R, 0, ALARMS_DATA.MemType, ALARMS_DATA.Address + i, 0, ref alarmData); - // if (cmsError.IsError()) - // return cmsError; - // var dataBits = new BitArray(new int[] { alarmData }).Cast().ToArray(); - // var processList = new List(); - - // for(int j = 2; j < 8; j++) - // { - // if (dataBits[j]) - // processList.Add(j - 1); - // } - - // alarms.Add(new PlcAlarmModel() - // { - // Id = (uint)i, - // IsWarning = dataBits[0], - // RestorationIsActive = dataBits[1], - // Process = processList - // }); - // } - // } - // /////////////////////////////// - // //alarms.Clear(); - - // //List demoAlarms; - // //// Get Alarms from server - // //serverService.PlcAlarms(out demoAlarms); - // //// Parse response - // //foreach (NcAlarmModel demoAlarm in demoAlarms) - // //{ - // // AddAlarmToList((uint)demoAlarm.code, demoAlarm.text, alarms); - // //} - // } - // catch (Exception ex) - // { - // return ManageException(ex); - // } - - // return NO_ERROR; - //} - - public override CmsError PLC_RActiveMessages(ref List alarms) + public override CmsError PLC_RActiveMessages(ref List alarms) { alarms.Clear(); List readValues = new List(); @@ -1736,7 +1671,7 @@ namespace CMS_CORE.Demo return NO_ERROR; } - public override CmsError TOOLS_RToolTable(ref List toolTable) + public override CmsError TOOLS_RToolsData(ref List toolTable) { // Check if the NC Demo is Connected CmsError cmsError = CheckConnection(); @@ -2202,28 +2137,18 @@ namespace CMS_CORE.Demo } } - public override CmsError TOOLS_RMagazinePositions(ref List positions) + public override CmsError TOOLS_RMagazinePositions(ref List positions) { // Check if the NC Demo is Connected CmsError cmsError = CheckConnection(); if (cmsError.IsError()) return cmsError; - positions = new List(); + positions = new List(); try { // Get position data from demo serverService.GetPositions(out positions); - //// Populate output model - //foreach (DemoPositionsModel position in demoPositions) - //{ - // positions.Add(new MagazinePositionsModel() - // { - // Id = position.Id, - // MagazineId = position.MagazineId, - // Type = position.Type - // }); - //} return NO_ERROR; } @@ -2233,7 +2158,7 @@ namespace CMS_CORE.Demo } } - public override CmsError TOOLS_WUpdateMagazinesPositions(MagazinePositionsModel position) + public override CmsError TOOLS_WUpdatePositions(PositionsModel position) { // Check if the NC Demo is Connected CmsError cmsError = CheckConnection(); @@ -2253,6 +2178,133 @@ namespace CMS_CORE.Demo } } + public override CmsError TOOLS_RMagazineTools(int magazineId, ref List magazinePos) + { + // Check if the NC Demo is Connected + CmsError cmsError = CheckConnection(); + if (cmsError.IsError()) + return cmsError; + + try + { + magazinePos = new List(); + // Get tools equipped in the magazine + serverService.GetMagazinePositionsWithTools(magazineId.ToString(), out List demoMagazinePositions); + + foreach (DemoMagPosDataModel demoPos in demoMagazinePositions) + { + if(demoPos.IsMultiTool == false) + { + if(demoPos.ChildTools != null) + { + + // Create Tool Model + PositionWithToolModel pos = new PositionWithToolModel() + { + Id = demoPos.Id, + Type = demoPos.Type, + Child = new MountedToolModel + { + Id = demoPos.ChildTools.Id, + FamilyName = demoPos.ChildTools.FamilyName, + ToolType = demoPos.ChildTools.ToolType + } + }; + + magazinePos.Add(pos); + } + } + else + { + // Get multi tools childs + var childsTools = demoPos.Shank?.ChildsTools?.Select(x => new ShankChildModel() // Get Childs + { + Id = x.Id, + FamilyName = x.FamilyName, + MultitoolId = x.MultitoolId, + ToolType = x.ToolType + }).ToList(); + + if (childsTools != null) + { + // Create multi tool model + PositionWithMultiToolModel pos = new PositionWithMultiToolModel() + { + Id = demoPos.Id, + Type = demoPos.Type, + ShankData = new MountedMultiToolModel() + { + Id = demoPos.Shank.Id, + Name = demoPos.Shank.Name, + ChildsTools = childsTools + } + }; + + magazinePos.Add(pos); + } + } + } + + return NO_ERROR; + } + catch(Exception ex) + { + return ManageException(ex); + } + } + + public override CmsError TOOLS_RAvailableTools(ref List multiTools, ref List tools) + { + // Check if the NC Demo is Connected + CmsError cmsError = CheckConnection(); + if (cmsError.IsError()) + return cmsError; + + try + { + serverService.GetToolsAndMultiTools(out List shanks, out List demoTools); + // Parse multiTool Data + multiTools = shanks.Select(x => new MountedMultiToolModel + { + Id = x.Id, + Name = x.Name, + ChildsTools = x.ChildsTools + }).ToList(); + // Parse tool data + tools = demoTools.Select(x => new MountedToolModel + { + Id = x.Id, + FamilyName = x.FamilyName, + ToolType = x.ToolType + }).ToList(); + + return NO_ERROR; + } + catch (Exception ex) + { + return ManageException(ex); + } + } + + public override CmsError TOOLS_WUpdateMagazineTools(int magazine, List newMagazine) + { + // Check if the NC Demo is Connected + CmsError cmsError = CheckConnection(); + if (cmsError.IsError()) + return cmsError; + + try + { + serverService.UpdateMagazine(magazine.ToString(), newMagazine); + + return NO_ERROR; + } + catch (Exception ex) + { + return ManageException(ex); + } + } + #endregion ToolTable /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index 884829f..32d202f 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -1670,7 +1670,7 @@ namespace CMS_CORE.Fanuc { return NO_ERROR; } - public override CmsError TOOLS_RToolTable(ref List toolTable) + public override CmsError TOOLS_RToolsData(ref List toolTable) { return NO_ERROR; } @@ -1685,7 +1685,7 @@ namespace CMS_CORE.Fanuc return NO_ERROR; } - public override CmsError TOOLS_RMagazinePositions(ref List positions) + public override CmsError TOOLS_RMagazinePositions(ref List positions) { return NO_ERROR; } @@ -1710,7 +1710,7 @@ namespace CMS_CORE.Fanuc return NO_ERROR; } - public override CmsError TOOLS_WUpdateMagazinesPositions(MagazinePositionsModel position) + public override CmsError TOOLS_WUpdatePositions(PositionsModel position) { return NO_ERROR; } @@ -1755,6 +1755,20 @@ namespace CMS_CORE.Fanuc return NO_ERROR; } + public override CmsError TOOLS_RMagazineTools(int magazineId, ref List magazinePos) + { + return NO_ERROR; + } + + public override CmsError TOOLS_RAvailableTools(ref List multiTools, ref List tools) + { + return NO_ERROR; + } + + public override CmsError TOOLS_WUpdateMagazineTools(int magazine, List newMagazine) + { + return NO_ERROR; + } #endregion Tools Management /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/CMS_CORE_Library/Nc.cs b/CMS_CORE_Library/Nc.cs index 440854a..201caae 100644 --- a/CMS_CORE_Library/Nc.cs +++ b/CMS_CORE_Library/Nc.cs @@ -1300,13 +1300,13 @@ namespace CMS_CORE * Reference to the tool table data object **/ - public abstract CmsError TOOLS_RToolTable(ref List toolTable); + public abstract CmsError TOOLS_RToolsData(ref List toolTable); public abstract CmsError TOOLS_RShanksData(ref List shanksData); public abstract CmsError TOOLS_RFamilyData(ref List families); - public abstract CmsError TOOLS_RMagazinePositions(ref List positions); + public abstract CmsError TOOLS_RMagazinePositions(ref List positions); public abstract CmsError TOOLS_WAddTool(ref SiemensToolModel tool); @@ -1316,7 +1316,7 @@ namespace CMS_CORE public abstract CmsError TOOLS_WUpdateFamilyData(string oldName, string newName); - public abstract CmsError TOOLS_WUpdateMagazinesPositions(MagazinePositionsModel position); + public abstract CmsError TOOLS_WUpdatePositions(PositionsModel position); public abstract CmsError TOOLS_WUpdateTool(SiemensToolModel tool); @@ -1334,6 +1334,12 @@ namespace CMS_CORE public abstract CmsError TOOLS_WUpdateShank(ref ShankModel shank); + public abstract CmsError TOOLS_RMagazineTools(int magazineId, ref List magazinePos); + + public abstract CmsError TOOLS_RAvailableTools(ref List multiTools, ref List tools); + + public abstract CmsError TOOLS_WUpdateMagazineTools(int magazine, List newMagazine); + #endregion Tool Table /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/CMS_CORE_Library/Osai/Nc_Osai.cs b/CMS_CORE_Library/Osai/Nc_Osai.cs index 0fffd7d..020125f 100644 --- a/CMS_CORE_Library/Osai/Nc_Osai.cs +++ b/CMS_CORE_Library/Osai/Nc_Osai.cs @@ -2040,7 +2040,7 @@ namespace CMS_CORE.Osai return NO_ERROR; } - public override CmsError TOOLS_RToolTable(ref List toolTable) + public override CmsError TOOLS_RToolsData(ref List toolTable) { return NO_ERROR; } @@ -2055,7 +2055,7 @@ namespace CMS_CORE.Osai return NO_ERROR; } - public override CmsError TOOLS_RMagazinePositions(ref List positions) + public override CmsError TOOLS_RMagazinePositions(ref List positions) { return NO_ERROR; } @@ -2080,7 +2080,7 @@ namespace CMS_CORE.Osai return NO_ERROR; } - public override CmsError TOOLS_WUpdateMagazinesPositions(MagazinePositionsModel position) + public override CmsError TOOLS_WUpdatePositions(PositionsModel position) { return NO_ERROR; } @@ -2125,6 +2125,21 @@ namespace CMS_CORE.Osai return NO_ERROR; } + public override CmsError TOOLS_RMagazineTools(int magazineId, ref List magazinePos) + { + return NO_ERROR; + } + + public override CmsError TOOLS_RAvailableTools(ref List multiTools, ref List tools) + { + return NO_ERROR; + } + + public override CmsError TOOLS_WUpdateMagazineTools(int magazine, List newMagazine) + { + return NO_ERROR; + } + #endregion Tools Management /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/CMS_CORE_Library/Siemens/Nc_Siemens.cs b/CMS_CORE_Library/Siemens/Nc_Siemens.cs index 073960c..8ce573f 100644 --- a/CMS_CORE_Library/Siemens/Nc_Siemens.cs +++ b/CMS_CORE_Library/Siemens/Nc_Siemens.cs @@ -66,8 +66,8 @@ namespace CMS_CORE.Siemens // STatic variables private AlarmSvc SiemensAlmSvc; - - private ToolMngmntSvc SiemensToolSvc = null; + // Tool table handler + private static ToolMngmntSvc SiemensToolSvc = null; private Guid ToolMngmtListGuid = Guid.Empty; private Alarm[] SiemensAlarms; @@ -75,6 +75,7 @@ namespace CMS_CORE.Siemens private static string PlcMessagesFilePath = "C:\\Program Files (x86)\\Siemens\\MotionControl\\oem\\sinumerik\\hmi\\lng\\"; private const string AXES_FILE_PATH = "C:\\CMS\\axes.xml"; + private SiemensEdgesConfiguration AdditionalEdgesParamConfig = new SiemensEdgesConfiguration(); private static List ToolTableData = new List(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -122,8 +123,12 @@ namespace CMS_CORE.Siemens SiemensAlmSvc = new AlarmSvc(ConvertToSTEPLanguage(SiemensLanguage).ThreeLetterISOLanguageName); SiemensAlmSvc.Subscribe(AlarmsChanged); - SiemensToolSvc = new ToolMngmntSvc(1); - ToolMngmtListGuid = SiemensToolSvc.Subscribe(TOOLS_UpdateToolsData); + + if (SiemensToolSvc == null) + { + SiemensToolSvc = new ToolMngmntSvc(1); + ToolMngmtListGuid = SiemensToolSvc.Subscribe(TOOLS_UpdateToolsData); + } } catch (Exception ex) { @@ -138,7 +143,8 @@ namespace CMS_CORE.Siemens { //Set Connected to FALSE and close the session Connected = false; - // SiemensToolSvc.UnSubscribe(TOOLS_UpdateToolsData); + if (SiemensToolSvc != null) + SiemensToolSvc.UnSubscribe(TOOLS_UpdateToolsData); return NO_ERROR; } @@ -1738,11 +1744,34 @@ namespace CMS_CORE.Siemens public override CmsError TOOLS_RConfiguration(ref ToolTableConfiguration config) { config.ToolsConfiguration = SiemensToolsConfig; + config.FamiliesConfiguration = SiemensFamiliesConfig; + config.ShanksConfiguration = SiemensShanksConfig; + config.MagazinePosConfiguration = SiemensMagazinePosConfig; + config.EdgesConfiguration = ToolConfigurations.SiemensEdgesConfiguration; + + config.EdgesConfiguration.EdgesAdditionalParamsConfiguration = new Dictionary>(); + // Remove path and set only names + foreach (int key in AdditionalEdgesParamConfig.EdgesConfig.Keys) + { + List tmpNames = new List(); + foreach (var conf in AdditionalEdgesParamConfig.EdgesConfig[key]) + { + tmpNames.Add(conf.Name); + } + config.EdgesConfiguration.EdgesAdditionalParamsConfiguration.Add(key, tmpNames); + } + + config.Magazines = new List() + { + new MagazineModel{Id = 1, Type = MAGAZINE_TYPE.MAGAZINE}, + new MagazineModel{Id = 2, Type = MAGAZINE_TYPE.MAGAZINE}, + new MagazineModel{Id = 3, Type = MAGAZINE_TYPE.SPINDLE}, + }; return NO_ERROR; } - public override CmsError TOOLS_RToolTable(ref List toolTable) + public override CmsError TOOLS_RToolsData(ref List toolTable) { toolTable = ToolTableData; @@ -1768,6 +1797,13 @@ namespace CMS_CORE.Siemens { try { + // Create a configuration file + FileStream f = new FileStream("C:\\TO_INI.INI", FileMode.Create); + // Read siemens configuration file + FILES_RProgramToFile("//NC/ACT.DIR/TO.DIR/TO_INI.INI", f); + f.Close(); + string[] toolStrings = File.ReadAllLines("C:\\TO_INI.INI"); + switch (toolInfo.action) { case ToolAction.TOOL_DELETED: @@ -1780,12 +1816,12 @@ namespace CMS_CORE.Siemens case ToolAction.TOOL_CREATED: { - // Create a configuration file - FileStream f = new FileStream("C:\\TO_INI.INI", FileMode.Create); - // Read siemens configuration file - FILES_RProgramToFile("//NC/ACT.DIR/TO.DIR/TO_INI.INI", f); - f.Close(); - string[] toolStrings = File.ReadAllLines("C:\\TO_INI.INI"); + //// Create a configuration file + //FileStream f = new FileStream("C:\\TO_INI.INI", FileMode.Create); + //// Read siemens configuration file + //FILES_RProgramToFile("//NC/ACT.DIR/TO.DIR/TO_INI.INI", f); + //f.Close(); + //string[] toolStrings = File.ReadAllLines("C:\\TO_INI.INI"); var newTool = TOOLS_CreateToolFromType((int)toolInfo.tNo, toolStrings); @@ -1793,7 +1829,12 @@ namespace CMS_CORE.Siemens } break; - case ToolAction.TOOL_DATA_CHANGED: { } break; + case ToolAction.TOOL_DATA_CHANGED: + { + var toolIndex = ToolTableData.FindIndex(t => t.Id == toolInfo.tNo); + ToolTableData[toolIndex] = TOOLS_CreateToolFromType((int)toolInfo.tNo, toolStrings); + } + break; case ToolAction.TOOL_MOVED: { } break; } } @@ -1805,14 +1846,14 @@ namespace CMS_CORE.Siemens return NO_ERROR; } - private SiemensToolModel TOOLS_CreateToolFromType(int toolId, string[] toolStrings) + private SiemensToolModel TOOLS_CreateToolFromType(int toolId, string[] toolsStrings) { SiemensEdgesConfiguration toolEdgesConfig = new SiemensEdgesConfiguration(); // Find its status - var toolStatus = Convert.ToByte(toolStrings.FirstOrDefault(X => X.Contains("$TC_TP8[" + toolId)).Split('=').LastOrDefault()); + var toolStatus = Convert.ToByte(toolsStrings.FirstOrDefault(X => X.Contains("$TC_TP8[" + toolId)).Split('=').LastOrDefault()); // Find basic info (rotation, cooling ...) - var toolInfo = Convert.ToInt32(toolStrings.FirstOrDefault(X => X.Contains("$TC_DP25[" + toolId)).Split('=').LastOrDefault()); + var toolInfo = Convert.ToInt32(toolsStrings.FirstOrDefault(X => X.Contains("$TC_DP25[" + toolId)).Split('=').LastOrDefault()); // Get rotation data ROTATION rotation = ROTATION.NONE; @@ -1820,16 +1861,17 @@ namespace CMS_CORE.Siemens rotation = ROTATION.CLOCKWHISE; else if (GetBitValue(toolInfo, 10)) rotation = ROTATION.COUNTERCLOCKWHISE; + // Create tool model SiemensToolModel toolValues = new SiemensToolModel() { Id = toolId, - FamilyName = toolStrings.FirstOrDefault(x => x.Contains("$TC_TP2[" + toolId)).Split('=').LastOrDefault(), - ChildId = Convert.ToInt32(toolStrings.FirstOrDefault(x => x.Contains("$TC_TP1[" + toolId)).Split('=').LastOrDefault()), - // ToolType = toolType, - LeftSize = Convert.ToByte(toolStrings.FirstOrDefault(X => X.Contains("$TC_TP3[" + toolId)).Split('=').LastOrDefault()), - RightSize = Convert.ToByte(toolStrings.FirstOrDefault(X => X.Contains("$TC_TP4[" + toolId)).Split('=').LastOrDefault()), + FamilyName = toolsStrings.FirstOrDefault(x => x.Contains("$TC_TP2[" + toolId)).Split('=').LastOrDefault(), + ChildId = Convert.ToInt32(toolsStrings.FirstOrDefault(x => x.Contains("$TC_TP1[" + toolId)).Split('=').LastOrDefault()), + LeftSize = Convert.ToByte(toolsStrings.FirstOrDefault(X => X.Contains("$TC_TP3[" + toolId)).Split('=').LastOrDefault()), + RightSize = Convert.ToByte(toolsStrings.FirstOrDefault(X => X.Contains("$TC_TP4[" + toolId)).Split('=').LastOrDefault()), Rotation = rotation, + LifeType = (SIEMENS_LIFE_TYPE)Convert.ToInt32(toolsStrings.FirstOrDefault(x => x.Contains("$TC_TP7[" + toolId)).Split('=').LastOrDefault()), Cooling1 = GetBitValue(toolInfo, 11), Cooling2 = GetBitValue(toolInfo, 12), IsActive = GetBitValue(toolStatus, 1), @@ -1844,27 +1886,33 @@ namespace CMS_CORE.Siemens // LEGGERE MAX = $MN_MM_MAX_CUTTING_EDGE_PERTOOL // For each possible edges - for (int i = 0; i < 5; i++) + for (int i = 1; i <= 5; i++) { // Find the type of the edges - var toolType = toolStrings.FirstOrDefault(X => X.Contains("$TC_DP1[" + toolId + "," + i)); + var toolType = toolsStrings.FirstOrDefault(X => X.Contains("$TC_DP1[" + toolId + "," + i)); // If type doesn't exist than edges doesn't exist if (toolType != null) { int toolTypeVal = Convert.ToByte(toolType.Split('=').LastOrDefault()); + // Set Tool type by its first edge type + if( i == 1) + toolValues.ToolType = toolTypeVal; // Get tool type additional parameters var toolTypeConfig = toolEdgesConfig.EdgesConfig[toolTypeVal]; - EdgeModel edgeData = new EdgeModel(); + // Create new edge data and set data + EdgeModel edgeData = SetUpEdgeData(toolsStrings, toolValues.LifeType, toolValues.Id, i); + // For each dynamic parameter configured foreach (var item in toolTypeConfig) { edgeData.EdgeAdditionalParams.Add( item.Name, - Convert.ToDouble(toolStrings.FirstOrDefault(X => X.Contains(item.Path + toolId + "," + i)).Split('=').LastOrDefault()) + Convert.ToDouble(toolsStrings.FirstOrDefault(X => X.Contains(item.Path + toolId + "," + i)).Split('=').LastOrDefault()) ); } + toolValues.EdgesData.Add(edgeData); } } @@ -1872,6 +1920,41 @@ namespace CMS_CORE.Siemens return toolValues; } + private EdgeModel SetUpEdgeData(string[] toolsString, SIEMENS_LIFE_TYPE lifeType, int toolId, int edgeId) + { + EdgeModel edgeData = new EdgeModel + { + Id = edgeId + }; + + switch (lifeType) + { + case SIEMENS_LIFE_TYPE.TIME: + { + edgeData.ResidualLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP2[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.NominalLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP11[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.PreAlmLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP1[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + } + break; + case SIEMENS_LIFE_TYPE.COUNT: + { + edgeData.ResidualLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP4[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.NominalLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP13[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.PreAlmLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP3[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + } + break; + case SIEMENS_LIFE_TYPE.WEAR: + { + edgeData.ResidualLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP6[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.NominalLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP13[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + edgeData.PreAlmLife = Convert.ToDouble(toolsString.FirstOrDefault(X => X.Contains("$TC_MOP15[" + toolId + "," + edgeId)).Split('=').LastOrDefault()); + } + break; + } + + return edgeData; + } + public override CmsError TOOLS_RShanksData(ref List shanksData) { return NO_ERROR; @@ -1882,7 +1965,7 @@ namespace CMS_CORE.Siemens return NO_ERROR; } - public override CmsError TOOLS_RMagazinePositions(ref List positions) + public override CmsError TOOLS_RMagazinePositions(ref List positions) { return NO_ERROR; } @@ -1907,7 +1990,7 @@ namespace CMS_CORE.Siemens return NO_ERROR; } - public override CmsError TOOLS_WUpdateMagazinesPositions(MagazinePositionsModel position) + public override CmsError TOOLS_WUpdatePositions(PositionsModel position) { return NO_ERROR; } @@ -1951,6 +2034,22 @@ namespace CMS_CORE.Siemens { return NO_ERROR; } + + public override CmsError TOOLS_RMagazineTools(int magazineId, ref List magazinePos) + { + return NO_ERROR; + } + + public override CmsError TOOLS_RAvailableTools(ref List multiTools, ref List tools) + { + return NO_ERROR; + } + + public override CmsError TOOLS_WUpdateMagazineTools(int magazine, List newMagazine) + { + return NO_ERROR; + } + #endregion Tool Management /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs b/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs index 201acef..d4f7353 100644 --- a/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs +++ b/CMS_CORE_Library/Siemens/SiemensEdgesConfigurations.cs @@ -10,430 +10,430 @@ namespace CMS_CORE_Library.Siemens { 100, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 110, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 111, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "CornerRadius", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "cornerRadius", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 120, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 121, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 130, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "GeomDeltaLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomDeltaLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomDeltaLenght3", Path = "$TC_DP14["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["}, - new EdgeConfigModel{Name = "V", Path = "$TC_DPV["}, - new EdgeConfigModel{Name = "Vector1", Path = "$TC_DPV3["}, - new EdgeConfigModel{Name = "Vector2", Path = "$TC_DPV4["}, - new EdgeConfigModel{Name = "Vector3", Path = "$TC_DPV5["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "geomDeltaLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomDeltaLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomDeltaLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["}, + new EdgeConfigModel{Name = "v", Path = "$TC_DPV["}, + new EdgeConfigModel{Name = "vector1", Path = "$TC_DPV3["}, + new EdgeConfigModel{Name = "vector2", Path = "$TC_DPV4["}, + new EdgeConfigModel{Name = "vector3", Path = "$TC_DPV5["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 131, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "CornerRadius", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "GeomDeltaLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomDeltaLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomDeltaLenght3", Path = "$TC_DP14["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["}, - new EdgeConfigModel{Name = "V", Path = "$TC_DPV["}, - new EdgeConfigModel{Name = "Vector1", Path = "$TC_DPV3["}, - new EdgeConfigModel{Name = "Vector2", Path = "$TC_DPV4["}, - new EdgeConfigModel{Name = "Vector3", Path = "$TC_DPV5["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "cornerRadius", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "geomDeltaLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomDeltaLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomDeltaLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["}, + new EdgeConfigModel{Name = "v", Path = "$TC_DPV["}, + new EdgeConfigModel{Name = "vector1", Path = "$TC_DPV3["}, + new EdgeConfigModel{Name = "vector2", Path = "$TC_DPV4["}, + new EdgeConfigModel{Name = "vector3", Path = "$TC_DPV5["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 140, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "OutsideRadius", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "outsideRadius", Path = "$TC_DP7["}, new EdgeConfigModel{Name = "ToolAngle", Path = "$TC_DP11["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 145, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 150, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, new EdgeConfigModel{Name = "Width", Path = "$TC_DP9[" }, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15[" }, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15[" }, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 151, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, new EdgeConfigModel{Name = "Width", Path = "$TC_DP9[" }, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15[" }, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15[" }, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 155, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "TaperAngle", Path = "$TC_DP11[" }, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "taperAngle", Path = "$TC_DP11[" }, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 156, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "CornerRadius", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "TaperAngle", Path = "$TC_DP11[" }, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "cornerRadius", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "taperAngle", Path = "$TC_DP11[" }, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 157, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "TaperAngle", Path = "$TC_DP11[" }, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "taperAngle", Path = "$TC_DP11[" }, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, { 160, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "Teeth", Path = "$TC_DPNT[" } + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "teeth", Path = "$TC_DPNT[" } } }, //////// 200 - 300 { 200, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{ Name = "TipAngle", Path = "$TC_DP24["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{ Name = "tipAngle", Path = "$TC_DP24["} } }, { 205, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 210, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 220, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{ Name = "TipAngle", Path = "$TC_DP24["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{ Name = "tipAngle", Path = "$TC_DP24["} } }, { 230, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{ Name = "TipAngle", Path = "$TC_DP24["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{ Name = "tipAngle", Path = "$TC_DP24["} } }, { 231, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 240, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "Pitch", Path = "$TC_DP9["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "pitch", Path = "$TC_DP9["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 241, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 242, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, { 250, new List() { - new EdgeConfigModel{ Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{ Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{ Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{ Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{ Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{ Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{ Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{ Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{ Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{ Name = "wearRadius", Path = "$TC_DP15["} } }, ///////// 700 - 900 { 700, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Diameter", Path = "6"}, - new EdgeConfigModel{Name = "GeomSlotWidth", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "GeomPrjection", Path = "$TC_DP8["}, - new EdgeConfigModel{Name = "GeomWearLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomWearLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomWearLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "diameter", Path = "6"}, + new EdgeConfigModel{Name = "geomSlotWidth", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "geomPrjection", Path = "$TC_DP8["}, + new EdgeConfigModel{Name = "geomWearLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomWearLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomWearLenght3", Path = "$TC_DP14["}, new EdgeConfigModel{Name = "WearDiameter", Path = "$TC_DP15["}, new EdgeConfigModel{Name = "WearSlotWdth", Path = "$TC_DP16["}, new EdgeConfigModel{Name = "WearGeomPrjection", Path = "$TC_DP17["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["} + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["} } }, { 710, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["} } }, { 711, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["} } }, { 712, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "CorrAngle", Path = "$TC_DP10["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "corrAngle", Path = "$TC_DP10["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["} } }, { 713, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "BoomLenght", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "CorrAngle", Path = "$TC_DP10["}, - new EdgeConfigModel{Name = "GeomWearLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomWearLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomWearLenght3", Path = "$TC_DP14["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "boomLenght", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "corrAngle", Path = "$TC_DP10["}, + new EdgeConfigModel{Name = "geomWearLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomWearLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomWearLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["} } }, { 714, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "BallRadius", Path = "$TC_DP7["}, - new EdgeConfigModel{Name = "CorrAngle", Path = "$TC_DP10["}, - new EdgeConfigModel{Name = "GeomWearLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomWearLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomWearLenght3", Path = "$TC_DP14["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "ballRadius", Path = "$TC_DP7["}, + new EdgeConfigModel{Name = "corrAngle", Path = "$TC_DP10["}, + new EdgeConfigModel{Name = "geomWearLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomWearLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomWearLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["} } }, { 725, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "GeomLenght1", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "GeomLenght2", Path = "$TC_DP4["}, - new EdgeConfigModel{Name = "GeomLenght3", Path = "$TC_DP5["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "CorrAngle", Path = "$TC_DP10["}, - new EdgeConfigModel{Name = "GeomWearLenght1", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "GeomWearLenght2", Path = "$TC_DP13["}, - new EdgeConfigModel{Name = "GeomWearLenght3", Path = "$TC_DP14["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["}, - new EdgeConfigModel{Name = "AdapterLenght1", Path = "$TC_DP21["}, - new EdgeConfigModel{Name = "AdapterLenght2", Path = "$TC_DP22["}, - new EdgeConfigModel{Name = "AdapterLenght3", Path = "$TC_DP23["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "geomLenght1", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "geomLenght2", Path = "$TC_DP4["}, + new EdgeConfigModel{Name = "geomLenght3", Path = "$TC_DP5["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "corrAngle", Path = "$TC_DP10["}, + new EdgeConfigModel{Name = "geomWearLenght1", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "geomWearLenght2", Path = "$TC_DP13["}, + new EdgeConfigModel{Name = "geomWearLenght3", Path = "$TC_DP14["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["}, + new EdgeConfigModel{Name = "adapterLenght1", Path = "$TC_DP21["}, + new EdgeConfigModel{Name = "adapterLenght2", Path = "$TC_DP22["}, + new EdgeConfigModel{Name = "adapterLenght3", Path = "$TC_DP23["} } }, { 730, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["} } }, { 900, new List() { - new EdgeConfigModel{Name = "CuttingEdgeConfigModel", Path = "$TC_DP2["}, - new EdgeConfigModel{Name = "Lenght", Path = "$TC_DP3["}, - new EdgeConfigModel{Name = "Radius", Path = "$TC_DP6["}, - new EdgeConfigModel{Name = "WearLenght", Path = "$TC_DP12["}, - new EdgeConfigModel{Name = "WearRadius", Path = "$TC_DP15["} + new EdgeConfigModel{Name = "cuttingEdge", Path = "$TC_DP2["}, + new EdgeConfigModel{Name = "lenght", Path = "$TC_DP3["}, + new EdgeConfigModel{Name = "radius", Path = "$TC_DP6["}, + new EdgeConfigModel{Name = "wearLenght", Path = "$TC_DP12["}, + new EdgeConfigModel{Name = "wearRadius", Path = "$TC_DP15["} } }, }; diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/DatabaseController.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/DatabaseController.cs index e6dfa93..be4f43d 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/DatabaseController.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/DatabaseController.cs @@ -730,7 +730,6 @@ namespace Nc_Demo_Application.Database lastId = lastId + 1; else lastId = Convert.ToInt32(row["id"]); - // Create&Populate shanks childs int i = 1; @@ -778,9 +777,7 @@ namespace Nc_Demo_Application.Database { // Create new row that must be inserted DataRow row = ShanksDataTable.NewRow(); - int id = 1; - if(ShanksDataTable.Rows.Count > 0) - id = Convert.ToInt32(ShanksDataTable.Rows[ShanksDataTable.Rows.Count - 1]["id"]) + 1; + int id = GetToolMultiToolId(); // Setup autoincrement Id newShank.Id = id; @@ -794,7 +791,7 @@ namespace Nc_Demo_Application.Database row["left_size"] = newShank.LeftSize; row["right_size"] = newShank.RightSize; row["magazine_position"] = newShank.RightSize; - + // Add the new row to the datatable ShanksDataTable.Rows.Add(row); // Update Database @@ -856,7 +853,7 @@ namespace Nc_Demo_Application.Database // Delete row with matching id DataRow row = ShanksDataTable.AsEnumerable().FirstOrDefault(x => Convert.ToInt32(x["id"]) == id); - if(row != null) + if (row != null) { row.Delete(); // Update database @@ -901,7 +898,7 @@ namespace Nc_Demo_Application.Database ToolsDataModel tool = new ToolsDataModel { Id = Convert.ToInt32(row["id"]), - MagazineId = Convert.ToInt32(row["magazine"]), + // MagazineId = Convert.ToInt32(row["magazine"]), FamilyName = row["family"].ToString(), ChildId = Convert.ToInt32(row["childId"]), MagazinePositionType = Convert.ToInt32(row["magazinePositionType"]), @@ -944,14 +941,14 @@ namespace Nc_Demo_Application.Database // Create new row that must be inserted DataRow row = ToolsDataTable.NewRow(); // Find & set new item Id - toolData.Id = Convert.ToInt32(ToolsDataTable.Rows[ToolsDataTable.Rows.Count - 1]["id"]) + 1; + toolData.Id = GetToolMultiToolId(); // Get child id toolData.ChildId = GetFamilyChildId(toolData.FamilyName); // Setup autoincrement Id row["id"] = toolData.Id; row["family"] = toolData.FamilyName; - row["magazine"] = toolData.MagazineId; + // row["magazine"] = toolData.MagazineId; row["childId"] = toolData.ChildId; row["magazinePositionType"] = toolData.MagazinePositionType; row["toolType"] = toolData.ToolType; @@ -1004,7 +1001,7 @@ namespace Nc_Demo_Application.Database row["childId"] = toolData.ChildId; row["family"] = toolData.FamilyName; - row["magazine"] = toolData.MagazineId; + // row["magazine"] = toolData.MagazineId; row["magazinePositionType"] = toolData.MagazinePositionType; row["toolType"] = toolData.ToolType; row["shankId"] = toolData.ShanksId; @@ -1038,6 +1035,7 @@ namespace Nc_Demo_Application.Database { UpdateDatabaseFromDataTable(tools, READ_TOOLS_QUERY); } + private int GetFamilyChildId(string familyName) { // Find next child id @@ -1051,6 +1049,19 @@ namespace Nc_Demo_Application.Database return 1; } + private int GetToolMultiToolId() + { + int max = 0; + if (ToolsDataTable.Rows.Count > 0) + max = Convert.ToInt32(ToolsDataTable.Rows[ToolsDataTable.Rows.Count - 1]["id"]); + + if (ShanksDataTable.Rows.Count > 0) + if (max < Convert.ToInt32(ShanksDataTable.Rows[ShanksDataTable.Rows.Count - 1]["id"])) + max = Convert.ToInt32(ShanksDataTable.Rows[ShanksDataTable.Rows.Count - 1]["id"]); + + return max + 1; + } + public void DeleteTool(int id) { try @@ -1067,7 +1078,7 @@ namespace Nc_Demo_Application.Database // Delete row with matching id DataRow row = ToolsDataTable.AsEnumerable().FirstOrDefault(x => Convert.ToInt32(x["id"]) == id); - if(row != null) + if (row != null) { row.Delete(); // Update database @@ -1199,11 +1210,11 @@ namespace Nc_Demo_Application.Database row["nominal_life"] = newEdge.NominalLife; row["prealm_life"] = newEdge.PreAlmLife; // Setup additional parameters value - foreach(KeyValuePair param in newEdge.EdgeAdditionalParams) + foreach (KeyValuePair param in newEdge.EdgeAdditionalParams) { row[param.Key] = param.Value; } - + UpdateEdges(edgesTable); return newEdge; @@ -1238,7 +1249,7 @@ namespace Nc_Demo_Application.Database // Delete row with matching edgeId inside tool DataRow row = edgesTable.AsEnumerable().FirstOrDefault(x => Convert.ToInt32(x["child_id"]) == edgeId); - if(row != null) + if (row != null) { row.Delete(); @@ -1274,11 +1285,6 @@ namespace Nc_Demo_Application.Database } } - public void UpdateMagazines(DataTable magazines) - { - UpdateDatabaseFromDataTable(magazines, READ_MAGAZINES_QUERY); - } - public List GetPositions() { List positions = new List(); @@ -1289,7 +1295,7 @@ namespace Nc_Demo_Application.Database { Id = Convert.ToInt32(row["positionId"]), MagazineId = Convert.ToInt32(row["magazineId"]), - Type = Convert.ToInt32(row["type"]), + Type = Convert.ToInt32(row["type"]) }; positions.Add(tmpPositions); @@ -1306,6 +1312,11 @@ namespace Nc_Demo_Application.Database .AsEnumerable() .Where(x => Convert.ToInt32(x["magazineId"]) == magazineId).ToList(); + // Get shanks Data + List shanks = GetShanks(); + // Get tools data + List tools = GetToolsData(); + foreach (DataRow row in magazinePositions) { // Convert DataTable.row into positions model @@ -1313,21 +1324,66 @@ namespace Nc_Demo_Application.Database { Id = Convert.ToInt32(row["positionId"]), MagazineId = Convert.ToInt32(row["magazineId"]), - Type = Convert.ToInt32(row["type"]), + Type = Convert.ToInt32(row["type"]) }; + int shankId = Convert.ToInt32(row["shankId"]); - // Find mounted tool in the selected position & magazine - tmpPositions.childsTools = ToolsDataTable.AsEnumerable() - .Where(x => Convert.ToInt32(x["magazine"]) == magazineId && Convert.ToInt32(x["shankId"]) == tmpPositions.Id)? - .Select(x => new PositionsChild() { Id = tmpPositions.Id }) - .ToList(); + if (shankId != 0) + { + // Find mounted tools in the selected position & with shankId + ShankDataModel shank = shanks.Where(x => x.Id == shankId).FirstOrDefault(); + // Populate child positions + if (shank != null) + tmpPositions.Shank = shank; + + tmpPositions.IsMultiTool = true; + } + else if (Convert.ToInt32(row["toolId"]) != 0) + { + // Find mounted tool by tool id + List childTools = tools.Where(x => x.Id == Convert.ToInt32(row["toolId"])) + .ToList(); + + if (childTools != null) + // Populate child positions + tmpPositions.ChildTools = childTools.Select(x => new PositionsChild() { Id = x.Id, FamilyName = x.FamilyName, ToolType = x.ToolType }).First(); + tmpPositions.IsMultiTool = false; + } positions.Add(tmpPositions); } - + GetNotInMagazineTools(out List shanksB, out List toolsA); return positions; } + public void GetNotInMagazineTools(out List shanks, out List tools) + { + // Get shanks Data + shanks = GetShanks(); + // Get Tools Data + tools = GetToolsData(); + + List magazinePositions = MagazinesPositionDataTable + .AsEnumerable() + .ToList(); + + foreach (var row in magazinePositions) + { + if (Convert.ToInt32(row["shankId"]) != 0) + { + //var itemToBeRemoved = shanks.Where(x => x.Id == Convert.ToInt32(row["shankId"]))?.FirstOrDefault(); + //if (itemToBeRemoved != null) + shanks.Remove(shanks.Where(x => x.Id == Convert.ToInt32(row["shankId"]))?.FirstOrDefault()); + } + else if (Convert.ToInt32(row["toolId"]) != 0) + { + //var itemToBeRemoved = tools.Where(x => x.Id == Convert.ToInt32(row["toolId"])).FirstOrDefault(); + //if (itemToBeRemoved != null) + tools.Remove(tools.Where(x => x.Id == Convert.ToInt32(row["toolId"])).FirstOrDefault()); + } + } + } + public void UpdatePosition(PositionsDataModel position) { // Find position to be updated @@ -1346,6 +1402,53 @@ namespace Nc_Demo_Application.Database UpdateDatabaseFromDataTable(positions, READ_MAGAZINES_QUERY); } + public void UpdateMagazine(int magazineId, List newMagazine) + { + try + { + // Get shanks Data + List shanks = GetShanks(); + + List tools = GetToolsData(); + + foreach (MagazineUpdate newMag in newMagazine) + { + // Find position to be updated + DataRow row = MagazinesPositionDataTable + .AsEnumerable() + .FirstOrDefault(x => Convert.ToInt32(x["positionId"]) == newMag.PositionId && Convert.ToInt32(x["magazineId"]) == magazineId); + + int shankId = 0; + int toolId = 0; + + // Find if id is contained in tools or in shanks + ToolsDataModel tool = tools.Where(x => x.Id == newMag.ToolId).FirstOrDefault(); + + if (tool != null) + { + toolId = tool.Id; + } + else + { + ShankDataModel shank = shanks.Where(x => x.Id == newMag.ToolId).FirstOrDefault(); + if (shank != null) + shankId = shank.Id; + } + + row["shankId"] = shankId; + row["toolId"] = toolId; + + // Save + UpdatePositions(MagazinesPositionDataTable); + } + } + catch(Exception ex) + { + Console.WriteLine("Update magazine exception: " + ex.Message); + } + + } + #endregion Magazines } } \ No newline at end of file diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/Models/ToolsDataModel.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/Models/ToolsDataModel.cs index d94b981..5d17b69 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/Models/ToolsDataModel.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Database/Models/ToolsDataModel.cs @@ -5,7 +5,7 @@ namespace Nc_Demo_Application.Database.Models public class ToolsDataModel { public int Id; - public int MagazineId; + // public int MagazineId; public string FamilyName; public int ChildId; public int MagazinePositionType; @@ -55,13 +55,18 @@ namespace Nc_Demo_Application.Database.Models public int Id; public int MagazineId; public int Type; - public List childsTools; + public bool IsMultiTool; + public ShankDataModel Shank; + public PositionsChild ChildTools; } + public class PositionsChild { public int Id; + public string FamilyName; + public int ToolType; } - + public class EdgesDataModel { public int Id; @@ -70,4 +75,10 @@ namespace Nc_Demo_Application.Database.Models public double PreAlmLife; public Dictionary EdgeAdditionalParams; } + + public class MagazineUpdate + { + public int PositionId; + public int ToolId; + } } \ No newline at end of file diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Nc_Demo_Db.db b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Nc_Demo_Db.db index cc1c7520c997002fcc187bf6b6eef2cb2a0a57c5..5dfa380aa13d8105b143d0a7a0f16e572368cc61 100644 GIT binary patch delta 1939 zcmbu9U1%It6vywq^KtLY?#$WU?3y&$jR{q&HYQQ9*cL6pHXk-ks%;Ha(1awIV3U=0 zBR*J?CQ3w7Y8)g8?Tg|Ueqq;E!O#z+59vdfRv**{Q;13nS}Pa?i{d#mJKL=Wd~ojW ze}CtG%sKa*dw1fZK5#?^ncFoa#VUAd2?y~!a^I3E; zdOX?~c{Y-iQR4?KE*7pOlrE44;zTbN18T6&_zxw|Prz%dXCybZTb18 z_K6J|T)+?f4Bx|ne>eA!f3%}+spaFboa-Gu(XQJmjd}LTsqNCySn9#yzAP-V_7FCO zur7qVLbxS_nh+8pSOnhrlXnKo9o#01F$POcKfD8L!E!IT3+}to+5c)7W>3_pe<;P6 zclumfR*X86?4y7a#4`cMiH8G@5w`{m#H)S2%^l5%6tgP1B`kUrK9<7Y*1d!K`UIPS zcHR~&b4K9|KM-(~`0;=v#2W*)iK_y(klAv;iugjnk~j!=w@Ez1>bb?qsj_N2aaT2= zNzwSv_Oa32@MxbH$ZVr=t2jLzR>kpwo6Qtcm7H_sJzPlX!l*O6rwa94_YM|nZ1mN8 zebf{Nc5L!S3bi^y#yeD4r(;cOy@kU1##1Z_^*WxS2DlIEVF|v00(=S|!kcgyW?>rk z!#)^>Ctw$Bg%&KyukN^|n-=-jg|q~r;zDR3HDuhJrjjNn5Voo)lBE(wQYu~~sbWPk z6%@%(Zjp556iHLjA_+yQ4`2-@Iw8uy=kb?ma+Q5&8ozT$b3kk+t9DSS6h z;H3(x&c2bp0VP(hU>dWh30PujtWwo@np2r6!TzDeefz(`na#4aP9AV;6vB-j#DK(D zGq_l-v^Yz*QiBBzuD}9(3$J0@OU?bWtQo$6HUH8bkHjO4g+AaXcDUR)RBlX`8)N0h zP`U9~xzSZ_w3LhpgigoNHJoN^N<(N=myAd>oJZ3Z7_9d5glBZeSVBe^W&!hqY1%QE z%MA(vD#EZbe%7q+TrLY1brG+@}UVo*H-ANc>a1DOLEAt~P!q;#f z&cYWk569pGyfjDPRX7MQ;I$cp5lr3vFxL z1is0EOL%v`!`u56-ruu$W>3NAa2!5{_u*}L9gdVjY3|oG#*-u!Bngr@NsI(YToQ*Q ZN)jQlNh}gYB1udVgG49MNQ9;_>u>KGexCpU delta 2477 zcma)8Yitx%6ux)fcV=hKw%v81+uGR>6e<*XHuwrF6lg%gqsR|T?6y0Wm39_)+lFZ3 z!j?p$KcLJH5-`RW(b^QeX`;y#>xlKYb<{i=7!7wIunvlKopEkxs4P(sX zs$0VZuE6K;HoOKYSOqgdutu$6e33UTIo2E|ns?(|ohrGpB}G|uV~fXSCb;$@lw-`J z=V}etu0mkSL=RRVCOh3PdqVl50OO1q7pHH&5Niw-QG$xsC8M@Ak%%NoyKUNDj%39gfME@kFiUW+H!! zM{Kf}lBA}1{56iykka-C+_Q|%Dz%1U#j$#D%(nxt)HuoVSx9+!@GX~UV~7K6+m#pnGQ5B8co{YZuP!Y-u3iw0foFDG zV+A;RK$_1huD4h^mup?u*0QQ);~br}cVanCxm^p|S&1=~jd%8@`kgZ4bE%z9a(#EA zv)r7@wz}I=9jRU?Sq4vKpK=n}zRVrw&TR>IS(np>)7}AZbvI|rUGK;^@$N*XX9B3t zzL&3rxf}Y`NF+jcQ~#qQi!*NbALjCnE%CM%yDk3Y+7`Rrx3zmQsmA+9sljiH>r%|P zMX2f#)x!stkx4Os7h}E`W8R*pV=-?iiMi|~yPQ@pXwE9Upw6neGt&u?1b=7tJ?p)0saQ@0ssI2 diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/ILibraryService.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/ILibraryService.cs index 37d4ca5..75db250 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/ILibraryService.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/ILibraryService.cs @@ -214,11 +214,18 @@ namespace Nc_Demo_Application.Server.Service [WebGet(UriTemplate = "tool_table/positions", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] void GetPositions(out List positionsData); - [WebGet(UriTemplate = "tool_table/magazine/{magazineId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] - void GetMagazinePositions(string magazineId, out List positionsData); - [WebInvoke(Method = "PUT", UriTemplate = "tool_table/position", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] void PutPosition(ref PositionsDataModel position); + + [WebGet(UriTemplate = "tool_table/magazine/{magazineId}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] + void GetMagazinePositionsWithTools(string magazineId, out List positionsData); + + [WebGet(UriTemplate = "tool_table/magazine/tools", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] + void GetToolsAndMultiTools(out List shanks, out List tools); + + [WebInvoke(Method = "PUT", UriTemplate = "tool_table/magazine/{magazineId}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] + void UpdateMagazine(string magazineId, List magazine); + #endregion } } diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/LibraryService.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/LibraryService.cs index bd0b31a..9516eba 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/LibraryService.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Server/Service/LibraryService.cs @@ -573,17 +573,26 @@ namespace Nc_Demo_Application.Server.Service { positionsData = DatabaseController.getInstance().GetPositions(); } - - public void GetMagazinePositions(string magazineId, out List positionsData) - { - positionsData = DatabaseController.getInstance().GetMagazinePositions(Convert.ToInt32(magazineId)); - } - public void PutPosition(ref PositionsDataModel position) { DatabaseController.getInstance().UpdatePosition(position); } + public void GetMagazinePositionsWithTools(string magazineId, out List positionsData) + { + positionsData = DatabaseController.getInstance().GetMagazinePositions(Convert.ToInt32(magazineId)); + } + + public void GetToolsAndMultiTools(out List shanks, out List tools) + { + DatabaseController.getInstance().GetNotInMagazineTools(out shanks, out tools); + } + + public void UpdateMagazine(string magazineId, List magazine) + { + DatabaseController.getInstance().UpdateMagazine(Convert.ToInt32(magazineId), magazine); + } + #endregion Positions } } \ No newline at end of file diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.Designer.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.Designer.cs index bd1d3af..e015aa5 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.Designer.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.Designer.cs @@ -113,6 +113,8 @@ namespace Nc_Demo_Application this.magazineId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.positionId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.positionType = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ShankId = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.magazineToolId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.toolStripEx2 = new Nc_Demo_Application.Views.ToolStripEx(); this.saveMagazinesButton = new System.Windows.Forms.ToolStripButton(); this.familiesTab = new System.Windows.Forms.TabPage(); @@ -125,13 +127,12 @@ namespace Nc_Demo_Application this.toolStripEx1 = new Nc_Demo_Application.Views.ToolStripEx(); this.saveFamiliesButton = new System.Windows.Forms.ToolStripButton(); this.toolsPage = new System.Windows.Forms.TabPage(); + this.isEnabledCheckBox = new System.Windows.Forms.CheckBox(); this.label19 = new System.Windows.Forms.Label(); this.shankIdTextBox = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); this.magazinePositionTypeTxt = new System.Windows.Forms.TextBox(); this.label15 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.magazineComboBox = new System.Windows.Forms.ComboBox(); this.label13 = new System.Windows.Forms.Label(); this.saveToolButton = new System.Windows.Forms.Button(); this.preAlarmCheckBox = new System.Windows.Forms.CheckBox(); @@ -200,17 +201,16 @@ namespace Nc_Demo_Application this.removeTool = new System.Windows.Forms.ToolStripButton(); this.addTool = new System.Windows.Forms.ToolStripButton(); this.stopServer = new System.Windows.Forms.Button(); - this.ShankMagPos = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ShankRightSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ShankLeftSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ShankIsInUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.FixedPlace = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.ShankInChangeTool = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.ShankIsInhibited = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.shankIsEnabled = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.shankName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.shanksId = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.isEnabledCheckBox = new System.Windows.Forms.CheckBox(); + this.shankName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.shankIsEnabled = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ShankIsInhibited = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ShankInChangeTool = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.FixedPlace = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ShankIsInUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ShankLeftSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ShankRightSize = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.MagPosType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ncDataPage.SuspendLayout(); this.toolStrip5.SuspendLayout(); this.ncTabControl.SuspendLayout(); @@ -957,7 +957,9 @@ namespace Nc_Demo_Application this.magazinesGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.magazineId, this.positionId, - this.positionType}); + this.positionType, + this.ShankId, + this.magazineToolId}); this.magazinesGridView.Location = new System.Drawing.Point(0, 31); this.magazinesGridView.Name = "magazinesGridView"; this.magazinesGridView.Size = new System.Drawing.Size(978, 607); @@ -995,6 +997,18 @@ namespace Nc_Demo_Application this.positionType.HeaderText = "Type"; this.positionType.Name = "positionType"; // + // ShankId + // + this.ShankId.DataPropertyName = "shankId"; + this.ShankId.HeaderText = "Shank Id"; + this.ShankId.Name = "ShankId"; + // + // magazineToolId + // + this.magazineToolId.DataPropertyName = "toolId"; + this.magazineToolId.HeaderText = "Tool Id"; + this.magazineToolId.Name = "magazineToolId"; + // // toolStripEx2 // this.toolStripEx2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -1042,7 +1056,8 @@ namespace Nc_Demo_Application // // shanksDataGridView // - this.shanksDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.shanksDataGridView.AllowUserToOrderColumns = true; + this.shanksDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.shanksDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.shanksDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.shanksId, @@ -1054,10 +1069,10 @@ namespace Nc_Demo_Application this.ShankIsInUse, this.ShankLeftSize, this.ShankRightSize, - this.ShankMagPos}); + this.MagPosType}); this.shanksDataGridView.Location = new System.Drawing.Point(271, 61); this.shanksDataGridView.Name = "shanksDataGridView"; - this.shanksDataGridView.Size = new System.Drawing.Size(701, 577); + this.shanksDataGridView.Size = new System.Drawing.Size(701, 584); this.shanksDataGridView.TabIndex = 3; // // label17 @@ -1126,8 +1141,6 @@ namespace Nc_Demo_Application this.toolsPage.Controls.Add(this.label16); this.toolsPage.Controls.Add(this.magazinePositionTypeTxt); this.toolsPage.Controls.Add(this.label15); - this.toolsPage.Controls.Add(this.label14); - this.toolsPage.Controls.Add(this.magazineComboBox); this.toolsPage.Controls.Add(this.label13); this.toolsPage.Controls.Add(this.saveToolButton); this.toolsPage.Controls.Add(this.preAlarmCheckBox); @@ -1164,6 +1177,17 @@ namespace Nc_Demo_Application this.toolsPage.Text = "Tools"; this.toolsPage.UseVisualStyleBackColor = true; // + // isEnabledCheckBox + // + this.isEnabledCheckBox.AutoSize = true; + this.isEnabledCheckBox.Location = new System.Drawing.Point(186, 233); + this.isEnabledCheckBox.Name = "isEnabledCheckBox"; + this.isEnabledCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.isEnabledCheckBox.Size = new System.Drawing.Size(65, 17); + this.isEnabledCheckBox.TabIndex = 35; + this.isEnabledCheckBox.Text = "Enabled"; + this.isEnabledCheckBox.UseVisualStyleBackColor = true; + // // label19 // this.label19.AutoSize = true; @@ -1183,7 +1207,7 @@ namespace Nc_Demo_Application // label16 // this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(204, 174); + this.label16.Location = new System.Drawing.Point(195, 174); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(71, 13); this.label16.TabIndex = 31; @@ -1191,7 +1215,7 @@ namespace Nc_Demo_Application // // magazinePositionTypeTxt // - this.magazinePositionTypeTxt.Location = new System.Drawing.Point(281, 169); + this.magazinePositionTypeTxt.Location = new System.Drawing.Point(272, 169); this.magazinePositionTypeTxt.Name = "magazinePositionTypeTxt"; this.magazinePositionTypeTxt.Size = new System.Drawing.Size(49, 20); this.magazinePositionTypeTxt.TabIndex = 30; @@ -1205,28 +1229,11 @@ namespace Nc_Demo_Application this.label15.TabIndex = 29; this.label15.Text = "Tool Name:"; // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(183, 93); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(53, 13); - this.label14.TabIndex = 28; - this.label14.Text = "Magazine"; - // - // magazineComboBox - // - this.magazineComboBox.FormattingEnabled = true; - this.magazineComboBox.Location = new System.Drawing.Point(246, 89); - this.magazineComboBox.Name = "magazineComboBox"; - this.magazineComboBox.Size = new System.Drawing.Size(121, 21); - this.magazineComboBox.TabIndex = 27; - // // label13 // this.label13.AutoSize = true; this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); - this.label13.Location = new System.Drawing.Point(203, 49); + this.label13.Location = new System.Drawing.Point(180, 40); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(83, 25); this.label13.TabIndex = 26; @@ -1316,7 +1323,7 @@ namespace Nc_Demo_Application // cooling1CheckBox // this.cooling1CheckBox.AutoSize = true; - this.cooling1CheckBox.Location = new System.Drawing.Point(790, 172); + this.cooling1CheckBox.Location = new System.Drawing.Point(742, 173); this.cooling1CheckBox.Name = "cooling1CheckBox"; this.cooling1CheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cooling1CheckBox.Size = new System.Drawing.Size(70, 17); @@ -1338,7 +1345,7 @@ namespace Nc_Demo_Application // label12 // this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(604, 174); + this.label12.Location = new System.Drawing.Point(197, 93); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(47, 13); this.label12.TabIndex = 15; @@ -1347,7 +1354,7 @@ namespace Nc_Demo_Application // rotationSelect // this.rotationSelect.FormattingEnabled = true; - this.rotationSelect.Location = new System.Drawing.Point(657, 171); + this.rotationSelect.Location = new System.Drawing.Point(250, 90); this.rotationSelect.Name = "rotationSelect"; this.rotationSelect.Size = new System.Drawing.Size(101, 21); this.rotationSelect.TabIndex = 14; @@ -1355,7 +1362,7 @@ namespace Nc_Demo_Application // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(485, 173); + this.label11.Location = new System.Drawing.Point(558, 172); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(61, 13); this.label11.TabIndex = 13; @@ -1363,7 +1370,7 @@ namespace Nc_Demo_Application // // rightSizeTxt // - this.rightSizeTxt.Location = new System.Drawing.Point(549, 170); + this.rightSizeTxt.Location = new System.Drawing.Point(622, 169); this.rightSizeTxt.Name = "rightSizeTxt"; this.rightSizeTxt.Size = new System.Drawing.Size(49, 20); this.rightSizeTxt.TabIndex = 12; @@ -1371,7 +1378,7 @@ namespace Nc_Demo_Application // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(354, 173); + this.label10.Location = new System.Drawing.Point(386, 173); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(60, 13); this.label10.TabIndex = 11; @@ -1379,7 +1386,7 @@ namespace Nc_Demo_Application // // leftSizeTxt // - this.leftSizeTxt.Location = new System.Drawing.Point(414, 170); + this.leftSizeTxt.Location = new System.Drawing.Point(446, 170); this.leftSizeTxt.Name = "leftSizeTxt"; this.leftSizeTxt.Size = new System.Drawing.Size(49, 20); this.leftSizeTxt.TabIndex = 10; @@ -1437,7 +1444,7 @@ namespace Nc_Demo_Application // this.toolsIdLlb.AutoSize = true; this.toolsIdLlb.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F); - this.toolsIdLlb.Location = new System.Drawing.Point(290, 49); + this.toolsIdLlb.Location = new System.Drawing.Point(267, 40); this.toolsIdLlb.Name = "toolsIdLlb"; this.toolsIdLlb.Size = new System.Drawing.Size(31, 25); this.toolsIdLlb.TabIndex = 3; @@ -1781,73 +1788,19 @@ namespace Nc_Demo_Application this.stopServer.UseVisualStyleBackColor = true; this.stopServer.Click += new System.EventHandler(this.StopServer_Click); // - // ShankMagPos + // shanksId // - this.ShankMagPos.DataPropertyName = "magazine_position"; - this.ShankMagPos.FillWeight = 140.2515F; - this.ShankMagPos.HeaderText = "ShankMagPos"; - this.ShankMagPos.Name = "ShankMagPos"; - this.ShankMagPos.Width = 102; + this.shanksId.DataPropertyName = "id"; + this.shanksId.FillWeight = 62.31002F; + this.shanksId.HeaderText = "Id"; + this.shanksId.Name = "shanksId"; // - // ShankRightSize + // shankName // - this.ShankRightSize.DataPropertyName = "right_size"; - this.ShankRightSize.FillWeight = 99.15981F; - this.ShankRightSize.HeaderText = "Man DX"; - this.ShankRightSize.Name = "ShankRightSize"; - this.ShankRightSize.Width = 66; - // - // ShankLeftSize - // - this.ShankLeftSize.DataPropertyName = "left_size"; - this.ShankLeftSize.FillWeight = 99.28913F; - this.ShankLeftSize.HeaderText = "Man SX"; - this.ShankLeftSize.Name = "ShankLeftSize"; - this.ShankLeftSize.Width = 65; - // - // ShankIsInUse - // - this.ShankIsInUse.DataPropertyName = "in_use"; - this.ShankIsInUse.FalseValue = "0"; - this.ShankIsInUse.FillWeight = 60.79543F; - this.ShankIsInUse.HeaderText = "In Use"; - this.ShankIsInUse.Name = "ShankIsInUse"; - this.ShankIsInUse.TrueValue = "1"; - this.ShankIsInUse.Width = 40; - // - // FixedPlace - // - this.FixedPlace.DataPropertyName = "in_fixed_place"; - this.FixedPlace.FalseValue = "0"; - this.FixedPlace.FillWeight = 94.99512F; - this.FixedPlace.HeaderText = "Fixed Place"; - this.FixedPlace.Name = "FixedPlace"; - this.FixedPlace.TrueValue = "1"; - this.FixedPlace.Width = 61; - // - // ShankInChangeTool - // - this.ShankInChangeTool.DataPropertyName = "in_change_tool"; - this.ShankInChangeTool.FalseValue = "0"; - this.ShankInChangeTool.FillWeight = 132.1911F; - this.ShankInChangeTool.HeaderText = "ChangeTool"; - this.ShankInChangeTool.Name = "ShankInChangeTool"; - this.ShankInChangeTool.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.ShankInChangeTool.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.ShankInChangeTool.TrueValue = "1"; - this.ShankInChangeTool.Width = 90; - // - // ShankIsInhibited - // - this.ShankIsInhibited.DataPropertyName = "is_inhibited"; - this.ShankIsInhibited.FalseValue = "0"; - this.ShankIsInhibited.FillWeight = 108.3094F; - this.ShankIsInhibited.HeaderText = "Inhibited"; - this.ShankIsInhibited.Name = "ShankIsInhibited"; - this.ShankIsInhibited.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.ShankIsInhibited.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.ShankIsInhibited.TrueValue = "1"; - this.ShankIsInhibited.Width = 72; + this.shankName.DataPropertyName = "name"; + this.shankName.FillWeight = 120.2494F; + this.shankName.HeaderText = "Name"; + this.shankName.Name = "shankName"; // // shankIsEnabled // @@ -1859,34 +1812,67 @@ namespace Nc_Demo_Application this.shankIsEnabled.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.shankIsEnabled.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.shankIsEnabled.TrueValue = "1"; - this.shankIsEnabled.Width = 71; // - // shankName + // ShankIsInhibited // - this.shankName.DataPropertyName = "name"; - this.shankName.FillWeight = 93.24941F; - this.shankName.HeaderText = "Name"; - this.shankName.Name = "shankName"; - this.shankName.Width = 60; + this.ShankIsInhibited.DataPropertyName = "is_inhibited"; + this.ShankIsInhibited.FalseValue = "0"; + this.ShankIsInhibited.FillWeight = 108.3094F; + this.ShankIsInhibited.HeaderText = "Inhibited"; + this.ShankIsInhibited.Name = "ShankIsInhibited"; + this.ShankIsInhibited.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ShankIsInhibited.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.ShankIsInhibited.TrueValue = "1"; // - // shanksId + // ShankInChangeTool // - this.shanksId.DataPropertyName = "id"; - this.shanksId.FillWeight = 62.31002F; - this.shanksId.HeaderText = "Id"; - this.shanksId.Name = "shanksId"; - this.shanksId.Width = 41; + this.ShankInChangeTool.DataPropertyName = "in_change_tool"; + this.ShankInChangeTool.FalseValue = "0"; + this.ShankInChangeTool.FillWeight = 132.1911F; + this.ShankInChangeTool.HeaderText = "ChangeTool"; + this.ShankInChangeTool.Name = "ShankInChangeTool"; + this.ShankInChangeTool.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.ShankInChangeTool.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.ShankInChangeTool.TrueValue = "1"; // - // isEnabledCheckBox + // FixedPlace // - this.isEnabledCheckBox.AutoSize = true; - this.isEnabledCheckBox.Location = new System.Drawing.Point(186, 233); - this.isEnabledCheckBox.Name = "isEnabledCheckBox"; - this.isEnabledCheckBox.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.isEnabledCheckBox.Size = new System.Drawing.Size(65, 17); - this.isEnabledCheckBox.TabIndex = 35; - this.isEnabledCheckBox.Text = "Enabled"; - this.isEnabledCheckBox.UseVisualStyleBackColor = true; + this.FixedPlace.DataPropertyName = "in_fixed_place"; + this.FixedPlace.FalseValue = "0"; + this.FixedPlace.FillWeight = 94.99512F; + this.FixedPlace.HeaderText = "Fixed Place"; + this.FixedPlace.Name = "FixedPlace"; + this.FixedPlace.TrueValue = "1"; + // + // ShankIsInUse + // + this.ShankIsInUse.DataPropertyName = "in_use"; + this.ShankIsInUse.FalseValue = "0"; + this.ShankIsInUse.FillWeight = 60.79543F; + this.ShankIsInUse.HeaderText = "In Use"; + this.ShankIsInUse.Name = "ShankIsInUse"; + this.ShankIsInUse.TrueValue = "1"; + // + // ShankLeftSize + // + this.ShankLeftSize.DataPropertyName = "left_size"; + this.ShankLeftSize.FillWeight = 99.28913F; + this.ShankLeftSize.HeaderText = "Man SX"; + this.ShankLeftSize.Name = "ShankLeftSize"; + // + // ShankRightSize + // + this.ShankRightSize.DataPropertyName = "right_size"; + this.ShankRightSize.FillWeight = 99.15981F; + this.ShankRightSize.HeaderText = "Man DX"; + this.ShankRightSize.Name = "ShankRightSize"; + // + // MagPosType + // + this.MagPosType.DataPropertyName = "magazine_position"; + this.MagPosType.FillWeight = 120F; + this.MagPosType.HeaderText = "MagPosType"; + this.MagPosType.Name = "MagPosType"; // // DemoApplicationForm // @@ -2047,8 +2033,6 @@ namespace Nc_Demo_Application private System.Windows.Forms.Label label13; private System.Windows.Forms.CheckBox cooling1CheckBox; private System.Windows.Forms.CheckBox cooling2CheckBox; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.ComboBox magazineComboBox; private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label16; private System.Windows.Forms.TextBox magazinePositionTypeTxt; @@ -2077,9 +2061,6 @@ namespace Nc_Demo_Application private System.Windows.Forms.ToolStripButton saveMagazinesButton; private System.Windows.Forms.Label label19; private System.Windows.Forms.TextBox shankIdTextBox; - private System.Windows.Forms.DataGridViewTextBoxColumn magazineId; - private System.Windows.Forms.DataGridViewTextBoxColumn positionId; - private System.Windows.Forms.DataGridViewTextBoxColumn positionType; private System.Windows.Forms.ToolStripButton refreshToolUI; private System.Windows.Forms.DataGridView edgesDataGridView; private System.Windows.Forms.DataGridViewTextBoxColumn edgesId; @@ -2118,6 +2099,12 @@ namespace Nc_Demo_Application private System.Windows.Forms.DataGridViewTextBoxColumn param29; private System.Windows.Forms.DataGridViewTextBoxColumn param30; private System.Windows.Forms.DataGridViewTextBoxColumn param34; + private System.Windows.Forms.CheckBox isEnabledCheckBox; + private System.Windows.Forms.DataGridViewTextBoxColumn magazineId; + private System.Windows.Forms.DataGridViewTextBoxColumn positionId; + private System.Windows.Forms.DataGridViewTextBoxColumn positionType; + private System.Windows.Forms.DataGridViewTextBoxColumn ShankId; + private System.Windows.Forms.DataGridViewTextBoxColumn magazineToolId; private System.Windows.Forms.DataGridViewTextBoxColumn shanksId; private System.Windows.Forms.DataGridViewTextBoxColumn shankName; private System.Windows.Forms.DataGridViewCheckBoxColumn shankIsEnabled; @@ -2127,8 +2114,7 @@ namespace Nc_Demo_Application private System.Windows.Forms.DataGridViewCheckBoxColumn ShankIsInUse; private System.Windows.Forms.DataGridViewTextBoxColumn ShankLeftSize; private System.Windows.Forms.DataGridViewTextBoxColumn ShankRightSize; - private System.Windows.Forms.DataGridViewTextBoxColumn ShankMagPos; - private System.Windows.Forms.CheckBox isEnabledCheckBox; + private System.Windows.Forms.DataGridViewTextBoxColumn MagPosType; } } diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.cs b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.cs index f2cabf4..92b111e 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.cs +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.cs @@ -57,7 +57,7 @@ namespace Nc_Demo_Application ncProcessStatusColumn.DataSource = Enum.GetValues(typeof(PROC_STATUS)); rotationSelect.DataSource = Enum.GetValues(typeof(ROTATION)); toolTypeSelect.DataSource = Enum.GetValues(typeof(TOOLS_TYPE)); - magazineComboBox.DataSource = Enum.GetValues(typeof(MAGAZINES)); + // magazineComboBox.DataSource = Enum.GetValues(typeof(MAGAZINES)); ShowServer(true); @@ -524,7 +524,7 @@ namespace Nc_Demo_Application ToolsDataModel newTool = new ToolsDataModel() { FamilyName = toolNameTxt.Text, - MagazineId = 0, + // MagazineId = 0, ChildId = 1, MagazinePositionType = 1, ToolType = 100, @@ -616,7 +616,7 @@ namespace Nc_Demo_Application toolTypeSelect.SelectedItem = (TOOLS_TYPE)toolInfo.ToolType; rotationSelect.SelectedItem = (ROTATION)toolInfo.Rotation; - magazineComboBox.SelectedItem = (MAGAZINES)toolInfo.MagazineId; + //magazineComboBox.SelectedItem = (MAGAZINES)toolInfo.MagazineId; // Populate edge grid view PopulateEdgeGridView(toolInfo.Id); @@ -638,7 +638,7 @@ namespace Nc_Demo_Application // Update form inputs toolInfo.Id = Convert.ToInt32(selectedTool.Tag); - toolInfo.MagazineId = (int)magazineComboBox.SelectedItem; + // toolInfo.MagazineId = (int)magazineComboBox.SelectedItem; toolInfo.FamilyName = FamilyTxt.Text; toolInfo.ChildId = Convert.ToInt32(childIdTxt.Text); toolInfo.MagazinePositionType = Convert.ToInt32(magazinePositionTypeTxt.Text); @@ -685,7 +685,7 @@ namespace Nc_Demo_Application private void SaveMagazinesButton_Click(object sender, EventArgs e) { - DatabaseController.getInstance().UpdateMagazines((DataTable)magazinesGridView.DataSource); + DatabaseController.getInstance().UpdatePositions((DataTable)magazinesGridView.DataSource); } private void refreshToolUI_Click(object sender, EventArgs e) diff --git a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.resx b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.resx index 675522a..fa2ff47 100644 --- a/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.resx +++ b/CMS_CORE_Nc_Demo_Application/Nc_Demo_Application/Views/DemoApplicationForm.resx @@ -144,6 +144,12 @@ True + + True + + + True + 869, 17 @@ -174,7 +180,7 @@ True - + True