/* * 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 ActiveRecipeMapper { // 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.ActiveRecipe get(ActiveRecipe itacActiveRecipe) { if (itacActiveRecipe == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe asmActiveRecipe = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe(); mapItac2Asm(asmActiveRecipe, itacActiveRecipe); return asmActiveRecipe; } public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe asmActiveRecipe, ActiveRecipe itacActiveRecipe) { asmActiveRecipe.ConveyorLanePosition = itacActiveRecipe.ConveyorLanePosition; asmActiveRecipe.ConveyorStopperPosition = itacActiveRecipe.ConveyorStopperPosition; asmActiveRecipe.ProcessingAreaPosition = itacActiveRecipe.ProcessingAreaPosition; asmActiveRecipe.ProcessingMode = itacActiveRecipe.ProcessingMode; asmActiveRecipe.PcbBarcode = itacActiveRecipe.PcbBarcode; asmActiveRecipe.BarcodeReaderPosition = itacActiveRecipe.BarcodeReaderPosition; asmActiveRecipe.PcbPath = itacActiveRecipe.PcbPath; asmActiveRecipe.RecipePath = itacActiveRecipe.RecipePath; asmActiveRecipe.PcbIndividualId = itacActiveRecipe.PcbIndividualId; asmActiveRecipe.PcbSide = itacActiveRecipe.PcbSide; } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe[] get(ActiveRecipe[] itacActiveRecipe) { if (itacActiveRecipe == null) { return null; } Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe[] asmActiveRecipe = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe[itacActiveRecipe.Length]; for (int i = 0; i < itacActiveRecipe.Length; i++) { // to itac array asmActiveRecipe[i] = ActiveRecipeMapper.get(itacActiveRecipe[i]); } return asmActiveRecipe; } // maps iTAC namespace conform array to ASM namespace list public static List getList(ActiveRecipe[] asmActiveRecipe) { if (asmActiveRecipe == null) { return null; } List itacActiveRecipe = new List(); for (int i = 0; i < asmActiveRecipe.Length; i++) { itacActiveRecipe.Add(ActiveRecipeMapper.get(asmActiveRecipe[i])); } return itacActiveRecipe; } // map type from ASM namespace to iTAC namespace public static ActiveRecipe get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe asmActiveRecipe) { if (asmActiveRecipe == null) { return null; } ActiveRecipe itacActiveRecipe = new ActiveRecipe(); mapAsm2Itac(asmActiveRecipe, itacActiveRecipe); return itacActiveRecipe; } public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe asmActiveRecipe, ActiveRecipe itacActiveRecipe) { itacActiveRecipe.ConveyorLanePosition = asmActiveRecipe.ConveyorLanePosition; itacActiveRecipe.ConveyorStopperPosition = asmActiveRecipe.ConveyorStopperPosition; itacActiveRecipe.ProcessingAreaPosition = asmActiveRecipe.ProcessingAreaPosition; itacActiveRecipe.ProcessingMode = asmActiveRecipe.ProcessingMode; itacActiveRecipe.PcbBarcode = asmActiveRecipe.PcbBarcode; itacActiveRecipe.BarcodeReaderPosition = asmActiveRecipe.BarcodeReaderPosition; itacActiveRecipe.PcbPath = asmActiveRecipe.PcbPath; itacActiveRecipe.RecipePath = asmActiveRecipe.RecipePath; itacActiveRecipe.PcbIndividualId = asmActiveRecipe.PcbIndividualId; itacActiveRecipe.PcbSide = asmActiveRecipe.PcbSide; } // maps ASM namespace conform list to iTAC namespace array public static ActiveRecipe[] getArray(IList asmActiveRecipe) { if (asmActiveRecipe == null) { return null; } ActiveRecipe[] itacActiveRecipe = new ActiveRecipe[asmActiveRecipe.Count]; for (int i = 0; i < asmActiveRecipe.Count; i++) { itacActiveRecipe[i] = ActiveRecipeMapper.get(asmActiveRecipe[i]); } return itacActiveRecipe; } // maps ASM namespace conform array to iTAC namespace array public static ActiveRecipe[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ActiveRecipe[] asmActiveRecipe) { if (asmActiveRecipe == null) { return null; } ActiveRecipe[] itacActiveRecipe = new ActiveRecipe[asmActiveRecipe.Length]; for (int i = 0; i < asmActiveRecipe.Length; i++) { itacActiveRecipe[i] = ActiveRecipeMapper.get(asmActiveRecipe[i]); } return itacActiveRecipe; } } }