exceeddata-sdk-vdata 2.9.11 → 2.10.5-1

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/test/sdk_test.js CHANGED
@@ -1,82 +1,82 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var vdatasdktest_1 = require("exceeddata-sdk-vdata"); // Replace with your module name
4
- var fs = require("fs");
5
- var path = require("path");
6
- var uint8arry = [];
7
- var inputPath = 'test.stf'; // inputPath
8
- var outputPath = inputPath + ".csv";
9
- if (fs.statSync(inputPath).isDirectory()) {
10
- var dirArr = fs.readdirSync(inputPath);
11
- dirArr.forEach(function (item) {
12
- if (item.endsWith('.vsw') || item.endsWith('.stf')) {
13
- var itemPath = path.join(inputPath, item);
14
- console.log('read ' + item);
15
- var readInput = fs.readFileSync(itemPath);
16
- uint8arry.push(new vdatasdktest_1.VDataByteReader(new Uint8Array(readInput)));
17
- }
18
- });
19
- }
20
- else {
21
- var readInput = fs.readFileSync(inputPath);
22
- uint8arry.push(new vdatasdktest_1.VDataByteReader(new Uint8Array(readInput)));
23
- }
24
- var rfactory = new vdatasdktest_1.VDataReaderFactory();
25
- rfactory.setDataReaders(uint8arry);
26
- rfactory.setSignals("");
27
- rfactory.setQueryStartTime(0);
28
- rfactory.setQueryEndTime(0);
29
- rfactory.setReadLivingData(true);
30
- rfactory.setQueryFilter(true);
31
- rfactory.setColumnExpandMode(vdatasdktest_1.DExpand.FULL); //DExpand.FLAT,DExpand.NONE
32
- var vreader = rfactory.open();
33
- var dataframe = vreader.df();
34
- var keys = dataframe.cols(true);
35
- var type = "values";
36
- var values;
37
- var densifyRowsAhead = 0;
38
- var densifyOutputItv = 0;
39
- if (type === "values") {
40
- console.log("calling values() interface");
41
- values = dataframe.values(densifyRowsAhead, densifyOutputItv);
42
- }
43
- else if (type === "objects") {
44
- console.log("calling objects() interface");
45
- values = dataframe.objects(densifyRowsAhead, densifyOutputItv);
46
- }
47
- else if (type === "object1s") {
48
- console.log("calling object1s() interface");
49
- values = dataframe.object1s();
50
- }
51
- else {
52
- console.error("Unsupported type: ".concat(type, ", using values by default"));
53
- values = dataframe.values(densifyRowsAhead, densifyOutputItv);
54
- }
55
- console.log("keys number: ".concat(keys.length, ", row num: ").concat(values.length));
56
- var str = keys.join(", ") + "\n";
57
- for (var i = 0; i < Math.min(values.length, 200000); i++) {
58
- var row = values[i];
59
- var line = row.map(function (item) {
60
- if (item === null) {
61
- return "";
62
- }
63
- else if (item instanceof Buffer || item instanceof Uint8Array) {
64
- return "\"[".concat(Array.from(item).join(","), "]\"");
65
- }
66
- else if (Array.isArray(item)) {
67
- return "\"[".concat(item.join(","), "]\"");
68
- }
69
- else if (item instanceof Map) {
70
- var entries = Array.from(item.entries()).map(function (_a) {
71
- var key = _a[0], value = _a[1];
72
- return "'".concat(key, "':'").concat(value, "'");
73
- });
74
- return "\"{".concat(entries.join(", "), "}\"");
75
- }
76
- else {
77
- return item.toString();
78
- }
79
- }).join(",");
80
- str += line + "\n";
81
- }
82
- fs.writeFileSync(outputPath, str);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var vdatasdktest_1 = require("exceeddata-sdk-vdata"); // Replace with your module name
4
+ var fs = require("fs");
5
+ var path = require("path");
6
+ var uint8arry = [];
7
+ var inputPath = 'test.stf'; // inputPath
8
+ var outputPath = inputPath + ".csv";
9
+ if (fs.statSync(inputPath).isDirectory()) {
10
+ var dirArr = fs.readdirSync(inputPath);
11
+ dirArr.forEach(function (item) {
12
+ if (item.endsWith('.vsw') || item.endsWith('.stf')) {
13
+ var itemPath = path.join(inputPath, item);
14
+ console.log('read ' + item);
15
+ var readInput = fs.readFileSync(itemPath);
16
+ uint8arry.push(new vdatasdktest_1.VDataByteReader(new Uint8Array(readInput)));
17
+ }
18
+ });
19
+ }
20
+ else {
21
+ var readInput = fs.readFileSync(inputPath);
22
+ uint8arry.push(new vdatasdktest_1.VDataByteReader(new Uint8Array(readInput)));
23
+ }
24
+ var rfactory = new vdatasdktest_1.VDataReaderFactory();
25
+ rfactory.setDataReaders(uint8arry);
26
+ rfactory.setSignals("");
27
+ rfactory.setQueryStartTime(0);
28
+ rfactory.setQueryEndTime(0);
29
+ rfactory.setReadLivingData(true);
30
+ rfactory.setQueryFilter(true);
31
+ rfactory.setColumnExpandMode(vdatasdktest_1.DExpand.FULL); //DExpand.FLAT,DExpand.NONE
32
+ var vreader = rfactory.open();
33
+ var dataframe = vreader.df();
34
+ var keys = dataframe.cols(true);
35
+ var type = "values";
36
+ var values;
37
+ var densifyRowsAhead = 0;
38
+ var densifyOutputItv = 0;
39
+ if (type === "values") {
40
+ console.log("calling values() interface");
41
+ values = dataframe.values(densifyRowsAhead, densifyOutputItv);
42
+ }
43
+ else if (type === "objects") {
44
+ console.log("calling objects() interface");
45
+ values = dataframe.objects(densifyRowsAhead, densifyOutputItv);
46
+ }
47
+ else if (type === "object1s") {
48
+ console.log("calling object1s() interface");
49
+ values = dataframe.object1s();
50
+ }
51
+ else {
52
+ console.error("Unsupported type: ".concat(type, ", using values by default"));
53
+ values = dataframe.values(densifyRowsAhead, densifyOutputItv);
54
+ }
55
+ console.log("keys number: ".concat(keys.length, ", row num: ").concat(values.length));
56
+ var str = keys.join(", ") + "\n";
57
+ for (var i = 0; i < Math.min(values.length, 200000); i++) {
58
+ var row = values[i];
59
+ var line = row.map(function (item) {
60
+ if (item === null) {
61
+ return "";
62
+ }
63
+ else if (item instanceof Buffer || item instanceof Uint8Array) {
64
+ return "\"[".concat(Array.from(item).join(","), "]\"");
65
+ }
66
+ else if (Array.isArray(item)) {
67
+ return "\"[".concat(item.join(","), "]\"");
68
+ }
69
+ else if (item instanceof Map) {
70
+ var entries = Array.from(item.entries()).map(function (_a) {
71
+ var key = _a[0], value = _a[1];
72
+ return "'".concat(key, "':'").concat(value, "'");
73
+ });
74
+ return "\"{".concat(entries.join(", "), "}\"");
75
+ }
76
+ else {
77
+ return item.toString();
78
+ }
79
+ }).join(",");
80
+ str += line + "\n";
81
+ }
82
+ fs.writeFileSync(outputPath, str);
@@ -1,8 +1,8 @@
1
- export function sprintf(key: any, ...args: any[]): string;
2
- export function vsprintf(fmt: any, argv: any): any;
3
- export class VswToAscConverter {
4
- convert(reader: any, colParser: any): string;
5
- }
6
- export class VswToBlfConverter {
7
- convert(reader: any, colParser: any): any;
8
- }
1
+ export function sprintf(key: any, ...args: any[]): string;
2
+ export function vsprintf(fmt: any, argv: any): any;
3
+ export class VswToAscConverter {
4
+ convert(reader: any, colParser: any): string;
5
+ }
6
+ export class VswToBlfConverter {
7
+ convert(reader: any, colParser: any): any;
8
+ }
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./vdata-2.9.0";
2
- export * from "./blf-2.9.0";
1
+ export * from "./vdata-2.10.0";
2
+ export * from "./blf-2.10.0";