]> sigrok.org Git - libsigrok.git/commitdiff
dmm: vc870: render POWER_FACTOR as such and not as frequency
authorWolfram Sang <redacted>
Sun, 3 Jan 2016 21:27:43 +0000 (22:27 +0100)
committerUwe Hermann <redacted>
Tue, 5 Jan 2016 21:25:29 +0000 (22:25 +0100)
The primary display is the power factor, the secondary is the frequency.
This got mixed up, so change the order. We also need to fix the
conversion factor.

Signed-off-by: Wolfram Sang <redacted>
src/dmm/vc870.c

index 2529f0baeb12f63c741fc7f97117e962e76908c5..125f4712d5fb23179bc09d363292c4940ece5b47 100644 (file)
@@ -59,7 +59,7 @@ static const float factors[][8] = {
        /* TODO: Verify factor for ACA */
        {1e-3,  0,     0,     0,    0,    0,    0,    0},    /* ACA */
        {1e-1,  0,     0,     0,    0,    0,    0,    0},    /* Act+apparent power */
-       {1e-1,  0,     0,     0,    0,    0,    0,    0},    /* Power factor / freq */
+       {1e-3,  0,     0,     0,    0,    0,    0,    0},    /* Power factor / freq */
        {1e-1,  0,     0,     0,    0,    0,    0,    0},    /* V eff + A eff */
 };
 
@@ -345,11 +345,11 @@ static void handle_flags(struct sr_datafeed_analog_old *analog,
                // analog->unit = SR_UNIT_VOLT_AMPERE;
        }
        if (info->is_power_factor_freq) {
-               /* TODO: Handle power factor. */
-               // analog->mq = SR_MQ_POWER_FACTOR;
-               // analog->unit = SR_UNIT_UNITLESS;
-               analog->mq = SR_MQ_FREQUENCY;
-               analog->unit = SR_UNIT_HERTZ;
+               analog->mq = SR_MQ_POWER_FACTOR;
+               analog->unit = SR_UNIT_UNITLESS;
+               /* TODO: Handle frequency. */
+               // analog->mq = SR_MQ_FREQUENCY;
+               // analog->unit = SR_UNIT_HERTZ;
        }
 
        /* Measurement related flags */