FIx siemens library
First Osai offset test
This commit is contained in:
@@ -209,12 +209,12 @@ namespace CMS_CORE_Application
|
||||
}
|
||||
|
||||
// cmsError = N.TOOLS_WAddShank(ref newShank);
|
||||
List<MountedToolModel> a = new List<MountedToolModel>() ;
|
||||
N.TOOLS_RMagazineTools(1, ref a);
|
||||
// List<MountedToolModel> a = new List<MountedToolModel>() ;
|
||||
// N.TOOLS_RMagazineTools(1, ref a);
|
||||
// cmsError = N.TOOLS_WDeleteShank(4);
|
||||
//cmsError = N.TOOLS_WUpdateEdge(1, ref newEdge);
|
||||
List<ShankModel> c = new List<ShankModel>();
|
||||
List<SiemensToolModel> b = new List<SiemensToolModel>();
|
||||
//List<ShankModel> c = new List<ShankModel>();
|
||||
//List<SiemensToolModel> b = new List<SiemensToolModel>();
|
||||
// cmsError = N.TOOLS_RAvailableTools(ref c, ref b);
|
||||
//cmsError = N.TOOLS_RConfiguration(ref toolsConfig);
|
||||
//cmsError = N.TOOLS_WUpdatePosition(new PositionModel()
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace CMS_CORE_Library
|
||||
return new CmsError(CMS_ERROR_CODES.NC_PROD_ERROR, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum CMS_ERROR_CODES : uint
|
||||
{
|
||||
OK = 0,
|
||||
@@ -337,7 +337,6 @@ namespace CMS_CORE_Library
|
||||
MAGAZINE_OCCUPIED = 19,
|
||||
TOOL_IS_MOUNTED = 20,
|
||||
TOOL_AND_POSITION_NOT_MATCHING = 21
|
||||
|
||||
}
|
||||
|
||||
internal static CmsError NO_ERROR = new CmsError(CMS_ERROR_CODES.OK, "");
|
||||
@@ -361,7 +360,6 @@ namespace CMS_CORE_Library
|
||||
internal static CmsError TOOL_IS_MOUNTED_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_mounted");
|
||||
internal static CmsError TOOL_AND_POSITION_NOT_MATCHING_ERROR = new CmsError(CMS_ERROR_CODES.TOOL_IS_MOUNTED, "error_tool_and_position_not_matching");
|
||||
|
||||
|
||||
#endregion Cms Errors Codes
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -434,8 +432,6 @@ namespace CMS_CORE_Library
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Tool Table Models
|
||||
|
||||
public enum MAGAZINE_ACTIONS
|
||||
{
|
||||
NONE = 0,
|
||||
@@ -472,6 +468,8 @@ namespace CMS_CORE_Library
|
||||
COUNTERCLOCKWHISE = 2
|
||||
}
|
||||
|
||||
#region Siemens Tool Manager Models
|
||||
|
||||
public enum SIEMENS_LIFE_TYPE
|
||||
{
|
||||
NONE = 0,
|
||||
@@ -634,6 +632,7 @@ namespace CMS_CORE_Library
|
||||
public string Name;
|
||||
public bool IsMultitool;
|
||||
}
|
||||
|
||||
///////////////// Tools Configuration
|
||||
public class FieldsConfiguration
|
||||
{
|
||||
@@ -642,8 +641,8 @@ namespace CMS_CORE_Library
|
||||
public string Category;
|
||||
public bool ReadOnly;
|
||||
public Dictionary<int, string> SelectValues;
|
||||
public int MinValue;
|
||||
public int MaxValue;
|
||||
public uint MinValue;
|
||||
public uint MaxValue;
|
||||
}
|
||||
|
||||
public class FamiliesConfiguration
|
||||
@@ -694,6 +693,19 @@ namespace CMS_CORE_Library
|
||||
public EdgesConfiguration EdgesConfiguration;
|
||||
}
|
||||
|
||||
#endregion Tool Table Models
|
||||
#endregion Siemens Tool Manager Models
|
||||
|
||||
#region Nc Tool Manager Models
|
||||
|
||||
public class OffsetModel
|
||||
{
|
||||
public short Id { get; set; }
|
||||
public double Length { get; set; }
|
||||
public double Radius { get; set; }
|
||||
public double WearLength { get; set; }
|
||||
public double WearRadius { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -2461,6 +2461,14 @@ namespace CMS_CORE.Demo
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Nc Tool Manager
|
||||
public override CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
#endregion Nc Tool Manager
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Subordinate Private Functions
|
||||
|
||||
//Check if NC is connected
|
||||
|
||||
@@ -1670,6 +1670,7 @@ namespace CMS_CORE.Fanuc
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError TOOLS_RToolsData(ref List<SiemensToolModel> toolTable)
|
||||
{
|
||||
return NO_ERROR;
|
||||
@@ -1779,6 +1780,7 @@ namespace CMS_CORE.Fanuc
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError TOOLS_WUnloadToolFromShank(int shankId, int positionId)
|
||||
{
|
||||
return NO_ERROR;
|
||||
@@ -1788,10 +1790,22 @@ namespace CMS_CORE.Fanuc
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion Tools Management
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Nc Tool Manager
|
||||
|
||||
public override CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion Nc Tool Manager
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Subordinate Private Functions
|
||||
|
||||
private CmsError ErrorHandler(short exNum)
|
||||
|
||||
@@ -1515,8 +1515,16 @@ namespace CMS_CORE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Nc Tool Manager
|
||||
|
||||
public abstract CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset);
|
||||
|
||||
#endregion Nc Tool Manager
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Fixed memory area
|
||||
// TODO REMOVE
|
||||
// TODO REMOVE
|
||||
//Lingua CN
|
||||
internal MEMORY_CELL PARAM_LING_FANUC = new MEMORY_CELL(MEMORY_TYPE.Null, 3281, 0, 1);
|
||||
|
||||
|
||||
@@ -6,15 +6,17 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
using static CMS_CORE.Nc;
|
||||
using static CMS_CORE.Osai.MEMORY_ADDRESS;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
using static CMS_CORE_Library.ToolConfigurations;
|
||||
|
||||
namespace CMS_CORE.Osai
|
||||
{
|
||||
@@ -35,7 +37,6 @@ namespace CMS_CORE.Osai
|
||||
private BasicHttpBinding HttpBinding;
|
||||
private static Dictionary<int, string> PlcMessages;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Contructor & global methods
|
||||
@@ -738,7 +739,6 @@ namespace CMS_CORE.Osai
|
||||
return cmsError;
|
||||
readValues = readInts.SelectMany(BitConverter.GetBytes).ToList();
|
||||
|
||||
|
||||
// Parse and format read data
|
||||
for (int i = 0; i < number; i++)
|
||||
{
|
||||
@@ -1076,7 +1076,6 @@ namespace CMS_CORE.Osai
|
||||
// Convert Byte into true/false array
|
||||
BitArray bits = new BitArray(new byte[] { bytes[0] }); //1st byte -> 0 : Proccess type (AUX-WORK), 1: Process in alarm status, 2: Run, 3: Hold, 4: Read, 5: PartProgramVisible
|
||||
|
||||
|
||||
// Get part program info visibility
|
||||
processData.Visible = bits[0];
|
||||
|
||||
@@ -1084,7 +1083,7 @@ namespace CMS_CORE.Osai
|
||||
processData.Type = bits[1] ? "WORK" : "AUX";
|
||||
processData.IsSelected = bits[2];
|
||||
processData.IsInAlarm = bits[3];
|
||||
|
||||
|
||||
// Choose process status
|
||||
if (bytes[1] == 1)
|
||||
processData.Status = "HOLD";
|
||||
@@ -1107,11 +1106,11 @@ namespace CMS_CORE.Osai
|
||||
CmsError cmsError;
|
||||
bool readValue = false;
|
||||
|
||||
for(int i = 0; i < PROCESS_NUMBER; i++)
|
||||
for (int i = 0; i < PROCESS_NUMBER; i++)
|
||||
{
|
||||
int memoryAddress = SELECTED_PROCESS.Address + i * (2);
|
||||
// Read memory from plc
|
||||
cmsError = MEM_RWBoolean(R, 0, SELECTED_PROCESS.MemType, memoryAddress, SELECTED_PROCESS.SubAddress, ref readValue);
|
||||
cmsError = MEM_RWBoolean(R, 0, SELECTED_PROCESS.MemType, memoryAddress, SELECTED_PROCESS.SubAddress, ref readValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
@@ -2032,10 +2031,31 @@ namespace CMS_CORE.Osai
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Tools Management
|
||||
#region Siemens Tools Management
|
||||
|
||||
public override CmsError TOOLS_RConfiguration(ref ToolTableConfiguration config)
|
||||
{
|
||||
// Set limits
|
||||
config.MaxTools = NC_MAX_TOOL_NUMER;
|
||||
config.MaxEdgesPerTools = NC_MAX_EDGES_PER_TOOL;
|
||||
config.MaxToolsPerFamily = NC_MAX_TOOLS_PER_FAMILY;
|
||||
config.MaxMultitools = NC_MAX_MULTITOOLS_NUMBER;
|
||||
config.MaxToolsPerMultitools = NC_MAX_TOOLS_PER_MULTITOOL;
|
||||
|
||||
// Set options
|
||||
//config.MultitoolOptionActive = MULTITOOL_OPTION_ACTIVE;
|
||||
//config.FamilyOptionActive = true;
|
||||
//config.MagPositionOptionActive = true;
|
||||
|
||||
// Set fields configurations
|
||||
config.ToolsConfiguration = NcToolFieldsConfig;
|
||||
config.FamiliesConfiguration = NcFamilyFieldsConfig;
|
||||
config.ShanksConfiguration = NcShankFieldsConfig;
|
||||
config.MagazinePosConfiguration = NcMagazinePosFieldsConfig;
|
||||
config.EdgesConfiguration = NcOffsetFieldsConfiguration;
|
||||
|
||||
config.EdgesConfiguration.EdgesAdditionalParamsConfiguration = new Dictionary<int, List<string>>();
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -2153,11 +2173,63 @@ namespace CMS_CORE.Osai
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError TOOLS_GetMagazinesStatus(ref MagazineActionModel magazineAction)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
#endregion Tools Management
|
||||
|
||||
#endregion Siemens Tools Management
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Nc Tool Manager
|
||||
|
||||
public override CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset)
|
||||
{
|
||||
//Check if the NC is Connected
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
ushort nReturn;
|
||||
uint errorClass, errorNum;
|
||||
|
||||
try
|
||||
{
|
||||
offset = new OffsetModel()
|
||||
{
|
||||
Id = offsetId
|
||||
};
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
nReturn = OpenNC.GetOffsetTabRecordII(1, out OFFSETTABLEII offsetData, out errorClass, out errorNum);
|
||||
|
||||
offset.Radius = offsetData.DiaVal[0].ValOrig;
|
||||
offset.WearRadius = offsetData.DiaVal[0].ActChangeVal;
|
||||
offset.Length = offsetData.LenVal[0].ValOrig;
|
||||
offset.WearLength = offsetData.LenVal[0].ActChangeVal;
|
||||
|
||||
Console.WriteLine("LETTURA" + sw.ElapsedMilliseconds);
|
||||
sw.Restart();
|
||||
if (errorClass != 0 || errorNum != 0 || nReturn == 0)
|
||||
return GetNCError(errorClass, errorNum);
|
||||
|
||||
nReturn = OpenNC.SetOffsetTabRecordII(2, offsetData, out errorClass, out errorNum);
|
||||
if (errorClass != 0 || errorNum != 0 || nReturn == 0)
|
||||
return GetNCError(errorClass, errorNum);
|
||||
|
||||
Console.WriteLine("SCRITT" + sw.ElapsedMilliseconds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion Nc Tool Manager
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -2872,6 +2872,18 @@ namespace CMS_CORE.Siemens
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region Nc Tool Manager
|
||||
|
||||
public override CmsError TOOLS_ROffset(short offsetId, ref OffsetModel offset)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion Nc Tool Manager
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#region Subordinate Private Functions
|
||||
|
||||
// Manage the Alarms - Called automatically on changes
|
||||
@@ -3218,8 +3230,7 @@ namespace CMS_CORE.Siemens
|
||||
|
||||
private void MagazineAction_OnChange(Guid guid, Item item, DataSvcStatus status)
|
||||
{
|
||||
|
||||
switch(Convert.ToInt32(item.Value))
|
||||
switch (Convert.ToInt32(item.Value))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
@@ -3234,6 +3245,7 @@ namespace CMS_CORE.Siemens
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case 4:
|
||||
{
|
||||
@@ -3248,17 +3260,17 @@ namespace CMS_CORE.Siemens
|
||||
};
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
{
|
||||
|
||||
string prefix = "DB";
|
||||
|
||||
if(Convert.ToInt32(item.Value) == 2)
|
||||
if (Convert.ToInt32(item.Value) == 2)
|
||||
prefix += "71.";
|
||||
else
|
||||
prefix += "72.";
|
||||
|
||||
|
||||
DataSvc dataSvc = new DataSvc();
|
||||
Item action = new Item(prefix + "DBB4");
|
||||
dataSvc.Read(action);
|
||||
@@ -3266,6 +3278,9 @@ namespace CMS_CORE.Siemens
|
||||
// Get action value
|
||||
MAGAZINE_ACTIONS magAction = Convert.ToInt32(action.Value) > (int)MAGAZINE_ACTIONS.GENERIC ? MAGAZINE_ACTIONS.GENERIC : (MAGAZINE_ACTIONS)Convert.ToInt32(action.Value);
|
||||
|
||||
int magIndex = 0;
|
||||
int posIndex = 0;
|
||||
|
||||
if (prefix.Contains("72"))
|
||||
{
|
||||
bool firstBit = GetBitValue(Convert.ToInt32(action.Value), 2);
|
||||
@@ -3278,6 +3293,36 @@ namespace CMS_CORE.Siemens
|
||||
magAction = MAGAZINE_ACTIONS.LOADING;
|
||||
else
|
||||
magAction = MAGAZINE_ACTIONS.GENERIC;
|
||||
|
||||
posIndex = 1;
|
||||
magIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Select tool & magazine position index based on the action
|
||||
switch (magAction)
|
||||
{
|
||||
case MAGAZINE_ACTIONS.LOADING:
|
||||
{
|
||||
posIndex = 1;
|
||||
magIndex = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.UNLOADING:
|
||||
{
|
||||
posIndex = 2;
|
||||
magIndex = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.TRANSFER:
|
||||
{
|
||||
posIndex = 2;
|
||||
magIndex = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Read position and tool data
|
||||
@@ -3299,38 +3344,10 @@ namespace CMS_CORE.Siemens
|
||||
uint toolMagId = 0;
|
||||
uint toolPosId = 0;
|
||||
uint toolId = 0;
|
||||
|
||||
int magIndex = 0;
|
||||
int posIndex = 0;
|
||||
// Select tool & magazine position index based on the action
|
||||
switch (magAction)
|
||||
{
|
||||
case MAGAZINE_ACTIONS.LOADING:
|
||||
{
|
||||
posIndex = 1;
|
||||
magIndex = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.UNLOADING:
|
||||
{
|
||||
posIndex = 2;
|
||||
magIndex = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.TRANSFER:
|
||||
{
|
||||
posIndex = 2;
|
||||
magIndex = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
toolPosId = (uint)((Convert.ToInt32(magazineValue[posIndex].Value) - 1) * 11 + 3); // (position_id - 1) * 11 + 3
|
||||
toolMagId = (uint)magazineValue[magIndex].Value;
|
||||
|
||||
|
||||
// If position and magazine exist
|
||||
if (toolMagId != 0 && toolPosId != 0)
|
||||
{
|
||||
@@ -3366,7 +3383,7 @@ namespace CMS_CORE.Siemens
|
||||
OriginPosition = Convert.ToInt32(magazineValue[1].Value),
|
||||
DestinationMagazine = Convert.ToInt32(magazineValue[4].Value),
|
||||
DestinationPosition = Convert.ToInt32(magazineValue[5].Value),
|
||||
Tool = tool
|
||||
Tool = tool //== null ? new MagazineActionToolModel() : tool
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -3425,15 +3442,15 @@ namespace CMS_CORE.Siemens
|
||||
break;
|
||||
|
||||
case "$TC_TP3":
|
||||
ToolTableData[toolIndex].LeftSize = Convert.ToByte(actualString.Split('=').LastOrDefault());
|
||||
ToolTableData[toolIndex].LeftSize = Convert.ToByte(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_TP4":
|
||||
ToolTableData[toolIndex].RightSize = Convert.ToByte(actualString.Split('=').LastOrDefault());
|
||||
ToolTableData[toolIndex].RightSize = Convert.ToByte(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_TP7":
|
||||
ToolTableData[toolIndex].MagazinePositionType = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
ToolTableData[toolIndex].MagazinePositionType = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_TP8":
|
||||
@@ -3453,7 +3470,7 @@ namespace CMS_CORE.Siemens
|
||||
break;
|
||||
|
||||
case "$TC_TP9":
|
||||
ToolTableData[toolIndex].LifeType = (SIEMENS_LIFE_TYPE)Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
ToolTableData[toolIndex].LifeType = (SIEMENS_LIFE_TYPE)Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_TP25":
|
||||
@@ -3476,11 +3493,11 @@ namespace CMS_CORE.Siemens
|
||||
break;
|
||||
|
||||
case "$TC_TP_MAX_VELO":
|
||||
ToolTableData[toolIndex].MaxSpeed = Convert.ToDouble(actualString.Split('=').LastOrDefault(), numberFormat);
|
||||
ToolTableData[toolIndex].MaxSpeed = Convert.ToDouble(actualString.Split('=').LastOrDefault(), numberFormat);
|
||||
break;
|
||||
|
||||
case "$TC_TP_MAX_ACC":
|
||||
ToolTableData[toolIndex].MaxAcceleration = Convert.ToDouble(actualString.Split('=').LastOrDefault(), numberFormat);
|
||||
ToolTableData[toolIndex].MaxAcceleration = Convert.ToDouble(actualString.Split('=').LastOrDefault(), numberFormat);
|
||||
break;
|
||||
|
||||
case "$TC_MTPN":
|
||||
@@ -3497,19 +3514,19 @@ namespace CMS_CORE.Siemens
|
||||
break;
|
||||
|
||||
case "$TC_MTP2":
|
||||
MultitoolsData[multitoolIndex].Name = actualString.Split('=').LastOrDefault().Replace("\"", "");
|
||||
MultitoolsData[multitoolIndex].Name = actualString.Split('=').LastOrDefault().Replace("\"", "");
|
||||
break;
|
||||
|
||||
case "$TC_MTP3":
|
||||
MultitoolsData[multitoolIndex].LeftSize = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
MultitoolsData[multitoolIndex].LeftSize = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_MTP4":
|
||||
MultitoolsData[multitoolIndex].RightSize = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
MultitoolsData[multitoolIndex].RightSize = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_MTP7":
|
||||
MultitoolsData[multitoolIndex].MagazinePositionType = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
MultitoolsData[multitoolIndex].MagazinePositionType = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
break;
|
||||
|
||||
case "$TC_MTP8":
|
||||
|
||||
@@ -72,11 +72,12 @@ namespace CMS_CORE_Library
|
||||
{6, "loading_station" },
|
||||
{7, "loading_point" }
|
||||
};
|
||||
|
||||
#endregion PRIVATE_SELECTS_VALUES
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region PUBLIC_CONFIGS_FIELDS
|
||||
#region SIEMENS FIELDS CONFIG
|
||||
|
||||
public static List<FieldsConfiguration> SiemensToolFieldsConfig = new List<FieldsConfiguration>()
|
||||
{
|
||||
@@ -162,6 +163,104 @@ namespace CMS_CORE_Library
|
||||
EdgesAdditionalParamsConfiguration = new Dictionary<int, List<string>>() // Set value runtime, based on NC vendor
|
||||
};
|
||||
|
||||
#endregion PUBLIC_CONFIGS_FIELDS
|
||||
#endregion SIEMENS FIELDS CONFIG
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#region NC FIELDS CONFIG
|
||||
|
||||
public const int NC_MAX_TOOL_NUMER = 300;
|
||||
public const int NC_MAX_EDGES_PER_TOOL = 3;
|
||||
public const int NC_MAX_TOOLS_PER_FAMILY = 255;
|
||||
public const int NC_MAX_MULTITOOLS_NUMBER = 3;
|
||||
public const int NC_MAX_TOOLS_PER_MULTITOOL = 3;
|
||||
|
||||
public static List<FieldsConfiguration> NcToolFieldsConfig = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{ Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0},
|
||||
new FieldsConfiguration{ Name = "familyId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "shankId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "length", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "offsetLength", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "residualLife", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = int.MaxValue},
|
||||
new FieldsConfiguration{ Name = "offset1", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "offset2", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "offset3", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
};
|
||||
|
||||
public static FamiliesConfiguration NcFamilyFieldsConfig = new FamiliesConfiguration()
|
||||
{
|
||||
FamilyConfiguration = new List<FieldsConfiguration>()
|
||||
{
|
||||
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 = "leftSize", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "rightSize", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "tcpTable", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "gamma", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "rotationType", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "maxSpeed", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "maxLoad", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "minLoadPctAutoload", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "maxLoadPctAutoload", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "minLoadDynamicCompensation", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "maxLoadDynamicCompensation", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "lifeType", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue},
|
||||
new FieldsConfiguration{ Name = "nominalLife", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
new FieldsConfiguration{ Name = "reviveDelta", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = ushort.MaxValue},
|
||||
},
|
||||
ToolsConfiguration = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{ Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
// new FieldsConfiguration{ Name = "toolType", Type = "select", SelectValues = toolTypeList, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
// new FieldsConfiguration{ Name = "childId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0}
|
||||
}
|
||||
};
|
||||
|
||||
public static ShanksConfiguration NcShankFieldsConfig = new ShanksConfiguration()
|
||||
{
|
||||
ShankConfiguration = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{ Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "balluf", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 0, MaxValue = (uint)short.MaxValue },
|
||||
new FieldsConfiguration{ Name = "magazinePositionType", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue },
|
||||
new FieldsConfiguration{ Name = "magazineId", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue },
|
||||
new FieldsConfiguration{ Name = "positionId", Type = "int", SelectValues = null, Category = "magazine", ReadOnly = false, MinValue = 0, MaxValue = byte.MaxValue }
|
||||
},
|
||||
ToolsConfiguration = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{ Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "multitoolId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "familyName", Type = "string", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "toolType", Type = "select", SelectValues = toolTypeList, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 }
|
||||
}
|
||||
};
|
||||
|
||||
public static List<FieldsConfiguration> NcMagazinePosFieldsConfig = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{ Name = "magazineId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "positionId", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "type", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "disabled", Type = "boolean", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = 0 }
|
||||
};
|
||||
|
||||
// Offset
|
||||
public static EdgesConfiguration NcOffsetFieldsConfiguration = new EdgesConfiguration()
|
||||
{
|
||||
EdgeConfiguration = new List<FieldsConfiguration>()
|
||||
{
|
||||
new FieldsConfiguration{Name = "id", Type = "int", SelectValues = null, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{Name = "ncOffsetId", Type = "int", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = (uint)short.MaxValue },
|
||||
new FieldsConfiguration{Name = "lenght", Type = "double", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = uint.MaxValue },
|
||||
new FieldsConfiguration{Name = "radius", Type = "double", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = uint.MaxValue },
|
||||
new FieldsConfiguration{Name = "wear_length", Type = "double", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = uint.MaxValue },
|
||||
new FieldsConfiguration{Name = "wear_radius", Type = "double", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = uint.MaxValue }
|
||||
},
|
||||
EdgesAdditionalParamsConfiguration = new Dictionary<int, List<string>>() // Set value runtime, based on NC vendor
|
||||
};
|
||||
|
||||
#endregion NC FIELDS CONFIG
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user