40 lines
910 B
C++
40 lines
910 B
C++
/*
|
|
* CurrentProcessing.cpp
|
|
*
|
|
* Created on: 27 ÿíâ. 2018 ã.
|
|
* Author: titov
|
|
*/
|
|
|
|
#include "CurrentProcessing.hh"
|
|
|
|
using processing::CurrentProcessing;
|
|
|
|
CurrentProcessing::CurrentProcessing(
|
|
systemic::ISignal & i1, systemic::ISignal & i2, systemic::ISignal & i3 ) :
|
|
current_1(i1), current_2(i2), current_3(i3),
|
|
current_uv(), current_ab(), offset(0.0f) {}
|
|
|
|
void processing::CurrentProcessing::process() {
|
|
|
|
control::NaturalCoordinate raw_current(
|
|
current_1, current_2, current_3
|
|
);
|
|
|
|
if( raw_current ) {
|
|
|
|
current_uv = control::normalize( raw_current );
|
|
offset = control::calc_offset( raw_current );
|
|
|
|
current_ab = tf_clark( current_uv );
|
|
|
|
} else {
|
|
|
|
current_uv = control::NaturalCoordinate( 0.0f, 0.0f, 0.0f );
|
|
current_ab = control::StandingVector( 0.0f, 0.0f );
|
|
|
|
offset = 0.0f;
|
|
|
|
}
|
|
|
|
}
|