Skip to content

Commit

Permalink
update due to de~soutter
Browse files Browse the repository at this point in the history
  • Loading branch information
TomKovac committed Jan 8, 2024
1 parent 811bb7e commit f97b0e5
Show file tree
Hide file tree
Showing 311 changed files with 26,400 additions and 97 deletions.
24 changes: 18 additions & 6 deletions src/tia2ax/V18_0/ApiResolver/ApiWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ public IList<ModuleItem> GetAllLocalModules(Device device, string name)
string _classification = "";
string _orderNumber = "";
string _firmware = "";
string deviceItemName = deviceItem.Name;
string deviceSubItemName = "";
string deviceSubSubItemName = "";
try
{
_classification = deviceItem.GetAttribute("Classification").ToString();
Expand All @@ -576,7 +579,10 @@ public IList<ModuleItem> GetAllLocalModules(Device device, string name)

foreach (var deviceSubItem in deviceItem.DeviceItems)
{
ModuleItem localModule = new ModuleItem() { Name = deviceSubItem.Name, FullName = name + "_" + deviceSubItem.Name, OrderNumber = _orderNumber, FirmwareVersion = _firmware, PositionNumber = deviceSubItem.PositionNumber, AddressItems = new List<AddressItem>() };
deviceSubItemName = deviceSubItem.Name;
deviceSubSubItemName = "";
//ModuleItem localModule = new ModuleItem() { Name = deviceSubItem.Name, FullName = name + "_" + deviceSubItem.Name, OrderNumber = _orderNumber, FirmwareVersion = _firmware, PositionNumber = deviceSubItem.PositionNumber, AddressItems = new List<AddressItem>() };
ModuleItem localModule = new ModuleItem() { Name = deviceItem.Name, FullName = name + "_" + deviceItem.Name, OrderNumber = _orderNumber, FirmwareVersion = _firmware, PositionNumber = deviceItem.PositionNumber, AddressItems = new List<AddressItem>() };

foreach (Address address in deviceSubItem.Addresses)
{
Expand All @@ -594,6 +600,7 @@ public IList<ModuleItem> GetAllLocalModules(Device device, string name)

foreach (DeviceItem deviceSubSubItem in deviceSubItem.Items)
{
deviceSubSubItemName = deviceSubSubItem.Name;
localModule = new ModuleItem() { Name = deviceSubSubItem.Name, FullName = name + "_" + deviceSubItem.Name + "_" + deviceSubSubItem.Name, OrderNumber = _orderNumber, FirmwareVersion = _firmware, PositionNumber = deviceSubItem.PositionNumber, AddressItems = new List<AddressItem>() };

foreach (Address address in deviceSubSubItem.Addresses)
Expand Down Expand Up @@ -644,21 +651,25 @@ public IList<HwIdentifierItem> GetAllHwIdentifiers(Device device, string name)
if (deviceItem != null)
{
string controller = "";
foreach (HwIdentifier HwIdentifier in deviceItem.HwIdentifiers)

if (deviceItem.HwIdentifiers != null && deviceItem.HwIdentifiers.Count > 0 && deviceItem.HwIdentifiers[0] != null)
{
controller = HwIdentifier.HwIdentifierControllers != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault() != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name") != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name").ToString() : "" : "" :"";
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem(){Controller = controller, Name = name + "_" + deviceItem.Name , Identifier = HwIdentifier.Identifier};
HwIdentifier HwIdentifier = deviceItem.HwIdentifiers[0];
controller = HwIdentifier.HwIdentifierControllers != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault() != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name") != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name").ToString() : "" : "" : "";
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem() { Controller = controller, Name = name.Equals(deviceItem.Name) ? name : name + "_" + deviceItem.Name, Identifier = HwIdentifier.Identifier };
if (IsNewHardwareId(hwIdentifierItem.Name, HwIdentifiers))
{
HwIdentifiers.Add(hwIdentifierItem);
}
}

foreach (var deviceSubItem in deviceItem.DeviceItems)
{
foreach (HwIdentifier HwIdentifier in deviceSubItem.HwIdentifiers)
{
controller = HwIdentifier.HwIdentifierControllers != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault() != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name") != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name").ToString() : "" : "" : "";
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem() { Controller = controller, Name = name + "_" + deviceSubItem.Name, Identifier = HwIdentifier.Identifier };
string _name = name.Equals(deviceItem.Name) ? name + "_" + deviceSubItem.Name : name + "_" + deviceItem.Name;
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem() { Controller = controller, Name = _name, Identifier = HwIdentifier.Identifier };
if (IsNewHardwareId(hwIdentifierItem.Name, HwIdentifiers))
{
HwIdentifiers.Add(hwIdentifierItem);
Expand All @@ -669,7 +680,8 @@ public IList<HwIdentifierItem> GetAllHwIdentifiers(Device device, string name)
foreach (HwIdentifier HwIdentifier in deviceSubSubItem.HwIdentifiers)
{
controller = HwIdentifier.HwIdentifierControllers != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault() != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name") != null ? HwIdentifier.HwIdentifierControllers.FirstOrDefault().GetAttribute("Name").ToString() : "" : "" : "";
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem() { Controller = controller, Name = name + "_" + deviceSubSubItem.Name, Identifier = HwIdentifier.Identifier };
string _name = name.Equals(deviceItem.Name) ? deviceItem.Name + "_" + deviceSubItem.Name + "_" + deviceSubSubItem.Name : deviceItem.Name + "_" + deviceSubItem.Name + "_" + deviceSubSubItem.Name;
HwIdentifierItem hwIdentifierItem = new HwIdentifierItem() { Controller = controller, Name = _name, Identifier = HwIdentifier.Identifier };
if (IsNewHardwareId(hwIdentifierItem.Name, HwIdentifiers))
{
HwIdentifiers.Add(hwIdentifierItem);
Expand Down
6 changes: 4 additions & 2 deletions src/tia2ax/V18_0/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"profiles": {
"tia2ax": {
"commandName": "Project",
"commandLineArgs": "-x D:\\github\\ix-ax\\TiaProjects\\AX_Plc1518V3_CmmtAs\\AX_Plc1518V3_CmmtAs.ap18 -o D:\\github\\ix-ax\\TiaProjects\\Export"
//"commandLineArgs": "-x D:\\_mts\\2023\\TiaPortalProjects\\Complete\\2000482_V18\\2000482_V18.ap18 -o D:\\_mts\\2023\\Export"
//"commandLineArgs": "-x D:\\github\\ix-ax\\TiaProjects\\AX_Plc1518V3_CognexDataman\\AX_Plc1518V3_CognexDataman.ap18 -o D:\\github\\ix-ax\\TiaProjects\\Export"
//"commandLineArgs": "-x D:\\github\\ix-ax\\TiaProjects\\AX_Plc1518V3_CmmtAs\\AX_Plc1518V3_CmmtAs.ap18 -o D:\\github\\ix-ax\\TiaProjects\\Export"
//"commandLineArgs": "-x D:\\github\\ix-ax\\TiaProjects\\AX_Plc1518V3_IndraDrive\\AX_Plc1518V3_IndraDrive.ap18 -o D:\\github\\ix-ax\\TiaProjects\\Export"
"commandLineArgs": "-x D:\\github\\ix-ax\\TiaProjects\\AX_Plc1518V3_Desoutter\\AX_Plc1518V3_Desoutter.ap18 -o D:\\github\\ix-ax\\TiaProjects\\Export"
}
}
}
7 changes: 0 additions & 7 deletions tests/test_projects/_expected/PLC_1/CopyInputs.st

This file was deleted.

6 changes: 0 additions & 6 deletions tests/test_projects/_expected/PLC_1/CopyOutputs.st

This file was deleted.

5 changes: 0 additions & 5 deletions tests/test_projects/_expected/PLC_1/HwInputs.st

This file was deleted.

4 changes: 0 additions & 4 deletions tests/test_projects/_expected/PLC_1/HwOutputs.st

This file was deleted.

5 changes: 0 additions & 5 deletions tests/test_projects/_expected/PLC_1/PlcInputs.st

This file was deleted.

4 changes: 0 additions & 4 deletions tests/test_projects/_expected/PLC_1/PlcOutputs.st

This file was deleted.

7 changes: 0 additions & 7 deletions tests/test_projects/_expected/PLC_2/CopyInputs.st

This file was deleted.

6 changes: 0 additions & 6 deletions tests/test_projects/_expected/PLC_2/CopyOutputs.st

This file was deleted.

5 changes: 0 additions & 5 deletions tests/test_projects/_expected/PLC_2/HwInputs.st

This file was deleted.

4 changes: 0 additions & 4 deletions tests/test_projects/_expected/PLC_2/HwOutputs.st

This file was deleted.

5 changes: 0 additions & 5 deletions tests/test_projects/_expected/PLC_2/PlcInputs.st

This file was deleted.

4 changes: 0 additions & 4 deletions tests/test_projects/_expected/PLC_2/PlcOutputs.st

This file was deleted.

Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.fdt
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.fdx
Binary file not shown.
2 changes: 0 additions & 2 deletions tests/test_projects/_work/IM/SearchIndex/_3c.fnm

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_projects/_work/IM/SearchIndex/_3c.frq

This file was deleted.

Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.prx
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.tii
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.tis
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.tvd
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.tvf
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c.tvx
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3c_1.del
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3d.cfs
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/_3e.cfs
Binary file not shown.
Binary file removed tests/test_projects/_work/IM/SearchIndex/segments.gen
Binary file not shown.
Binary file removed tests/test_projects/_work/System/PEData.idx
Binary file not shown.
Binary file removed tests/test_projects/_work/System/PEData.plf
Binary file not shown.
38 changes: 38 additions & 0 deletions tests/test_projects/expected/HW_1516/6A1/HwIdentifiers.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
TYPE
HwIdentifiers : WORD
(
_6A1_Rail_0 := WORD#256,
_6A1 := WORD#48,
_6A1_Card_reader_writer_1 := WORD#51,
_6A1_CPU_display_1 := WORD#54,
_6A1_OPC_UA_1 := WORD#117,
_6A1_DP_interface_1 := WORD#60,
_6A1_PROFINET_interface_1 := WORD#64,
_6A1_PROFINET_interface_1_Port_1 := WORD#65,
_6A1_PROFINET_interface_1_Port_2 := WORD#66,
_6A1_PROFINET_interface_2 := WORD#72,
_6A1_PROFINET_interface_2_Port_1 := WORD#73,
_10A1_Rack := WORD#270,
_10A1 := WORD#258,
_10A1_Interface := WORD#259,
_10A1_Interface_Port_1 := WORD#260,
_10A1_DataMan_280_CC_B := WORD#261,
_10A1_Acquisition_Control_1 := WORD#262,
_10A1_Acquisition_Status_1 := WORD#263,
_10A1_Results_Control_1 := WORD#264,
_10A1_Results_Status_1 := WORD#265,
_10A1_Soft_Event_Control_1 := WORD#266,
_10A1_User_Data_64_bytes_1 := WORD#267,
_10A1_Result_Data_64_bytes_1 := WORD#268,
_11A1_PN_IO := WORD#274,
_11A1_PN_IO_Port_1_2xRJ45 := WORD#276,
_11A1_PN_IO_Port_2_2xRJ45 := WORD#275,
_11A1_IM_155_6_PN_ST_V3_3 := WORD#277,
_11A1_Port_1_2xRJ45 := WORD#276,
_11A1_Port_2_2xRJ45 := WORD#275,
_11A1_11A2 := WORD#278,
_11A1_11A3 := WORD#279,
_11A1_11A4 := WORD#280,
NONE:= WORD#0
);
END_TYPE
47 changes: 47 additions & 0 deletions tests/test_projects/expected/HW_1516_reader/6A1/HwIdentifiers.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
TYPE
HwIdentifiers : WORD
(
_6A1_Rail_0 := WORD#256,
_6A1 := WORD#48,
_6A1_Card_reader_writer_1 := WORD#51,
_6A1_CPU_display_1 := WORD#54,
_6A1_OPC_UA_1 := WORD#117,
_6A1_DP_interface_1 := WORD#60,
_6A1_PROFINET_interface_1 := WORD#64,
_6A1_PROFINET_interface_1_Port_1 := WORD#65,
_6A1_PROFINET_interface_1_Port_2 := WORD#66,
_6A1_PROFINET_interface_2 := WORD#72,
_6A1_PROFINET_interface_2_Port_1 := WORD#73,
_6A1_6A2 := WORD#257,
_6A1_6A3 := WORD#258,
_6A1_6A4 := WORD#259,
_10A1_Rack := WORD#270,
_10A1 := WORD#271,
_10A1_Interface := WORD#272,
_10A1_Interface_Port_1 := WORD#273,
_10A1_DataMan_280_CC_B := WORD#274,
_10A1_Acquisition_Control_1 := WORD#262,
_10A1_Acquisition_Status_1 := WORD#263,
_10A1_Results_Control_1 := WORD#264,
_10A1_Results_Status_1 := WORD#265,
_10A1_Soft_Event_Control_1 := WORD#266,
_10A1_User_Data_64_bytes_1 := WORD#267,
_10A1_Result_Data_64_bytes_1 := WORD#268,
_11A1_PN_IO := WORD#278,
_11A1_PN_IO_Port_1_2xRJ45 := WORD#280,
_11A1_PN_IO_Port_2_2xRJ45 := WORD#279,
_11A1_IM_155_6_PN_ST_V3_3 := WORD#281,
_11A1_Port_1_2xRJ45 := WORD#280,
_11A1_Port_2_2xRJ45 := WORD#279,
_11A1_11A2 := WORD#282,
_11A1_11A3 := WORD#283,
_11A1_11A4 := WORD#284,
_12A1_Rack_0 := WORD#286,
_12A1 := WORD#287,
_12A1_12A2 := WORD#288,
_12A1_12A3 := WORD#289,
_12A1_12A4 := WORD#290,
_12A1_Server_module_1 := WORD#291,
NONE:= WORD#0
);
END_TYPE
Loading

0 comments on commit f97b0e5

Please sign in to comment.