ccs table
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
4f013dabd7
commit
647b3a5fb3
|
|
@ -1717,11 +1717,13 @@ OutputWaveforms::voltageTimes(size_t wave_index,
|
||||||
float prev_current = currents->value(0);
|
float prev_current = currents->value(0);
|
||||||
float voltage = 0.0;
|
float voltage = 0.0;
|
||||||
volts.push_back(voltage);
|
volts.push_back(voltage);
|
||||||
|
bool always_rise = true;
|
||||||
|
bool invert = (always_rise && rf_ == RiseFall::fall());
|
||||||
for (size_t i = 1; i < time_axis->size(); i++) {
|
for (size_t i = 1; i < time_axis->size(); i++) {
|
||||||
float time = time_axis->axisValue(i);
|
float time = time_axis->axisValue(i);
|
||||||
float current = currents->value(i);
|
float current = currents->value(i);
|
||||||
float dv = (current + prev_current) / 2.0 * (time - prev_time) / cap;
|
float dv = (current + prev_current) / 2.0 * (time - prev_time) / cap;
|
||||||
voltage += dv;
|
voltage += invert ? -dv : dv;
|
||||||
volts.push_back(voltage);
|
volts.push_back(voltage);
|
||||||
prev_time = time;
|
prev_time = time;
|
||||||
prev_current = current;
|
prev_current = current;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue