/* * 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 ActiveSetupMapper { // 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.ActiveSetup get(ActiveSetup itacActiveSetup) { if (itacActiveSetup == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup asmActiveSetup = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup(); mapItac2Asm(asmActiveSetup, itacActiveSetup); return asmActiveSetup; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup asmActiveSetup, ActiveSetup itacActiveSetup) { asmActiveSetup.StationPath = itacActiveSetup.StationPath; asmActiveSetup.SetupPath = itacActiveSetup.SetupPath; asmActiveSetup.LinePath = itacActiveSetup.LinePath; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup[] get(ActiveSetup[] itacActiveSetup) { if (itacActiveSetup == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup[] asmActiveSetup = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup[itacActiveSetup.Length]; for (int i = 0; i < itacActiveSetup.Length; i++) { // to itac array asmActiveSetup[i] = ActiveSetupMapper.get(itacActiveSetup[i]); } return asmActiveSetup; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ActiveSetup[] asmActiveSetup) { if (asmActiveSetup == null) { return null; } List itacActiveSetup = new List(); for (int i = 0; i < asmActiveSetup.Length; i++) { itacActiveSetup.Add(ActiveSetupMapper.get(asmActiveSetup[i])); } return itacActiveSetup; } // map type from ASM namespace to iTAC namespace public static ActiveSetup get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup asmActiveSetup) { if (asmActiveSetup == null) { return null; } ActiveSetup itacActiveSetup = new ActiveSetup(); mapAsm2Itac(asmActiveSetup, itacActiveSetup); return itacActiveSetup; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup asmActiveSetup, ActiveSetup itacActiveSetup) { itacActiveSetup.StationPath = asmActiveSetup.StationPath; itacActiveSetup.SetupPath = asmActiveSetup.SetupPath; itacActiveSetup.LinePath = asmActiveSetup.LinePath; } // maps ASM namespace conform list to iTAC namespace array public static ActiveSetup[] getArray(IList asmActiveSetup) { if (asmActiveSetup == null) { return null; } ActiveSetup[] itacActiveSetup = new ActiveSetup[asmActiveSetup.Count]; for (int i = 0; i < asmActiveSetup.Count; i++) { itacActiveSetup[i] = ActiveSetupMapper.get(asmActiveSetup[i]); } return itacActiveSetup; } // maps ASM namespace conform array to iTAC namespace array public static ActiveSetup[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveSetup[] asmActiveSetup) { if (asmActiveSetup == null) { return null; } ActiveSetup[] itacActiveSetup = new ActiveSetup[asmActiveSetup.Length]; for (int i = 0; i < asmActiveSetup.Length; i++) { itacActiveSetup[i] = ActiveSetupMapper.get(asmActiveSetup[i]); } return itacActiveSetup; } } }