136 lines
5.4 KiB
C#
136 lines
5.4 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 DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property BoardWidthRestriction, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property LineTopology, declared in Line
|
|
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 LineMapper
|
|
{
|
|
// 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.Line get(Line itacLine)
|
|
{
|
|
if (itacLine == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line();
|
|
mapItac2Asm(asmLine, itacLine);
|
|
return asmLine;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine, Line itacLine)
|
|
{
|
|
// skip readonly property StationInLines
|
|
// complex property StationInLineOptions, isArray:False, isGeneric:False
|
|
itacLine.StationInLineOptions = com.itac.oib.siplacepro.contracts.types.StationInLineOptionsMapper.get( asmLine.StationInLineOptions);
|
|
// complex property LineHandlingOptions, isArray:False, isGeneric:False
|
|
itacLine.LineHandlingOptions = com.itac.oib.siplacepro.contracts.types.LineHandlingOptionsMapper.get( asmLine.LineHandlingOptions);
|
|
// skip property DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property BoardWidthRestriction, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip readonly property PrintersInLine
|
|
// skip readonly property GenericDevicesInLine
|
|
// skip property LineTopology, declared in Line
|
|
asmLine.IsBoardWidthRestrictionEnabled = itacLine.IsBoardWidthRestrictionEnabled;
|
|
// 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.Line[] get(Line[] itacLine)
|
|
{
|
|
if (itacLine == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[] asmLine = new Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[itacLine.Length];
|
|
for (int i = 0; i < itacLine.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmLine[i] = LineMapper.get(itacLine[i]);
|
|
}
|
|
return asmLine;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line> getList(Line[] asmLine)
|
|
{
|
|
if (asmLine == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line> itacLine = new List<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line>();
|
|
for (int i = 0; i < asmLine.Length; i++)
|
|
{
|
|
itacLine.Add(LineMapper.get(asmLine[i]));
|
|
}
|
|
return itacLine;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static Line get(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine)
|
|
{
|
|
if (asmLine == null) { return null; }
|
|
Line itacLine = new Line();
|
|
mapAsm2Itac(asmLine, itacLine);
|
|
return itacLine;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line asmLine, Line itacLine)
|
|
{
|
|
// maps ASM list 2 iTAC array
|
|
itacLine.StationInLines = StationInLineMapper.getArray(asmLine.StationInLines);
|
|
itacLine.StationInLineOptions = com.itac.oib.siplacepro.contracts.types.StationInLineOptionsMapper.get(asmLine.StationInLineOptions);
|
|
// complex asm property StationInLineOptions
|
|
itacLine.LineHandlingOptions = com.itac.oib.siplacepro.contracts.types.LineHandlingOptionsMapper.get(asmLine.LineHandlingOptions);
|
|
// complex asm property LineHandlingOptions
|
|
// skip property DictionaryProxy`2, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// skip property BoardWidthRestriction, property in exclude list
|
|
// skip property ListProxy`1, property in exclude list
|
|
// maps ASM list 2 iTAC array
|
|
itacLine.PrintersInLine = PrinterInLineMapper.getArray(asmLine.PrintersInLine);
|
|
// maps ASM list 2 iTAC array
|
|
itacLine.GenericDevicesInLine = GenericDeviceInLineMapper.getArray(asmLine.GenericDevicesInLine);
|
|
// skip property LineTopology, declared in Line
|
|
itacLine.IsBoardWidthRestrictionEnabled = asmLine.IsBoardWidthRestrictionEnabled;
|
|
itacLine.Name = asmLine.Name;
|
|
itacLine.FullPath = asmLine.FullPath;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static Line[] getArray(IList<Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line> asmLine)
|
|
{
|
|
if (asmLine == null) { return null; }
|
|
Line[] itacLine = new Line[asmLine.Count];
|
|
for (int i = 0; i < asmLine.Count; i++)
|
|
{
|
|
itacLine[i] = LineMapper.get(asmLine[i]);
|
|
}
|
|
return itacLine;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static Line[] getArray(Asm.As.Oib.SiplacePro.Proxy.Business.Objects.Line[] asmLine)
|
|
{
|
|
if (asmLine == null) { return null; }
|
|
Line[] itacLine = new Line[asmLine.Length];
|
|
for (int i = 0; i < asmLine.Length; i++)
|
|
{
|
|
itacLine[i] = LineMapper.get(asmLine[i]);
|
|
}
|
|
return itacLine;
|
|
}
|
|
}
|
|
}
|