Added axis type

Fix siemens part program info
Added unit of measure
This commit is contained in:
Lucio Maranta
2018-12-14 16:59:09 +01:00
parent d9fdc002e4
commit 2d01d818cf
4 changed files with 34 additions and 11 deletions
Binary file not shown.
+1 -1
View File
@@ -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)
+2
View File
@@ -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;
+31 -10
View File
@@ -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;
}