@mlightcad/cad-simple-viewer 1.5.8 → 1.5.9
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/README.md +12 -4
- package/dist/cad-simple-viewer.js +8556 -6655
- package/dist/cad-simple-viewer.umd.cjs +200 -37
- package/dist/libredwg-parser-worker.js +2061 -2059
- package/dist/mtext-renderer-worker.js +1878 -1865
- package/lib/app/AcApBrand.d.ts +36 -0
- package/lib/app/AcApBrand.d.ts.map +1 -0
- package/lib/app/AcApBrand.js +63 -0
- package/lib/app/AcApBrand.js.map +1 -0
- package/lib/app/AcApBusyIndicator.d.ts.map +1 -1
- package/lib/app/AcApBusyIndicator.js +2 -2
- package/lib/app/AcApBusyIndicator.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +11 -15
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +60 -35
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApOpenFileDialog.d.ts.map +1 -1
- package/lib/app/AcApOpenFileDialog.js +8 -4
- package/lib/app/AcApOpenFileDialog.js.map +1 -1
- package/lib/app/AcApOpenFileProfiler.d.ts +58 -0
- package/lib/app/AcApOpenFileProfiler.d.ts.map +1 -0
- package/lib/app/AcApOpenFileProfiler.js +353 -0
- package/lib/app/AcApOpenFileProfiler.js.map +1 -0
- package/lib/app/AcApOpenFileProgressController.d.ts +12 -0
- package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
- package/lib/app/AcApOpenFileProgressController.js +85 -5
- package/lib/app/AcApOpenFileProgressController.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +9 -2
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +40 -12
- package/lib/app/AcApProgress.js.map +1 -1
- package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -1
- package/lib/app/AcApWebworkerReadiness.js +6 -7
- package/lib/app/AcApWebworkerReadiness.js.map +1 -1
- package/lib/app/AcApWorkerAssets.d.ts +27 -0
- package/lib/app/AcApWorkerAssets.d.ts.map +1 -0
- package/lib/app/AcApWorkerAssets.js +27 -0
- package/lib/app/AcApWorkerAssets.js.map +1 -0
- package/lib/app/index.d.ts +3 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +3 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApAboutCmd.d.ts +21 -0
- package/lib/command/AcApAboutCmd.d.ts.map +1 -0
- package/lib/command/AcApAboutCmd.js +119 -0
- package/lib/command/AcApAboutCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +6 -4
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/convert/AcApConvertToPngCmd.js +1 -1
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
- package/lib/command/convert/AcApDxfConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApDxfConvertor.js +2 -1
- package/lib/command/convert/AcApDxfConvertor.js.map +1 -1
- package/lib/command/convert/AcApEntityPreviewCmd.js +1 -1
- package/lib/command/convert/AcApEntityPreviewCmd.js.map +1 -1
- package/lib/command/draw/AcApHatchCmd.js +12 -10
- package/lib/command/draw/AcApHatchCmd.js.map +1 -1
- package/lib/command/draw/AcApImageAttachCmd.js +2 -2
- package/lib/command/draw/AcApImageAttachCmd.js.map +1 -1
- package/lib/command/draw/AcApInsertCmd.js +2 -2
- package/lib/command/draw/AcApInsertCmd.js.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.js +3 -1
- package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
- package/lib/command/draw/AcApXAttachCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApXAttachCmd.js +10 -5
- package/lib/command/draw/AcApXAttachCmd.js.map +1 -1
- package/lib/command/index.d.ts +1 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +1 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApCopyCmd.js +6 -2
- package/lib/command/modify/AcApCopyCmd.js.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.js +1 -4
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
- package/lib/editor/global/AcEdUiTheme.d.ts +12 -0
- package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiTheme.js +26 -0
- package/lib/editor/global/AcEdUiTheme.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +5 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +5 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +20 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptOptions.js +29 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +18 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +49 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +5 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +6 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +3 -1
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +1 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +2 -1
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/cs/command.d.ts +390 -0
- package/lib/i18n/cs/command.d.ts.map +1 -0
- package/lib/i18n/cs/command.js +389 -0
- package/lib/i18n/cs/command.js.map +1 -0
- package/lib/i18n/cs/jig.d.ts +2 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -0
- package/lib/i18n/cs/jig.js +7 -0
- package/lib/i18n/cs/jig.js.map +1 -0
- package/lib/i18n/cs/main.d.ts +58 -0
- package/lib/i18n/cs/main.d.ts.map +1 -0
- package/lib/i18n/cs/main.js +57 -0
- package/lib/i18n/cs/main.js.map +1 -0
- package/lib/i18n/en/command.d.ts +49 -1
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +49 -1
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/main.d.ts +11 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +11 -0
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +8 -0
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +49 -1
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +49 -1
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +11 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +11 -0
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +49 -1
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +49 -1
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +11 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +11 -0
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/ui/AcUiAboutDialog.d.ts +25 -0
- package/lib/ui/AcUiAboutDialog.d.ts.map +1 -0
- package/lib/ui/AcUiAboutDialog.js +120 -0
- package/lib/ui/AcUiAboutDialog.js.map +1 -0
- package/lib/ui/AcUiDialog.d.ts +101 -0
- package/lib/ui/AcUiDialog.d.ts.map +1 -0
- package/lib/ui/AcUiDialog.js +182 -0
- package/lib/ui/AcUiDialog.js.map +1 -0
- package/lib/ui/index.d.ts +3 -0
- package/lib/ui/index.d.ts.map +1 -0
- package/lib/ui/index.js +3 -0
- package/lib/ui/index.js.map +1 -0
- package/lib/util/index.d.ts +0 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +0 -1
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcTrEntityDisplayController.d.ts +9 -0
- package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -1
- package/lib/view/AcTrEntityDisplayController.js +18 -5
- package/lib/view/AcTrEntityDisplayController.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +19 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +79 -9
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrProgressiveOpenFitController.d.ts +1 -4
- package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -1
- package/lib/view/AcTrProgressiveOpenFitController.js +3 -8
- package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +4 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +79 -44
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +23 -3
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +145 -57
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +8 -9
- package/dist/dxf-parser-worker.js +0 -2357
- package/lib/util/yieldToMain.d.ts +0 -5
- package/lib/util/yieldToMain.d.ts.map +0 -1
- package/lib/util/yieldToMain.js +0 -11
- package/lib/util/yieldToMain.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApOpenFileDialog.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileDialog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAKxE;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GACxC,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0EAA0E;IAC1E,uBAAuB,CAAC,EAAE,MACtB,uBAAuB,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACrC;
|
|
1
|
+
{"version":3,"file":"AcApOpenFileDialog.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileDialog.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAKxE;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GACxC,uBAAuB,GACvB,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAEtE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,0EAA0E;IAC1E,uBAAuB,CAAC,EAAE,MACtB,uBAAuB,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACrC;AA2GD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,yBAA8B,QASxC;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,yBAAyB,QAGnC;AAED,0EAA0E;AAC1E,wBAAgB,2BAA2B,SAS1C"}
|
|
@@ -125,9 +125,10 @@ var onFileChange = function (event) { return __awaiter(void 0, void 0, void 0, f
|
|
|
125
125
|
log.warn("Unsupported file type: ".concat(file.name));
|
|
126
126
|
return [2 /*return*/];
|
|
127
127
|
}
|
|
128
|
+
content = null;
|
|
128
129
|
_c.label = 1;
|
|
129
130
|
case 1:
|
|
130
|
-
_c.trys.push([1, 6, ,
|
|
131
|
+
_c.trys.push([1, 6, 7, 8]);
|
|
131
132
|
return [4 /*yield*/, readFileAsArrayBuffer(file)];
|
|
132
133
|
case 2:
|
|
133
134
|
content = _c.sent();
|
|
@@ -143,12 +144,15 @@ var onFileChange = function (event) { return __awaiter(void 0, void 0, void 0, f
|
|
|
143
144
|
return [4 /*yield*/, AcApDocManager.instance.openDocument(file.name, content, options)];
|
|
144
145
|
case 5:
|
|
145
146
|
_c.sent();
|
|
146
|
-
return [3 /*break*/,
|
|
147
|
+
return [3 /*break*/, 8];
|
|
147
148
|
case 6:
|
|
148
149
|
error_1 = _c.sent();
|
|
149
150
|
log.error('Failed to open selected file:', error_1);
|
|
150
|
-
return [3 /*break*/,
|
|
151
|
-
case 7:
|
|
151
|
+
return [3 /*break*/, 8];
|
|
152
|
+
case 7:
|
|
153
|
+
content = null;
|
|
154
|
+
return [7 /*endfinally*/];
|
|
155
|
+
case 8: return [2 /*return*/];
|
|
152
156
|
}
|
|
153
157
|
});
|
|
154
158
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApOpenFileDialog.js","sourceRoot":"","sources":["../../src/app/AcApOpenFileDialog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAG1D,iEAAiE;AACjE,IAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAwBtD,wEAAwE;AACxE,IAAI,SAAuC,CAAA;AAC3C,yFAAyF;AACzF,IAAI,SAAS,GAAG,KAAK,CAAA;AACrB,kEAAkE;AAClE,IAAI,cAAc,GAA8B,EAAE,CAAA;AAElD;;;;;GAKG;AACH,IAAM,kBAAkB,GAAG,UAAC,QAAgB;IAC1C,IAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;IACxC,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAvB,CAAuB,CAAC,CAAA;AAClE,CAAC,CAAA;AAED;;;;;GAKG;AACH,IAAM,qBAAqB,GAAG,UAAC,IAAU;IACvC,OAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAC1B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAA;QAC/B,MAAM,CAAC,MA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AAC1E,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,SAAS;QAAE,OAAM;IAEtB,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IACrC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IACtD,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,EAAE,CAAA;IACnB,SAAS,GAAG,SAAS,CAAA;IACrB,SAAS,GAAG,KAAK,CAAA;IACjB,cAAc,GAAG,EAAE,CAAA;AACrB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AcDbDatabase } from '@mlightcad/data-model';
|
|
2
|
+
import type { AcTrView2d } from '../view/AcTrView2d';
|
|
3
|
+
/**
|
|
4
|
+
* Session open-file profiler gated by the {@link AcDbSystemVariables.OPENPROF}
|
|
5
|
+
* system variable.
|
|
6
|
+
*
|
|
7
|
+
* When enabled, records PARSE/FONT/ENTITY (and other `openProgress` sub-stages),
|
|
8
|
+
* wall-clock read vs scene convert time, and {@link AcDbRenderingCache} hit/miss
|
|
9
|
+
* counters, then prints a console summary once the view finishes converting
|
|
10
|
+
* entities (`isProcessingEntities === false`).
|
|
11
|
+
*
|
|
12
|
+
* Stage durations use **active-stage wall time**: from the first event of a
|
|
13
|
+
* sub-stage until the first event of a different sub-stage. This matches the
|
|
14
|
+
* UI overlay (e.g. font download that continues after a converter emits
|
|
15
|
+
* `FONT`/`END` prematurely) better than START→END alone.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AcApOpenFileProfiler {
|
|
18
|
+
private _active;
|
|
19
|
+
private _t0;
|
|
20
|
+
private _readEndMs;
|
|
21
|
+
private _stages;
|
|
22
|
+
private _activeStage?;
|
|
23
|
+
private _activeStageStartedAt;
|
|
24
|
+
private _progressListener?;
|
|
25
|
+
private _database?;
|
|
26
|
+
private _finishScheduled;
|
|
27
|
+
/**
|
|
28
|
+
* Returns whether OPENPROF is currently enabled for `database`.
|
|
29
|
+
*/
|
|
30
|
+
static isEnabled(database: AcDbDatabase): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Starts a profiling session if OPENPROF is on.
|
|
33
|
+
*
|
|
34
|
+
* Call from document-open start (before `db.read` / URI open). Safe to call
|
|
35
|
+
* when profiling is off — it becomes a no-op.
|
|
36
|
+
*
|
|
37
|
+
* @param database - Database that will emit `openProgress` for this open.
|
|
38
|
+
*/
|
|
39
|
+
begin(database: AcDbDatabase): void;
|
|
40
|
+
/**
|
|
41
|
+
* Marks the end of `db.read` / document open await and schedules the console
|
|
42
|
+
* report once the view has finished converting entities.
|
|
43
|
+
*
|
|
44
|
+
* @param view - Active 2d view whose entity convert queue is drained.
|
|
45
|
+
*/
|
|
46
|
+
markReadCompleteAndScheduleReport(view: AcTrView2d): void;
|
|
47
|
+
/**
|
|
48
|
+
* Aborts an in-flight session without printing (e.g. document replaced).
|
|
49
|
+
*/
|
|
50
|
+
cancel(): void;
|
|
51
|
+
private onProgress;
|
|
52
|
+
private closeActiveStage;
|
|
53
|
+
private scheduleReport;
|
|
54
|
+
private waitForIdle;
|
|
55
|
+
private printReport;
|
|
56
|
+
private detachProgressListener;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=AcApOpenFileProfiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApOpenFileProfiler.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileProfiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAMb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAMpD;;;;;;;;;;;;;GAaG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,GAAG,CAAI;IACf,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,qBAAqB,CAAI;IACjC,OAAO,CAAC,iBAAiB,CAAC,CAAwC;IAClE,OAAO,CAAC,SAAS,CAAC,CAAc;IAChC,OAAO,CAAC,gBAAgB,CAAQ;IAEhC;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAajD;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAwBnC;;;;;OAKG;IACH,iCAAiC,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAQzD;;OAEG;IACH,MAAM,IAAI,IAAI;IAYd,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,cAAc;YAmBR,WAAW;IAkBzB,OAAO,CAAC,WAAW;IAkFnB,OAAO,CAAC,sBAAsB;CAQ/B"}
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
49
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
50
|
+
if (!m) return o;
|
|
51
|
+
var i = m.call(o), r, ar = [], e;
|
|
52
|
+
try {
|
|
53
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
54
|
+
}
|
|
55
|
+
catch (error) { e = { error: error }; }
|
|
56
|
+
finally {
|
|
57
|
+
try {
|
|
58
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
59
|
+
}
|
|
60
|
+
finally { if (e) throw e.error; }
|
|
61
|
+
}
|
|
62
|
+
return ar;
|
|
63
|
+
};
|
|
64
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
65
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
66
|
+
if (ar || !(i in from)) {
|
|
67
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
68
|
+
ar[i] = from[i];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
72
|
+
};
|
|
73
|
+
var __values = (this && this.__values) || function(o) {
|
|
74
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
75
|
+
if (m) return m.call(o);
|
|
76
|
+
if (o && typeof o.length === "number") return {
|
|
77
|
+
next: function () {
|
|
78
|
+
if (o && i >= o.length) o = void 0;
|
|
79
|
+
return { value: o && o[i++], done: !o };
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
83
|
+
};
|
|
84
|
+
import { AcCmPerformanceCollector, AcDbRenderingCache, AcDbSystemVariables, AcDbSysVarManager, log } from '@mlightcad/data-model';
|
|
85
|
+
/**
|
|
86
|
+
* Session open-file profiler gated by the {@link AcDbSystemVariables.OPENPROF}
|
|
87
|
+
* system variable.
|
|
88
|
+
*
|
|
89
|
+
* When enabled, records PARSE/FONT/ENTITY (and other `openProgress` sub-stages),
|
|
90
|
+
* wall-clock read vs scene convert time, and {@link AcDbRenderingCache} hit/miss
|
|
91
|
+
* counters, then prints a console summary once the view finishes converting
|
|
92
|
+
* entities (`isProcessingEntities === false`).
|
|
93
|
+
*
|
|
94
|
+
* Stage durations use **active-stage wall time**: from the first event of a
|
|
95
|
+
* sub-stage until the first event of a different sub-stage. This matches the
|
|
96
|
+
* UI overlay (e.g. font download that continues after a converter emits
|
|
97
|
+
* `FONT`/`END` prematurely) better than START→END alone.
|
|
98
|
+
*/
|
|
99
|
+
var AcApOpenFileProfiler = /** @class */ (function () {
|
|
100
|
+
function AcApOpenFileProfiler() {
|
|
101
|
+
this._active = false;
|
|
102
|
+
this._t0 = 0;
|
|
103
|
+
this._readEndMs = 0;
|
|
104
|
+
this._stages = new Map();
|
|
105
|
+
this._activeStageStartedAt = 0;
|
|
106
|
+
this._finishScheduled = false;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns whether OPENPROF is currently enabled for `database`.
|
|
110
|
+
*/
|
|
111
|
+
AcApOpenFileProfiler.isEnabled = function (database) {
|
|
112
|
+
try {
|
|
113
|
+
return (AcDbSysVarManager.instance().getVar(AcDbSystemVariables.OPENPROF, database) === true);
|
|
114
|
+
}
|
|
115
|
+
catch (_a) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Starts a profiling session if OPENPROF is on.
|
|
121
|
+
*
|
|
122
|
+
* Call from document-open start (before `db.read` / URI open). Safe to call
|
|
123
|
+
* when profiling is off — it becomes a no-op.
|
|
124
|
+
*
|
|
125
|
+
* @param database - Database that will emit `openProgress` for this open.
|
|
126
|
+
*/
|
|
127
|
+
AcApOpenFileProfiler.prototype.begin = function (database) {
|
|
128
|
+
var _this = this;
|
|
129
|
+
this.cancel();
|
|
130
|
+
if (!AcApOpenFileProfiler.isEnabled(database)) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this._active = true;
|
|
134
|
+
this._finishScheduled = false;
|
|
135
|
+
this._t0 = performance.now();
|
|
136
|
+
this._readEndMs = 0;
|
|
137
|
+
this._stages.clear();
|
|
138
|
+
this._activeStage = undefined;
|
|
139
|
+
this._activeStageStartedAt = 0;
|
|
140
|
+
this._database = database;
|
|
141
|
+
AcDbRenderingCache.resetProfile();
|
|
142
|
+
AcDbRenderingCache.profiling = true;
|
|
143
|
+
this._progressListener = function (args) {
|
|
144
|
+
_this.onProgress(args);
|
|
145
|
+
};
|
|
146
|
+
database.events.openProgress.addEventListener(this._progressListener);
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Marks the end of `db.read` / document open await and schedules the console
|
|
150
|
+
* report once the view has finished converting entities.
|
|
151
|
+
*
|
|
152
|
+
* @param view - Active 2d view whose entity convert queue is drained.
|
|
153
|
+
*/
|
|
154
|
+
AcApOpenFileProfiler.prototype.markReadCompleteAndScheduleReport = function (view) {
|
|
155
|
+
if (!this._active) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this._readEndMs = performance.now();
|
|
159
|
+
this.scheduleReport(view);
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Aborts an in-flight session without printing (e.g. document replaced).
|
|
163
|
+
*/
|
|
164
|
+
AcApOpenFileProfiler.prototype.cancel = function () {
|
|
165
|
+
this.detachProgressListener();
|
|
166
|
+
if (this._active) {
|
|
167
|
+
AcDbRenderingCache.profiling = false;
|
|
168
|
+
}
|
|
169
|
+
this._active = false;
|
|
170
|
+
this._finishScheduled = false;
|
|
171
|
+
this._database = undefined;
|
|
172
|
+
this._activeStage = undefined;
|
|
173
|
+
this._stages.clear();
|
|
174
|
+
};
|
|
175
|
+
AcApOpenFileProfiler.prototype.onProgress = function (args) {
|
|
176
|
+
var _a, _b;
|
|
177
|
+
var name = String((_b = (_a = args.subStage) !== null && _a !== void 0 ? _a : args.stage) !== null && _b !== void 0 ? _b : 'UNKNOWN');
|
|
178
|
+
var now = performance.now();
|
|
179
|
+
if (this._activeStage == null) {
|
|
180
|
+
this._activeStage = name;
|
|
181
|
+
this._activeStageStartedAt = now;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (name !== this._activeStage) {
|
|
185
|
+
this.closeActiveStage(now);
|
|
186
|
+
this._activeStage = name;
|
|
187
|
+
this._activeStageStartedAt = now;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
AcApOpenFileProfiler.prototype.closeActiveStage = function (now) {
|
|
191
|
+
if (this._activeStage == null) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
var stats = this._stages.get(this._activeStage);
|
|
195
|
+
if (!stats) {
|
|
196
|
+
stats = { durationMs: 0 };
|
|
197
|
+
this._stages.set(this._activeStage, stats);
|
|
198
|
+
}
|
|
199
|
+
stats.durationMs += Math.max(0, now - this._activeStageStartedAt);
|
|
200
|
+
this._activeStage = undefined;
|
|
201
|
+
};
|
|
202
|
+
AcApOpenFileProfiler.prototype.scheduleReport = function (view) {
|
|
203
|
+
var _this = this;
|
|
204
|
+
if (!this._active || this._finishScheduled) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this._finishScheduled = true;
|
|
208
|
+
void this.waitForIdle(view)
|
|
209
|
+
.then(function () {
|
|
210
|
+
if (!_this._active) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
_this.printReport(performance.now());
|
|
214
|
+
_this.cancel();
|
|
215
|
+
})
|
|
216
|
+
.catch(function (error) {
|
|
217
|
+
log.warn('OPENPROF: failed to finish open profile', error);
|
|
218
|
+
_this.cancel();
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
AcApOpenFileProfiler.prototype.waitForIdle = function (view) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
223
|
+
return __generator(this, function (_a) {
|
|
224
|
+
switch (_a.label) {
|
|
225
|
+
case 0:
|
|
226
|
+
// Allow any synchronously queued addEntity calls to bump the counter.
|
|
227
|
+
return [4 /*yield*/, Promise.resolve()];
|
|
228
|
+
case 1:
|
|
229
|
+
// Allow any synchronously queued addEntity calls to bump the counter.
|
|
230
|
+
_a.sent();
|
|
231
|
+
if (!view.isProcessingEntities) {
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
return [4 /*yield*/, new Promise(function (resolve) {
|
|
235
|
+
var poll = function () {
|
|
236
|
+
if (!view.isProcessingEntities) {
|
|
237
|
+
resolve();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
setTimeout(poll, 16);
|
|
241
|
+
};
|
|
242
|
+
poll();
|
|
243
|
+
})];
|
|
244
|
+
case 2:
|
|
245
|
+
_a.sent();
|
|
246
|
+
return [2 /*return*/];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
AcApOpenFileProfiler.prototype.printReport = function (convertEndMs) {
|
|
252
|
+
var e_1, _a, e_2, _b;
|
|
253
|
+
var _c, _d, _e, _f, _g, _h;
|
|
254
|
+
// Close the last openProgress stage when read finished (usually END/ENTITY).
|
|
255
|
+
this.closeActiveStage(this._readEndMs > 0 ? this._readEndMs : convertEndMs);
|
|
256
|
+
var readMs = Math.max(0, this._readEndMs - this._t0);
|
|
257
|
+
var convertMs = Math.max(0, convertEndMs - this._readEndMs);
|
|
258
|
+
var totalMs = Math.max(0, convertEndMs - this._t0);
|
|
259
|
+
var parseMs = (_d = (_c = this._stages.get('PARSE')) === null || _c === void 0 ? void 0 : _c.durationMs) !== null && _d !== void 0 ? _d : 0;
|
|
260
|
+
var fontMs = (_f = (_e = this._stages.get('FONT')) === null || _e === void 0 ? void 0 : _e.durationMs) !== null && _f !== void 0 ? _f : 0;
|
|
261
|
+
var entityMs = (_h = (_g = this._stages.get('ENTITY')) === null || _g === void 0 ? void 0 : _g.durationMs) !== null && _h !== void 0 ? _h : 0;
|
|
262
|
+
var cache = __assign({}, AcDbRenderingCache.profileStats);
|
|
263
|
+
var tl = cache.topLevel;
|
|
264
|
+
var pct = function (part, total) {
|
|
265
|
+
return total <= 0 ? '0%' : "".concat(((part / total) * 100).toFixed(1), "%");
|
|
266
|
+
};
|
|
267
|
+
var lines = [
|
|
268
|
+
'',
|
|
269
|
+
'========== OPENPROF (open-file profile) ==========',
|
|
270
|
+
'Note: progress-bar % weights (PARSE~12%, FONT~18%, ENTITY~98%) are not wall-time shares.',
|
|
271
|
+
'Stage ms = active-stage wall time (first event of stage → first event of next stage).',
|
|
272
|
+
"wall clock total: ".concat(totalMs.toFixed(0), " ms"),
|
|
273
|
+
" db.read: ".concat(readMs.toFixed(0), " ms (").concat(pct(readMs, totalMs), ")"),
|
|
274
|
+
" PARSE: ".concat(parseMs.toFixed(0), " ms (").concat(pct(parseMs, readMs), " of read)"),
|
|
275
|
+
" FONT: ".concat(fontMs.toFixed(0), " ms (").concat(pct(fontMs, readMs), " of read)"),
|
|
276
|
+
" ENTITY flush: ".concat(entityMs.toFixed(0), " ms (").concat(pct(entityMs, readMs), " of read)"),
|
|
277
|
+
" scene convert: ".concat(convertMs.toFixed(0), " ms (").concat(pct(convertMs, totalMs), ")"),
|
|
278
|
+
'',
|
|
279
|
+
'--- AcDbRenderingCache (top-level INSERT draws) ---',
|
|
280
|
+
"hits: ".concat(tl.hits, ", hit path ").concat(tl.hitMs.toFixed(0), " ms (clone ").concat(tl.cloneMs.toFixed(0), " ms)"),
|
|
281
|
+
"misses: ".concat(tl.misses, ", build ").concat(tl.missBuildMs.toFixed(0), " ms (incl. nested), compact ").concat(tl.missCompactMs.toFixed(0), " ms, set/clone ").concat(tl.setCloneMs.toFixed(0), " ms"),
|
|
282
|
+
"applyMatrix+attribs: ".concat(tl.applyMs.toFixed(0), " ms"),
|
|
283
|
+
'',
|
|
284
|
+
"--- AcDbRenderingCache (all depths: hits=".concat(cache.hits, ", misses=").concat(cache.misses, ") ---"),
|
|
285
|
+
"hit ".concat(cache.hitMs.toFixed(0), " ms (clone ").concat(cache.cloneMs.toFixed(0), "), build ").concat(cache.missBuildMs.toFixed(0), ", compact ").concat(cache.missCompactMs.toFixed(0), ", set ").concat(cache.setCloneMs.toFixed(0), ", apply ").concat(cache.applyMs.toFixed(0))
|
|
286
|
+
];
|
|
287
|
+
var slowBlocks = __spreadArray([], __read(cache.blockMisses), false).sort(function (a, b) { return b.buildMs + b.compactMs - (a.buildMs + a.compactMs); })
|
|
288
|
+
.slice(0, 10);
|
|
289
|
+
if (slowBlocks.length > 0) {
|
|
290
|
+
lines.push('', '--- Slowest block template misses (build+compact) ---');
|
|
291
|
+
try {
|
|
292
|
+
for (var slowBlocks_1 = __values(slowBlocks), slowBlocks_1_1 = slowBlocks_1.next(); !slowBlocks_1_1.done; slowBlocks_1_1 = slowBlocks_1.next()) {
|
|
293
|
+
var block = slowBlocks_1_1.value;
|
|
294
|
+
var name_1 = block.blockName.length > 40
|
|
295
|
+
? "".concat(block.blockName.slice(0, 37), "...")
|
|
296
|
+
: block.blockName;
|
|
297
|
+
lines.push("".concat(name_1.padEnd(40), " build=").concat(block.buildMs.toFixed(0).padStart(7), "ms compact=").concat(block.compactMs.toFixed(0).padStart(7), "ms total=").concat((block.buildMs + block.compactMs).toFixed(0).padStart(7), "ms"));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
301
|
+
finally {
|
|
302
|
+
try {
|
|
303
|
+
if (slowBlocks_1_1 && !slowBlocks_1_1.done && (_a = slowBlocks_1.return)) _a.call(slowBlocks_1);
|
|
304
|
+
}
|
|
305
|
+
finally { if (e_1) throw e_1.error; }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
var otherStages = __spreadArray([], __read(this._stages.entries()), false).filter(function (_a) {
|
|
309
|
+
var _b = __read(_a, 2), name = _b[0], stats = _b[1];
|
|
310
|
+
return !['PARSE', 'FONT', 'ENTITY', 'START', 'END'].includes(name) &&
|
|
311
|
+
stats.durationMs > 0;
|
|
312
|
+
})
|
|
313
|
+
.sort(function (a, b) { return b[1].durationMs - a[1].durationMs; });
|
|
314
|
+
if (otherStages.length > 0) {
|
|
315
|
+
lines.push('', '--- Other openProgress sub-stages ---');
|
|
316
|
+
try {
|
|
317
|
+
for (var otherStages_1 = __values(otherStages), otherStages_1_1 = otherStages_1.next(); !otherStages_1_1.done; otherStages_1_1 = otherStages_1.next()) {
|
|
318
|
+
var _j = __read(otherStages_1_1.value, 2), name_2 = _j[0], stats = _j[1];
|
|
319
|
+
lines.push(" ".concat(name_2, ": ").concat(stats.durationMs.toFixed(0), " ms"));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
323
|
+
finally {
|
|
324
|
+
try {
|
|
325
|
+
if (otherStages_1_1 && !otherStages_1_1.done && (_b = otherStages_1.return)) _b.call(otherStages_1);
|
|
326
|
+
}
|
|
327
|
+
finally { if (e_2) throw e_2.error; }
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
lines.push('==================================================', '');
|
|
331
|
+
console.log(lines.join('\n'));
|
|
332
|
+
// Classic converter also fills AcCmPerformanceCollector ("Load Database").
|
|
333
|
+
try {
|
|
334
|
+
var collector = AcCmPerformanceCollector.getInstance();
|
|
335
|
+
if (collector.getAll().length > 0) {
|
|
336
|
+
console.log('--- AcCmPerformanceCollector ---');
|
|
337
|
+
collector.printAll();
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
catch (_k) {
|
|
341
|
+
// optional
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
AcApOpenFileProfiler.prototype.detachProgressListener = function () {
|
|
345
|
+
if (this._progressListener && this._database) {
|
|
346
|
+
this._database.events.openProgress.removeEventListener(this._progressListener);
|
|
347
|
+
}
|
|
348
|
+
this._progressListener = undefined;
|
|
349
|
+
};
|
|
350
|
+
return AcApOpenFileProfiler;
|
|
351
|
+
}());
|
|
352
|
+
export { AcApOpenFileProfiler };
|
|
353
|
+
//# sourceMappingURL=AcApOpenFileProfiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApOpenFileProfiler.js","sourceRoot":"","sources":["../../src/app/AcApOpenFileProfiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,wBAAwB,EAGxB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,GAAG,EACJ,MAAM,uBAAuB,CAAA;AAQ9B;;;;;;;;;;;;;GAaG;AACH;IAAA;QACU,YAAO,GAAG,KAAK,CAAA;QACf,QAAG,GAAG,CAAC,CAAA;QACP,eAAU,GAAG,CAAC,CAAA;QACd,YAAO,GAAG,IAAI,GAAG,EAAsB,CAAA;QAEvC,0BAAqB,GAAG,CAAC,CAAA;QAGzB,qBAAgB,GAAG,KAAK,CAAA;IA0OlC,CAAC;IAxOC;;OAEG;IACI,8BAAS,GAAhB,UAAiB,QAAsB;QACrC,IAAI,CAAC;YACH,OAAO,CACL,iBAAiB,CAAC,QAAQ,EAAE,CAAC,MAAM,CACjC,mBAAmB,CAAC,QAAQ,EAC5B,QAAQ,CACT,KAAK,IAAI,CACX,CAAA;QACH,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACH,oCAAK,GAAL,UAAM,QAAsB;QAA5B,iBAsBC;QArBC,IAAI,CAAC,MAAM,EAAE,CAAA;QACb,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,C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AAG,CAAC,EAAE,CAAC;gBAClC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAA;gBAC/C,SAAS,CAAC,QAAQ,EAAE,CAAA;YACtB,CAAC;QACH,CAAC;QAAC,WAAM,CAAC;YACP,WAAW;QACb,CAAC;IACH,CAAC;IAEO,qDAAsB,GAA9B;QACE,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC7C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,mBAAmB,CACpD,IAAI,CAAC,iBAAiB,CACvB,CAAA;QACH,CAAC;QACD,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAA;IACpC,CAAC;IACH,2BAAC;AAAD,CAAC,AAnPD,IAmPC"}
|
|
@@ -5,11 +5,17 @@ import { AcDbProgressdEventArgs } from '@mlightcad/data-model';
|
|
|
5
5
|
* Listens to database open progress callbacks (wired by {@link AcApDocManager}),
|
|
6
6
|
* normalizes monotonic percentages, updates the canvas overlay, and emits
|
|
7
7
|
* `open-file-progress` on the global event bus.
|
|
8
|
+
*
|
|
9
|
+
* Overlay DOM updates are deduplicated: `show()` runs once per open, and
|
|
10
|
+
* `setMessage` only when the localized stage text changes. Progress events
|
|
11
|
+
* still emit on every callback so listeners see fine-grained percentages.
|
|
8
12
|
*/
|
|
9
13
|
export declare class AcApOpenFileProgressController {
|
|
10
14
|
private readonly _progress;
|
|
11
15
|
private _peak;
|
|
12
16
|
private _stage?;
|
|
17
|
+
private _overlayVisible;
|
|
18
|
+
private _lastMessage;
|
|
13
19
|
/**
|
|
14
20
|
* @param host - Canvas container that receives the progress overlay
|
|
15
21
|
*/
|
|
@@ -18,6 +24,11 @@ export declare class AcApOpenFileProgressController {
|
|
|
18
24
|
* Resets tracked progress for a new open operation.
|
|
19
25
|
*/
|
|
20
26
|
reset(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Shows the open-file overlay immediately and yields so it can paint before
|
|
29
|
+
* main-thread DXF parse work blocks the UI (native converter path).
|
|
30
|
+
*/
|
|
31
|
+
beginOpen(database: AcDbProgressdEventArgs['database']): Promise<void>;
|
|
21
32
|
/**
|
|
22
33
|
* Normalizes progress, emits `open-file-progress`, and updates the overlay.
|
|
23
34
|
*
|
|
@@ -37,6 +48,7 @@ export declare class AcApOpenFileProgressController {
|
|
|
37
48
|
* briefly report a lower percentage after IN-PROGRESS already reached 100%.
|
|
38
49
|
*/
|
|
39
50
|
private normalize;
|
|
51
|
+
private resolveMessage;
|
|
40
52
|
private updateOverlay;
|
|
41
53
|
}
|
|
42
54
|
//# sourceMappingURL=AcApOpenFileProgressController.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApOpenFileProgressController.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileProgressController.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AcApOpenFileProgressController.d.ts","sourceRoot":"","sources":["../../src/app/AcApOpenFileProgressController.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,sBAAsB,EAAC,MAAM,uBAAuB,CAAA;AAOtD;;;;;;;;;;GAUG;AACH,qBAAa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,KAAK,CAAI;IACjB,OAAO,CAAC,MAAM,CAAC,CAAiC;IAChD,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAK;IAEzB;;OAEG;gBACS,IAAI,EAAE,WAAW;IAK7B;;OAEG;IACH,KAAK,IAAI,IAAI;IAOb;;;OAGG;IACG,SAAS,CAAC,QAAQ,EAAE,sBAAsB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5E;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,sBAAsB;IAQ5D;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,aAAa;CAkBtB"}
|