/* * 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 31.10.2018 08:16:46 using System; using System.Collections.Generic; using com.itac.oib.monitoring.contracts.data; namespace com.itac.oib.monitoring.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.Monitoring.Proxy public class ProcessingLocationAddressMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress get(ProcessingLocationAddress asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress itacProcessingLocationAddress = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress(); mapItac2Asm(itacProcessingLocationAddress, asmProcessingLocationAddress); return itacProcessingLocationAddress; } public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress itacProcessingLocationAddress, ProcessingLocationAddress asmProcessingLocationAddress) { // complex property Conveyor, isArray:False, isGeneric:False itacProcessingLocationAddress.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get( asmProcessingLocationAddress.Conveyor); // complex property SubConveyor, isArray:False, isGeneric:False itacProcessingLocationAddress.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get( asmProcessingLocationAddress.SubConveyor); itacProcessingLocationAddress.ProcessingArea = asmProcessingLocationAddress.ProcessingArea; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[] get(ProcessingLocationAddress[] asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[] itacProcessingLocationAddress = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[asmProcessingLocationAddress.Length]; for (int i = 0; i < asmProcessingLocationAddress.Length; i++) { // to itac array itacProcessingLocationAddress[i] = ProcessingLocationAddressMapper.get(asmProcessingLocationAddress[i]); } return itacProcessingLocationAddress; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ProcessingLocationAddress[] asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } List itacProcessingLocationAddress = new List(); for (int i = 0; i < asmProcessingLocationAddress.Length; i++) { itacProcessingLocationAddress.Add(ProcessingLocationAddressMapper.get(asmProcessingLocationAddress[i])); } return itacProcessingLocationAddress; } // map type from ASM namespace to iTAC namespace public static ProcessingLocationAddress get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } ProcessingLocationAddress itacProcessingLocationAddress = new ProcessingLocationAddress(); mapAsm2Itac(asmProcessingLocationAddress, itacProcessingLocationAddress); return itacProcessingLocationAddress; } public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress asmProcessingLocationAddress, ProcessingLocationAddress itacProcessingLocationAddress) { itacProcessingLocationAddress.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get(asmProcessingLocationAddress.Conveyor); // complex asm property Conveyor itacProcessingLocationAddress.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get(asmProcessingLocationAddress.SubConveyor); // complex asm property SubConveyor itacProcessingLocationAddress.ProcessingArea = asmProcessingLocationAddress.ProcessingArea; } // maps ASM namespace conform list to iTAC namespace array public static ProcessingLocationAddress[] getArray(IList asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } ProcessingLocationAddress[] itacProcessingLocationAddress = new ProcessingLocationAddress[asmProcessingLocationAddress.Count]; for (int i = 0; i < asmProcessingLocationAddress.Count; i++) { itacProcessingLocationAddress[i] = ProcessingLocationAddressMapper.get(asmProcessingLocationAddress[i]); } return itacProcessingLocationAddress; } // maps ASM namespace conform array to iTAC namespace array public static ProcessingLocationAddress[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[] asmProcessingLocationAddress) { if (asmProcessingLocationAddress == null) { return null; } ProcessingLocationAddress[] itacProcessingLocationAddress = new ProcessingLocationAddress[asmProcessingLocationAddress.Length]; for (int i = 0; i < asmProcessingLocationAddress.Length; i++) { itacProcessingLocationAddress[i] = ProcessingLocationAddressMapper.get(asmProcessingLocationAddress[i]); } return itacProcessingLocationAddress; } } }