112 lines
6.4 KiB
C#
112 lines
6.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 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 ProcessingLocationStateMapper
|
|
{
|
|
// 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.ProcessingLocationState get(ProcessingLocationState itacProcessingLocationState)
|
|
{
|
|
if (itacProcessingLocationState == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState asmProcessingLocationState = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState();
|
|
mapItac2Asm(asmProcessingLocationState, itacProcessingLocationState);
|
|
return asmProcessingLocationState;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState asmProcessingLocationState, ProcessingLocationState itacProcessingLocationState)
|
|
{
|
|
// complex property Conveyor, isArray:False, isGeneric:False
|
|
asmProcessingLocationState.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get( itacProcessingLocationState.Conveyor);
|
|
asmProcessingLocationState.ProcessingArea = itacProcessingLocationState.ProcessingArea;
|
|
// complex property State, isArray:False, isGeneric:False
|
|
asmProcessingLocationState.State = com.itac.oib.monitoring.contracts.data.StationStateTypeMapper.get( itacProcessingLocationState.State);
|
|
asmProcessingLocationState.SequenceNumber = itacProcessingLocationState.SequenceNumber;
|
|
asmProcessingLocationState.StationTime = itacProcessingLocationState.StationTime;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState[] get(ProcessingLocationState[] itacProcessingLocationState)
|
|
{
|
|
if (itacProcessingLocationState == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState[] asmProcessingLocationState = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState[itacProcessingLocationState.Length];
|
|
for (int i = 0; i < itacProcessingLocationState.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmProcessingLocationState[i] = ProcessingLocationStateMapper.get(itacProcessingLocationState[i]);
|
|
}
|
|
return asmProcessingLocationState;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState> getList(ProcessingLocationState[] asmProcessingLocationState)
|
|
{
|
|
if (asmProcessingLocationState == null) { return null; }
|
|
List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState> itacProcessingLocationState = new List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState>();
|
|
for (int i = 0; i < asmProcessingLocationState.Length; i++)
|
|
{
|
|
itacProcessingLocationState.Add(ProcessingLocationStateMapper.get(asmProcessingLocationState[i]));
|
|
}
|
|
return itacProcessingLocationState;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static ProcessingLocationState get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState asmProcessingLocationState)
|
|
{
|
|
if (asmProcessingLocationState == null) { return null; }
|
|
ProcessingLocationState itacProcessingLocationState = new ProcessingLocationState();
|
|
mapAsm2Itac(asmProcessingLocationState, itacProcessingLocationState);
|
|
return itacProcessingLocationState;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState asmProcessingLocationState, ProcessingLocationState itacProcessingLocationState)
|
|
{
|
|
itacProcessingLocationState.Conveyor = com.itac.oib.monitoring.contracts.data.ConveyorTypeMapper.get(asmProcessingLocationState.Conveyor);
|
|
// complex asm property Conveyor
|
|
itacProcessingLocationState.ProcessingArea = asmProcessingLocationState.ProcessingArea;
|
|
itacProcessingLocationState.State = com.itac.oib.monitoring.contracts.data.StationStateTypeMapper.get(asmProcessingLocationState.State);
|
|
// complex asm property State
|
|
itacProcessingLocationState.SequenceNumber = asmProcessingLocationState.SequenceNumber;
|
|
itacProcessingLocationState.StationTime = asmProcessingLocationState.StationTime;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static ProcessingLocationState[] getArray(IList<Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState> asmProcessingLocationState)
|
|
{
|
|
if (asmProcessingLocationState == null) { return null; }
|
|
ProcessingLocationState[] itacProcessingLocationState = new ProcessingLocationState[asmProcessingLocationState.Count];
|
|
for (int i = 0; i < asmProcessingLocationState.Count; i++)
|
|
{
|
|
itacProcessingLocationState[i] = ProcessingLocationStateMapper.get(asmProcessingLocationState[i]);
|
|
}
|
|
return itacProcessingLocationState;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static ProcessingLocationState[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.ProcessingLocationState[] asmProcessingLocationState)
|
|
{
|
|
if (asmProcessingLocationState == null) { return null; }
|
|
ProcessingLocationState[] itacProcessingLocationState = new ProcessingLocationState[asmProcessingLocationState.Length];
|
|
for (int i = 0; i < asmProcessingLocationState.Length; i++)
|
|
{
|
|
itacProcessingLocationState[i] = ProcessingLocationStateMapper.get(asmProcessingLocationState[i]);
|
|
}
|
|
return itacProcessingLocationState;
|
|
}
|
|
}
|
|
}
|