Skip to content

Visualizing array data. #2051

Answered by paxcut
LupusTheCanine asked this question in Get Help
Discussion options

You must be logged in to vote

Currently only arrays of floats can be plotted as an line plot so you need to create a section to have the data converted from u32 to float. This is one way you could do that:

import std.mem;

std::mem::Section provider=std::mem::create_section("Provider");

struct dat{
u32 timestamp;
s16 data[4*8];
};

struct A {
    float data[64];
}[[hex::visualize("line_plot", data)]];


dat a[64] @ 0;

A plot@0 in provider;

for (u32 i=0,i<64,i+=1) {
    plot.data[i] = float(a[i].timestamp);
}

To view the plot click on the sections tab and on the icon on the rigth side. When hex editor opens click on the eye on the data column of the pattern data for the section.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LupusTheCanine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants