2
0
forked from Ivasoft/DSView

v0.4 release

This commit is contained in:
DreamSourceLab
2014-09-24 18:43:42 +08:00
parent 5d7e3237b7
commit 9eb36b33b9
170 changed files with 10539 additions and 4321 deletions

View File

@@ -41,7 +41,7 @@ struct context {
static int init(struct sr_output *o)
{
struct context *ctx;
struct sr_probe *probe;
struct sr_channel *probe;
GSList *l;
sr_spew("Initializing output module.");
@@ -57,7 +57,7 @@ static int init(struct sr_output *o)
/* Get the number of probes and their names. */
ctx->probelist = g_ptr_array_new();
for (l = o->sdi->probes; l; l = l->next) {
for (l = o->sdi->channels; l; l = l->next) {
probe = l->data;
if (!probe || !probe->enabled)
continue;
@@ -190,7 +190,7 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet, GString **out)
{
const struct sr_datafeed_analog *analog;
struct sr_probe *probe;
struct sr_channel *probe;
GSList *l;
const float *fdata;
int i, p;

View File

@@ -57,7 +57,7 @@ struct context {
static int init(struct sr_output *o)
{
struct context *ctx;
struct sr_probe *probe;
struct sr_channel *probe;
GSList *l;
GVariant *gvar;
int num_probes;
@@ -81,7 +81,7 @@ static int init(struct sr_output *o)
o->internal = ctx;
/* Get the number of probes, and the unitsize. */
for (l = o->sdi->probes; l; l = l->next) {
for (l = o->sdi->channels; l; l = l->next) {
probe = l->data;
if (probe->enabled)
ctx->num_enabled_probes++;
@@ -89,10 +89,10 @@ static int init(struct sr_output *o)
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
num_probes = g_slist_length(o->sdi->probes);
num_probes = g_slist_length(o->sdi->channels);
if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
o->sdi) == SR_OK) {
if (sr_config_get(o->sdi->driver, o->sdi, NULL, NULL,
SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
ctx->samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
} else
@@ -112,7 +112,7 @@ static int init(struct sr_output *o)
/* Columns / channels */
g_string_append_printf(ctx->header, "; Channels (%d/%d): ",
ctx->num_enabled_probes, num_probes);
for (l = o->sdi->probes; l; l = l->next) {
for (l = o->sdi->channels; l; l = l->next) {
probe = l->data;
if (probe->enabled)
g_string_append_printf(ctx->header, "%s, ", probe->name);

View File

@@ -51,7 +51,7 @@ $comment\n Acquisition with %d/%d probes at %s\n$end\n";
static int init(struct sr_output *o)
{
struct context *ctx;
struct sr_probe *probe;
struct sr_channel *probe;
GSList *l;
GVariant *gvar;
int num_probes, i;
@@ -67,7 +67,7 @@ static int init(struct sr_output *o)
ctx->num_enabled_probes = 0;
ctx->probeindices = g_array_new(FALSE, FALSE, sizeof(int));
for (l = o->sdi->probes; l; l = l->next) {
for (l = o->sdi->channels; l; l = l->next) {
probe = l->data;
if (!probe->enabled)
continue;
@@ -82,7 +82,7 @@ static int init(struct sr_output *o)
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
ctx->header = g_string_sized_new(512);
num_probes = g_slist_length(o->sdi->probes);
num_probes = g_slist_length(o->sdi->channels);
/* timestamp */
t = time(NULL);
@@ -95,8 +95,8 @@ static int init(struct sr_output *o)
g_string_append_printf(ctx->header, "$version %s %s $end\n",
PACKAGE, PACKAGE_VERSION);
if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
o->sdi) == SR_OK) {
if (sr_config_get(o->sdi->driver, o->sdi, NULL, NULL,
SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
ctx->samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
@@ -129,7 +129,7 @@ static int init(struct sr_output *o)
g_string_append_printf(ctx->header, "$scope module %s $end\n", PACKAGE);
/* Wires / channels */
for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
probe = l->data;
if (!probe->enabled)
continue;

View File

@@ -81,7 +81,7 @@ SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
{
struct context *ctx;
struct sr_probe *probe;
struct sr_channel *probe;
GSList *l;
GVariant *gvar;
uint64_t samplerate;
@@ -97,7 +97,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
ctx->num_enabled_probes = 0;
ctx->probenames = NULL;
for (l = o->sdi->probes; l; l = l->next) {
for (l = o->sdi->channels; l; l = l->next) {
probe = l->data;
if (!probe->enabled)
continue;
@@ -128,9 +128,9 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
}
snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->sdi->probes);
if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
o->sdi) == SR_OK) {
num_probes = g_slist_length(o->sdi->channels);
if (sr_config_get(o->sdi->driver, o->sdi, NULL, NULL,
SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
if (!(samplerate_s = sr_samplerate_string(samplerate))) {