Browse Source

report time too;

git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8677 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/zoom-1.0
nilm 12 years ago
parent
commit
3bec37256b
3 changed files with 9 additions and 6 deletions
  1. +1
    -1
      pc/calibrate.c
  2. +5
    -3
      pc/dactest.c
  3. +3
    -2
      pc/zoom.c

+ 1
- 1
pc/calibrate.c View File

@@ -278,7 +278,7 @@ fail:

void zero(int zoom)
{
int r;
int r = 0;
int dac;

info("Initializing Zoom NILM\n");


+ 5
- 3
pc/dactest.c View File

@@ -12,6 +12,7 @@
#include <err.h>
#include <linux/serial.h>
#include <sys/signal.h>
#include <sys/time.h>
#include "serial-util.h"
#include "gpib.h"
#include "zoom.h"
@@ -103,6 +104,7 @@ void write_random(int zoom, int gpib)
{
int dac;
double meas;
struct timeval now;

info("Initializing Zoom NILM\n");
if (zoom_init_nozero(zoom) < 0) goto fail;
@@ -118,10 +120,10 @@ void write_random(int zoom, int gpib)
info("Running\n");
while (!g_quit) {
dac = genrand_int32() & 0x3ff;
zoom_write_dac(zoom, dac);
gettimeofday(&now, NULL);
meas = keithley2002_read(gpib);
if (isnan(meas))
goto fail;
printf("%d %.12f\n", dac, meas);
printf("%ld.%06ld %d %.12f\n", now.tv_sec, now.tv_usec, dac, meas);
}

safecleanup:


+ 3
- 2
pc/zoom.c View File

@@ -21,8 +21,9 @@ static int verify_prompt(int fd)
chomp(s);
if (sscanf(s, "%x %d %x %d", &dac1, &dac2, &adc1, &adc2) != 4)
return -1;
// if (dac1 != dac2 || adc1 != adc2)
// return -1;
// if (dac1 != dac2 || adc1 != adc2)
if (adc1 != adc2)
return -1;
last_dac = dac1;
last_adc = adc1;
return 0;


Loading…
Cancel
Save