nitro-converter/src/mapping/mappers/asset/IndexMapper.ts

23 lines
719 B
TypeScript
Raw Normal View History

2021-02-17 06:14:07 +01:00
import { IAssetData } from '../../json';
import { IndexXML } from '../../xml';
import { Mapper } from './Mapper';
export class IndexMapper extends Mapper
{
public static mapXML(index: any, output: IAssetData): void
{
if(!index || !output) return;
IndexMapper.mapIndexXML(new IndexXML(index.object), output);
}
private static mapIndexXML(indexXML: IndexXML, output: IAssetData): void
{
2021-02-18 07:03:08 +01:00
if(!indexXML || !output) return;
2021-02-17 06:14:07 +01:00
if(indexXML.type !== undefined) output.name = indexXML.type;
if(indexXML.logic !== undefined) output.logicType = indexXML.logic;
if(indexXML.visualization !== undefined) output.visualizationType = indexXML.visualization;
}
}