Add stuff skelly missed

This commit is contained in:
Bill 2021-08-03 14:07:45 -04:00
parent 3127b33eb5
commit e6a7f3dde5
11 changed files with 109 additions and 27 deletions

View File

@ -6,6 +6,7 @@
"typescript.format.placeOpenBraceOnNewLineForFunctions": true, "typescript.format.placeOpenBraceOnNewLineForFunctions": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll": true, "source.fixAll": true,
"source.fixAll.sortJSON": false,
"source.organizeImports": true, "source.organizeImports": true,
}, },
"emmet.showExpandedAbbreviation": "never", "emmet.showExpandedAbbreviation": "never",

View File

@ -0,0 +1,4 @@
export interface IFigureDataHiddenLayer
{
partType?: string;
}

View File

@ -1,12 +1,15 @@
import { IFigureDataHiddenLayer } from './IFigureDataHiddenLayer';
import { IFigureDataPart } from './IFigureDataPart'; import { IFigureDataPart } from './IFigureDataPart';
export interface IFigureDataSet export interface IFigureDataSet
{ {
id?: number; id?: number;
gender?: string; gender?: string;
club?: boolean; club?: number;
colorable?: boolean; colorable?: boolean;
selectable?: boolean; selectable?: boolean;
preselectable?: boolean; preselectable?: boolean;
sellable?: boolean;
parts?: IFigureDataPart[]; parts?: IFigureDataPart[];
hiddenLayers?: IFigureDataHiddenLayer[];
} }

View File

@ -1,5 +1,6 @@
export * from './IFigureData'; export * from './IFigureData';
export * from './IFigureDataColor'; export * from './IFigureDataColor';
export * from './IFigureDataHiddenLayer';
export * from './IFigureDataPalette'; export * from './IFigureDataPalette';
export * from './IFigureDataPart'; export * from './IFigureDataPart';
export * from './IFigureDataSet'; export * from './IFigureDataSet';

View File

@ -1,5 +1,7 @@
import { IFigureDataHiddenLayer } from '../json';
import { IFigureDataPalette } from '../json/figuredata/IFigureDataPalette'; import { IFigureDataPalette } from '../json/figuredata/IFigureDataPalette';
import { IFigureDataSet } from '../json/figuredata/IFigureDataSet'; import { IFigureDataSet } from '../json/figuredata/IFigureDataSet';
import { FigureDataHiddenLayerXML } from '../xml';
import { FigureDataColorXML } from '../xml/figuredata/FigureDataColorXML'; import { FigureDataColorXML } from '../xml/figuredata/FigureDataColorXML';
import { FigureDataPaletteXML } from '../xml/figuredata/FigureDataPaletteXML'; import { FigureDataPaletteXML } from '../xml/figuredata/FigureDataPaletteXML';
import { FigureDataXML } from '../xml/figuredata/FigureDataXML'; import { FigureDataXML } from '../xml/figuredata/FigureDataXML';
@ -131,6 +133,7 @@ export class FigureDataMapper extends Mapper
if(setXML.colorable !== undefined) setType.colorable = setXML.colorable; if(setXML.colorable !== undefined) setType.colorable = setXML.colorable;
if(setXML.selectable !== undefined) setType.selectable = setXML.selectable; if(setXML.selectable !== undefined) setType.selectable = setXML.selectable;
if(setXML.preselectable !== undefined) setType.preselectable = setXML.preselectable; if(setXML.preselectable !== undefined) setType.preselectable = setXML.preselectable;
if(setXML.sellable !== undefined) setType.sellable = setXML.sellable;
if(setXML.parts !== undefined) if(setXML.parts !== undefined)
{ {
@ -142,6 +145,16 @@ export class FigureDataMapper extends Mapper
} }
} }
if(setXML.hiddenLayers !== undefined)
{
if(setXML.hiddenLayers.length)
{
setType.hiddenLayers = [];
FigureDataMapper.mapFigureDataHiddenLayers(setXML.hiddenLayers, setType.hiddenLayers);
}
}
output.push(setType); output.push(setType);
} }
} }
@ -163,4 +176,18 @@ export class FigureDataMapper extends Mapper
output.push(part); output.push(part);
} }
} }
private static mapFigureDataHiddenLayers(xml: FigureDataHiddenLayerXML[], output: IFigureDataHiddenLayer[]): void
{
if(!xml || !xml.length || !output) return;
for(const hiddenLayerXML of xml)
{
const hiddenLayer: IFigureDataHiddenLayer = {};
if(hiddenLayerXML.partType !== undefined) hiddenLayer.partType = hiddenLayerXML.partType;
output.push(hiddenLayer);
}
}
} }

View File

@ -0,0 +1,16 @@
export class FigureDataHiddenLayerXML
{
private _partType: string;
constructor(xml: any)
{
const attributes = xml.$;
this._partType = ((attributes && attributes.parttype) || '');
}
public get partType(): string
{
return this._partType;
}
}

View File

@ -1,14 +1,17 @@
import { FigureDataHiddenLayerXML } from './FigureDataHiddenLayerXML';
import { FigureDataPartXML } from './FigureDataPartXML'; import { FigureDataPartXML } from './FigureDataPartXML';
export class FigureDataSetXML export class FigureDataSetXML
{ {
private _id: number; private _id: number;
private _gender: string; private _gender: string;
private _club: boolean; private _club: number;
private _colorable: boolean; private _colorable: boolean;
private _selectable: boolean; private _selectable: boolean;
private _preselectable: boolean; private _preselectable: boolean;
private _sellable: boolean;
private _parts: FigureDataPartXML[]; private _parts: FigureDataPartXML[];
private _hiddenLayers: FigureDataHiddenLayerXML[];
constructor(xml: any) constructor(xml: any)
{ {
@ -16,10 +19,11 @@ export class FigureDataSetXML
this._id = ((attributes && parseInt(attributes.id)) || 0); this._id = ((attributes && parseInt(attributes.id)) || 0);
this._gender = ((attributes && attributes.gender) || ''); this._gender = ((attributes && attributes.gender) || '');
this._club = ((attributes && parseInt(attributes.club) === 1) || false); this._club = ((attributes && parseInt(attributes.club)) || 0);
this._colorable = ((attributes && parseInt(attributes.colorable) === 1) || false); this._colorable = ((attributes && parseInt(attributes.colorable) === 1) || false);
this._selectable = ((attributes && parseInt(attributes.selectable) === 1) || false); this._selectable = ((attributes && parseInt(attributes.selectable) === 1) || false);
this._preselectable = ((attributes && parseInt(attributes.preselectable) === 1) || false); this._preselectable = ((attributes && parseInt(attributes.preselectable) === 1) || false);
this._sellable = ((attributes && parseInt(attributes.sellable) === 1) || false);
if(xml.part !== undefined) if(xml.part !== undefined)
{ {
@ -35,6 +39,21 @@ export class FigureDataSetXML
} }
} }
} }
if(xml.hiddenlayers !== undefined)
{
this._hiddenLayers = [];
for(const hiddenLayer of xml.hiddenlayers)
{
const layers = hiddenLayer.layer;
if(layers !== undefined)
{
if(Array.isArray(layers)) for(const layer of layers) this._hiddenLayers.push(new FigureDataHiddenLayerXML(layer));
}
}
}
} }
public get id(): number public get id(): number
@ -47,7 +66,7 @@ export class FigureDataSetXML
return this._gender; return this._gender;
} }
public get club(): boolean public get club(): number
{ {
return this._club; return this._club;
} }
@ -67,8 +86,18 @@ export class FigureDataSetXML
return this._preselectable; return this._preselectable;
} }
public get sellable(): boolean
{
return this._sellable;
}
public get parts(): FigureDataPartXML[] public get parts(): FigureDataPartXML[]
{ {
return this._parts; return this._parts;
} }
public get hiddenLayers(): FigureDataHiddenLayerXML[]
{
return this._hiddenLayers;
}
} }

View File

@ -1,4 +1,5 @@
export * from './FigureDataColorXML'; export * from './FigureDataColorXML';
export * from './FigureDataHiddenLayerXML';
export * from './FigureDataPaletteXML'; export * from './FigureDataPaletteXML';
export * from './FigureDataPartXML'; export * from './FigureDataPartXML';
export * from './FigureDataSetTypeXML'; export * from './FigureDataSetTypeXML';