/* * 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 15:39:46 // skip property ExtensionDataObject, declared in PrinterRecipe // skip property PrinterFiducial[], property in exclude list using System; using System.Collections.Generic; namespace com.itac.oib.traceability.contracts.data { // source: assembly 3.0.0.0 // source: assembly ASM.AS.OIB.Client public class PrinterRecipeMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe get(PrinterRecipe itacPrinterRecipe) { if (itacPrinterRecipe == null) { return null; } www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe asmPrinterRecipe = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe(); mapItac2Asm(asmPrinterRecipe, itacPrinterRecipe); return asmPrinterRecipe; } public static void mapItac2Asm(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe asmPrinterRecipe, PrinterRecipe itacPrinterRecipe) { // skip property ExtensionDataObject, declared in PrinterRecipe // complex property Cleanings, isArray:True, isGeneric:False asmPrinterRecipe.Cleanings = com.itac.oib.traceability.contracts.data.PrinterCleaningMapper.get( itacPrinterRecipe.Cleanings); // complex property Geometry, isArray:False, isGeneric:False asmPrinterRecipe.Geometry = com.itac.oib.traceability.contracts.data.PrinterBoardGeometryMapper.get( itacPrinterRecipe.Geometry); // complex property Kneading, isArray:False, isGeneric:False asmPrinterRecipe.Kneading = com.itac.oib.traceability.contracts.data.PrinterKneadingMapper.get( itacPrinterRecipe.Kneading); // complex property PasteDispenser, isArray:False, isGeneric:False asmPrinterRecipe.PasteDispenser = com.itac.oib.traceability.contracts.data.PrinterPasteDispenserMapper.get( itacPrinterRecipe.PasteDispenser); asmPrinterRecipe.ProductGuid = itacPrinterRecipe.ProductGuid; asmPrinterRecipe.ProductName = itacPrinterRecipe.ProductName; // complex property Setup, isArray:False, isGeneric:False asmPrinterRecipe.Setup = com.itac.oib.traceability.contracts.data.PrinterMachineSetupMapper.get( itacPrinterRecipe.Setup); // skip property PrinterFiducial[], property in exclude list // complex property CleanTypes, isArray:False, isGeneric:False asmPrinterRecipe.CleanTypes = com.itac.oib.traceability.contracts.data.PrinterCleanTypesMapper.get( itacPrinterRecipe.CleanTypes); } // maps iTAC namespace conform array to ASM namespace array public static www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe[] get(PrinterRecipe[] itacPrinterRecipe) { if (itacPrinterRecipe == null) { return null; } www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe[] asmPrinterRecipe = new www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe[itacPrinterRecipe.Length]; for (int i = 0; i < itacPrinterRecipe.Length; i++) { // to itac array asmPrinterRecipe[i] = PrinterRecipeMapper.get(itacPrinterRecipe[i]); } return asmPrinterRecipe; } // maps iTAC namespace conform array to ASM namespace list public static List getList(PrinterRecipe[] asmPrinterRecipe) { if (asmPrinterRecipe == null) { return null; } List itacPrinterRecipe = new List(); for (int i = 0; i < asmPrinterRecipe.Length; i++) { itacPrinterRecipe.Add(PrinterRecipeMapper.get(asmPrinterRecipe[i])); } return itacPrinterRecipe; } // map type from ASM namespace to iTAC namespace public static PrinterRecipe get(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe asmPrinterRecipe) { if (asmPrinterRecipe == null) { return null; } PrinterRecipe itacPrinterRecipe = new PrinterRecipe(); mapAsm2Itac(asmPrinterRecipe, itacPrinterRecipe); return itacPrinterRecipe; } public static void mapAsm2Itac(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe asmPrinterRecipe, PrinterRecipe itacPrinterRecipe) { // skip property ExtensionDataObject, declared in PrinterRecipe // array mapping itacPrinterRecipe.Cleanings = PrinterCleaningMapper.getArray(asmPrinterRecipe.Cleanings); // complex asm property Cleanings itacPrinterRecipe.Geometry = com.itac.oib.traceability.contracts.data.PrinterBoardGeometryMapper.get(asmPrinterRecipe.Geometry); // complex asm property Geometry itacPrinterRecipe.Kneading = com.itac.oib.traceability.contracts.data.PrinterKneadingMapper.get(asmPrinterRecipe.Kneading); // complex asm property Kneading itacPrinterRecipe.PasteDispenser = com.itac.oib.traceability.contracts.data.PrinterPasteDispenserMapper.get(asmPrinterRecipe.PasteDispenser); // complex asm property PasteDispenser itacPrinterRecipe.ProductGuid = asmPrinterRecipe.ProductGuid; itacPrinterRecipe.ProductName = asmPrinterRecipe.ProductName; itacPrinterRecipe.Setup = com.itac.oib.traceability.contracts.data.PrinterMachineSetupMapper.get(asmPrinterRecipe.Setup); // complex asm property Setup // skip property PrinterFiducial[], property in exclude list itacPrinterRecipe.CleanTypes = com.itac.oib.traceability.contracts.data.PrinterCleanTypesMapper.get(asmPrinterRecipe.CleanTypes); // complex asm property CleanTypes } // maps ASM namespace conform list to iTAC namespace array public static PrinterRecipe[] getArray(IList asmPrinterRecipe) { if (asmPrinterRecipe == null) { return null; } PrinterRecipe[] itacPrinterRecipe = new PrinterRecipe[asmPrinterRecipe.Count]; for (int i = 0; i < asmPrinterRecipe.Count; i++) { itacPrinterRecipe[i] = PrinterRecipeMapper.get(asmPrinterRecipe[i]); } return itacPrinterRecipe; } // maps ASM namespace conform array to iTAC namespace array public static PrinterRecipe[] getArray(www.siplace.com.OIB._2012._03.Traceability.Contracts.Data.PrinterRecipe[] asmPrinterRecipe) { if (asmPrinterRecipe == null) { return null; } PrinterRecipe[] itacPrinterRecipe = new PrinterRecipe[asmPrinterRecipe.Length]; for (int i = 0; i < asmPrinterRecipe.Length; i++) { itacPrinterRecipe[i] = PrinterRecipeMapper.get(asmPrinterRecipe[i]); } return itacPrinterRecipe; } } }