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