source: flair-src/trunk/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h @ 3

Last change on this file since 3 was 3, checked in by Sanahuja Guillaume, 6 years ago

sensoractuator

File size: 1.7 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5//  created:    2011/09/13
6//  filename:   BlCtrlV2_impl.h
7//
8//  author:     Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    objet integrant les moteurs i2c
14//
15//
16/*********************************************************************/
17
18
19#ifndef BLCTRLV2_IMPL_H
20#define BLCTRLV2_IMPL_H
21
22#include <stdint.h>
23#include <Object.h>
24
25#define MAX_MOTORS 8
26
27namespace flair
28{
29    namespace core
30    {
31        class I2cPort;
32    }
33    namespace gui
34    {
35        class SpinBox;
36        class GroupBox;
37        class Layout;
38    }
39    namespace actuator
40    {
41        class BlCtrlV2;
42    }
43    namespace sensor
44    {
45        class BatteryMonitor;
46    }
47}
48
49class BlCtrlV2_impl
50{
51    public:
52        BlCtrlV2_impl(flair::actuator::BlCtrlV2* self,flair::gui::Layout *layout,flair::core::I2cPort* i2cport);
53        ~BlCtrlV2_impl();
54        void SetMotors(float* value);
55        flair::sensor::BatteryMonitor *battery;
56        flair::gui::SpinBox *poles;
57
58    private:
59        void WriteValue(uint16_t value);//I2cPort mutex must be taken before calling this function
60        void DetectMotors(void);
61        void GetCurrentSpeedAndVoltage(float &current,float &speed,float &voltage);//I2cPort mutex must be taken before calling this function
62        void GetCurrentAndSpeed(float &current,float &speed);//I2cPort mutex must be taken before calling this function
63        flair::core::Time last_voltage_time;
64        int nb_mot;
65        flair::core::I2cPort* i2cport;
66        flair::actuator::BlCtrlV2* self;
67};
68
69#endif // BLCTRLV2_IMPL_H
Note: See TracBrowser for help on using the repository browser.