/* * 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:07:38 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 ComponentLocationStateMapper:PackagingUnitLocationMapper { // 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.ComponentLocationState get(ComponentLocationState itacComponentLocationState) { if (itacComponentLocationState == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState asmComponentLocationState = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState(); mapItac2Asm(asmComponentLocationState, itacComponentLocationState); return asmComponentLocationState; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState asmComponentLocationState, ComponentLocationState itacComponentLocationState) { asmComponentLocationState.MachineControllerState = itacComponentLocationState.MachineControllerState; asmComponentLocationState.ValidationStatus = itacComponentLocationState.ValidationStatus; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState[] get(ComponentLocationState[] itacComponentLocationState) { if (itacComponentLocationState == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState[] asmComponentLocationState = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState[itacComponentLocationState.Length]; for (int i = 0; i < itacComponentLocationState.Length; i++) { // to itac array asmComponentLocationState[i] = ComponentLocationStateMapper.get(itacComponentLocationState[i]); } return asmComponentLocationState; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ComponentLocationState[] asmComponentLocationState) { if (asmComponentLocationState == null) { return null; } List itacComponentLocationState = new List(); for (int i = 0; i < asmComponentLocationState.Length; i++) { itacComponentLocationState.Add(ComponentLocationStateMapper.get(asmComponentLocationState[i])); } return itacComponentLocationState; } // map type from ASM namespace to iTAC namespace public static ComponentLocationState get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState asmComponentLocationState) { if (asmComponentLocationState == null) { return null; } ComponentLocationState itacComponentLocationState = new ComponentLocationState(); mapAsm2Itac(asmComponentLocationState, itacComponentLocationState); return itacComponentLocationState; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState asmComponentLocationState, ComponentLocationState itacComponentLocationState) { PackagingUnitLocationMapper.mapAsm2Itac(asmComponentLocationState, itacComponentLocationState); itacComponentLocationState.MachineControllerState = asmComponentLocationState.MachineControllerState; itacComponentLocationState.ValidationStatus = asmComponentLocationState.ValidationStatus; } // maps ASM namespace conform list to iTAC namespace array public static ComponentLocationState[] getArray(IList asmComponentLocationState) { if (asmComponentLocationState == null) { return null; } ComponentLocationState[] itacComponentLocationState = new ComponentLocationState[asmComponentLocationState.Count]; for (int i = 0; i < asmComponentLocationState.Count; i++) { itacComponentLocationState[i] = ComponentLocationStateMapper.get(asmComponentLocationState[i]); } return itacComponentLocationState; } // maps ASM namespace conform array to iTAC namespace array public static ComponentLocationState[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocationState[] asmComponentLocationState) { if (asmComponentLocationState == null) { return null; } ComponentLocationState[] itacComponentLocationState = new ComponentLocationState[asmComponentLocationState.Length]; for (int i = 0; i < asmComponentLocationState.Length; i++) { itacComponentLocationState[i] = ComponentLocationStateMapper.get(asmComponentLocationState[i]); } return itacComponentLocationState; } } }