/* * 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 23.11.2018 08:09:33 using System; using System.Collections.Generic; using com.itac.oib.monitoring.contracts.data; namespace com.itac.oib.monitoring.contracts.data { // source: assembly 3.2.0.152 // 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 itacProcessingLocationAddress) { if (itacProcessingLocationAddress == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress asmProcessingLocationAddress = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress(); mapItac2Asm(asmProcessingLocationAddress, itacProcessingLocationAddress); return asmProcessingLocationAddress; } public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress asmProcessingLocationAddress, ProcessingLocationAddress itacProcessingLocationAddress) { // complex property Conveyor, isArray:False, isGeneric:False asmProcessingLocationAddress.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get( itacProcessingLocationAddress.Conveyor); // complex property SubConveyor, isArray:False, isGeneric:False asmProcessingLocationAddress.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get( itacProcessingLocationAddress.SubConveyor); asmProcessingLocationAddress.ProcessingArea = itacProcessingLocationAddress.ProcessingArea; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[] get(ProcessingLocationAddress[] itacProcessingLocationAddress) { if (itacProcessingLocationAddress == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[] asmProcessingLocationAddress = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationAddress[itacProcessingLocationAddress.Length]; for (int i = 0; i < itacProcessingLocationAddress.Length; i++) { // to itac array asmProcessingLocationAddress[i] = ProcessingLocationAddressMapper.get(itacProcessingLocationAddress[i]); } return asmProcessingLocationAddress; } // 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; } } }