123 lines
7.9 KiB
C#
123 lines
7.9 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:10:38
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.linecontrol.contracts.data
|
|
{
|
|
// source: assembly 3.2.0.152
|
|
// source: assembly ASM.AS.OIB.SIPLACEPro.LineControl.Contracts
|
|
public class LineControlStationStatusMapper
|
|
{
|
|
// used for itac->asm: True
|
|
// used for asm->itac: True
|
|
|
|
// maps iTAC namespace conform type to ASM namespace type
|
|
public static Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus get(LineControlStationStatus itacLineControlStationStatus)
|
|
{
|
|
if (itacLineControlStationStatus == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus asmLineControlStationStatus = new Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus();
|
|
mapItac2Asm(asmLineControlStationStatus, itacLineControlStationStatus);
|
|
return asmLineControlStationStatus;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus asmLineControlStationStatus, LineControlStationStatus itacLineControlStationStatus)
|
|
{
|
|
asmLineControlStationStatus.Name = itacLineControlStationStatus.Name;
|
|
asmLineControlStationStatus.HostName = itacLineControlStationStatus.HostName;
|
|
asmLineControlStationStatus.HostIP = itacLineControlStationStatus.HostIP;
|
|
asmLineControlStationStatus.SoftwareVersion = itacLineControlStationStatus.SoftwareVersion;
|
|
asmLineControlStationStatus.IsEndOfCluster = itacLineControlStationStatus.IsEndOfCluster;
|
|
asmLineControlStationStatus.IsControlledByExternSystem = itacLineControlStationStatus.IsControlledByExternSystem;
|
|
asmLineControlStationStatus.ConnectionState = itacLineControlStationStatus.ConnectionState;
|
|
// complex property LeftConveyorStatus, isArray:False, isGeneric:False
|
|
asmLineControlStationStatus.LeftConveyorStatus = com.itac.oib.linecontrol.contracts.data.LineControlConveyorStatusMapper.get( itacLineControlStationStatus.LeftConveyorStatus);
|
|
// complex property RightConveyorStatus, isArray:False, isGeneric:False
|
|
asmLineControlStationStatus.RightConveyorStatus = com.itac.oib.linecontrol.contracts.data.LineControlConveyorStatusMapper.get( itacLineControlStationStatus.RightConveyorStatus);
|
|
asmLineControlStationStatus.SetupName = itacLineControlStationStatus.SetupName;
|
|
asmLineControlStationStatus.LastDownloadedSetupTimeStamp = itacLineControlStationStatus.LastDownloadedSetupTimeStamp;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus[] get(LineControlStationStatus[] itacLineControlStationStatus)
|
|
{
|
|
if (itacLineControlStationStatus == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus[] asmLineControlStationStatus = new Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus[itacLineControlStationStatus.Length];
|
|
for (int i = 0; i < itacLineControlStationStatus.Length; i++)
|
|
{
|
|
// to itac array
|
|
asmLineControlStationStatus[i] = LineControlStationStatusMapper.get(itacLineControlStationStatus[i]);
|
|
}
|
|
return asmLineControlStationStatus;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus> getList(LineControlStationStatus[] asmLineControlStationStatus)
|
|
{
|
|
if (asmLineControlStationStatus == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus> itacLineControlStationStatus = new List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus>();
|
|
for (int i = 0; i < asmLineControlStationStatus.Length; i++)
|
|
{
|
|
itacLineControlStationStatus.Add(LineControlStationStatusMapper.get(asmLineControlStationStatus[i]));
|
|
}
|
|
return itacLineControlStationStatus;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static LineControlStationStatus get(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus asmLineControlStationStatus)
|
|
{
|
|
if (asmLineControlStationStatus == null) { return null; }
|
|
LineControlStationStatus itacLineControlStationStatus = new LineControlStationStatus();
|
|
mapAsm2Itac(asmLineControlStationStatus, itacLineControlStationStatus);
|
|
return itacLineControlStationStatus;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus asmLineControlStationStatus, LineControlStationStatus itacLineControlStationStatus)
|
|
{
|
|
itacLineControlStationStatus.Name = asmLineControlStationStatus.Name;
|
|
itacLineControlStationStatus.HostName = asmLineControlStationStatus.HostName;
|
|
itacLineControlStationStatus.HostIP = asmLineControlStationStatus.HostIP;
|
|
itacLineControlStationStatus.SoftwareVersion = asmLineControlStationStatus.SoftwareVersion;
|
|
itacLineControlStationStatus.IsEndOfCluster = asmLineControlStationStatus.IsEndOfCluster;
|
|
itacLineControlStationStatus.IsControlledByExternSystem = asmLineControlStationStatus.IsControlledByExternSystem;
|
|
itacLineControlStationStatus.ConnectionState = asmLineControlStationStatus.ConnectionState;
|
|
itacLineControlStationStatus.LeftConveyorStatus = com.itac.oib.linecontrol.contracts.data.LineControlConveyorStatusMapper.get(asmLineControlStationStatus.LeftConveyorStatus);
|
|
// complex asm property LeftConveyorStatus
|
|
itacLineControlStationStatus.RightConveyorStatus = com.itac.oib.linecontrol.contracts.data.LineControlConveyorStatusMapper.get(asmLineControlStationStatus.RightConveyorStatus);
|
|
// complex asm property RightConveyorStatus
|
|
itacLineControlStationStatus.SetupName = asmLineControlStationStatus.SetupName;
|
|
itacLineControlStationStatus.LastDownloadedSetupTimeStamp = asmLineControlStationStatus.LastDownloadedSetupTimeStamp;
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static LineControlStationStatus[] getArray(IList<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus> asmLineControlStationStatus)
|
|
{
|
|
if (asmLineControlStationStatus == null) { return null; }
|
|
LineControlStationStatus[] itacLineControlStationStatus = new LineControlStationStatus[asmLineControlStationStatus.Count];
|
|
for (int i = 0; i < asmLineControlStationStatus.Count; i++)
|
|
{
|
|
itacLineControlStationStatus[i] = LineControlStationStatusMapper.get(asmLineControlStationStatus[i]);
|
|
}
|
|
return itacLineControlStationStatus;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static LineControlStationStatus[] getArray(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.LineControlStationStatus[] asmLineControlStationStatus)
|
|
{
|
|
if (asmLineControlStationStatus == null) { return null; }
|
|
LineControlStationStatus[] itacLineControlStationStatus = new LineControlStationStatus[asmLineControlStationStatus.Length];
|
|
for (int i = 0; i < asmLineControlStationStatus.Length; i++)
|
|
{
|
|
itacLineControlStationStatus[i] = LineControlStationStatusMapper.get(asmLineControlStationStatus[i]);
|
|
}
|
|
return itacLineControlStationStatus;
|
|
}
|
|
}
|
|
}
|