diff --git a/CMS_CORE_Application/Form1.cs b/CMS_CORE_Application/Form1.cs index 4793aec..55d0a05 100644 --- a/CMS_CORE_Application/Form1.cs +++ b/CMS_CORE_Application/Form1.cs @@ -104,7 +104,7 @@ namespace CMS_CORE_Application cmsError = N.NC_RDateTime(ref NcTime); if (cmsError.IsError()) { error = true; SetError(Lines, cmsError); } - cmsError = N.PLC_RHeadsData(Heads, 3); + cmsError = N.PLC_RHeadsData(Heads, 1); if (cmsError.IsError()) { error = true; SetError(Lines, cmsError); } cmsError = N.NC_RSerialNumber(ref serial); @@ -118,11 +118,7 @@ namespace CMS_CORE_Application ////////////////////////////////////////////////////////////// TEST Stopwatch st = new Stopwatch(); sw.Restart(); - - N.AXES_ROrigin(5); - - int val1 = 0; - N.PLC_RActiveClient(ref val1); + N.NC_Connect(); sw.Stop(); Console.WriteLine("TEMPO PER FUNZIONE " + sw.ElapsedMilliseconds); diff --git a/CMS_CORE_Library/Demo/Nc_Demo.cs b/CMS_CORE_Library/Demo/Nc_Demo.cs index 7e1e5ce..9eef728 100644 --- a/CMS_CORE_Library/Demo/Nc_Demo.cs +++ b/CMS_CORE_Library/Demo/Nc_Demo.cs @@ -31,9 +31,8 @@ namespace CMS_CORE_Library.Demo // Magazine config parameters private List MagazineConfig = new List() { - new SiemensMagazineConfigModel{Id = 1, Type = SIEMENS_MAGAZINE_TYPE.REVOLVER, LoadingIsActive = true, Name = "MAG1"}, - new SiemensMagazineConfigModel{Id = 2, Type = SIEMENS_MAGAZINE_TYPE.BOX_MAGAZINE, LoadingIsActive = true, Name = "MAG2"}, - new SiemensMagazineConfigModel{Id = 3, Type = SIEMENS_MAGAZINE_TYPE.CHAIN, LoadingIsActive = false, Name = "MAG3"}, + new SiemensMagazineConfigModel{Id = 1, Type = SIEMENS_MAGAZINE_TYPE.BOX_MAGAZINE, LoadingIsActive = true, Name = "MAG1"}, + new SiemensMagazineConfigModel{Id = 2, Type = SIEMENS_MAGAZINE_TYPE.BOX_MAGAZINE, LoadingIsActive = true, Name = "MAG2"} }; ////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// @@ -1447,7 +1446,7 @@ namespace CMS_CORE_Library.Demo processData.WorkOverride = val; - processData.ProcessMessage = "Messaggio di test decisamente lungo"; + processData.ProcessMessage = "Generic Message"; processData.OffsetData = new OffsetModel() { diff --git a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs index 8286e93..c6cca78 100644 --- a/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs +++ b/CMS_CORE_Library/Fanuc/Nc_Fanuc.cs @@ -2996,6 +2996,8 @@ namespace CMS_CORE_Library.Fanuc { ODBPDFDRV baseDir = new ODBPDFDRV(); short nReturn = cnc_rdpdf_drive(nLibHandle[0], baseDir); + if (nReturn != 0) + return GetNcError(nReturn); string absolutePath = FormatPathForNc(path, baseDir.drive1); diff --git a/CMS_CORE_Library/Fanuc/fwlib32_64.cs b/CMS_CORE_Library/Fanuc/fwlib32_64.cs index fc07ea6..1a049d3 100644 --- a/CMS_CORE_Library/Fanuc/fwlib32_64.cs +++ b/CMS_CORE_Library/Fanuc/fwlib32_64.cs @@ -11764,7 +11764,7 @@ internal class Focas1 internal static extern short cnc_getcurscrn(ushort FlibHndl, out short scrn_no); // funzioni aggiunte al marshalling - [DllImport("FWLIB32.dll", EntryPoint = "cnc_chglang")] + [DllImport(FOCAS_LIB_NAME, EntryPoint = "cnc_chglang")] public static extern short cnc_chglang(ushort FlibHndl, byte b); internal enum page_code: short diff --git a/CMS_CORE_Library/Models/DataStructures.cs b/CMS_CORE_Library/Models/DataStructures.cs index 521007f..7cabea2 100644 --- a/CMS_CORE_Library/Models/DataStructures.cs +++ b/CMS_CORE_Library/Models/DataStructures.cs @@ -342,6 +342,11 @@ namespace CMS_CORE_Library.Models { public string ToolName; public int ChildId; + public bool Disabled; + public bool Measured; + public double MaxLoad; + public double MaxSpeed; + public double ResidualLife; } public class HeadDataModel diff --git a/CMS_CORE_Library/Models/SiemensToolModels.cs b/CMS_CORE_Library/Models/SiemensToolModels.cs index 91dcfb9..34d0d75 100644 --- a/CMS_CORE_Library/Models/SiemensToolModels.cs +++ b/CMS_CORE_Library/Models/SiemensToolModels.cs @@ -224,6 +224,7 @@ namespace CMS_CORE_Library.Models public bool MagPositionOptionActive; public bool OffsetOptionActive; public bool RadiusMetricType; + public bool LifeOption; public List Magazines; public List ToolsConfiguration; diff --git a/CMS_CORE_Library/Siemens/Nc_Siemens.cs b/CMS_CORE_Library/Siemens/Nc_Siemens.cs index a02cb35..a7279d5 100644 --- a/CMS_CORE_Library/Siemens/Nc_Siemens.cs +++ b/CMS_CORE_Library/Siemens/Nc_Siemens.cs @@ -1083,6 +1083,11 @@ namespace CMS_CORE_Library.Siemens { ChildId = tool == null ? 0 : tool.ChildId, ToolName = tool == null ? "" : tool.FamilyName, + Disabled = tool == null ? false : !tool.IsEnabled, + Measured = tool == null ? false : tool.IsMeasured, + MaxLoad = tool == null ? 0 : tool.Load, + MaxSpeed = tool == null ? 0 : tool.MaxSpeed, + ResidualLife = tool.EdgesData.FirstOrDefault().ResidualLife } }); } @@ -3401,6 +3406,7 @@ namespace CMS_CORE_Library.Siemens config.FamilyOptionActive = true; config.MagPositionOptionActive = true; config.RadiusMetricType = false; + config.LifeOption = true; // Set fields configurations config.ToolsConfiguration = SiemensToolFieldsConfig;