Last change
on this file since 197 was 15, checked in by Bayard Gildas, 8 years ago |
sources reformatted with flair-format-dir script
|
File size:
1.7 KB
|
Rev | Line | |
---|
[3] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[3] | 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 | #ifndef BLCTRLV2_IMPL_H
|
---|
| 19 | #define BLCTRLV2_IMPL_H
|
---|
| 20 |
|
---|
| 21 | #include <stdint.h>
|
---|
| 22 | #include <Object.h>
|
---|
| 23 |
|
---|
| 24 | #define MAX_MOTORS 8
|
---|
| 25 |
|
---|
[15] | 26 | namespace flair {
|
---|
| 27 | namespace core {
|
---|
| 28 | class I2cPort;
|
---|
[3] | 29 | }
|
---|
[15] | 30 | namespace gui {
|
---|
| 31 | class SpinBox;
|
---|
| 32 | class GroupBox;
|
---|
| 33 | class Layout;
|
---|
| 34 | }
|
---|
| 35 | namespace actuator {
|
---|
| 36 | class BlCtrlV2;
|
---|
| 37 | }
|
---|
| 38 | namespace sensor {
|
---|
| 39 | class BatteryMonitor;
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
[3] | 42 |
|
---|
[15] | 43 | class BlCtrlV2_impl {
|
---|
| 44 | public:
|
---|
| 45 | BlCtrlV2_impl(flair::actuator::BlCtrlV2 *self, flair::gui::Layout *layout,
|
---|
| 46 | flair::core::I2cPort *i2cport);
|
---|
| 47 | ~BlCtrlV2_impl();
|
---|
| 48 | void SetMotors(float *value);
|
---|
| 49 | flair::sensor::BatteryMonitor *battery;
|
---|
| 50 | flair::gui::SpinBox *poles;
|
---|
[3] | 51 |
|
---|
[15] | 52 | private:
|
---|
| 53 | void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
|
---|
| 54 | // this function
|
---|
| 55 | void DetectMotors(void);
|
---|
| 56 | void GetCurrentSpeedAndVoltage(float ¤t, float &speed,
|
---|
| 57 | float &voltage); // I2cPort mutex must be taken
|
---|
| 58 | // before calling this
|
---|
| 59 | // function
|
---|
| 60 | void GetCurrentAndSpeed(
|
---|
| 61 | float ¤t,
|
---|
| 62 | 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;
|
---|
[3] | 67 | };
|
---|
| 68 |
|
---|
| 69 | #endif // BLCTRLV2_IMPL_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.