/* * 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 Boolean, property in exclude list // skip property IFeederType, declared in Component // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component // skip property String, property in exclude list // skip property ArrayList, property in exclude list // skip property ListProxy`1, property in exclude list // skip (ignore generic type IReserveType) // skip property ValidationMode, declared in Component // skip property IReserveType, declared in Component // skip property DictionaryProxy`2, property in exclude list // skip property ListProxy`1, property in exclude list // skip property AlternativeComponentShapeDefinitions, declared in Component // skip property ComponentShape, property in exclude list // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component 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 ComponentMapper { // 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.Component get(Component itacComponent) { if (itacComponent == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component asmComponent = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component(); mapItac2Asm(asmComponent, itacComponent); return asmComponent; } public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component asmComponent, Component itacComponent) { asmComponent.Comment = itacComponent.Comment; asmComponent.Omit = itacComponent.Omit; asmComponent.CoplanarModule = itacComponent.CoplanarModule; asmComponent.NonPolarized = itacComponent.NonPolarized; // skip property Boolean, property in exclude list asmComponent.DisposeComponent = itacComponent.DisposeComponent; asmComponent.MeasureCRDL = itacComponent.MeasureCRDL; asmComponent.RotateCRDL = itacComponent.RotateCRDL; asmComponent.Place = itacComponent.Place; asmComponent.Validate = itacComponent.Validate; asmComponent.WithSpliceDetection = itacComponent.WithSpliceDetection; asmComponent.WithTrace = itacComponent.WithTrace; // skip property IFeederType, declared in Component // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component // skip property String, property in exclude list // skip property ArrayList, property in exclude list asmComponent.ActionProperties = itacComponent.ActionProperties; asmComponent.MaxSetupCount = itacComponent.MaxSetupCount; // skip property ListProxy`1, property in exclude list // skip (ignore generic type IReserveType) asmComponent.ComponentsPerReel = itacComponent.ComponentsPerReel; // skip property ValidationMode, declared in Component asmComponent.RejectFeeder = itacComponent.RejectFeeder; asmComponent.DippingActive = itacComponent.DippingActive; asmComponent.NumberOfRepicks = itacComponent.NumberOfRepicks; // skip property IReserveType, declared in Component // skip property DictionaryProxy`2, property in exclude list asmComponent.Pitch = itacComponent.Pitch; // complex property ComponentType, isArray:False, isGeneric:False itacComponent.ComponentType = com.itac.oib.siplacepro.contracts.types.ComponentTypeMapper.get( asmComponent.ComponentType); asmComponent.ShortageTracking = itacComponent.ShortageTracking; asmComponent.OrientationCheckByOperator = itacComponent.OrientationCheckByOperator; asmComponent.MeasurePickupPositionPerPick = itacComponent.MeasurePickupPositionPerPick; // skip property ListProxy`1, property in exclude list asmComponent.ScanIndividualBarcode = itacComponent.ScanIndividualBarcode; // skip property AlternativeComponentShapeDefinitions, declared in Component // skip property ComponentShape, property in exclude list // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component // 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.Component[] get(Component[] itacComponent) { if (itacComponent == null) { return null; } Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component[] asmComponent = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component[itacComponent.Length]; for (int i = 0; i < itacComponent.Length; i++) { // to itac array asmComponent[i] = ComponentMapper.get(itacComponent[i]); } return asmComponent; } // maps iTAC namespace conform array to ASM namespace list public static List getList(Component[] asmComponent) { if (asmComponent == null) { return null; } List itacComponent = new List(); for (int i = 0; i < asmComponent.Length; i++) { itacComponent.Add(ComponentMapper.get(asmComponent[i])); } return itacComponent; } // map type from ASM namespace to iTAC namespace public static Component get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component asmComponent) { if (asmComponent == null) { return null; } Component itacComponent = new Component(); mapAsm2Itac(asmComponent, itacComponent); return itacComponent; } public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component asmComponent, Component itacComponent) { itacComponent.Comment = asmComponent.Comment; itacComponent.Omit = asmComponent.Omit; itacComponent.CoplanarModule = asmComponent.CoplanarModule; itacComponent.NonPolarized = asmComponent.NonPolarized; // skip property Boolean, property in exclude list itacComponent.DisposeComponent = asmComponent.DisposeComponent; itacComponent.MeasureCRDL = asmComponent.MeasureCRDL; itacComponent.RotateCRDL = asmComponent.RotateCRDL; itacComponent.Place = asmComponent.Place; itacComponent.Validate = asmComponent.Validate; itacComponent.WithSpliceDetection = asmComponent.WithSpliceDetection; itacComponent.WithTrace = asmComponent.WithTrace; // skip property IFeederType, declared in Component // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component // skip property String, property in exclude list // skip property ArrayList, property in exclude list itacComponent.ActionProperties = asmComponent.ActionProperties; itacComponent.MaxSetupCount = asmComponent.MaxSetupCount; // skip property ListProxy`1, property in exclude list // skip (ignore generic type IReserveType) itacComponent.ComponentsPerReel = asmComponent.ComponentsPerReel; // skip property ValidationMode, declared in Component itacComponent.RejectFeeder = asmComponent.RejectFeeder; itacComponent.DippingActive = asmComponent.DippingActive; itacComponent.NumberOfRepicks = asmComponent.NumberOfRepicks; // skip property IReserveType, declared in Component // skip property DictionaryProxy`2, property in exclude list itacComponent.Pitch = asmComponent.Pitch; itacComponent.ComponentType = com.itac.oib.siplacepro.contracts.types.ComponentTypeMapper.get(asmComponent.ComponentType); // complex asm property ComponentType itacComponent.ShortageTracking = asmComponent.ShortageTracking; itacComponent.OrientationCheckByOperator = asmComponent.OrientationCheckByOperator; itacComponent.MeasurePickupPositionPerPick = asmComponent.MeasurePickupPositionPerPick; // skip property ListProxy`1, property in exclude list itacComponent.ScanIndividualBarcode = asmComponent.ScanIndividualBarcode; // skip property AlternativeComponentShapeDefinitions, declared in Component // skip property ComponentShape, property in exclude list // skip property IReserveType, declared in Component // skip property IFeederType, declared in Component itacComponent.Name = asmComponent.Name; itacComponent.FullPath = asmComponent.FullPath; } // maps ASM namespace conform list to iTAC namespace array public static Component[] getArray(IList asmComponent) { if (asmComponent == null) { return null; } Component[] itacComponent = new Component[asmComponent.Count]; for (int i = 0; i < asmComponent.Count; i++) { itacComponent[i] = ComponentMapper.get(asmComponent[i]); } return itacComponent; } // maps ASM namespace conform array to iTAC namespace array public static Component[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Component[] asmComponent) { if (asmComponent == null) { return null; } Component[] itacComponent = new Component[asmComponent.Length]; for (int i = 0; i < asmComponent.Length; i++) { itacComponent[i] = ComponentMapper.get(asmComponent[i]); } return itacComponent; } } }