210 lines
8.7 KiB
C#
210 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 05.11.2018 14:52:23
|
|
// skip property Double, property in exclude list
|
|
// skip property BoardSide, property in exclude list
|
|
// skip property String, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
// skip property Color, declared in Panel
|
|
// skip property CoordSys, declared in Panel
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property Boolean, property in exclude list
|
|
// skip property Int32, property in exclude list
|
|
// skip property PositionCorrectionMethod, property in exclude list
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property PolygonPoint, declared in Panel
|
|
// skip property ArrayList, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.siplacepro.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACEPro.Proxy
|
|
public class PanelMapper
|
|
{
|
|
// 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.Panel get(Panel itacPanel)
|
|
{
|
|
if (itacPanel == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel asmPanel = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel();
|
|
mapItac2Asm(asmPanel, itacPanel);
|
|
return asmPanel;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel asmPanel, Panel itacPanel)
|
|
{
|
|
// skip property Double, property in exclude list
|
|
// skip property BoardSide, property in exclude list
|
|
asmPanel.IsHidden = itacPanel.IsHidden;
|
|
// skip readonly property PanelOwner
|
|
// skip readonly property FullHeirarchyName
|
|
asmPanel.MatrixRow = itacPanel.MatrixRow;
|
|
asmPanel.MatrixColumn = itacPanel.MatrixColumn;
|
|
// skip readonly property MatrixRowDisplay
|
|
// skip readonly property MatrixColumnDisplay
|
|
asmPanel.Name = itacPanel.Name;
|
|
asmPanel.Omit = itacPanel.Omit;
|
|
// skip property String, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
// skip readonly property ChildPanels
|
|
// skip property Color, declared in Panel
|
|
// skip property CoordSys, declared in Panel
|
|
asmPanel.OffsetZeroPointX = itacPanel.OffsetZeroPointX;
|
|
asmPanel.OffsetZeroPointY = itacPanel.OffsetZeroPointY;
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
asmPanel.Height = itacPanel.Height;
|
|
// skip property Boolean, property in exclude list
|
|
// skip property Int32, property in exclude list
|
|
// skip property PositionCorrectionMethod, property in exclude list
|
|
asmPanel.CountAsAssembledPCB = itacPanel.CountAsAssembledPCB;
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
asmPanel.SizeX = itacPanel.SizeX;
|
|
asmPanel.SizeY = itacPanel.SizeY;
|
|
// skip property PolygonPoint, declared in Panel
|
|
asmPanel.Mirrored = itacPanel.Mirrored;
|
|
// skip property ArrayList, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
// complex property PlacementList, isArray:False, isGeneric:False
|
|
itacPanel.PlacementList = com.itac.oib.siplacepro.contracts.data.PlacementListMapper.get( asmPanel.PlacementList);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel[] get(Panel[] itacPanel)
|
|
{
|
|
if (itacPanel == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel[] asmPanel = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel[itacPanel.Length];
|
|
for (int i = 0; i < itacPanel.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmPanel[i] = PanelMapper.get(itacPanel[i]);
|
|
}
|
|
return asmPanel;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel> getList(Panel[] asmPanel)
|
|
{
|
|
if (asmPanel == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel> itacPanel = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel>();
|
|
for (int i = 0; i < asmPanel.Length; i++)
|
|
{
|
|
itacPanel.Add(PanelMapper.get(asmPanel[i]));
|
|
}
|
|
return itacPanel;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static Panel get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel asmPanel)
|
|
{
|
|
if (asmPanel == null) { return null; }
|
|
Panel itacPanel = new Panel();
|
|
mapAsm2Itac(asmPanel, itacPanel);
|
|
return itacPanel;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel asmPanel, Panel itacPanel)
|
|
{
|
|
// skip property Double, property in exclude list
|
|
// skip property BoardSide, property in exclude list
|
|
itacPanel.IsHidden = asmPanel.IsHidden;
|
|
itacPanel.PanelOwner = com.itac.oib.siplacepro.contracts.data.PanelMapper.get(asmPanel.PanelOwner);
|
|
// complex asm property PanelOwner
|
|
itacPanel.FullHeirarchyName = asmPanel.FullHeirarchyName;
|
|
itacPanel.MatrixRow = asmPanel.MatrixRow;
|
|
itacPanel.MatrixColumn = asmPanel.MatrixColumn;
|
|
itacPanel.MatrixRowDisplay = asmPanel.MatrixRowDisplay;
|
|
itacPanel.MatrixColumnDisplay = asmPanel.MatrixColumnDisplay;
|
|
itacPanel.Name = asmPanel.Name;
|
|
itacPanel.Omit = asmPanel.Omit;
|
|
// skip property String, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
// assign Dictionary(): maps ASM Dictionary 2 iTAC dictionary
|
|
itacPanel.ChildPanels = getChildPanelsDictionary( asmPanel.ChildPanels);
|
|
// skip property Color, declared in Panel
|
|
// skip property CoordSys, declared in Panel
|
|
itacPanel.OffsetZeroPointX = asmPanel.OffsetZeroPointX;
|
|
itacPanel.OffsetZeroPointY = asmPanel.OffsetZeroPointY;
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
itacPanel.Height = asmPanel.Height;
|
|
// skip property Boolean, property in exclude list
|
|
// skip property Int32, property in exclude list
|
|
// skip property PositionCorrectionMethod, property in exclude list
|
|
itacPanel.CountAsAssembledPCB = asmPanel.CountAsAssembledPCB;
|
|
// skip property FiducialList, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
// skip property Double, property in exclude list
|
|
itacPanel.SizeX = asmPanel.SizeX;
|
|
itacPanel.SizeY = asmPanel.SizeY;
|
|
// skip property PolygonPoint, declared in Panel
|
|
itacPanel.Mirrored = asmPanel.Mirrored;
|
|
// skip property ArrayList, property in exclude list
|
|
// skip property FiducialPlacement, declared in Panel
|
|
// skip property Boolean, property in exclude list
|
|
itacPanel.PlacementList = com.itac.oib.siplacepro.contracts.data.PlacementListMapper.get(asmPanel.PlacementList);
|
|
// complex asm property PlacementList
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static Panel[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel> asmPanel)
|
|
{
|
|
if (asmPanel == null) { return null; }
|
|
Panel[] itacPanel = new Panel[asmPanel.Count];
|
|
for (int i = 0; i < asmPanel.Count; i++)
|
|
{
|
|
itacPanel[i] = PanelMapper.get(asmPanel[i]);
|
|
}
|
|
return itacPanel;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static Panel[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Panel[] asmPanel)
|
|
{
|
|
if (asmPanel == null) { return null; }
|
|
Panel[] itacPanel = new Panel[asmPanel.Length];
|
|
for (int i = 0; i < asmPanel.Length; i++)
|
|
{
|
|
itacPanel[i] = PanelMapper.get(asmPanel[i]);
|
|
}
|
|
return itacPanel;
|
|
}
|
|
|
|
// original declaration: Asm.As.Oib.SiplacePro.Proxy.Architecture.Collections.DictionaryProxy`2[System.String,Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PanelMatrix]
|
|
// generate key / value array for dictionary
|
|
// generated dictionary mapper
|
|
private static Dictionary<String, PanelMatrix> getChildPanelsDictionary(IDictionary<String, Asm.As.Oib.SiplacePro.Proxy.Business.Objects.PanelMatrix> childPanels)
|
|
{
|
|
Dictionary <String, PanelMatrix> result = new Dictionary<String, PanelMatrix>();
|
|
foreach (String key in childPanels.Keys)
|
|
{
|
|
result.Add(key, com.itac.oib.siplacepro.contracts.data.PanelMatrixMapper.get(childPanels[key]));
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|