107 lines
4.1 KiB
C#
107 lines
4.1 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;
|
|
|
|
namespace com.itac.oib.monitoring.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.Monitoring.Proxy
|
|
public class SpliceEventMapper
|
|
{
|
|
// 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.SpliceEvent get(SpliceEvent asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent itacSpliceEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent();
|
|
mapItac2Asm(itacSpliceEvent, asmSpliceEvent);
|
|
return itacSpliceEvent;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent itacSpliceEvent, SpliceEvent asmSpliceEvent)
|
|
{
|
|
itacSpliceEvent.TableLocation = asmSpliceEvent.TableLocation;
|
|
itacSpliceEvent.Track = asmSpliceEvent.Track;
|
|
itacSpliceEvent.Division = asmSpliceEvent.Division;
|
|
itacSpliceEvent.ComponentName = asmSpliceEvent.ComponentName;
|
|
itacSpliceEvent.SpliceTime = asmSpliceEvent.SpliceTime;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent[] get(SpliceEvent[] asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent[] itacSpliceEvent = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent[asmSpliceEvent.Length];
|
|
for (int i = 0; i < asmSpliceEvent.Length; i++)
|
|
{
|
|
// to itac array
|
|
itacSpliceEvent[i] = SpliceEventMapper.get(asmSpliceEvent[i]);
|
|
}
|
|
return itacSpliceEvent;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent> getList(SpliceEvent[] asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent> itacSpliceEvent = new List<Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent>();
|
|
for (int i = 0; i < asmSpliceEvent.Length; i++)
|
|
{
|
|
itacSpliceEvent.Add(SpliceEventMapper.get(asmSpliceEvent[i]));
|
|
}
|
|
return itacSpliceEvent;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static SpliceEvent get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
SpliceEvent itacSpliceEvent = new SpliceEvent();
|
|
mapAsm2Itac(asmSpliceEvent, itacSpliceEvent);
|
|
return itacSpliceEvent;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent asmSpliceEvent, SpliceEvent itacSpliceEvent)
|
|
{
|
|
itacSpliceEvent.TableLocation = asmSpliceEvent.TableLocation;
|
|
itacSpliceEvent.Track = asmSpliceEvent.Track;
|
|
itacSpliceEvent.Division = asmSpliceEvent.Division;
|
|
itacSpliceEvent.ComponentName = asmSpliceEvent.ComponentName;
|
|
itacSpliceEvent.SpliceTime = asmSpliceEvent.SpliceTime;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static SpliceEvent[] getArray(IList<Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent> asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
SpliceEvent[] itacSpliceEvent = new SpliceEvent[asmSpliceEvent.Count];
|
|
for (int i = 0; i < asmSpliceEvent.Count; i++)
|
|
{
|
|
itacSpliceEvent[i] = SpliceEventMapper.get(asmSpliceEvent[i]);
|
|
}
|
|
return itacSpliceEvent;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static SpliceEvent[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.SpliceEvent[] asmSpliceEvent)
|
|
{
|
|
if (asmSpliceEvent == null) { return null; }
|
|
SpliceEvent[] itacSpliceEvent = new SpliceEvent[asmSpliceEvent.Length];
|
|
for (int i = 0; i < asmSpliceEvent.Length; i++)
|
|
{
|
|
itacSpliceEvent[i] = SpliceEventMapper.get(asmSpliceEvent[i]);
|
|
}
|
|
return itacSpliceEvent;
|
|
}
|
|
}
|
|
}
|