/* * 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 RecipeBaseMapper:MonitoringDataMapper { // 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.BaseClasses.RecipeBase get(RecipeBase itacRecipeBase) { if (itacRecipeBase == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase asmRecipeBase = new Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase(Asm.As.Oib.SiplacePro.Proxy.Business.Types.ResourceIDs.AttachableheadtypeCp_20); mapItac2Asm(asmRecipeBase, itacRecipeBase); return asmRecipeBase; }*/ public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase asmRecipeBase, RecipeBase itacRecipeBase) { // skip readonly property Station } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase[] get(RecipeBase[] itacRecipeBase) { if (itacRecipeBase == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase[] asmRecipeBase = new Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase[itacRecipeBase.Length]; for (int i = 0; i < itacRecipeBase.Length; i++) { // to itac array // asmRecipeBase[i] = RecipeBaseMapper.get(itacRecipeBase[i]); } return asmRecipeBase; } // maps iTAC namespace conform array to ASM namespace list public static List getList(RecipeBase[] asmRecipeBase) { if (asmRecipeBase == null) { return null; } List itacRecipeBase = new List(); for (int i = 0; i < asmRecipeBase.Length; i++) { // itacRecipeBase.Add(RecipeBaseMapper.get(asmRecipeBase[i])); } return itacRecipeBase; } // map type from ASM namespace to iTAC namespace public static RecipeBase get(Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase asmRecipeBase) { if (asmRecipeBase == null) { return null; } RecipeBase itacRecipeBase = new RecipeBase(); mapAsm2Itac(asmRecipeBase, itacRecipeBase); return itacRecipeBase; } public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase asmRecipeBase, RecipeBase itacRecipeBase) { MonitoringDataMapper.mapAsm2Itac(asmRecipeBase, itacRecipeBase); itacRecipeBase.Station = com.itac.oib.monitoring.contracts.data.StationMapper.get(asmRecipeBase.Station); // complex asm property Station } // maps ASM namespace conform list to iTAC namespace array public static RecipeBase[] getArray(IList asmRecipeBase) { if (asmRecipeBase == null) { return null; } RecipeBase[] itacRecipeBase = new RecipeBase[asmRecipeBase.Count]; for (int i = 0; i < asmRecipeBase.Count; i++) { itacRecipeBase[i] = RecipeBaseMapper.get(asmRecipeBase[i]); } return itacRecipeBase; } // maps ASM namespace conform array to iTAC namespace array public static RecipeBase[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.BaseClasses.RecipeBase[] asmRecipeBase) { if (asmRecipeBase == null) { return null; } RecipeBase[] itacRecipeBase = new RecipeBase[asmRecipeBase.Length]; for (int i = 0; i < asmRecipeBase.Length; i++) { itacRecipeBase[i] = RecipeBaseMapper.get(asmRecipeBase[i]); } return itacRecipeBase; } } }