修复 【wave最大仿真时间的vcd更新了但view不更新】
This commit is contained in:
parent
c847eb5a83
commit
afa5e8fb2b
@ -16,8 +16,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.readVcdFile = async () => {
|
window.readVcdFile = async () => {
|
||||||
let inputVcdFile = 'test.vcd';
|
let inputVcdFile = 'basic_tb.vcd';
|
||||||
let inputViewFile = 'test.view';
|
let inputViewFile = 'basic_tb.view';
|
||||||
const response = await fetch(inputVcdFile);
|
const response = await fetch(inputVcdFile);
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
return [arrayBuffer, inputVcdFile, inputViewFile];
|
return [arrayBuffer, inputVcdFile, inputViewFile];
|
||||||
|
@ -99,7 +99,8 @@ onMounted(async () => {
|
|||||||
globalLookup.t0 = vcdInfo.t0 || 0;
|
globalLookup.t0 = vcdInfo.t0 || 0;
|
||||||
|
|
||||||
globalLookup.tgcd = workerVars.tgcd;
|
globalLookup.tgcd = workerVars.tgcd;
|
||||||
globalLookup.time = workerVars.time;
|
globalLookup.time = workerVars.time;
|
||||||
|
globalLookup.maxTime = globalLookup.time * globalLookup.tgcd;
|
||||||
globalLookup.chango = signalValues;
|
globalLookup.chango = signalValues;
|
||||||
makeWaveView();
|
makeWaveView();
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
|
import { globalLookup } from "../global";
|
||||||
|
|
||||||
const xOffsetUpdate = (pstate, nextOffsetXFn) => {
|
const xOffsetUpdate = (pstate, nextOffsetXFn) => {
|
||||||
let nextOffsetX = nextOffsetXFn();
|
let nextOffsetX = nextOffsetXFn();
|
||||||
const { width, xOffset, xScale, time, sidebarWidth } = pstate;
|
const { width, xOffset, xScale, time, sidebarWidth } = pstate;
|
||||||
|
const maxTime = globalLookup.maxTime;
|
||||||
|
|
||||||
const maxOffsetX = width + xScale * time * 1.0; // maximum offset
|
const maxOffsetX = width + xScale * maxTime * 1.0; // maximum offset
|
||||||
nextOffsetX = Math.min(nextOffsetX, maxOffsetX);
|
nextOffsetX = Math.min(nextOffsetX, maxOffsetX);
|
||||||
|
|
||||||
const minOffsetX = - width - xScale * time * 1.2; // minimum offset
|
const minOffsetX = - width - xScale * maxTime * 1.0; // minimum offset
|
||||||
nextOffsetX = Math.max(nextOffsetX, minOffsetX);
|
nextOffsetX = Math.max(nextOffsetX, minOffsetX);
|
||||||
|
|
||||||
// 检测 0 是否超出了左侧的 --sidebar-width 的位置
|
// 检测 0 是否超出了左侧的 --sidebar-width 的位置
|
||||||
|
Loading…
x
Reference in New Issue
Block a user