Skip to content

Commit

Permalink
Ported file parsing and handling to wellen library
Browse files Browse the repository at this point in the history
  • Loading branch information
Lramseyer committed Nov 1, 2024
1 parent 2db1df1 commit 1bb0a2c
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 1,650 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ crate-type = ["cdylib"]

[dependencies]
lazy_static = "1.5.0"
wellen = "0.12.0"
wit-bindgen = "0.33.0"
wellen = "0.12.2"
wit-bindgen = "0.34.0"
8 changes: 5 additions & 3 deletions media/vaporview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ sendDisplayedSignals = function () {
};

sendWebviewContext = function (responseType) {

vscode.postMessage({
command: 'contextUpdate',
markerTime: markerTime,
Expand Down Expand Up @@ -1172,7 +1173,7 @@ handleMarkerSet = function (time, markerType) {

// first find the chunk with the marker
chunkIndex = Math.floor(time / chunkTime);

// create new marker
if (chunkIndex >= dataCache.startIndex && chunkIndex < dataCache.endIndex + chunksInColumn) {
const clusterIndex = Math.floor((chunkIndex - dataCache.startIndex) / chunksInColumn);
Expand Down Expand Up @@ -1965,7 +1966,7 @@ goToNextTransition = function (direction, edge) {
let netlistId = null;
const waveChunkId = event.target.closest('.waveform-chunk');
if (waveChunkId) {netlistId = parseInt(waveChunkId.id.split('--').slice(1).join('--'));}
if (netlistId) {
if (netlistId !== undefined) {
if (button === 0) {
handleSignalSelect(netlistId);
}
Expand Down Expand Up @@ -2276,6 +2277,7 @@ goToNextTransition = function (direction, edge) {
break;
}
case 'update-waveform-chunk': {
// Newer command used for fetching transition data in chunks

let signalId = message.signalId;
if (waveformDataTemp[signalId].totalChunks === 0) {
Expand All @@ -2295,7 +2297,7 @@ goToNextTransition = function (direction, edge) {
let transitionData = JSON.parse(waveformDataTemp[signalId].chunkData.join(""));

let netlistId = waveformDataTemp[signalId].netlistId;
if (!netlistId) {console.log('netlistId not found for signalId ' + signalId); break;}
if (netlistId === undefined) {console.log('netlistId not found for signalId ' + signalId); break;}
let signalWidth = netlistData[netlistId].signalWidth;
let numberFormat = netlistData[netlistId].numberFormat;
let nullValue = "X".repeat(signalWidth);
Expand Down
Loading

0 comments on commit 1bb0a2c

Please sign in to comment.