106 lines
5.2 KiB
C#
106 lines
5.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 06.11.2018 11:58:58
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.siplacesetupcenter.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACESetupCenter.Contracts
|
|
public class ComponentLocationMapper:FeederLocationMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation get(ComponentLocation itacComponentLocation)
|
|
{
|
|
if (itacComponentLocation == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation asmComponentLocation = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation();
|
|
mapItac2Asm(asmComponentLocation, itacComponentLocation);
|
|
return asmComponentLocation;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation asmComponentLocation, ComponentLocation itacComponentLocation)
|
|
{
|
|
asmComponentLocation.Division = itacComponentLocation.Division;
|
|
asmComponentLocation.Level = itacComponentLocation.Level;
|
|
asmComponentLocation.Tower = itacComponentLocation.Tower;
|
|
asmComponentLocation.StationTrack = itacComponentLocation.StationTrack;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation[] get(ComponentLocation[] itacComponentLocation)
|
|
{
|
|
if (itacComponentLocation == null) { return null; }
|
|
Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation[] asmComponentLocation = new Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation[itacComponentLocation.Length];
|
|
for (int i = 0; i < itacComponentLocation.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmComponentLocation[i] = ComponentLocationMapper.get(itacComponentLocation[i]);
|
|
}
|
|
return asmComponentLocation;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation> getList(ComponentLocation[] asmComponentLocation)
|
|
{
|
|
if (asmComponentLocation == null) { return null; }
|
|
List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation> itacComponentLocation = new List<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation>();
|
|
for (int i = 0; i < asmComponentLocation.Length; i++)
|
|
{
|
|
itacComponentLocation.Add(ComponentLocationMapper.get(asmComponentLocation[i]));
|
|
}
|
|
return itacComponentLocation;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static ComponentLocation get(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation asmComponentLocation)
|
|
{
|
|
if (asmComponentLocation == null) { return null; }
|
|
ComponentLocation itacComponentLocation = new ComponentLocation();
|
|
mapAsm2Itac(asmComponentLocation, itacComponentLocation);
|
|
return itacComponentLocation;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation asmComponentLocation, ComponentLocation itacComponentLocation)
|
|
{
|
|
FeederLocationMapper.mapAsm2Itac(asmComponentLocation, itacComponentLocation);
|
|
itacComponentLocation.Division = asmComponentLocation.Division;
|
|
itacComponentLocation.Level = asmComponentLocation.Level;
|
|
itacComponentLocation.Tower = asmComponentLocation.Tower;
|
|
itacComponentLocation.StationTrack = asmComponentLocation.StationTrack;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static ComponentLocation[] getArray(IList<Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation> asmComponentLocation)
|
|
{
|
|
if (asmComponentLocation == null) { return null; }
|
|
ComponentLocation[] itacComponentLocation = new ComponentLocation[asmComponentLocation.Count];
|
|
for (int i = 0; i < asmComponentLocation.Count; i++)
|
|
{
|
|
itacComponentLocation[i] = ComponentLocationMapper.get(asmComponentLocation[i]);
|
|
}
|
|
return itacComponentLocation;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static ComponentLocation[] getArray(Asm.As.Oib.SiplaceSetupCenter.Contracts.Data.ComponentLocation[] asmComponentLocation)
|
|
{
|
|
if (asmComponentLocation == null) { return null; }
|
|
ComponentLocation[] itacComponentLocation = new ComponentLocation[asmComponentLocation.Length];
|
|
for (int i = 0; i < asmComponentLocation.Length; i++)
|
|
{
|
|
itacComponentLocation[i] = ComponentLocationMapper.get(asmComponentLocation[i]);
|
|
}
|
|
return itacComponentLocation;
|
|
}
|
|
}
|
|
}
|