diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index 757ebc9..171ede9 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -434,22 +434,22 @@ namespace CMS_CORE_Library.Fanuc if (pageToGo == 0) return INCORRECT_PARAMETERS_ERROR; - //Read actual page - nReturn = Focas1.cnc_getcurscrn(nLibHandle[0], out actualPage); + ////Read actual page + //nReturn = Focas1.cnc_getcurscrn(nLibHandle[0], out actualPage); - //Throw Exception if there's an error - if (nReturn != 0) - return GetNcError(nReturn); + ////Throw Exception if there's an error + //if (nReturn != 0) + // return GetNcError(nReturn); //Write the new page - if (actualPage != pageToGo) - { + //if (actualPage != pageToGo) + //{ nReturn = Focas1.cnc_setcurscrn(nLibHandle[0], pageToGo); //Throw Exception if there's an error if (nReturn != 0) return GetNcError(nReturn); - } + //} return NO_ERROR; } @@ -3952,9 +3952,7 @@ namespace CMS_CORE_Library.Fanuc if (cmsError.IsError()) return cmsError; - short nReturn1, nReturn2; - Focas1.ODBSYS node = new Focas1.ODBSYS(); - Focas1.ODBSYSEX nodeex = new Focas1.ODBSYSEX(); + short nReturn = 0; ulong SerialNumber = 0; //Read oly one time every 10 seconds @@ -3965,35 +3963,27 @@ namespace CMS_CORE_Library.Fanuc if (cmsError.IsError()) return cmsError; + Focas1.ODBSYS node = new Focas1.ODBSYS(); // Execute the method - nReturn1 = Focas1.cnc_sysinfo(nLibHandle[0], node); - - nReturn2 = Focas1.cnc_rdcncid(nLibHandle[0], out SerialNumber); + nReturn = Focas1.cnc_sysinfo(nLibHandle[0], node); + if (nReturn != 0) + return GetNcError(nReturn); - // Throw Exception if there's an error - if (nReturn1 != 0) - { - return GetNcError(nReturn1); - } - else if (nReturn2 != 0 && nReturn2 != 1) - { - return GetNcError(nReturn2); - } - else - { - Cnc_name = "NOME_CN"; - Cnc_SftVersion = "VERSIONE_SW"; - //Setup the name - // Cnc_name = GetName(node.cnc_type, node.mt_type); + // Read serial number + nReturn = Focas1.cnc_rdcncid(nLibHandle[0], out SerialNumber); + if (nReturn != 0 && nReturn != 1) + return GetNcError(nReturn); - //Setup the Software version - //Cnc_SftVersion = new string(node.version); + // Setup the name + Cnc_name = GetName(node.cnc_type, node.mt_type); - //Setup the Number Series - Cnc_SeriesNum = SerialNumber.ToString(); + // Setup the Software version + Cnc_SftVersion = new string(node.version); - Last_Static_Read = DateTime.Now; - } + //Setup the Number Series + Cnc_SeriesNum = SerialNumber.ToString(); + + Last_Static_Read = DateTime.Now; } return NO_ERROR; diff --git a/CMS_CORE_Library/Nc.cs b/CMS_CORE_Library/Nc.cs index 2380390..704886b 100644 --- a/CMS_CORE_Library/Nc.cs +++ b/CMS_CORE_Library/Nc.cs @@ -1804,14 +1804,14 @@ namespace CMS_CORE_Library Siemens_Setup = 105, //Fanuc - Fanuc_Pos = 201, - Fanuc_Prog = 202, - Fanuc_Offset = 203, + Fanuc_Pos = 200, + Fanuc_Prog = 201, + Fanuc_Offset = 202, + Fanuc_System = 203, Fanuc_Message = 204, Fanuc_Graph = 205, Fanuc_Custom1 = 206, Fanuc_Custom2 = 207, - Fanuc_System = 208 } #endregion CONSTANTS (Struct and Enum are Static for definition) diff --git a/CMS_CORE_Library/Osai/Nc_Osai.cs b/CMS_CORE_Library/Osai/Nc_Osai.cs index efb7558..adf4766 100644 --- a/CMS_CORE_Library/Osai/Nc_Osai.cs +++ b/CMS_CORE_Library/Osai/Nc_Osai.cs @@ -3826,7 +3826,7 @@ namespace CMS_CORE_Library.Osai try { //Execute the method - nReturn = OpenNC.GetActivePartProgram(procNumber, out Level, out mainPath, out SubPath, out errorClass, out errorNum); + nReturn = OpenNC.GetActivePartProgramFullPath(procNumber, out Level, out mainPath, out SubPath, out errorClass, out errorNum); //If there's an error launch exception\ if (errorClass != 0 || errorNum != 0 || nReturn == 0) diff --git a/CMS_CORE_Library/ToolConfigurations.cs b/CMS_CORE_Library/ToolConfigurations.cs index 487baf5..dbd337e 100644 --- a/CMS_CORE_Library/ToolConfigurations.cs +++ b/CMS_CORE_Library/ToolConfigurations.cs @@ -83,6 +83,13 @@ namespace CMS_CORE_Library {(int)SIEMENS_LIFE_TYPE.WEAR, "wearLife"} }; + private static Dictionary cmsToolLifeList = new Dictionary() + { + {(int)SIEMENS_LIFE_TYPE.NONE, "none"}, + {(int)SIEMENS_LIFE_TYPE.TIME, "timeLife"}, + {(int)SIEMENS_LIFE_TYPE.COUNT, "countLife"} + }; + private static Dictionary rotationTypeList = new Dictionary() { {0, "none"}, @@ -240,7 +247,7 @@ namespace CMS_CORE_Library { new FieldsConfiguration{ Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0}, new FieldsConfiguration{ Name = "name", Type = "string", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = 0}, - new FieldsConfiguration{ Name = "toolType", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, + new FieldsConfiguration{ Name = "toolType", Type = "select", SelectValues = toolTypeCodeList, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "leftSize", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 1, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "rightSize", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 1, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "tcpTable", Type = "int", SelectValues = null, Category = "tcp", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, @@ -263,14 +270,14 @@ namespace CMS_CORE_Library new FieldsConfiguration{ Name = "dynamicCompensation", Type = "int", SelectValues = null, Category = "dynamicCompensation", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "minLoadDynamicCompensation", Type = "int", SelectValues = null, Category = "dynamicCompensation", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "maxLoadDynamicCompensation", Type = "int", SelectValues = null, Category = "dynamicCompensation", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, - new FieldsConfiguration{ Name = "lifeType", Type = "int", SelectValues = null, Category = "life", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, + new FieldsConfiguration{ Name = "lifeType", Type = "select", SelectValues = cmsToolLifeList, Category = "life", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "nominalLife", Type = "int", SelectValues = null, Category = "life", ReadOnly = false, MinValue = 0, MaxValue = ushort.MaxValue}, new FieldsConfiguration{ Name = "reviveDelta", Type = "int", SelectValues = null, Category = "revive", ReadOnly = false, MinValue = 0, MaxValue = ushort.MaxValue}, }, FamilyReadOnlyConfiguration = new List() { new FieldsConfiguration{ Name = "name", Type = "string", SelectValues = null, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = 0}, - new FieldsConfiguration{ Name = "toolType", Type = "int", SelectValues = null, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = byte.MaxValue}, + new FieldsConfiguration{ Name = "toolType", Type = "select", SelectValues = toolTypeCodeList, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "leftSize", Type = "int", SelectValues = null, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "rightSize", Type = "int", SelectValues = null, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = byte.MaxValue}, new FieldsConfiguration{ Name = "tcpTable", Type = "int", SelectValues = null, Category = "family", ReadOnly = true, MinValue = 0, MaxValue = byte.MaxValue},