112 lines
5.0 KiB
C#
112 lines
5.0 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:05:09
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using com.itac.oib.siplacepro.contracts.data;
|
|
using com.itac.oib.siplacepro.contracts.types;
|
|
|
|
namespace com.itac.oib.client.customextensions
|
|
{
|
|
// source: assembly 2.3.0.2
|
|
// source: assembly ASM.AS.OIB.Client.CustomExtensions
|
|
public class ConveyorInfoMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.Client.CustomExtensions.ConveyorInfo get(ConveyorInfo itacConveyorInfo)
|
|
{
|
|
if (itacConveyorInfo == null) { return null; }
|
|
Asm.As.Oib.Client.CustomExtensions.ConveyorInfo asmConveyorInfo = new Asm.As.Oib.Client.CustomExtensions.ConveyorInfo();
|
|
mapItac2Asm(asmConveyorInfo, itacConveyorInfo);
|
|
return asmConveyorInfo;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Client.CustomExtensions.ConveyorInfo asmConveyorInfo, ConveyorInfo itacConveyorInfo)
|
|
{
|
|
// property LineJobGuid is readonly(no set method)
|
|
// property OrderId is readonly(no set method)
|
|
// property Recipe is readonly(no set method)
|
|
// property Board is readonly(no set method)
|
|
// property BoardSide is readonly(no set method)
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Client.CustomExtensions.ConveyorInfo[] get(ConveyorInfo[] itacConveyorInfo)
|
|
{
|
|
if (itacConveyorInfo == null) { return null; }
|
|
Asm.As.Oib.Client.CustomExtensions.ConveyorInfo[] asmConveyorInfo = new Asm.As.Oib.Client.CustomExtensions.ConveyorInfo[itacConveyorInfo.Length];
|
|
for (int i = 0; i < itacConveyorInfo.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmConveyorInfo[i] = ConveyorInfoMapper.get(itacConveyorInfo[i]);
|
|
}
|
|
return asmConveyorInfo;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Client.CustomExtensions.ConveyorInfo> getList(ConveyorInfo[] asmConveyorInfo)
|
|
{
|
|
if (asmConveyorInfo == null) { return null; }
|
|
List<Asm.As.Oib.Client.CustomExtensions.ConveyorInfo> itacConveyorInfo = new List<Asm.As.Oib.Client.CustomExtensions.ConveyorInfo>();
|
|
for (int i = 0; i < asmConveyorInfo.Length; i++)
|
|
{
|
|
itacConveyorInfo.Add(ConveyorInfoMapper.get(asmConveyorInfo[i]));
|
|
}
|
|
return itacConveyorInfo;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static ConveyorInfo get(Asm.As.Oib.Client.CustomExtensions.ConveyorInfo asmConveyorInfo)
|
|
{
|
|
if (asmConveyorInfo == null) { return null; }
|
|
ConveyorInfo itacConveyorInfo = new ConveyorInfo();
|
|
mapAsm2Itac(asmConveyorInfo, itacConveyorInfo);
|
|
return itacConveyorInfo;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Client.CustomExtensions.ConveyorInfo asmConveyorInfo, ConveyorInfo itacConveyorInfo)
|
|
{
|
|
itacConveyorInfo.LineJobGuid = asmConveyorInfo.LineJobGuid;
|
|
itacConveyorInfo.OrderId = asmConveyorInfo.OrderId;
|
|
itacConveyorInfo.Recipe = com.itac.oib.siplacepro.contracts.data.RecipeMapper.get(asmConveyorInfo.Recipe);
|
|
// complex asm property Recipe
|
|
itacConveyorInfo.Board = com.itac.oib.siplacepro.contracts.data.BoardMapper.get(asmConveyorInfo.Board);
|
|
// complex asm property Board
|
|
itacConveyorInfo.BoardSide = com.itac.oib.siplacepro.contracts.types.BoardSideMapper.get(asmConveyorInfo.BoardSide);
|
|
// complex asm property BoardSide
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static ConveyorInfo[] getArray(IList<Asm.As.Oib.Client.CustomExtensions.ConveyorInfo> asmConveyorInfo)
|
|
{
|
|
if (asmConveyorInfo == null) { return null; }
|
|
ConveyorInfo[] itacConveyorInfo = new ConveyorInfo[asmConveyorInfo.Count];
|
|
for (int i = 0; i < asmConveyorInfo.Count; i++)
|
|
{
|
|
itacConveyorInfo[i] = ConveyorInfoMapper.get(asmConveyorInfo[i]);
|
|
}
|
|
return itacConveyorInfo;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static ConveyorInfo[] getArray(Asm.As.Oib.Client.CustomExtensions.ConveyorInfo[] asmConveyorInfo)
|
|
{
|
|
if (asmConveyorInfo == null) { return null; }
|
|
ConveyorInfo[] itacConveyorInfo = new ConveyorInfo[asmConveyorInfo.Length];
|
|
for (int i = 0; i < asmConveyorInfo.Length; i++)
|
|
{
|
|
itacConveyorInfo[i] = ConveyorInfoMapper.get(asmConveyorInfo[i]);
|
|
}
|
|
return itacConveyorInfo;
|
|
}
|
|
}
|
|
}
|