Files
2025-06-06 09:15:13 +02:00

172 lines
8.7 KiB
C#

/*
* 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:08:14
// skip property Dictionary`2, property in exclude list
// skip property TriState, declared in Setup
// skip property DictionaryProxy`2, property in exclude list
// skip property ListProxy`1, property in exclude list
// skip property ArrayList, property in exclude list
// skip property ArrayList, property in exclude list
// skip property NamedObjectBase, declared in Setup
using System;
using System.Collections.Generic;
using com.itac.oib.siplacepro.contracts.types;
namespace com.itac.oib.siplacepro.contracts.data
{
// source: assembly 3.2.0.152
// source: assembly ASM.AS.OIB.SIPLACEPro.Proxy
public class SetupMapper
{
// 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.Setup get(Setup itacSetup)
{
if (itacSetup == null) { return null; }
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup asmSetup = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup();
mapItac2Asm(asmSetup, itacSetup);
return asmSetup;
}
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup asmSetup, Setup itacSetup)
{
// skip readonly property StationList
// skip property Dictionary`2, property in exclude list
// skip property TriState, declared in Setup
// skip readonly property Line
// skip readonly property StationSetups
asmSetup.FixAllNozzles = itacSetup.FixAllNozzles;
// skip property DictionaryProxy`2, property in exclude list
asmSetup.WhisperPCBBarcodes = itacSetup.WhisperPCBBarcodes;
// complex property WhisperDownTheLineModeBarcodes, isArray:False, isGeneric:False
asmSetup.WhisperDownTheLineModeBarcodes = com.itac.oib.siplacepro.contracts.types.WhisperDownTheLineModeBarcodesMapper.get( itacSetup.WhisperDownTheLineModeBarcodes);
asmSetup.ExternalVirtualInkspotHandling = itacSetup.ExternalVirtualInkspotHandling;
// skip property ListProxy`1, property in exclude list
// skip property ArrayList, property in exclude list
// skip property ArrayList, property in exclude list
// skip readonly property IsWDTLCapable
// skip readonly property IsMixed705
// skip readonly property TotalAvailablePlacingAreas
// skip readonly property IsPCBBarcodeWDTLCapable
// skip readonly property SupportsAlternativeComponents
// skip readonly property DoesAnyStationSupportSPS
// complex property WhisperDownTheLineMode, isArray:False, isGeneric:False
asmSetup.WhisperDownTheLineMode = com.itac.oib.siplacepro.contracts.types.WhisperDownTheLineModeMapper.get( itacSetup.WhisperDownTheLineMode);
// skip property NamedObjectBase, declared in Setup
// 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.Setup[] get(Setup[] itacSetup)
{
if (itacSetup == null) { return null; }
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup[] asmSetup = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup[itacSetup.Length];
for (int i = 0; i < itacSetup.Length; i++)
{
// to itac array
asmSetup[i] = SetupMapper.get(itacSetup[i]);
}
return asmSetup;
}
// maps iTAC namespace conform array to ASM namespace list
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup> getList(Setup[] asmSetup)
{
if (asmSetup == null) { return null; }
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup> itacSetup = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup>();
for (int i = 0; i < asmSetup.Length; i++)
{
itacSetup.Add(SetupMapper.get(asmSetup[i]));
}
return itacSetup;
}
// map type from ASM namespace to iTAC namespace
public static Setup get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup asmSetup)
{
if (asmSetup == null) { return null; }
Setup itacSetup = new Setup();
mapAsm2Itac(asmSetup, itacSetup);
return itacSetup;
}
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup asmSetup, Setup itacSetup)
{
// array mapping
itacSetup.StationList = StationMapper.getArray(asmSetup.StationList);
// complex asm property StationList
// skip property Dictionary`2, property in exclude list
// skip property TriState, declared in Setup
itacSetup.Line = com.itac.oib.siplacepro.contracts.data.LineMapper.get(asmSetup.Line);
// complex asm property Line
// assign Dictionary(): maps ASM Dictionary 2 iTAC dictionary
itacSetup.StationSetups = getStationSetupsDictionary( asmSetup.StationSetups);
itacSetup.FixAllNozzles = asmSetup.FixAllNozzles;
// skip property DictionaryProxy`2, property in exclude list
itacSetup.WhisperPCBBarcodes = asmSetup.WhisperPCBBarcodes;
itacSetup.WhisperDownTheLineModeBarcodes = com.itac.oib.siplacepro.contracts.types.WhisperDownTheLineModeBarcodesMapper.get(asmSetup.WhisperDownTheLineModeBarcodes);
// complex asm property WhisperDownTheLineModeBarcodes
itacSetup.ExternalVirtualInkspotHandling = asmSetup.ExternalVirtualInkspotHandling;
// skip property ListProxy`1, property in exclude list
// skip property ArrayList, property in exclude list
// skip property ArrayList, property in exclude list
itacSetup.IsWDTLCapable = asmSetup.IsWDTLCapable;
itacSetup.IsMixed705 = asmSetup.IsMixed705;
itacSetup.TotalAvailablePlacingAreas = asmSetup.TotalAvailablePlacingAreas;
itacSetup.IsPCBBarcodeWDTLCapable = asmSetup.IsPCBBarcodeWDTLCapable;
itacSetup.SupportsAlternativeComponents = asmSetup.SupportsAlternativeComponents;
itacSetup.DoesAnyStationSupportSPS = asmSetup.DoesAnyStationSupportSPS;
itacSetup.WhisperDownTheLineMode = com.itac.oib.siplacepro.contracts.types.WhisperDownTheLineModeMapper.get(asmSetup.WhisperDownTheLineMode);
// complex asm property WhisperDownTheLineMode
// skip property NamedObjectBase, declared in Setup
itacSetup.Name = asmSetup.Name;
itacSetup.FullPath = asmSetup.FullPath;
}
// maps ASM namespace conform list to iTAC namespace array
public static Setup[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup> asmSetup)
{
if (asmSetup == null) { return null; }
Setup[] itacSetup = new Setup[asmSetup.Count];
for (int i = 0; i < asmSetup.Count; i++)
{
itacSetup[i] = SetupMapper.get(asmSetup[i]);
}
return itacSetup;
}
// maps ASM namespace conform array to iTAC namespace array
public static Setup[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Setup[] asmSetup)
{
if (asmSetup == null) { return null; }
Setup[] itacSetup = new Setup[asmSetup.Length];
for (int i = 0; i < asmSetup.Length; i++)
{
itacSetup[i] = SetupMapper.get(asmSetup[i]);
}
return itacSetup;
}
// original declaration: Asm.As.Oib.SiplacePro.Proxy.Architecture.Collections.DictionaryProxy`2[Asm.As.Oib.SiplacePro.Proxy.Business.Objects.StationInLine,Asm.As.Oib.SiplacePro.Proxy.Business.Objects.StationSetup]
// generate key / value array for dictionary
// generated dictionary mapper
private static Dictionary<StationInLine, StationSetup> getStationSetupsDictionary(IDictionary<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.StationInLine, Asm.As.Oib.SiplacePro.Proxy.Business.Objects.StationSetup> stationSetups)
{
Dictionary <StationInLine, StationSetup> result = new Dictionary<StationInLine, StationSetup>();
foreach (Asm.As.Oib.SiplacePro.Proxy.Business.Objects.StationInLine key in stationSetups.Keys)
{
result.Add(com.itac.oib.siplacepro.contracts.data.StationInLineMapper.get(key), com.itac.oib.siplacepro.contracts.data.StationSetupMapper.get(stationSetups[key]));
}
return result;
}
}
}