MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/technological/function/InverterDebug.hh
2024-06-07 11:12:56 +03:00

58 lines
1.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* InverterDebug.h
*
* Created on: 4 апр. 2017 г.
* Author: titov
*/
#ifndef SOURCES_TECHNOLOGICAL_INVERTERDEBUG_H_
#define SOURCES_TECHNOLOGICAL_INVERTERDEBUG_H_
#include "../../peripheral/IPwmOverride.hh"
#include "../../driver/IInverter.hh"
#include "../../common/ResourceKeeper.hpp"
#include "../ITechFunction.hh"
namespace technological { namespace function {
class InverterDebug : public ITechFunction {
public:
struct Input {
float time_a;
float time_b;
float time_c;
};
InverterDebug( peripheral::IPwmOverride & u, peripheral::IPwmOverride & v, peripheral::IPwmOverride & w,
ResourceKeeper<driver::IInverter> & inv );
bool run( const char * value, std::size_t size );
//!Остановка кокнретной процедуры настройки и диагностики.
void stop();
//!Проверка что процедура на данный момент выполняется.
short getState() const;
//!Получение значений конкретной процедуры.
bool getResult( char * value, std::size_t size ) const { return true; }
~InverterDebug() noexcept;
private:
peripheral::IPwmOverride & pwm_u;
peripheral::IPwmOverride & pwm_v;
peripheral::IPwmOverride & pwm_w;
ResourceKeeper<driver::IInverter> & inverter_resource;
driver::IInverter * inverter;
static bool validate( Input & input );
void prepare_time(const Input & input, float (& time)[3]);
};
} }
#endif /* SOURCES_TECHNOLOGICAL_INVERTERDEBUG_H_ */