/* * 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 05.11.2018 14:52:23 // skip property NamedObjectBase, declared in Recipe // skip property DictionaryProxy`2, property in exclude list // skip property AdditionalOperationInformation, declared in Recipe // skip (ignore generic type WaferLevelPackageBoardElement) // skip property ListProxy`1, property in exclude list // skip property RecipeHandling, declared in Recipe using System; using System.Collections.Generic; using com.itac.oib.siplacepro.contracts.types; namespace com.itac.oib.siplacepro.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.SIPLACEPro.Proxy public class RecipeMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe get(Recipe itacRecipe) { if (itacRecipe == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe asmRecipe = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe(); mapItac2Asm(asmRecipe, itacRecipe); return asmRecipe; } public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe asmRecipe, Recipe itacRecipe) { // skip property NamedObjectBase, declared in Recipe // skip readonly property LineName // skip readonly property SetupName asmRecipe.LotSize = itacRecipe.LotSize; // complex property ConveyorLane, isArray:False, isGeneric:False itacRecipe.ConveyorLane = com.itac.oib.siplacepro.contracts.types.ConveyorLaneTypeMapper.get( asmRecipe.ConveyorLane); // complex property Setup, isArray:False, isGeneric:False itacRecipe.Setup = com.itac.oib.siplacepro.contracts.data.SetupMapper.get( asmRecipe.Setup); asmRecipe.RecipeCycleTime = itacRecipe.RecipeCycleTime; // skip property DictionaryProxy`2, property in exclude list asmRecipe.GenerateTraceInformation = itacRecipe.GenerateTraceInformation; // skip readonly property BoardElements // skip readonly property Board2Elements asmRecipe.AverageUtilization = itacRecipe.AverageUtilization; // skip property AdditionalOperationInformation, declared in Recipe asmRecipe.EnableProxyMode = itacRecipe.EnableProxyMode; // complex property SplitTableModeSetting, isArray:False, isGeneric:False itacRecipe.SplitTableModeSetting = com.itac.oib.siplacepro.contracts.types.SplitTableModeMapper.get( asmRecipe.SplitTableModeSetting); // skip readonly property LotSizeCountUnit // skip (ignore generic type WaferLevelPackageBoardElement) // skip property ListProxy`1, property in exclude list // skip property RecipeHandling, declared in Recipe asmRecipe.FractionNumber = itacRecipe.FractionNumber; asmRecipe.FractionCount = itacRecipe.FractionCount; // complex property PrinterSetup, isArray:False, isGeneric:False itacRecipe.PrinterSetup = com.itac.oib.siplacepro.contracts.data.PrinterSetupMapper.get( asmRecipe.PrinterSetup); asmRecipe.CheckIntegrityForAllConveyorLanes = itacRecipe.CheckIntegrityForAllConveyorLanes; asmRecipe.QuantityUnlimited = itacRecipe.QuantityUnlimited; // skip readonly property ConveyorLane2 asmRecipe.LotSizeBoards = itacRecipe.LotSizeBoards; asmRecipe.LotSizeAssembledPCBs = itacRecipe.LotSizeAssembledPCBs; // skip readonly property IsMatchingPanelCount // skip readonly property IsAnyPanelCountZero // skip readonly property Name // skip readonly property FullPath } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe[] get(Recipe[] itacRecipe) { if (itacRecipe == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe[] asmRecipe = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe[itacRecipe.Length]; for (int i = 0; i < itacRecipe.Length; i++) { // to itac array asmRecipe[i] = RecipeMapper.get(itacRecipe[i]); } return asmRecipe; } // maps iTAC namespace conform array to ASM namespace list public static List getList(Recipe[] asmRecipe) { if (asmRecipe == null) { return null; } List itacRecipe = new List(); for (int i = 0; i < asmRecipe.Length; i++) { itacRecipe.Add(RecipeMapper.get(asmRecipe[i])); } return itacRecipe; } // map type from ASM namespace to iTAC namespace public static Recipe get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe asmRecipe) { if (asmRecipe == null) { return null; } Recipe itacRecipe = new Recipe(); mapAsm2Itac(asmRecipe, itacRecipe); return itacRecipe; } public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe asmRecipe, Recipe itacRecipe) { // skip property NamedObjectBase, declared in Recipe itacRecipe.LineName = asmRecipe.LineName; itacRecipe.SetupName = asmRecipe.SetupName; itacRecipe.LotSize = asmRecipe.LotSize; itacRecipe.ConveyorLane = com.itac.oib.siplacepro.contracts.types.ConveyorLaneTypeMapper.get(asmRecipe.ConveyorLane); // complex asm property ConveyorLane itacRecipe.Setup = com.itac.oib.siplacepro.contracts.data.SetupMapper.get(asmRecipe.Setup); // complex asm property Setup itacRecipe.RecipeCycleTime = asmRecipe.RecipeCycleTime; // skip property DictionaryProxy`2, property in exclude list itacRecipe.GenerateTraceInformation = asmRecipe.GenerateTraceInformation; // maps ASM list 2 iTAC array itacRecipe.BoardElements = BoardElementMapper.getArray(asmRecipe.BoardElements); // maps ASM list 2 iTAC array itacRecipe.Board2Elements = BoardElementMapper.getArray(asmRecipe.Board2Elements); itacRecipe.AverageUtilization = asmRecipe.AverageUtilization; // skip property AdditionalOperationInformation, declared in Recipe itacRecipe.EnableProxyMode = asmRecipe.EnableProxyMode; itacRecipe.SplitTableModeSetting = com.itac.oib.siplacepro.contracts.types.SplitTableModeMapper.get(asmRecipe.SplitTableModeSetting); // complex asm property SplitTableModeSetting itacRecipe.LotSizeCountUnit = com.itac.oib.siplacepro.contracts.types.LotSizeCountUnitMapper.get(asmRecipe.LotSizeCountUnit); // complex asm property LotSizeCountUnit // skip (ignore generic type WaferLevelPackageBoardElement) // skip property ListProxy`1, property in exclude list // skip property RecipeHandling, declared in Recipe itacRecipe.FractionNumber = asmRecipe.FractionNumber; itacRecipe.FractionCount = asmRecipe.FractionCount; itacRecipe.PrinterSetup = com.itac.oib.siplacepro.contracts.data.PrinterSetupMapper.get(asmRecipe.PrinterSetup); // complex asm property PrinterSetup itacRecipe.CheckIntegrityForAllConveyorLanes = asmRecipe.CheckIntegrityForAllConveyorLanes; itacRecipe.QuantityUnlimited = asmRecipe.QuantityUnlimited; itacRecipe.ConveyorLane2 = com.itac.oib.siplacepro.contracts.types.ConveyorLaneTypeMapper.get(asmRecipe.ConveyorLane2); // complex asm property ConveyorLane2 itacRecipe.LotSizeBoards = asmRecipe.LotSizeBoards; itacRecipe.LotSizeAssembledPCBs = asmRecipe.LotSizeAssembledPCBs; itacRecipe.IsMatchingPanelCount = asmRecipe.IsMatchingPanelCount; itacRecipe.IsAnyPanelCountZero = asmRecipe.IsAnyPanelCountZero; itacRecipe.Name = asmRecipe.Name; itacRecipe.FullPath = asmRecipe.FullPath; } // maps ASM namespace conform list to iTAC namespace array public static Recipe[] getArray(IList asmRecipe) { if (asmRecipe == null) { return null; } Recipe[] itacRecipe = new Recipe[asmRecipe.Count]; for (int i = 0; i < asmRecipe.Count; i++) { itacRecipe[i] = RecipeMapper.get(asmRecipe[i]); } return itacRecipe; } // maps ASM namespace conform array to iTAC namespace array public static Recipe[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Recipe[] asmRecipe) { if (asmRecipe == null) { return null; } Recipe[] itacRecipe = new Recipe[asmRecipe.Length]; for (int i = 0; i < asmRecipe.Length; i++) { itacRecipe[i] = RecipeMapper.get(asmRecipe[i]); } return itacRecipe; } } }