/* * 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 06.11.2018 11:58:58 using System; using System.Collections.Generic; namespace com.itac.oib.siplacesetupcenter.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts public class TableLocationMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation get(TableLocation itacTableLocation) { if (itacTableLocation == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation asmTableLocation = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation(); mapItac2Asm(asmTableLocation, itacTableLocation); return asmTableLocation; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation asmTableLocation, TableLocation itacTableLocation) { asmTableLocation.TableState = itacTableLocation.TableState; // complex property Machine, isArray:False, isGeneric:False asmTableLocation.Machine = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get( itacTableLocation.Machine); // complex property DockingStation, isArray:False, isGeneric:False asmTableLocation.DockingStation = com.itac.oib.siplacesetupcenter.contracts.data.DockingStationMapper.get( itacTableLocation.DockingStation); asmTableLocation.Location = itacTableLocation.Location; asmTableLocation.TableId = itacTableLocation.TableId; asmTableLocation.Device = itacTableLocation.Device; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation[] get(TableLocation[] itacTableLocation) { if (itacTableLocation == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation[] asmTableLocation = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation[itacTableLocation.Length]; for (int i = 0; i < itacTableLocation.Length; i++) { // to itac array asmTableLocation[i] = TableLocationMapper.get(itacTableLocation[i]); } return asmTableLocation; } // maps iTAC namespace conform array to ASM namespace list public static List getList(TableLocation[] asmTableLocation) { if (asmTableLocation == null) { return null; } List itacTableLocation = new List(); for (int i = 0; i < asmTableLocation.Length; i++) { itacTableLocation.Add(TableLocationMapper.get(asmTableLocation[i])); } return itacTableLocation; } // map type from ASM namespace to iTAC namespace public static TableLocation get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation asmTableLocation) { if (asmTableLocation == null) { return null; } TableLocation itacTableLocation = new TableLocation(); mapAsm2Itac(asmTableLocation, itacTableLocation); return itacTableLocation; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation asmTableLocation, TableLocation itacTableLocation) { itacTableLocation.TableState = asmTableLocation.TableState; itacTableLocation.Machine = com.itac.oib.siplacesetupcenter.contracts.data.MachineLocatorMapper.get(asmTableLocation.Machine); // complex asm property Machine itacTableLocation.DockingStation = com.itac.oib.siplacesetupcenter.contracts.data.DockingStationMapper.get(asmTableLocation.DockingStation); // complex asm property DockingStation itacTableLocation.Location = asmTableLocation.Location; itacTableLocation.TableId = asmTableLocation.TableId; itacTableLocation.Device = asmTableLocation.Device; } // maps ASM namespace conform list to iTAC namespace array public static TableLocation[] getArray(IList asmTableLocation) { if (asmTableLocation == null) { return null; } TableLocation[] itacTableLocation = new TableLocation[asmTableLocation.Count]; for (int i = 0; i < asmTableLocation.Count; i++) { itacTableLocation[i] = TableLocationMapper.get(asmTableLocation[i]); } return itacTableLocation; } // maps ASM namespace conform array to iTAC namespace array public static TableLocation[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.TableLocation[] asmTableLocation) { if (asmTableLocation == null) { return null; } TableLocation[] itacTableLocation = new TableLocation[asmTableLocation.Length]; for (int i = 0; i < asmTableLocation.Length; i++) { itacTableLocation[i] = TableLocationMapper.get(asmTableLocation[i]); } return itacTableLocation; } } }