114 lines
4.7 KiB
C#
114 lines
4.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 31.10.2018 08:16:46
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using com.itac.oib.monitoring.contracts.data;
|
|
|
|
namespace com.itac.oib.monitoring.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.Monitoring.Proxy
|
|
public class TargetBoardMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard get(TargetBoard asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard itacTargetBoard = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard();
|
|
mapItac2Asm(itacTargetBoard, asmTargetBoard);
|
|
return itacTargetBoard;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard itacTargetBoard, TargetBoard asmTargetBoard)
|
|
{
|
|
itacTargetBoard.LotSize = asmTargetBoard.LotSize;
|
|
itacTargetBoard.BoardName = asmTargetBoard.BoardName;
|
|
itacTargetBoard.BoardFullPath = asmTargetBoard.BoardFullPath;
|
|
itacTargetBoard.OrderId = asmTargetBoard.OrderId;
|
|
// complex property BoardSide, isArray:False, isGeneric:False
|
|
itacTargetBoard.BoardSide = com.itac.oib.monitoring.contracts.data.BoardSideTypeMapper.get( asmTargetBoard.BoardSide);
|
|
// complex property SubConveyor, isArray:False, isGeneric:False
|
|
itacTargetBoard.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get( asmTargetBoard.SubConveyor);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard[] get(TargetBoard[] asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard[] itacTargetBoard = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard[asmTargetBoard.Length];
|
|
for (int i = 0; i < asmTargetBoard.Length; i++)
|
|
{
|
|
// to itac array
|
|
itacTargetBoard[i] = TargetBoardMapper.get(asmTargetBoard[i]);
|
|
}
|
|
return itacTargetBoard;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard> getList(TargetBoard[] asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard> itacTargetBoard = new List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard>();
|
|
for (int i = 0; i < asmTargetBoard.Length; i++)
|
|
{
|
|
itacTargetBoard.Add(TargetBoardMapper.get(asmTargetBoard[i]));
|
|
}
|
|
return itacTargetBoard;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static TargetBoard get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
TargetBoard itacTargetBoard = new TargetBoard();
|
|
mapAsm2Itac(asmTargetBoard, itacTargetBoard);
|
|
return itacTargetBoard;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard asmTargetBoard, TargetBoard itacTargetBoard)
|
|
{
|
|
itacTargetBoard.LotSize = asmTargetBoard.LotSize;
|
|
itacTargetBoard.BoardName = asmTargetBoard.BoardName;
|
|
itacTargetBoard.BoardFullPath = asmTargetBoard.BoardFullPath;
|
|
itacTargetBoard.OrderId = asmTargetBoard.OrderId;
|
|
itacTargetBoard.BoardSide = com.itac.oib.monitoring.contracts.data.BoardSideTypeMapper.get(asmTargetBoard.BoardSide);
|
|
// complex asm property BoardSide
|
|
itacTargetBoard.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get(asmTargetBoard.SubConveyor);
|
|
// complex asm property SubConveyor
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static TargetBoard[] getArray(IList<Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard> asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
TargetBoard[] itacTargetBoard = new TargetBoard[asmTargetBoard.Count];
|
|
for (int i = 0; i < asmTargetBoard.Count; i++)
|
|
{
|
|
itacTargetBoard[i] = TargetBoardMapper.get(asmTargetBoard[i]);
|
|
}
|
|
return itacTargetBoard;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static TargetBoard[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.TargetBoard[] asmTargetBoard)
|
|
{
|
|
if (asmTargetBoard == null) { return null; }
|
|
TargetBoard[] itacTargetBoard = new TargetBoard[asmTargetBoard.Length];
|
|
for (int i = 0; i < asmTargetBoard.Length; i++)
|
|
{
|
|
itacTargetBoard[i] = TargetBoardMapper.get(asmTargetBoard[i]);
|
|
}
|
|
return itacTargetBoard;
|
|
}
|
|
}
|
|
}
|