feat: CLK toggles on Step, add pan/zoom (arrows, +/-, wheel, 0=reset)
This commit is contained in:
@@ -52,9 +52,23 @@ export function forceRecordSample() {
|
||||
}
|
||||
|
||||
export function manualStep() {
|
||||
// Toggle all CLOCK gates on each step (same as simTick)
|
||||
state.gates.forEach(g => {
|
||||
if (g.type === 'CLOCK') {
|
||||
g.value = g.value ? 0 : 1;
|
||||
}
|
||||
});
|
||||
// Use the lazy-loaded evaluateAll to avoid circular imports
|
||||
if (_evaluateAll) _evaluateAll();
|
||||
forceRecordSample();
|
||||
}
|
||||
|
||||
// Lazy reference to evaluateAll (set by gates.js to break circular dep)
|
||||
let _evaluateAll = null;
|
||||
export function setEvaluateAll(fn) {
|
||||
_evaluateAll = fn;
|
||||
}
|
||||
|
||||
export function updateWaveInfo() {
|
||||
const totalSamples = Object.values(state.waveData).reduce((sum, arr) => sum + arr.length, 0);
|
||||
document.getElementById('wave-info').textContent = `T=${state.timeStep} | ${totalSamples} samples`;
|
||||
|
||||
Reference in New Issue
Block a user