120 lines
5.4 KiB
C#
120 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 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 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 asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent itacStationEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent();
|
|
mapItac2Asm(itacStationEvent, asmStationEvent);
|
|
return itacStationEvent;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent itacStationEvent, StationEvent asmStationEvent)
|
|
{
|
|
itacStationEvent.BoardNumber = asmStationEvent.BoardNumber;
|
|
itacStationEvent.StationTime = asmStationEvent.StationTime;
|
|
// complex property Conveyor, isArray:False, isGeneric:False
|
|
itacStationEvent.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get( asmStationEvent.Conveyor);
|
|
// complex property StationEventType, isArray:False, isGeneric:False
|
|
itacStationEvent.StationEventType = com.itac.oib.monitoring.contracts.data.StationEventTypeMapper.get( asmStationEvent.StationEventType);
|
|
itacStationEvent.ProcessingArea = asmStationEvent.ProcessingArea;
|
|
// complex property ProcessingMode, isArray:False, isGeneric:False
|
|
itacStationEvent.ProcessingMode = com.itac.oib.monitoring.contracts.data.ProcessingModeTypeMapper.get( asmStationEvent.ProcessingMode);
|
|
// complex property SubConveyor, isArray:False, isGeneric:False
|
|
itacStationEvent.SubConveyor = com.itac.oib.monitoring.contracts.data.SubConveyorTypeMapper.get( asmStationEvent.SubConveyor);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[] get(StationEvent[] asmStationEvent)
|
|
{
|
|
if (asmStationEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[] itacStationEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.StationEvent[asmStationEvent.Length];
|
|
for (int i = 0; i < asmStationEvent.Length; i++)
|
|
{
|
|
// to itac array
|
|
itacStationEvent[i] = StationEventMapper.get(asmStationEvent[i]);
|
|
}
|
|
return itacStationEvent;
|
|
}
|
|
|
|
// 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;
|
|
}
|
|
}
|
|
}
|