diff --git a/Libs/CMS_CORE_Library.dll b/Libs/CMS_CORE_Library.dll index 299e5ef3..ce754e00 100644 Binary files a/Libs/CMS_CORE_Library.dll and b/Libs/CMS_CORE_Library.dll differ diff --git a/Step.Core/ThreadsFunctions.cs b/Step.Core/ThreadsFunctions.cs index 1468c18b..21c7ac43 100644 --- a/Step.Core/ThreadsFunctions.cs +++ b/Step.Core/ThreadsFunctions.cs @@ -482,7 +482,7 @@ public static class ThreadsFunctions ReadAxesTimes++; // Wait - Thread.Sleep(CalcSleepTime(200, (int)sw.ElapsedMilliseconds)); + Thread.Sleep(CalcSleepTime(100, (int)sw.ElapsedMilliseconds)); } } catch (ThreadAbortException) diff --git a/Step.Model/DTOModels/DTOAxisNameModel.cs b/Step.Model/DTOModels/DTOAxisNameModel.cs index 6c4b560a..ec18071c 100644 --- a/Step.Model/DTOModels/DTOAxisNameModel.cs +++ b/Step.Model/DTOModels/DTOAxisNameModel.cs @@ -4,6 +4,8 @@ namespace Step.Model.DTOModels { public class DTOAxisNameModel : AxisModel { + public new string Type; + public override bool Equals(object obj) { var item = obj as DTOAxisNameModel; diff --git a/Step.NC/NcHandler.cs b/Step.NC/NcHandler.cs index 2168e46b..2b154b74 100644 --- a/Step.NC/NcHandler.cs +++ b/Step.NC/NcHandler.cs @@ -86,15 +86,32 @@ namespace Step.NC { fileInfo = new InfoFile(); CmsError cmsError = NO_ERROR; - - if (File.Exists(path)) - cmsError = LocalPartProgramFileInfo(path, out fileInfo); + + if(FileExistWithNc(path)) + cmsError = LocalPartProgramFileInfo(path, out fileInfo); else cmsError = numericalControl.FILES_RGetFileInfo(path, ref fileInfo); return cmsError; } + public bool FileExistWithNc(string path) + { + if (NcConfig.NcVendor != NC_VENDOR.SIEMENS) + { + // TODO Manare + return File.Exists(path); + } + else + { + if (path.StartsWith("//NC")) + return false; + else + return File.Exists(path); + } + } + + public CmsError GetActiveFileInfo(string path, out DTOActiveImageAndNameDataModel fileInfo) { fileInfo = new DTOActiveImageAndNameDataModel(); @@ -636,7 +653,8 @@ namespace Step.NC { Id = x.Id, Name = x.Name, - IsSelectable = x.IsSelectable + IsSelectable = x.IsSelectable, + Type = x.Type.ToString() }).ToList(); } @@ -679,21 +697,21 @@ namespace Step.NC genericData.SerialNumber = tmpInfo; // Get software version - numericalControl.NC_RSoftwareVersion(ref tmpInfo); + cmsError = numericalControl.NC_RSoftwareVersion(ref tmpInfo); if (cmsError.errorCode != 0) return cmsError; genericData.NcSoftwareVersion = tmpInfo; // Get model name - numericalControl.NC_RModelName(ref tmpInfo); + cmsError = numericalControl.NC_RModelName(ref tmpInfo); if (cmsError.errorCode != 0) return cmsError; genericData.NcModel = tmpInfo; // Get machine number - numericalControl.NC_RMachineNumber(ref tmpInfo); + cmsError = numericalControl.NC_RMachineNumber(ref tmpInfo); if (cmsError.errorCode != 0) return cmsError; @@ -701,8 +719,8 @@ namespace Step.NC // Get max process number ushort procNum = 0; - numericalControl.NC_RProcessesNum(ref procNum); - if (cmsError.errorCode != 0) + cmsError = numericalControl.NC_RProcessesNum(ref procNum); + if (cmsError.IsError()) return cmsError; // Max process number genericData.ProcessNumber = procNum; @@ -711,7 +729,10 @@ namespace Step.NC // Get PLC version genericData.PlcVersion = "1.0.0"; // Get PLC version - genericData.UnitOfMeasurement = "mm"; + cmsError = numericalControl.NC_RUnitOfMeasure(ref tmpInfo); + if (cmsError.errorCode != 0) + return cmsError; + genericData.UnitOfMeasurement = tmpInfo; return cmsError; }