This commit is contained in:
@@ -224,7 +224,8 @@ namespace CMS_CORE_Application
|
||||
// PositionId = 1
|
||||
//});
|
||||
// cmsError = N.TOOLS_WUnloadToolInMagazine(1, 53);
|
||||
cmsError = N.TOOLS_WLoadToolInMagazine(1, new NewToolInMagazineModel() { PositionId = 1, ToolId = 4 });
|
||||
// cmsError = N.TOOLS_WLoadToolInMagazine(1, new NewToolInMagazineModel() { PositionId = 1, ToolId = 4 });
|
||||
cmsError = N.TOOLS_RToolsData(ref dataTable);
|
||||
//cmsError = N.PLC_WRefreshAllMessages();
|
||||
//cmsError = N.PLC_RHeadsData(headsTest, 1);
|
||||
|
||||
|
||||
@@ -445,13 +445,6 @@ namespace CMS_CORE_Library
|
||||
GENERIC = 5
|
||||
}
|
||||
|
||||
public enum ROTATION
|
||||
{
|
||||
NONE = 0,
|
||||
CLOCKWHISE = 1,
|
||||
COUNTERCLOCKWHISE = 2
|
||||
}
|
||||
|
||||
public enum MAGAZINE_TYPE
|
||||
{
|
||||
CHAIN = 1,
|
||||
@@ -461,6 +454,24 @@ namespace CMS_CORE_Library
|
||||
MAGAZINE_LOADING_STATION = 9
|
||||
}
|
||||
|
||||
public enum POSITION_TYPE
|
||||
{
|
||||
MAGAZINE_LOCATION = 1,
|
||||
SPINDLE = 2,
|
||||
GRIPPER = 3,
|
||||
LOADER = 4,
|
||||
TRANSFER_LOCATION = 5,
|
||||
LOADING_STATION = 6,
|
||||
LOADING_POINT = 7
|
||||
}
|
||||
|
||||
public enum ROTATION
|
||||
{
|
||||
NONE = 0,
|
||||
CLOCKWHISE = 1,
|
||||
COUNTERCLOCKWHISE = 2
|
||||
}
|
||||
|
||||
public enum SIEMENS_LIFE_TYPE
|
||||
{
|
||||
NONE = 0,
|
||||
@@ -570,6 +581,7 @@ namespace CMS_CORE_Library
|
||||
{
|
||||
public int PositionId;
|
||||
public int MagazineId;
|
||||
public POSITION_TYPE PhysicalType;
|
||||
public int Type;
|
||||
public bool Disabled;
|
||||
}
|
||||
@@ -659,6 +671,7 @@ namespace CMS_CORE_Library
|
||||
public MAGAZINE_TYPE Type;
|
||||
public int MaxPositions;
|
||||
public bool LoadingIsActive;
|
||||
public int LoadPosition;
|
||||
}
|
||||
|
||||
public class ToolTableConfiguration
|
||||
|
||||
@@ -1722,19 +1722,21 @@ namespace CMS_CORE.Demo
|
||||
{
|
||||
if (tool.IsMultiTool)
|
||||
{
|
||||
if (tool.Shank.Id == demoTool.Id)
|
||||
{
|
||||
magazineId = tool.MagazineId;
|
||||
positionId = tool.PositionId;
|
||||
}
|
||||
if(tool.Shank != null)
|
||||
if (tool.Shank.Id == demoTool.Id)
|
||||
{
|
||||
magazineId = tool.MagazineId;
|
||||
positionId = tool.PositionId;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tool.ChildTools.Id == demoTool.Id)
|
||||
{
|
||||
magazineId = tool.MagazineId;
|
||||
positionId = tool.PositionId;
|
||||
}
|
||||
if(tool.ChildTools != null)
|
||||
if (tool.ChildTools.Id == demoTool.Id)
|
||||
{
|
||||
magazineId = tool.MagazineId;
|
||||
positionId = tool.PositionId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -249,13 +249,15 @@ namespace CMS_CORE.Siemens
|
||||
if (magPosItems.Count > 0)
|
||||
// Subscribe
|
||||
MagazinePositionSvc.Subscribe(MagazinePositionEnabled_OnChange, magPosItems.ToArray());
|
||||
List<Item> magActionsItem = new List<Item>()
|
||||
{
|
||||
new Item() { Path = "DB71.DBB0", SymbolicName = "71"},
|
||||
new Item() { Path = "DB72.DBB0", SymbolicName = "72"}
|
||||
};
|
||||
|
||||
|
||||
// Setup magazine actions listener
|
||||
Item magActionsItem = new Item()
|
||||
{
|
||||
Path = "DB71.DBB0"
|
||||
};
|
||||
MagazineActionsSvc.Subscribe(MagazineAction_OnChange, magActionsItem);
|
||||
MagazineActionsSvc.Subscribe(MagazineAction_OnChange, magActionsItem.ToArray());
|
||||
|
||||
DataSvc d = new DataSvc();
|
||||
Item i = new Item() { Path = "/Tool/MTCatalogue/numMultiTools[u1]" };
|
||||
@@ -2175,7 +2177,7 @@ namespace CMS_CORE.Siemens
|
||||
foreach (ShankChildModel child in shank.ChildsTools)
|
||||
{
|
||||
// Find tool by id
|
||||
SiemensToolModel tool = ToolTableData.Where(x => x.Id == child.Id).First();
|
||||
SiemensToolModel tool = ToolTableData.Where(x => x.Id == child.Id).FirstOrDefault();
|
||||
if (tool != null)
|
||||
{
|
||||
child.FamilyName = tool.FamilyName;
|
||||
@@ -2472,8 +2474,8 @@ namespace CMS_CORE.Siemens
|
||||
case SIEMENS_LIFE_TYPE.COUNT:
|
||||
{
|
||||
items.Add(new Item() { Path = string.Format("/Tool/Supervision/data[c{0}, {1}]", tool.Id, edgeLifeOffset + 3), Value = edge.PreAlmLife });
|
||||
items.Add(new Item() { Path = string.Format("/Tool/Supervision/data[c{0}, {1}]", tool.Id, edgeLifeOffset + 4), Value = edge.NominalLife });
|
||||
items.Add(new Item() { Path = string.Format("/Tool/Supervision/data[c{0}, {1}]", tool.Id, edgeLifeOffset + 6), Value = edge.ResidualLife });
|
||||
items.Add(new Item() { Path = string.Format("/Tool/Supervision/data[c{0}, {1}]", tool.Id, edgeLifeOffset + 6), Value = edge.NominalLife });
|
||||
items.Add(new Item() { Path = string.Format("/Tool/Supervision/data[c{0}, {1}]", tool.Id, edgeLifeOffset + 4), Value = edge.ResidualLife });
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2583,17 +2585,28 @@ namespace CMS_CORE.Siemens
|
||||
int toolIndex = ToolTableData.FindIndex(x => x.Id == pos.ToolId);
|
||||
if (toolIndex > 0)
|
||||
{
|
||||
|
||||
int decPosition, incPosition;
|
||||
decPosition = incPosition = pos.PositionId;
|
||||
// if it is a circular magazine move position before ( for left case ) or after ( right case ) the location you want to mount the tool
|
||||
if (magConfig.Type != MAGAZINE_TYPE.BOX_MAGAZINE)
|
||||
{
|
||||
decPosition = decPosition < newMagazineTool.PositionId ? decPosition + magConfig.MaxPositions : decPosition;
|
||||
incPosition = incPosition > newMagazineTool.PositionId ? incPosition - magConfig.MaxPositions : incPosition;
|
||||
}
|
||||
// Right check
|
||||
int decPosition = pos.PositionId < newMagazineTool.PositionId ? pos.PositionId + 60 : pos.PositionId;
|
||||
double leftMounted = decPosition - (ToolTableData[toolIndex].LeftSize / 2.0); // Calculate left space occupied
|
||||
double rightToBeMount = newMagazineTool.PositionId + ((tool as SiemensToolModel).RightSize / 2.0); // Calculate right space needed
|
||||
// Calculate left space occupied
|
||||
double leftMounted = decPosition - (ToolTableData[toolIndex].LeftSize / 2.0);
|
||||
// Calculate right space needed
|
||||
double rightToBeMount = newMagazineTool.PositionId + ((tool as SiemensToolModel).RightSize / 2.0);
|
||||
if (leftMounted < rightToBeMount)
|
||||
return MAGAZINE_POSITION_OCCUPIED_ERROR;
|
||||
|
||||
// Left check
|
||||
int incPosition = pos.PositionId > newMagazineTool.PositionId ? pos.PositionId - 60 : pos.PositionId;
|
||||
double rightMounted = incPosition + (ToolTableData[toolIndex].RightSize / 2.0); // Calculate right space occupied
|
||||
double leftToBeMounted = newMagazineTool.PositionId - ((tool as SiemensToolModel).LeftSize / 2.0); // Calculate left space needed
|
||||
// Calculate right space occupied
|
||||
double rightMounted = incPosition + (ToolTableData[toolIndex].RightSize / 2.0);
|
||||
// Calculate left space needed
|
||||
double leftToBeMounted = newMagazineTool.PositionId - ((tool as SiemensToolModel).LeftSize / 2.0);
|
||||
if (rightMounted > leftToBeMounted)
|
||||
return MAGAZINE_POSITION_OCCUPIED_ERROR;
|
||||
}
|
||||
@@ -2612,7 +2625,7 @@ namespace CMS_CORE.Siemens
|
||||
piArgs[0] = "/NC";
|
||||
piArgs[1] = "401";
|
||||
piArgs[2] = newMagazineTool.ToolId.ToString().PadLeft(5, '0'); //Tool ID (> 00000)
|
||||
piArgs[3] = magazineId.ToString().PadLeft(5, '0'); ; // Manina carico (valore fisso)
|
||||
piArgs[3] = magConfig.LoadPosition.ToString().PadLeft(5, '0'); ; // Manina carico (valore fisso)
|
||||
piArgs[4] = "09999"; // Magazzino di carico (valore fisso)
|
||||
piArgs[5] = newMagazineTool.PositionId.ToString().PadLeft(5, '0'); // Manina di destinazione (dove caricare l'utensile)
|
||||
piArgs[6] = magazineId.ToString().PadLeft(5, '0'); // Magazzino di destinazione (dove caricare l'utensile)
|
||||
@@ -2626,6 +2639,7 @@ namespace CMS_CORE.Siemens
|
||||
{
|
||||
return ManageException(ex);
|
||||
}
|
||||
|
||||
// Mount temporarily till the Siemens notification arrives
|
||||
MountToolToMagazineList(newMagazineTool.ToolId, magazineId, newMagazineTool.PositionId);
|
||||
|
||||
@@ -2637,6 +2651,11 @@ namespace CMS_CORE.Siemens
|
||||
if (MagazineAction.Action != MAGAZINE_ACTIONS.NONE)
|
||||
return MAGAZINE_BUSY_ERROR;
|
||||
|
||||
// Get mag config
|
||||
MagazineConfigModel magConfig = MagazineConfig.Where(x => x.Id == magazineId).FirstOrDefault();
|
||||
if (magConfig == null || !magConfig.LoadingIsActive)
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
//Check if the NC is Connected
|
||||
CmsError cmsError = CheckConnection();
|
||||
if (cmsError.IsError())
|
||||
@@ -2651,7 +2670,7 @@ namespace CMS_CORE.Siemens
|
||||
piArgs[2] = "-0001"; // Tool ID (Fixed, no ID)
|
||||
piArgs[3] = positionId.ToString().PadLeft(5, '0'); // Manina carico (valore fisso)
|
||||
piArgs[4] = magazineId.ToString().PadLeft(5, '0'); // Magazzino di carico (valore fisso)
|
||||
piArgs[5] = magazineId.ToString().PadLeft(5, '0'); //Manina carico (valore fisso)
|
||||
piArgs[5] = magConfig.LoadPosition.ToString().PadLeft(5, '0'); //Manina carico (valore fisso)
|
||||
piArgs[6] = "09999"; // Magazzino da cui scaricare l'utensile
|
||||
piArgs[7] = "_N_TMMVTL";
|
||||
|
||||
@@ -3203,105 +3222,110 @@ namespace CMS_CORE.Siemens
|
||||
}
|
||||
}
|
||||
|
||||
private void MagazineAction_OnChange(Guid guid, Item item, DataSvcStatus status)
|
||||
private void MagazineAction_OnChange(Guid guid, Item[] items, DataSvcStatus[] status)
|
||||
{
|
||||
DataSvc dataSvc = new DataSvc();
|
||||
Item action = new Item("DB71.DBB4");
|
||||
dataSvc.Read(action);
|
||||
|
||||
if ((uint)item.Value == 0)
|
||||
foreach (Item item in items)
|
||||
{
|
||||
MagazineAction = new MagazineActionModel()
|
||||
string prefix = "DB" + item.SymbolicName + ".";
|
||||
DataSvc dataSvc = new DataSvc();
|
||||
Item action = new Item(prefix + "DBB4");
|
||||
dataSvc.Read(action);
|
||||
|
||||
if ((uint)item.Value == 0)
|
||||
{
|
||||
Action = MAGAZINE_ACTIONS.NONE,
|
||||
OriginMagazine = 0,
|
||||
OriginPosition = 0,
|
||||
DestinationMagazine = 0,
|
||||
DestinationPosition = 0,
|
||||
Tool = null
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Item> magazineValue = new List<Item>()
|
||||
MagazineAction = new MagazineActionModel()
|
||||
{
|
||||
Action = MAGAZINE_ACTIONS.NONE,
|
||||
OriginMagazine = 0,
|
||||
OriginPosition = 0,
|
||||
DestinationMagazine = 0,
|
||||
DestinationPosition = 0,
|
||||
Tool = null
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Item> magazineValue = new List<Item>()
|
||||
{
|
||||
new Item("DB71.DBW20"), // Intermediate mag Id
|
||||
new Item("DB71.DBW22"), // intermediate pos Id
|
||||
new Item(prefix + "DBW20"), // Intermediate mag Id
|
||||
new Item(prefix + "DBW22"), // intermediate pos Id
|
||||
|
||||
new Item("DB71.DBW24"), // Unload mag Id
|
||||
new Item("DB71.DBW26"), // Unload pos Id
|
||||
new Item(prefix + "DBW24"), // Unload mag Id
|
||||
new Item(prefix + "DBW26"), // Unload pos Id
|
||||
|
||||
new Item("DB71.DBW28"), // Load mag Id
|
||||
new Item("DB71.DBW30") // Load pos Id
|
||||
new Item(prefix + "DBW28"), // Load mag Id
|
||||
new Item(prefix + "DBW30") // Load pos Id
|
||||
};
|
||||
|
||||
// Read magazine positions
|
||||
dataSvc.Read(magazineValue.ToArray());
|
||||
// Read magazine positions
|
||||
dataSvc.Read(magazineValue.ToArray());
|
||||
|
||||
uint toolMagId = 0;
|
||||
uint toolPosId = 0;
|
||||
uint toolId = 0;
|
||||
uint toolMagId = 0;
|
||||
uint toolPosId = 0;
|
||||
uint toolId = 0;
|
||||
|
||||
switch ((MAGAZINE_ACTIONS)Convert.ToInt32(action.Value))
|
||||
{
|
||||
case MAGAZINE_ACTIONS.LOADING:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[1].Value - 1) * 11) + 3; // (position_id - 1) * 11 + 3
|
||||
toolMagId = (uint)magazineValue[0].Value;
|
||||
}
|
||||
break;
|
||||
switch ((MAGAZINE_ACTIONS)Convert.ToInt32(action.Value))
|
||||
{
|
||||
case MAGAZINE_ACTIONS.LOADING:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[1].Value - 1) * 11) + 3; // (position_id - 1) * 11 + 3
|
||||
toolMagId = (uint)magazineValue[0].Value;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.UNLOADING:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[3].Value - 1) * 11) + 3;
|
||||
toolMagId = (uint)magazineValue[2].Value;
|
||||
}
|
||||
break;
|
||||
case MAGAZINE_ACTIONS.UNLOADING:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[3].Value - 1) * 11) + 3;
|
||||
toolMagId = (uint)magazineValue[2].Value;
|
||||
}
|
||||
break;
|
||||
|
||||
case MAGAZINE_ACTIONS.TRANSFER:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[3].Value - 1) * 11) + 3;
|
||||
toolMagId = (uint)magazineValue[2].Value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
// If position and magazine exist
|
||||
if (toolMagId != 0 && toolPosId != 0)
|
||||
{
|
||||
// Read tool id
|
||||
Item toolIdItem = new Item(string.Format("/Tool/Magazine/placeData[c{0} , {1}]", toolMagId, toolPosId));
|
||||
dataSvc.Read(toolIdItem);
|
||||
toolId = (uint)toolIdItem.Value;
|
||||
}
|
||||
case MAGAZINE_ACTIONS.TRANSFER:
|
||||
{
|
||||
toolPosId = (((uint)magazineValue[3].Value - 1) * 11) + 3;
|
||||
toolMagId = (uint)magazineValue[2].Value;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Find tool data into tools list
|
||||
MagazineActionToolModel tool = ToolTableData.Where(x => x.Id == toolId)?.Select(x => new MagazineActionToolModel
|
||||
{
|
||||
Id = x.Id,
|
||||
Name = x.FamilyName,
|
||||
ToolType = x.ToolType,
|
||||
IsMultitool = false
|
||||
}).FirstOrDefault();
|
||||
// If position and magazine exist
|
||||
if (toolMagId != 0 && toolPosId != 0)
|
||||
{
|
||||
// Read tool id
|
||||
Item toolIdItem = new Item(string.Format("/Tool/Magazine/placeData[c{0} , {1}]", toolMagId, toolPosId));
|
||||
dataSvc.Read(toolIdItem);
|
||||
toolId = (uint)toolIdItem.Value;
|
||||
}
|
||||
|
||||
if (tool == null)
|
||||
// If not found in the tools list, find in the multitools
|
||||
tool = MultitoolsData.Where(x => x.Id == toolId)?.Select(x => new MagazineActionToolModel
|
||||
// Find tool data into tools list
|
||||
MagazineActionToolModel tool = ToolTableData.Where(x => x.Id == toolId)?.Select(x => new MagazineActionToolModel
|
||||
{
|
||||
Id = x.Id,
|
||||
Name = x.Name,
|
||||
ToolType = 0,
|
||||
IsMultitool = true
|
||||
Name = x.FamilyName,
|
||||
ToolType = x.ToolType,
|
||||
IsMultitool = false
|
||||
}).FirstOrDefault();
|
||||
|
||||
MagazineAction = new MagazineActionModel()
|
||||
{
|
||||
Action = (MAGAZINE_ACTIONS)Convert.ToInt32(action.Value),
|
||||
OriginMagazine = Convert.ToInt32(magazineValue[4].Value),
|
||||
OriginPosition = Convert.ToInt32(magazineValue[5].Value),
|
||||
DestinationMagazine = Convert.ToInt32(magazineValue[2].Value),
|
||||
DestinationPosition = Convert.ToInt32(magazineValue[3].Value),
|
||||
Tool = tool
|
||||
};
|
||||
if (tool == null)
|
||||
// If not found in the tools list, find in the multitools
|
||||
tool = MultitoolsData.Where(x => x.Id == toolId)?.Select(x => new MagazineActionToolModel
|
||||
{
|
||||
Id = x.Id,
|
||||
Name = x.Name,
|
||||
ToolType = 0,
|
||||
IsMultitool = true
|
||||
}).FirstOrDefault();
|
||||
|
||||
MagazineAction = new MagazineActionModel()
|
||||
{
|
||||
Action = (MAGAZINE_ACTIONS)Convert.ToInt32(action.Value),
|
||||
OriginMagazine = Convert.ToInt32(magazineValue[4].Value),
|
||||
OriginPosition = Convert.ToInt32(magazineValue[5].Value),
|
||||
DestinationMagazine = Convert.ToInt32(magazineValue[2].Value),
|
||||
DestinationPosition = Convert.ToInt32(magazineValue[3].Value),
|
||||
Tool = tool
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3506,6 +3530,14 @@ namespace CMS_CORE.Siemens
|
||||
mag.Name = actualString.Split('=').LastOrDefault().Replace("\"", "");
|
||||
}
|
||||
break;
|
||||
case "$TC_MAP7":
|
||||
{
|
||||
// Add max number of magazine positions
|
||||
MagazineConfigModel mag = MagazineConfig.Where(x => x.Id == firstId).FirstOrDefault();
|
||||
if (mag != null)
|
||||
mag.MaxPositions = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3643,17 +3675,29 @@ namespace CMS_CORE.Siemens
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "$TC_MPP2":
|
||||
case "$TC_MPP1":
|
||||
{
|
||||
MagazinePositionsData.Add(new PositionModel()
|
||||
{
|
||||
PositionId = secondId,
|
||||
MagazineId = firstId,
|
||||
Type = Convert.ToInt32(actualString.Split('=').LastOrDefault())
|
||||
PhysicalType = (POSITION_TYPE)Convert.ToInt32(actualString.Split('=').LastOrDefault())
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "$TC_MPP2":
|
||||
{
|
||||
int index = MagazinePositionsData.FindIndex(x => x.PositionId == secondId && x.MagazineId == firstId);
|
||||
if (index >= 0)
|
||||
MagazinePositionsData[index].Type = Convert.ToInt32(actualString.Split('=').LastOrDefault());
|
||||
//MagazinePositionsData.Add(new PositionModel()
|
||||
//{
|
||||
// PositionId = secondId,
|
||||
// MagazineId = firstId,
|
||||
// Type = Convert.ToInt32(actualString.Split('=').LastOrDefault())
|
||||
//});
|
||||
}
|
||||
break;
|
||||
|
||||
case "$TC_MPP4":
|
||||
{
|
||||
@@ -3688,6 +3732,14 @@ namespace CMS_CORE.Siemens
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "$TC_MDP1":
|
||||
{
|
||||
// Add max number of magazine positions
|
||||
MagazineConfigModel mag = MagazineConfig.Where(x => x.Id == firstId).FirstOrDefault();
|
||||
if (mag != null)
|
||||
mag.LoadPosition = secondId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3922,8 +3974,18 @@ namespace CMS_CORE.Siemens
|
||||
// Find tool
|
||||
SiemensToolModel tool = ToolTableData.FirstOrDefault(t => t.Id == toolInfo.tNo);
|
||||
if (tool != null)
|
||||
{
|
||||
// Delete Families
|
||||
SiemensToolModel sameFamilyTool = ToolTableData.FirstOrDefault(x => x.FamilyName == tool.FamilyName && x.Id != tool.Id);
|
||||
if(sameFamilyTool == null)
|
||||
{
|
||||
FamiliesData.RemoveAll(x => x.Name == tool.FamilyName);
|
||||
}
|
||||
|
||||
// Remove
|
||||
ToolTableData.Remove(tool);
|
||||
}
|
||||
|
||||
else if (MULTITOOL_OPTION_ACTIVE)
|
||||
{
|
||||
// if tool not exist, find into shanks
|
||||
|
||||
@@ -62,6 +62,16 @@ namespace CMS_CORE_Library
|
||||
{2, "counterClockWhise"}
|
||||
};
|
||||
|
||||
private static Dictionary<int, string> physicalType = new Dictionary<int, string>()
|
||||
{
|
||||
{1, "magazine_location" },
|
||||
{2, "spindle" },
|
||||
{3, "gripper" },
|
||||
{4, "loader" },
|
||||
{5, "transfer_location" },
|
||||
{6, "loading_station" },
|
||||
{7, "loading_point" }
|
||||
};
|
||||
#endregion PRIVATE_SELECTS_VALUES
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -133,10 +143,11 @@ namespace CMS_CORE_Library
|
||||
|
||||
public static List<FieldsConfiguration> SiemensMagazinePosFieldsConfig = 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 },
|
||||
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 = "physicalType", Type = "select", SelectValues = physicalType, Category = "general", ReadOnly = true, MinValue = 0, MaxValue = 0 },
|
||||
new FieldsConfiguration{ Name = "disabled", Type = "boolean", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = 0 }
|
||||
};
|
||||
|
||||
public static EdgesConfiguration SiemensEdgesFieldsConfiguration = new EdgesConfiguration()
|
||||
|
||||
@@ -1412,6 +1412,7 @@ namespace Nc_Demo_Application.Database
|
||||
PositionId = Convert.ToInt32(row["positionId"]),
|
||||
MagazineId = Convert.ToInt32(row["magazineId"]),
|
||||
Type = Convert.ToInt32(row["type"]),
|
||||
PhysicalType = Convert.ToInt32(row["physicalType"]),
|
||||
Disabled = Convert.ToInt32(row["disabled"]) == 1
|
||||
};
|
||||
|
||||
@@ -1513,6 +1514,7 @@ namespace Nc_Demo_Application.Database
|
||||
|
||||
// Update positions type
|
||||
row["type"] = position.Type;
|
||||
row["physicalType"] = position.PhysicalType;
|
||||
row["disabled"] = position.Disabled;
|
||||
// Save
|
||||
UpdatePositions(MagazinesPositionDataTable);
|
||||
@@ -1622,7 +1624,7 @@ namespace Nc_Demo_Application.Database
|
||||
};
|
||||
|
||||
// Set model data
|
||||
status.action = (MAGAZINE_ACTIONS)Convert.ToInt32(row["action"]);
|
||||
status.Action = (MAGAZINE_ACTIONS)Convert.ToInt32(row["action"]);
|
||||
status.Tool = tool;
|
||||
status.Tool.Id = Convert.ToInt32(row["tool_id"]);
|
||||
status.OriginMagazine = Convert.ToInt32(row["orig_mag"]);
|
||||
@@ -1641,7 +1643,7 @@ namespace Nc_Demo_Application.Database
|
||||
// Update local ncDatatable data
|
||||
foreach (DataRow row in MagazinesActionDataTable.Rows)
|
||||
{
|
||||
row["action"] = (int)ncData.action;
|
||||
row["action"] = (int)ncData.Action;
|
||||
row["tool_id"] = ncData.Tool.Id;
|
||||
row["orig_mag"] = ncData.OriginMagazine;
|
||||
row["orig_pos"] = ncData.OriginPosition;
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace Nc_Demo_Application.Database.Models
|
||||
public int PositionId;
|
||||
public int MagazineId;
|
||||
public int Type;
|
||||
public int PhysicalType;
|
||||
public bool Disabled;
|
||||
public bool IsMultiTool;
|
||||
public ShankDataModel Shank;
|
||||
@@ -89,7 +90,7 @@ namespace Nc_Demo_Application.Database.Models
|
||||
|
||||
public class MagazineActionModel
|
||||
{
|
||||
public MAGAZINE_ACTIONS action;
|
||||
public MAGAZINE_ACTIONS Action;
|
||||
public int OriginMagazine;
|
||||
public int OriginPosition;
|
||||
public int DestinationMagazine;
|
||||
|
||||
+76
-67
@@ -32,11 +32,11 @@ namespace Nc_Demo_Application
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DemoApplicationForm));
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.serverStatusLabel = new System.Windows.Forms.Label();
|
||||
this.ncDataPage = new System.Windows.Forms.TabPage();
|
||||
this.magPositionOptionCheckbox = new System.Windows.Forms.CheckBox();
|
||||
@@ -117,12 +117,6 @@ namespace Nc_Demo_Application
|
||||
this.label21 = new System.Windows.Forms.Label();
|
||||
this.magActionAction = new System.Windows.Forms.ComboBox();
|
||||
this.magazinesGridView = new System.Windows.Forms.DataGridView();
|
||||
this.magazineId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.positionId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.positionType = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ShankId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.magazineToolId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.disablePosition = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.familiesTab = new System.Windows.Forms.TabPage();
|
||||
this.label18 = new System.Windows.Forms.Label();
|
||||
this.shanksDataGridView = new System.Windows.Forms.DataGridView();
|
||||
@@ -244,6 +238,13 @@ namespace Nc_Demo_Application
|
||||
this.refreshToolUI = new System.Windows.Forms.ToolStripButton();
|
||||
this.removeTool = new System.Windows.Forms.ToolStripButton();
|
||||
this.addTool = new System.Windows.Forms.ToolStripButton();
|
||||
this.magazineId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.positionId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.physicalType = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.positionType = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ShankId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.magazineToolId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.disablePosition = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.ncDataPage.SuspendLayout();
|
||||
this.ncTabControl.SuspendLayout();
|
||||
this.processPage.SuspendLayout();
|
||||
@@ -1034,6 +1035,7 @@ namespace Nc_Demo_Application
|
||||
this.magazinesGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.magazineId,
|
||||
this.positionId,
|
||||
this.physicalType,
|
||||
this.positionType,
|
||||
this.ShankId,
|
||||
this.magazineToolId,
|
||||
@@ -1043,58 +1045,6 @@ namespace Nc_Demo_Application
|
||||
this.magazinesGridView.Size = new System.Drawing.Size(978, 548);
|
||||
this.magazinesGridView.TabIndex = 0;
|
||||
//
|
||||
// magazineId
|
||||
//
|
||||
this.magazineId.DataPropertyName = "magazineId";
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.Black;
|
||||
this.magazineId.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.magazineId.FillWeight = 105.2829F;
|
||||
this.magazineId.HeaderText = "Magazine Id";
|
||||
this.magazineId.Name = "magazineId";
|
||||
this.magazineId.ReadOnly = true;
|
||||
this.magazineId.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
||||
//
|
||||
// positionId
|
||||
//
|
||||
this.positionId.DataPropertyName = "positionId";
|
||||
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black;
|
||||
this.positionId.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.positionId.FillWeight = 94.61015F;
|
||||
this.positionId.HeaderText = "Position Id";
|
||||
this.positionId.Name = "positionId";
|
||||
this.positionId.ReadOnly = true;
|
||||
//
|
||||
// positionType
|
||||
//
|
||||
this.positionType.DataPropertyName = "type";
|
||||
this.positionType.FillWeight = 100.1069F;
|
||||
this.positionType.HeaderText = "Type";
|
||||
this.positionType.Name = "positionType";
|
||||
//
|
||||
// ShankId
|
||||
//
|
||||
this.ShankId.DataPropertyName = "shankId";
|
||||
this.ShankId.HeaderText = "Shank Id";
|
||||
this.ShankId.Name = "ShankId";
|
||||
//
|
||||
// magazineToolId
|
||||
//
|
||||
this.magazineToolId.DataPropertyName = "toolId";
|
||||
this.magazineToolId.HeaderText = "Tool Id";
|
||||
this.magazineToolId.Name = "magazineToolId";
|
||||
//
|
||||
// disablePosition
|
||||
//
|
||||
this.disablePosition.DataPropertyName = "disabled";
|
||||
this.disablePosition.FalseValue = "0";
|
||||
this.disablePosition.HeaderText = "Disabled";
|
||||
this.disablePosition.Name = "disablePosition";
|
||||
this.disablePosition.TrueValue = "1";
|
||||
//
|
||||
// familiesTab
|
||||
//
|
||||
this.familiesTab.Controls.Add(this.label18);
|
||||
@@ -2057,7 +2007,7 @@ namespace Nc_Demo_Application
|
||||
this.versionLabel.Name = "versionLabel";
|
||||
this.versionLabel.Size = new System.Drawing.Size(89, 20);
|
||||
this.versionLabel.TabIndex = 11;
|
||||
this.versionLabel.Text = "Version: 29";
|
||||
this.versionLabel.Text = "Version: 30";
|
||||
//
|
||||
// toolStrip5
|
||||
//
|
||||
@@ -2321,6 +2271,64 @@ namespace Nc_Demo_Application
|
||||
this.addTool.Text = "toolStripButton1";
|
||||
this.addTool.Click += new System.EventHandler(this.AddTool_Click);
|
||||
//
|
||||
// magazineId
|
||||
//
|
||||
this.magazineId.DataPropertyName = "magazineId";
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.Black;
|
||||
this.magazineId.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.magazineId.FillWeight = 105.2829F;
|
||||
this.magazineId.HeaderText = "Magazine Id";
|
||||
this.magazineId.Name = "magazineId";
|
||||
this.magazineId.ReadOnly = true;
|
||||
this.magazineId.Resizable = System.Windows.Forms.DataGridViewTriState.False;
|
||||
//
|
||||
// positionId
|
||||
//
|
||||
this.positionId.DataPropertyName = "positionId";
|
||||
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
|
||||
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black;
|
||||
this.positionId.DefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.positionId.FillWeight = 94.61015F;
|
||||
this.positionId.HeaderText = "Position Id";
|
||||
this.positionId.Name = "positionId";
|
||||
this.positionId.ReadOnly = true;
|
||||
//
|
||||
// physicalType
|
||||
//
|
||||
this.physicalType.DataPropertyName = "physicalType";
|
||||
this.physicalType.HeaderText = "Physical Type";
|
||||
this.physicalType.Name = "physicalType";
|
||||
//
|
||||
// positionType
|
||||
//
|
||||
this.positionType.DataPropertyName = "type";
|
||||
this.positionType.FillWeight = 100.1069F;
|
||||
this.positionType.HeaderText = "Type";
|
||||
this.positionType.Name = "positionType";
|
||||
//
|
||||
// ShankId
|
||||
//
|
||||
this.ShankId.DataPropertyName = "shankId";
|
||||
this.ShankId.HeaderText = "Shank Id";
|
||||
this.ShankId.Name = "ShankId";
|
||||
//
|
||||
// magazineToolId
|
||||
//
|
||||
this.magazineToolId.DataPropertyName = "toolId";
|
||||
this.magazineToolId.HeaderText = "Tool Id";
|
||||
this.magazineToolId.Name = "magazineToolId";
|
||||
//
|
||||
// disablePosition
|
||||
//
|
||||
this.disablePosition.DataPropertyName = "disabled";
|
||||
this.disablePosition.FalseValue = "0";
|
||||
this.disablePosition.HeaderText = "Disabled";
|
||||
this.disablePosition.Name = "disablePosition";
|
||||
this.disablePosition.TrueValue = "1";
|
||||
//
|
||||
// DemoApplicationForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -2586,16 +2594,17 @@ namespace Nc_Demo_Application
|
||||
private System.Windows.Forms.TextBox maxEdgeXToolTxb;
|
||||
private System.Windows.Forms.Label label28;
|
||||
private System.Windows.Forms.TextBox maxToolTxb;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn magazineId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn positionId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn positionType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ShankId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn magazineToolId;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn disablePosition;
|
||||
private System.Windows.Forms.Label label32;
|
||||
private System.Windows.Forms.TextBox multitoolIdTxb;
|
||||
private System.Windows.Forms.CheckBox magPositionOptionCheckbox;
|
||||
private System.Windows.Forms.CheckBox familyOptCheckbox;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn magazineId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn positionId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn physicalType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn positionType;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ShankId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn magazineToolId;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn disablePosition;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Nc_Demo_Application
|
||||
magazinesGridView.DataSource = magazines;
|
||||
// Set UI components data
|
||||
MagazineActionModel magAction = DatabaseController.getInstance().ReadMagazinesAction();
|
||||
magActionAction.SelectedItem = magAction.action;
|
||||
magActionAction.SelectedItem = magAction.Action;
|
||||
magActionToolId.Text = magAction.Tool.Id.ToString();
|
||||
magActionOrigMag.Text = magAction.OriginMagazine.ToString();
|
||||
magActionOrigPos.Text = magAction.OriginPosition.ToString();
|
||||
@@ -729,7 +729,7 @@ namespace Nc_Demo_Application
|
||||
|
||||
MagazineActionModel magAction = new MagazineActionModel()
|
||||
{
|
||||
action = (MAGAZINE_ACTIONS)magActionAction.SelectedItem,
|
||||
Action = (MAGAZINE_ACTIONS)magActionAction.SelectedItem,
|
||||
Tool = new MagazineActionToolModel() { Id = Convert.ToInt32(magActionToolId.Text) },
|
||||
OriginMagazine = Convert.ToInt32(magActionOrigMag.Text),
|
||||
OriginPosition = Convert.ToInt32(magActionOrigPos.Text),
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
<metadata name="positionId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="physicalType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="positionType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
Reference in New Issue
Block a user