120 lines
6.2 KiB
C#
120 lines
6.2 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:09:33
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using com.itac.oib.monitoring.contracts.data;
|
|
|
|
namespace com.itac.oib.monitoring.contracts.data
|
|
{
|
|
// source: assembly 3.2.0.152
|
|
// source: assembly ASM.AS.OIB.Monitoring.Proxy
|
|
public class StationEventMapper
|
|
{
|
|
// 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.StationEvent get(StationEvent itacStationEvent)
|
|
{
|
|
if (itacStationEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent asmStationEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent();
|
|
mapItac2Asm(asmStationEvent, itacStationEvent);
|
|
return asmStationEvent;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent asmStationEvent, StationEvent itacStationEvent)
|
|
{
|
|
asmStationEvent.BoardNumber = itacStationEvent.BoardNumber;
|
|
asmStationEvent.StationTime = itacStationEvent.StationTime;
|
|
// complex property Conveyor, isArray:False, isGeneric:False
|
|
asmStationEvent.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get( itacStationEvent.Conveyor);
|
|
// complex property StationEventType, isArray:False, isGeneric:False
|
|
asmStationEvent.StationEventType = com.itac.oib.monitoring.contracts.data.StationEventTypeMapper.get( itacStationEvent.StationEventType);
|
|
asmStationEvent.ProcessingArea = itacStationEvent.ProcessingArea;
|
|
// complex property ProcessingMode, isArray:False, isGeneric:False
|
|
asmStationEvent.ProcessingMode = com.itac.oib.monitoring.contracts.data.ProcessingModeTypeMapper.get( itacStationEvent.ProcessingMode);
|
|
// complex property SubConveyor, isArray:False, isGeneric:False
|
|
asmStationEvent.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get( itacStationEvent.SubConveyor);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[] get(StationEvent[] itacStationEvent)
|
|
{
|
|
if (itacStationEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[] asmStationEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[itacStationEvent.Length];
|
|
for (int i = 0; i < itacStationEvent.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmStationEvent[i] = StationEventMapper.get(itacStationEvent[i]);
|
|
}
|
|
return asmStationEvent;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent> getList(StationEvent[] asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent> itacStationEvent = new List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent>();
|
|
for (int i = 0; i < asmStationEvent.Length; i++)
|
|
{
|
|
itacStationEvent.Add(StationEventMapper.get(asmStationEvent[i]));
|
|
}
|
|
return itacStationEvent;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static StationEvent get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
StationEvent itacStationEvent = new StationEvent();
|
|
mapAsm2Itac(asmStationEvent, itacStationEvent);
|
|
return itacStationEvent;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent asmStationEvent, StationEvent itacStationEvent)
|
|
{
|
|
itacStationEvent.BoardNumber = asmStationEvent.BoardNumber;
|
|
itacStationEvent.StationTime = asmStationEvent.StationTime;
|
|
itacStationEvent.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get(asmStationEvent.Conveyor);
|
|
// complex asm property Conveyor
|
|
itacStationEvent.StationEventType = com.itac.oib.monitoring.contracts.data.StationEventTypeMapper.get(asmStationEvent.StationEventType);
|
|
// complex asm property StationEventType
|
|
itacStationEvent.ProcessingArea = asmStationEvent.ProcessingArea;
|
|
itacStationEvent.ProcessingMode = com.itac.oib.monitoring.contracts.data.ProcessingModeTypeMapper.get(asmStationEvent.ProcessingMode);
|
|
// complex asm property ProcessingMode
|
|
itacStationEvent.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get(asmStationEvent.SubConveyor);
|
|
// complex asm property SubConveyor
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static StationEvent[] getArray(IList<Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent> asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
StationEvent[] itacStationEvent = new StationEvent[asmStationEvent.Count];
|
|
for (int i = 0; i < asmStationEvent.Count; i++)
|
|
{
|
|
itacStationEvent[i] = StationEventMapper.get(asmStationEvent[i]);
|
|
}
|
|
return itacStationEvent;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static StationEvent[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[] asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
StationEvent[] itacStationEvent = new StationEvent[asmStationEvent.Length];
|
|
for (int i = 0; i < asmStationEvent.Length; i++)
|
|
{
|
|
itacStationEvent[i] = StationEventMapper.get(asmStationEvent[i]);
|
|
}
|
|
return itacStationEvent;
|
|
}
|
|
}
|
|
}
|