@enervance/insight-cim-model 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/converter/integral7/ConverterIntegral7.d.ts +4 -4
- package/dist/converter/integral7/config/db-config.d.ts +1 -1
- package/dist/converter/integral7/utils.d.ts +3 -3
- package/dist/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/converter/integral7/ConverterIntegral7.ts +4 -4
- package/src/converter/integral7/config/db-config.ts +1 -1
- package/src/converter/integral7/utils.ts +3 -3
- package/src/index.ts +1 -0
- package/test/integral7-converter/integral7-converter.tests.spec.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseVoltage, Bay, Diagram, IdentifiedObject, Model } from '../..';
|
|
2
2
|
import * as mysql from 'mysql';
|
|
3
|
-
import { MySQL,
|
|
3
|
+
import { MySQL, ConverterStatus } from './config/db-config';
|
|
4
4
|
import { StandortImpl } from './model/integral/Standort';
|
|
5
5
|
import { SchaltanlageImpl } from './model/integral/Schaltanlage';
|
|
6
6
|
import { SchaltanlagenabschnittImpl } from './model/integral/Schaltanlagenabschnitt';
|
|
@@ -52,9 +52,9 @@ export declare class ConverterIntegral7 {
|
|
|
52
52
|
vlUUID: string;
|
|
53
53
|
}[]>;
|
|
54
54
|
constructor();
|
|
55
|
-
init(mySqlConfig: MySQL): Promise<
|
|
56
|
-
convert(energyTypesConfig: any, tempDirPath: string): Promise<
|
|
57
|
-
release(tempDirPath?: string): Promise<
|
|
55
|
+
init(mySqlConfig: MySQL): Promise<ConverterStatus>;
|
|
56
|
+
convert(energyTypesConfig: any, tempDirPath: string): Promise<ConverterStatus>;
|
|
57
|
+
release(tempDirPath?: string): Promise<ConverterStatus>;
|
|
58
58
|
private getAvailableTableNames;
|
|
59
59
|
private queryObjectCount;
|
|
60
60
|
private queryAnschlussIDs;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { BaseClass, Belastung, Wicklung } from './model/interfaces';
|
|
3
3
|
import { BaseVoltage, ConductingEquipment, EquipmentContainer, IdentifiedObject, IIdentifiedObject, Line, Model, PowerTransformerEnd, PowerTransformerInfo, PSRType, Terminal, ThermalGeneratingUnit, WindingConnection } from '../..';
|
|
4
4
|
import JSZip from 'jszip';
|
|
5
|
-
import {
|
|
5
|
+
import { ConverterStatus } from './config/db-config';
|
|
6
6
|
export declare function ueberpruefeZeichenkette(str: string): string;
|
|
7
7
|
export declare function getName(object: BaseClass): string;
|
|
8
8
|
export declare function getLineByAttribute(cimModel: Model, lineAttribute: string, attributeInstance: string): Line | undefined;
|
|
@@ -31,11 +31,11 @@ export declare function getDescription(obejct: IdentifiedObject): string;
|
|
|
31
31
|
export declare function getNumber(value: any): number;
|
|
32
32
|
export declare function generateFuelType(name: string, type: String, generatingUnit: ThermalGeneratingUnit, cimModel: Model): void;
|
|
33
33
|
export declare function writeFile(filePath: string, data: any): void;
|
|
34
|
-
export declare function generateNodeStream(zip: JSZip): Promise<
|
|
34
|
+
export declare function generateNodeStream(zip: JSZip): Promise<ConverterStatus>;
|
|
35
35
|
export declare function writeZipFile(data: NodeJS.ReadableStream, path: string): Promise<any>;
|
|
36
36
|
export declare function determineEquipmentContainer(equipmentContainerType: string, cimModel: Model, equipmentContainer: EquipmentContainer): EquipmentContainer | undefined;
|
|
37
37
|
export declare function createTempDirPath(): Promise<unknown>;
|
|
38
38
|
export declare function getIntegral7IDs(cimObjects: Map<string, IIdentifiedObject>, UUID2IntegralID: Map<string, number[]>): number[];
|
|
39
39
|
export declare function putUUIDtoI7Ids(uuid: string, i7ID: number, UUID2IntegralID: Map<string, number[]>): void;
|
|
40
40
|
export declare function getPSRType(cimModel: Model, name: string): PSRType;
|
|
41
|
-
export declare function createWriteStreamPromise(writeStream: any): Promise<
|
|
41
|
+
export declare function createWriteStreamPromise(writeStream: any): Promise<ConverterStatus>;
|
package/dist/index.d.ts
CHANGED
|
@@ -174,3 +174,4 @@ export { createFeederLines, } from './etl-neplan/etl-neplan-feederline';
|
|
|
174
174
|
export { performContingencyAnalysis, } from './etl-neplan/etl-neplan-contingency-analysis';
|
|
175
175
|
export { ConverterPowerSystemDataModel } from './converter/PSDM/ConverterPowerSystemDataModel';
|
|
176
176
|
export { ConverterIntegral7 } from './converter/integral7/ConverterIntegral7';
|
|
177
|
+
export { MySQL, ConverterStatus } from './converter/integral7/config/db-config';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enervance/insight-cim-model",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "CIM data model",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"
|
|
8
|
+
"release": "rimraf dist && npm run build && npm publish",
|
|
9
9
|
"build": "rimraf dist && tsc && copyfiles -f src/package.json dist",
|
|
10
10
|
"test": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine/jasmine_all.json",
|
|
11
11
|
"test_fuseki_psdm": "ts-node node_modules/jasmine/bin/jasmine --config=jasmine/jasmine_fuseki_psdm.json",
|
|
@@ -155,7 +155,7 @@ import {
|
|
|
155
155
|
import { calculateImpedanzenTrafo3W } from './utils-trafo3w';
|
|
156
156
|
// import { FUEL_TYPE_CONFIG } from './config/generation-unit-fuel-types';
|
|
157
157
|
import { getNetzQuery, I7Objects, Integral7TableNames } from './sql/integral.sql';
|
|
158
|
-
import { MySQL,
|
|
158
|
+
import { MySQL, ConverterStatus } from './config/db-config';
|
|
159
159
|
import path from "path";
|
|
160
160
|
import fs from "fs";
|
|
161
161
|
|
|
@@ -275,7 +275,7 @@ export class ConverterIntegral7 {
|
|
|
275
275
|
this.availableTableNames = [];
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
async init(mySqlConfig: MySQL): Promise<
|
|
278
|
+
async init(mySqlConfig: MySQL): Promise<ConverterStatus> {
|
|
279
279
|
|
|
280
280
|
return new Promise(async (resolve, reject) => {
|
|
281
281
|
try {
|
|
@@ -297,7 +297,7 @@ export class ConverterIntegral7 {
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
async convert(energyTypesConfig: any, tempDirPath: string): Promise<
|
|
300
|
+
async convert(energyTypesConfig: any, tempDirPath: string): Promise<ConverterStatus> {
|
|
301
301
|
|
|
302
302
|
return new Promise(async (resolve, reject) => {
|
|
303
303
|
try {
|
|
@@ -1005,7 +1005,7 @@ export class ConverterIntegral7 {
|
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
1007
|
|
|
1008
|
-
async release(tempDirPath?: string): Promise<
|
|
1008
|
+
async release(tempDirPath?: string): Promise<ConverterStatus> {
|
|
1009
1009
|
return new Promise(async (resolve, reject) => {
|
|
1010
1010
|
try {
|
|
1011
1011
|
this.closeConnection();
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import fs from "fs";
|
|
29
29
|
import JSZip from 'jszip';
|
|
30
30
|
import path from "path";
|
|
31
|
-
import {
|
|
31
|
+
import { ConverterStatus } from './config/db-config';
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
export function ueberpruefeZeichenkette(str: string) {
|
|
@@ -549,7 +549,7 @@ export function writeFile(filePath: string, data: any) {
|
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
export function generateNodeStream(zip: JSZip): Promise<
|
|
552
|
+
export function generateNodeStream(zip: JSZip): Promise<ConverterStatus> {
|
|
553
553
|
return new Promise((resolve, reject) => {
|
|
554
554
|
try {
|
|
555
555
|
resolve({status: 'successful', message: 'ok', data: zip.generateNodeStream({type: 'nodebuffer', streamFiles: true})});
|
|
@@ -676,7 +676,7 @@ export function getPSRType(cimModel: Model, name: string): PSRType {
|
|
|
676
676
|
}
|
|
677
677
|
|
|
678
678
|
|
|
679
|
-
export async function createWriteStreamPromise(writeStream: any): Promise<
|
|
679
|
+
export async function createWriteStreamPromise(writeStream: any): Promise<ConverterStatus> {
|
|
680
680
|
return new Promise((resolve, reject) => {
|
|
681
681
|
writeStream.on('close', async () => {
|
|
682
682
|
resolve({status: 'successful', message: 'ok'});
|
package/src/index.ts
CHANGED
|
@@ -297,3 +297,4 @@ export {
|
|
|
297
297
|
|
|
298
298
|
export { ConverterPowerSystemDataModel } from './converter/PSDM/ConverterPowerSystemDataModel';
|
|
299
299
|
export { ConverterIntegral7 } from './converter/integral7/ConverterIntegral7';
|
|
300
|
+
export { MySQL, ConverterStatus } from './converter/integral7/config/db-config';
|
|
@@ -14,7 +14,7 @@ import { Status } from '../../src';
|
|
|
14
14
|
|
|
15
15
|
describe('Converter integral 7', () => {
|
|
16
16
|
let converter;
|
|
17
|
-
const dbName = '
|
|
17
|
+
const dbName = 'aintegraldb_00002'
|
|
18
18
|
// let conn;
|
|
19
19
|
beforeAll( async(done) => {
|
|
20
20
|
converter = new ConverterIntegral7();
|