183 lines
10 KiB
C#
183 lines
10 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 02.11.2018 11:01:17
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace com.itac.oib.linecontrol.contracts.data
|
|
{
|
|
// source: assembly 5.1.0.84
|
|
// source: assembly ASM.AS.OIB.SIPLACEPro.LineControl.Contracts
|
|
public class MissingComponentsMapper
|
|
{
|
|
// 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.MissingComponents get(MissingComponents asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents itacMissingComponents = new Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents();
|
|
mapItac2Asm(itacMissingComponents, asmMissingComponents);
|
|
return itacMissingComponents;
|
|
}
|
|
|
|
public static void mapItac2Asm(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents itacMissingComponents, MissingComponents asmMissingComponents)
|
|
{
|
|
// skip readonly property MissingComponentsTotalCount
|
|
// complex property ComponentsNotKnownAtAll, isArray:False, isGeneric:True
|
|
// map Dictionary
|
|
itacMissingComponents.ComponentsNotKnownAtAll = getDictionary(asmMissingComponents.ComponentsNotKnownAtAll);
|
|
// complex property ComponentsSetUpOnWrongTable, isArray:False, isGeneric:True
|
|
// map Dictionary
|
|
itacMissingComponents.ComponentsSetUpOnWrongTable = getDictionary(asmMissingComponents.ComponentsSetUpOnWrongTable);
|
|
// complex property ComponentsKnownButNotSetUp, isArray:False, isGeneric:True
|
|
// map Dictionary
|
|
itacMissingComponents.ComponentsKnownButNotSetUp = getDictionary(asmMissingComponents.ComponentsKnownButNotSetUp);
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace array
|
|
public static Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents[] get(MissingComponents[] asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents[] itacMissingComponents = new Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents[asmMissingComponents.Length];
|
|
for (int i = 0; i < asmMissingComponents.Length; i++)
|
|
{
|
|
// to itac array
|
|
itacMissingComponents[i] = MissingComponentsMapper.get(asmMissingComponents[i]);
|
|
}
|
|
return itacMissingComponents;
|
|
}
|
|
|
|
// maps iTAC namespace conform array to ASM namespace list
|
|
public static List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents> getList(MissingComponents[] asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents> itacMissingComponents = new List<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents>();
|
|
for (int i = 0; i < asmMissingComponents.Length; i++)
|
|
{
|
|
itacMissingComponents.Add(MissingComponentsMapper.get(asmMissingComponents[i]));
|
|
}
|
|
return itacMissingComponents;
|
|
}
|
|
|
|
// map type from ASM namespace to iTAC namespace
|
|
public static MissingComponents get(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
MissingComponents itacMissingComponents = new MissingComponents();
|
|
mapAsm2Itac(asmMissingComponents, itacMissingComponents);
|
|
return itacMissingComponents;
|
|
}
|
|
|
|
public static void mapAsm2Itac(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents asmMissingComponents, MissingComponents itacMissingComponents)
|
|
{
|
|
itacMissingComponents.MissingComponentsTotalCount = asmMissingComponents.MissingComponentsTotalCount;
|
|
// assign Dictionary(): maps ASM Dictionary 2 iTAC dictionary
|
|
itacMissingComponents.ComponentsNotKnownAtAll = getComponentsNotKnownAtAllDictionary( asmMissingComponents.ComponentsNotKnownAtAll);
|
|
// assign Dictionary(): maps ASM Dictionary 2 iTAC dictionary
|
|
itacMissingComponents.ComponentsSetUpOnWrongTable = getComponentsSetUpOnWrongTableDictionary( asmMissingComponents.ComponentsSetUpOnWrongTable);
|
|
// assign Dictionary(): maps ASM Dictionary 2 iTAC dictionary
|
|
itacMissingComponents.ComponentsKnownButNotSetUp = getComponentsKnownButNotSetUpDictionary( asmMissingComponents.ComponentsKnownButNotSetUp);
|
|
}
|
|
|
|
// maps ASM namespace conform list to iTAC namespace array
|
|
public static MissingComponents[] getArray(IList<Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents> asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
MissingComponents[] itacMissingComponents = new MissingComponents[asmMissingComponents.Count];
|
|
for (int i = 0; i < asmMissingComponents.Count; i++)
|
|
{
|
|
itacMissingComponents[i] = MissingComponentsMapper.get(asmMissingComponents[i]);
|
|
}
|
|
return itacMissingComponents;
|
|
}
|
|
|
|
// maps ASM namespace conform array to iTAC namespace array
|
|
public static MissingComponents[] getArray(Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.MissingComponents[] asmMissingComponents)
|
|
{
|
|
if (asmMissingComponents == null) { return null; }
|
|
MissingComponents[] itacMissingComponents = new MissingComponents[asmMissingComponents.Length];
|
|
for (int i = 0; i < asmMissingComponents.Length; i++)
|
|
{
|
|
itacMissingComponents[i] = MissingComponentsMapper.get(asmMissingComponents[i]);
|
|
}
|
|
return itacMissingComponents;
|
|
}
|
|
// maps c# dictionary with ASM types to c# dictionary with java types
|
|
public static Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentNotKnownAtAll> getDictionary(Dictionary<String, ComponentNotKnownAtAll> dictionary)
|
|
{
|
|
Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentNotKnownAtAll> result = new Dictionary<String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentNotKnownAtAll>();
|
|
foreach (String key in dictionary.Keys)
|
|
{
|
|
result.Add(key, ComponentNotKnownAtAllMapper.get(dictionary[key]));
|
|
}
|
|
return result;
|
|
}
|
|
// maps c# dictionary with ASM types to c# dictionary with java types
|
|
public static Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentSetUpOnWrongTable> getDictionary(Dictionary<String, ComponentSetUpOnWrongTable> dictionary)
|
|
{
|
|
Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentSetUpOnWrongTable> result = new Dictionary<String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentSetUpOnWrongTable>();
|
|
foreach (String key in dictionary.Keys)
|
|
{
|
|
result.Add(key, ComponentSetUpOnWrongTableMapper.get(dictionary[key]));
|
|
}
|
|
return result;
|
|
}
|
|
// maps c# dictionary with ASM types to c# dictionary with java types
|
|
public static Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentKnownButNotSetUp> getDictionary(Dictionary<String, ComponentKnownButNotSetUp> dictionary)
|
|
{
|
|
Dictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentKnownButNotSetUp> result = new Dictionary<String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentKnownButNotSetUp>();
|
|
foreach (String key in dictionary.Keys)
|
|
{
|
|
result.Add(key, ComponentKnownButNotSetUpMapper.get(dictionary[key]));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// original declaration: System.Collections.Generic.Dictionary`2[System.String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentNotKnownAtAll]
|
|
// generate key / value array for dictionary
|
|
// generated dictionary mapper
|
|
private static Dictionary<String, ComponentNotKnownAtAll> getComponentsNotKnownAtAllDictionary(IDictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentNotKnownAtAll> componentsNotKnownAtAll)
|
|
{
|
|
Dictionary <String, ComponentNotKnownAtAll> result = new Dictionary<String, ComponentNotKnownAtAll>();
|
|
foreach (String key in componentsNotKnownAtAll.Keys)
|
|
{
|
|
result.Add(key, com.itac.oib.linecontrol.contracts.data.ComponentNotKnownAtAllMapper.get(componentsNotKnownAtAll[key]));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// original declaration: System.Collections.Generic.Dictionary`2[System.String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentSetUpOnWrongTable]
|
|
// generate key / value array for dictionary
|
|
// generated dictionary mapper
|
|
private static Dictionary<String, ComponentSetUpOnWrongTable> getComponentsSetUpOnWrongTableDictionary(IDictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentSetUpOnWrongTable> componentsSetUpOnWrongTable)
|
|
{
|
|
Dictionary <String, ComponentSetUpOnWrongTable> result = new Dictionary<String, ComponentSetUpOnWrongTable>();
|
|
foreach (String key in componentsSetUpOnWrongTable.Keys)
|
|
{
|
|
result.Add(key, com.itac.oib.linecontrol.contracts.data.ComponentSetUpOnWrongTableMapper.get(componentsSetUpOnWrongTable[key]));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// original declaration: System.Collections.Generic.Dictionary`2[System.String,Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentKnownButNotSetUp]
|
|
// generate key / value array for dictionary
|
|
// generated dictionary mapper
|
|
private static Dictionary<String, ComponentKnownButNotSetUp> getComponentsKnownButNotSetUpDictionary(IDictionary<String, Asm.As.Oib.SiplacePro.LineControl.Contracts.Data.ComponentKnownButNotSetUp> componentsKnownButNotSetUp)
|
|
{
|
|
Dictionary <String, ComponentKnownButNotSetUp> result = new Dictionary<String, ComponentKnownButNotSetUp>();
|
|
foreach (String key in componentsKnownButNotSetUp.Keys)
|
|
{
|
|
result.Add(key, com.itac.oib.linecontrol.contracts.data.ComponentKnownButNotSetUpMapper.get(componentsKnownButNotSetUp[key]));
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|