/* * 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 RecipeAddOnMapper { // 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.RecipeAddOn get(RecipeAddOn itacRecipeAddOn) { if (itacRecipeAddOn == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn asmRecipeAddOn = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn(); mapItac2Asm(asmRecipeAddOn, itacRecipeAddOn); return asmRecipeAddOn; } public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn asmRecipeAddOn, RecipeAddOn itacRecipeAddOn) { asmRecipeAddOn.ProcessingArea = itacRecipeAddOn.ProcessingArea; // complex property PlacementMode, isArray:False, isGeneric:False asmRecipeAddOn.PlacementMode = com.itac.oib.monitoring.contracts.data.ProcessingModeTypeMapper.get( itacRecipeAddOn.PlacementMode); asmRecipeAddOn.BuildTime = itacRecipeAddOn.BuildTime; asmRecipeAddOn.StationTactTime = itacRecipeAddOn.StationTactTime; asmRecipeAddOn.ParallelProcessingFactor = itacRecipeAddOn.ParallelProcessingFactor; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn[] get(RecipeAddOn[] itacRecipeAddOn) { if (itacRecipeAddOn == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn[] asmRecipeAddOn = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn[itacRecipeAddOn.Length]; for (int i = 0; i < itacRecipeAddOn.Length; i++) { // to itac array asmRecipeAddOn[i] = RecipeAddOnMapper.get(itacRecipeAddOn[i]); } return asmRecipeAddOn; } // maps iTAC namespace conform array to ASM namespace list public static List getList(RecipeAddOn[] asmRecipeAddOn) { if (asmRecipeAddOn == null) { return null; } List itacRecipeAddOn = new List(); for (int i = 0; i < asmRecipeAddOn.Length; i++) { itacRecipeAddOn.Add(RecipeAddOnMapper.get(asmRecipeAddOn[i])); } return itacRecipeAddOn; } // map type from ASM namespace to iTAC namespace public static RecipeAddOn get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn asmRecipeAddOn) { if (asmRecipeAddOn == null) { return null; } RecipeAddOn itacRecipeAddOn = new RecipeAddOn(); mapAsm2Itac(asmRecipeAddOn, itacRecipeAddOn); return itacRecipeAddOn; } public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn asmRecipeAddOn, RecipeAddOn itacRecipeAddOn) { itacRecipeAddOn.ProcessingArea = asmRecipeAddOn.ProcessingArea; itacRecipeAddOn.PlacementMode = com.itac.oib.monitoring.contracts.data.ProcessingModeTypeMapper.get(asmRecipeAddOn.PlacementMode); // complex asm property PlacementMode itacRecipeAddOn.BuildTime = asmRecipeAddOn.BuildTime; itacRecipeAddOn.StationTactTime = asmRecipeAddOn.StationTactTime; itacRecipeAddOn.ParallelProcessingFactor = asmRecipeAddOn.ParallelProcessingFactor; } // maps ASM namespace conform list to iTAC namespace array public static RecipeAddOn[] getArray(IList asmRecipeAddOn) { if (asmRecipeAddOn == null) { return null; } RecipeAddOn[] itacRecipeAddOn = new RecipeAddOn[asmRecipeAddOn.Count]; for (int i = 0; i < asmRecipeAddOn.Count; i++) { itacRecipeAddOn[i] = RecipeAddOnMapper.get(asmRecipeAddOn[i]); } return itacRecipeAddOn; } // maps ASM namespace conform array to iTAC namespace array public static RecipeAddOn[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.RecipeAddOn[] asmRecipeAddOn) { if (asmRecipeAddOn == null) { return null; } RecipeAddOn[] itacRecipeAddOn = new RecipeAddOn[asmRecipeAddOn.Length]; for (int i = 0; i < asmRecipeAddOn.Length; i++) { itacRecipeAddOn[i] = RecipeAddOnMapper.get(asmRecipeAddOn[i]); } return itacRecipeAddOn; } } }