Skip to content

Commit fe42401

Browse files
committed
xScale, xOffset calculation on flight
1 parent 12bf1fb commit fe42401

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

lib/handle-vcd-parser-ready.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {
77
domContainer,
88
pluginRenderValues,
99
pluginRenderTimeGrid,
10+
pluginRenderCursor,
1011
keyBindo,
1112
mountTree,
1213
genKeyHandler,
@@ -42,6 +43,8 @@ const genStats = ($, statPanelDiv) => async (e) => {
4243
// console.log('rx: stats', $);
4344
const {data} = e.data;
4445
statPanelDiv.innerHTML = stringify(statusPanel.mlStats($, data, getTimeStamp($)));
46+
// update current time
47+
$.cnt1.pstate.time = Number($.memI64[memmap.time]);
4548
};
4649

4750
const genLoadVcdDone = ($, statPanelDiv) => async (e) => {
@@ -65,6 +68,7 @@ const handleVcdParserReady = ($) => async () => {
6568
elemento: mountTree.defaultElemento,
6669
layers: mountTree.defaultLayers,
6770
renderPlugins: [
71+
pluginRenderCursor,
6872
pluginRenderTimeGrid,
6973
pluginRenderValues,
7074
pluginLocalStore

lib/plugin-local-store.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
'use strict';
22

33
const pluginLocalStore = (desc, pstate /* , els */) => {
4-
localStorage.setItem(
5-
'vcdrom',
6-
JSON.stringify({
7-
// yOffset: pstate.yOffset,
8-
xOffset: pstate.xOffset,
9-
xScale: pstate.xScale
10-
})
11-
);
4+
let {xOffset, xScale, width, sidebarWidth, time} = pstate;
5+
// xOffset = xOffset || 320;
6+
// if (
7+
// (xScale === undefined) ||
8+
// isNaN(xScale) ||
9+
// (xScale === 0) ||
10+
// (xScale === null) ||
11+
// (xScale === -Infinity) ||
12+
// (xScale === Infinity)
13+
// ) {
14+
// xScale = 8;
15+
// }
16+
const obj = {xOffset, xScale, width, sidebarWidth, time};
17+
console.log(obj);
18+
// localStorage.setItem('vcdrom', JSON.stringify(obj));
1219
};
1320

1421
module.exports = pluginLocalStore;

0 commit comments

Comments
 (0)