Files
2025-06-06 09:15:13 +02:00

156 lines
6.3 KiB
C#

/*
* Copyright (c) 2018 iTAC Software AG, Germany. All Rights Reserved.
*
* This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
* printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
* without the written permission of iTAC Software AG.
*/
// created 05.11.2018 14:52:23
// skip property Dictionary`2, property in exclude list
// skip (ignore generic type TrackArea)
// skip property Double, property in exclude list
// skip property Double, property in exclude list
// skip property DictionaryProxy`2, property in exclude list
// skip (ignore generic type TrackInformation)
// skip property ListProxy`1, property in exclude list
using System;
using System.Collections.Generic;
namespace com.itac.oib.siplacepro.contracts.data
{
// source: assembly 5.1.0.84
// source: assembly ASM.AS.OIB.SIPLACEPro.Proxy
public class TableMapper
{
// used for itac->asm: True
// used for asm->itac: True
// maps iTAC namespace conform type to ASM namespace type
public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table get(Table itacTable)
{
if (itacTable == null) { return null; }
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table asmTable = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table(Asm.As.Oib.SiplacePro.Proxy.Business.Types.ResourceIDs.AttachableheadtypeCp_20);
mapItac2Asm(asmTable, itacTable);
return asmTable;
}
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table asmTable, Table itacTable)
{
// skip property Dictionary`2, property in exclude list
asmTable.AllowRandomSetupDuringOnlinePreparation = itacTable.AllowRandomSetupDuringOnlinePreparation;
// complex property StationLocationContext, isArray:False, isGeneric:False
itacTable.StationLocationContext = com.itac.oib.siplacepro.contracts.data.StationLocationMapper.get( asmTable.StationLocationContext);
// skip (ignore generic type TrackArea)
// skip property Double, property in exclude list
// skip property Double, property in exclude list
asmTable.OffsetZ = itacTable.OffsetZ;
// skip property DictionaryProxy`2, property in exclude list
asmTable.Frozen = itacTable.Frozen;
// skip (ignore generic type TrackInformation)
// skip property ListProxy`1, property in exclude list
asmTable.SplitLevel = itacTable.SplitLevel;
asmTable.IsInSplitMode = itacTable.IsInSplitMode;
// skip readonly property IsConstant
// skip readonly property HasTrayFeeders
// complex property Type, isArray:False, isGeneric:False
itacTable.Type = com.itac.oib.siplacepro.contracts.data.TableTypeMapper.get( asmTable.Type);
// skip readonly property IsAnyFeederOnBlockedTrack
// skip readonly property CountOfFeedersOnTable
// skip readonly property IsAnyFeederFixed
// skip readonly property IsAnyFeederUnfixed
// skip readonly property IsAnyComponentFixed
// skip readonly property IsAnyComponentUnfixed
// skip readonly property Name
// skip readonly property FullPath
}
// maps iTAC namespace conform array to ASM namespace array
public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table[] get(Table[] itacTable)
{
if (itacTable == null) { return null; }
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table[] asmTable = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table[itacTable.Length];
for (int i = 0; i < itacTable.Length; i++)
{
// to itac array
asmTable[i] = TableMapper.get(itacTable[i]);
}
return asmTable;
}
// maps iTAC namespace conform array to ASM namespace list
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table> getList(Table[] asmTable)
{
if (asmTable == null) { return null; }
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table> itacTable = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table>();
for (int i = 0; i < asmTable.Length; i++)
{
itacTable.Add(TableMapper.get(asmTable[i]));
}
return itacTable;
}
// map type from ASM namespace to iTAC namespace
public static Table get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table asmTable)
{
if (asmTable == null) { return null; }
Table itacTable = new Table();
mapAsm2Itac(asmTable, itacTable);
return itacTable;
}
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table asmTable, Table itacTable)
{
// skip property Dictionary`2, property in exclude list
itacTable.AllowRandomSetupDuringOnlinePreparation = asmTable.AllowRandomSetupDuringOnlinePreparation;
itacTable.StationLocationContext = com.itac.oib.siplacepro.contracts.data.StationLocationMapper.get(asmTable.StationLocationContext);
// complex asm property StationLocationContext
// skip (ignore generic type TrackArea)
// skip property Double, property in exclude list
// skip property Double, property in exclude list
itacTable.OffsetZ = asmTable.OffsetZ;
// skip property DictionaryProxy`2, property in exclude list
itacTable.Frozen = asmTable.Frozen;
// skip (ignore generic type TrackInformation)
// skip property ListProxy`1, property in exclude list
itacTable.SplitLevel = asmTable.SplitLevel;
itacTable.IsInSplitMode = asmTable.IsInSplitMode;
itacTable.IsConstant = asmTable.IsConstant;
itacTable.HasTrayFeeders = asmTable.HasTrayFeeders;
itacTable.Type = com.itac.oib.siplacepro.contracts.data.TableTypeMapper.get(asmTable.Type);
// complex asm property Type
itacTable.IsAnyFeederOnBlockedTrack = asmTable.IsAnyFeederOnBlockedTrack;
itacTable.CountOfFeedersOnTable = asmTable.CountOfFeedersOnTable;
itacTable.IsAnyFeederFixed = asmTable.IsAnyFeederFixed;
itacTable.IsAnyFeederUnfixed = asmTable.IsAnyFeederUnfixed;
itacTable.IsAnyComponentFixed = asmTable.IsAnyComponentFixed;
itacTable.IsAnyComponentUnfixed = asmTable.IsAnyComponentUnfixed;
itacTable.Name = asmTable.Name;
itacTable.FullPath = asmTable.FullPath;
}
// maps ASM namespace conform list to iTAC namespace array
public static Table[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table> asmTable)
{
if (asmTable == null) { return null; }
Table[] itacTable = new Table[asmTable.Count];
for (int i = 0; i < asmTable.Count; i++)
{
itacTable[i] = TableMapper.get(asmTable[i]);
}
return itacTable;
}
// maps ASM namespace conform array to iTAC namespace array
public static Table[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Table[] asmTable)
{
if (asmTable == null) { return null; }
Table[] itacTable = new Table[asmTable.Length];
for (int i = 0; i < asmTable.Length; i++)
{
itacTable[i] = TableMapper.get(asmTable[i]);
}
return itacTable;
}
}
}