Changeset 15 in flair-src for trunk/lib/FlairCore/src/unexported


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

Location:
trunk/lib/FlairCore/src/unexported
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/unexported/ConditionVariable_impl.h

    r2 r15  
    2323
    2424namespace flair {
    25     namespace core {
    26         class ConditionVariable;
    27     }
     25namespace core {
     26class ConditionVariable;
     27}
    2828}
    2929
     
    3232*
    3333*/
    34 class ConditionVariable_impl
    35 {
     34class ConditionVariable_impl {
    3635
    37     public:
    38         ConditionVariable_impl(flair::core::ConditionVariable* self);
    39         ~ConditionVariable_impl();
    40         void CondWait(void);
    41         bool CondWaitUntil(flair::core::Time date);
    42         void CondSignal(void);
     36public:
     37  ConditionVariable_impl(flair::core::ConditionVariable *self);
     38  ~ConditionVariable_impl();
     39  void CondWait(void);
     40  bool CondWaitUntil(flair::core::Time date);
     41  void CondSignal(void);
    4342
    44     private:
    45         flair::core::ConditionVariable* self;
     43private:
     44  flair::core::ConditionVariable *self;
    4645#ifdef __XENO__
    47         RT_COND m_ResumeCond;
     46  RT_COND m_ResumeCond;
    4847#else
    49         pthread_cond_t m_ResumeCond;
     48  pthread_cond_t m_ResumeCond;
    5049#endif
    5150};
  • trunk/lib/FlairCore/src/unexported/DataPlot_impl.h

    r2 r15  
    1616#include <vector>
    1717
    18 namespace flair
    19 {
    20     namespace core
    21     {
    22         class IODataElement;
    23     }
     18namespace flair {
     19namespace core {
     20class IODataElement;
     21}
    2422}
    2523
     
    2826*
    2927*/
    30 class DataPlot_impl
    31 {
    32     public:
    33         DataPlot_impl();
    34         ~DataPlot_impl();
     28class DataPlot_impl {
     29public:
     30  DataPlot_impl();
     31  ~DataPlot_impl();
    3532
    36         std::vector<const flair::core::IODataElement*> tosend;
     33  std::vector<const flair::core::IODataElement *> tosend;
    3734};
    3835
  • trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h

    r2 r15  
    2424#endif
    2525
    26 namespace flair
    27 {
    28     namespace core
    29     {
    30         class FrameworkManager;
    31         class IODevice;
    32         class Watchdog;
    33     }
    34     namespace gui
    35     {
    36         class TabWidget;
    37         class PushButton;
    38         class Layout;
    39     }
     26namespace flair {
     27namespace core {
     28class FrameworkManager;
     29class IODevice;
     30class Watchdog;
     31}
     32namespace gui {
     33class TabWidget;
     34class PushButton;
     35class Layout;
     36}
    4037}
    4138
    4239class ui_com;
    4340
    44 class FrameworkManager_impl: public flair::core::Thread
    45 {
    46     public:
    47         FrameworkManager_impl(flair::core::FrameworkManager *self,std::string name);
    48         ~FrameworkManager_impl();
    49         void SetupConnection(std::string address,uint16_t port,size_t rcv_buf_size=10000);
    50         void SetupUserInterface(std::string xml_file);
    51         void SetupLogger(std::string log_path);
    52         void AddDeviceToLog(flair::core::IODevice *device);
    53         void StartLog();
    54         void StopLog();
    55         char* GetBuffer(size_t sz);
    56         void ReleaseBuffer(char* buf);
    57         void WriteLog(const char* buf,size_t size);
     41class FrameworkManager_impl : public flair::core::Thread {
     42public:
     43  FrameworkManager_impl(flair::core::FrameworkManager *self, std::string name);
     44  ~FrameworkManager_impl();
     45  void SetupConnection(std::string address, uint16_t port,
     46                       size_t rcv_buf_size = 10000);
     47  void SetupUserInterface(std::string xml_file);
     48  void SetupLogger(std::string log_path);
     49  void AddDeviceToLog(flair::core::IODevice *device);
     50  void StartLog();
     51  void StopLog();
     52  char *GetBuffer(size_t sz);
     53  void ReleaseBuffer(char *buf);
     54  void WriteLog(const char *buf, size_t size);
    5855
    59         /*!
    60         * \brief Affiche le xml
    61         *
    62         * Pour debug.
    63         */
    64         void PrintXml(void) const;
     56  /*!
     57  * \brief Affiche le xml
     58  *
     59  * Pour debug.
     60  */
     61  void PrintXml(void) const;
    6562
    66         bool is_logging;
    67         bool disable_errors;
    68         bool connection_lost;
    69         static ui_com *com;
    70         static FrameworkManager_impl *_this;
    71         std::string log_path;
     63  bool is_logging;
     64  bool disable_errors;
     65  bool connection_lost;
     66  static ui_com *com;
     67  static FrameworkManager_impl *_this;
     68  std::string log_path;
    7269
    73         flair::gui::TabWidget* tabwidget;
    74         flair::gui::PushButton *save_button;//,*load_button;
     70  flair::gui::TabWidget *tabwidget;
     71  flair::gui::PushButton *save_button; //,*load_button;
    7572
    76         xmlDocPtr file_doc;
     73  xmlDocPtr file_doc;
    7774
    78         typedef struct {
    79             const flair::core::IODevice* device;
    80             size_t size;
    81             flair::core::Time time;
    82         } log_header_t;
     75  typedef struct {
     76    const flair::core::IODevice *device;
     77    size_t size;
     78    flair::core::Time time;
     79  } log_header_t;
    8380
    84     private:
    85         flair::core::FrameworkManager *self;
    86         UDTSOCKET file_sock,com_sock;
    87         UDTSOCKET GetSocket(std::string address,uint16_t port);
    88         void Run();
    89         void SendFile(std::string path,std::string name);
    90         void FinishSending(void);
    91         std::string FileName(flair::core::IODevice* device);
    92         void SaveXmlChange(char* buf);
    93         void SaveXml(void);
    94         size_t rcv_buf_size;
    95         char *rcv_buf;
     81private:
     82  flair::core::FrameworkManager *self;
     83  UDTSOCKET file_sock, com_sock;
     84  UDTSOCKET GetSocket(std::string address, uint16_t port);
     85  void Run();
     86  void SendFile(std::string path, std::string name);
     87  void FinishSending(void);
     88  std::string FileName(flair::core::IODevice *device);
     89  void SaveXmlChange(char *buf);
     90  void SaveXml(void);
     91  size_t rcv_buf_size;
     92  char *rcv_buf;
    9693#ifdef __XENO__
    97         int CreatePipe(RT_PIPE* fd,std::string name);
    98         int DeletePipe(RT_PIPE* fd);
    99         RT_PIPE cmd_pipe;
    100         RT_PIPE data_pipe;
    101         RT_HEAP log_heap;
     94  int CreatePipe(RT_PIPE *fd, std::string name);
     95  int DeletePipe(RT_PIPE *fd);
     96  RT_PIPE cmd_pipe;
     97  RT_PIPE data_pipe;
     98  RT_HEAP log_heap;
    10299#else
    103         int CreatePipe(int (*fd)[2],std::string name);
    104         int DeletePipe(int (*fd)[2]);
    105         int cmd_pipe[2];
    106         int data_pipe[2];
     100  int CreatePipe(int (*fd)[2], std::string name);
     101  int DeletePipe(int (*fd)[2]);
     102  int cmd_pipe[2];
     103  int data_pipe[2];
    107104#endif
    108         //logger
    109         bool continuer;//a enlever, avoir un seul bool pour toutes les taches
    110         static void* write_log_user(void * arg);
    111         pthread_t log_th;
    112         std::string xml_file;
    113         bool logger_defined;
    114         bool ui_defined;
    115         flair::gui::Layout* top_layout;
     105  // logger
     106  bool continuer; // a enlever, avoir un seul bool pour toutes les taches
     107  static void *write_log_user(void *arg);
     108  pthread_t log_th;
     109  std::string xml_file;
     110  bool logger_defined;
     111  bool ui_defined;
     112  flair::gui::Layout *top_layout;
    116113
    117         typedef struct {
    118             flair::core::IODevice* device;
    119             size_t size;
    120             hdfile_t *dbtFile;
    121             bool running;
    122         } log_desc_t;
     114  typedef struct {
     115    flair::core::IODevice *device;
     116    size_t size;
     117    hdfile_t *dbtFile;
     118    bool running;
     119  } log_desc_t;
    123120
    124         std::vector<log_desc_t> logs;
    125         std::vector<std::string> xml_changes;
    126         flair::core::Watchdog* gcs_watchdog;
    127         void ConnectionLost(void);
     121  std::vector<log_desc_t> logs;
     122  std::vector<std::string> xml_changes;
     123  flair::core::Watchdog *gcs_watchdog;
     124  void ConnectionLost(void);
    128125};
    129126
    130 namespace
    131 {
    132     inline ui_com* getUiCom(void) {
    133         return FrameworkManager_impl::com;
    134     }
     127namespace {
     128inline ui_com *getUiCom(void) { return FrameworkManager_impl::com; }
    135129
    136     inline  FrameworkManager_impl* getFrameworkManagerImpl(void) {
    137         return FrameworkManager_impl::_this;
    138     }
     130inline FrameworkManager_impl *getFrameworkManagerImpl(void) {
     131  return FrameworkManager_impl::_this;
     132}
    139133}
    140134
  • trunk/lib/FlairCore/src/unexported/IODevice_impl.h

    r2 r15  
    1717#include <Object.h>
    1818
    19 namespace flair
    20 {
    21     namespace core
    22     {
    23         class io_data;
    24         class IODevice;
    25         class Thread;
    26         class Mutex;
    27         class FrameworkManager;
    28         class SharedMem;
    29     }
     19namespace flair {
     20namespace core {
     21class io_data;
     22class IODevice;
     23class Thread;
     24class Mutex;
     25class FrameworkManager;
     26class SharedMem;
     27}
    3028}
    3129
    3230class FrameworkManager_impl;
    3331
    34 class IODevice_impl
    35 {
    36     public:
    37         IODevice_impl(const flair::core::IODevice* self);
    38         ~IODevice_impl();
    39         void ResumeThread(void);
    40         size_t LogSize(void) const;
    41         void AppendLog(char** ptr);
    42         void AddDataToLog(const flair::core::io_data* data);
    43         void WriteLogsDescriptors(std::fstream& desc_file,int *index);
    44         int SetToWake(const flair::core::Thread* thread);
    45         void WriteLog(flair::core::Time time);
    46         void AddDeviceToLog(const flair::core::IODevice* device);
    47         bool SetToBeLogged(void);//return true if possible
    48         void OutputToShMem(bool enabled);
    49         void WriteToShMem(void);
    50         void PrintLogsDescriptors(void);
     32class IODevice_impl {
     33public:
     34  IODevice_impl(const flair::core::IODevice *self);
     35  ~IODevice_impl();
     36  void ResumeThread(void);
     37  size_t LogSize(void) const;
     38  void AppendLog(char **ptr);
     39  void AddDataToLog(const flair::core::io_data *data);
     40  void WriteLogsDescriptors(std::fstream &desc_file, int *index);
     41  int SetToWake(const flair::core::Thread *thread);
     42  void WriteLog(flair::core::Time time);
     43  void AddDeviceToLog(const flair::core::IODevice *device);
     44  bool SetToBeLogged(void); // return true if possible
     45  void OutputToShMem(bool enabled);
     46  void WriteToShMem(void);
     47  void PrintLogsDescriptors(void);
    5148
    52     private:
    53         std::vector<const flair::core::IODevice*> devicesToLog;
    54         const flair::core::IODevice* self;
    55         const flair::core::FrameworkManager* framework;
    56         FrameworkManager_impl* framework_impl;
    57         std::vector<const flair::core::io_data*> datasToLog;
    58         flair::core::Thread* thread_to_wake;
    59         flair::core::Mutex* wake_mutex;
    60         bool tobelogged;
    61         bool outputtoshm;
    62         flair::core::SharedMem *shmem;
     49private:
     50  std::vector<const flair::core::IODevice *> devicesToLog;
     51  const flair::core::IODevice *self;
     52  const flair::core::FrameworkManager *framework;
     53  FrameworkManager_impl *framework_impl;
     54  std::vector<const flair::core::io_data *> datasToLog;
     55  flair::core::Thread *thread_to_wake;
     56  flair::core::Mutex *wake_mutex;
     57  bool tobelogged;
     58  bool outputtoshm;
     59  flair::core::SharedMem *shmem;
    6360};
    6461
  • trunk/lib/FlairCore/src/unexported/Mutex_impl.h

    r2 r15  
    2020#endif
    2121
    22 namespace flair
    23 {
    24     namespace core
    25     {
    26         class Mutex;
    27     }
     22namespace flair {
     23namespace core {
     24class Mutex;
     25}
    2826}
    2927
    30 class Mutex_impl
    31 {
    32     public:
    33         Mutex_impl(flair::core::Mutex *self);
    34         ~Mutex_impl();
    35         void GetMutex(void);
    36         void ReleaseMutex(void);
     28class Mutex_impl {
     29public:
     30  Mutex_impl(flair::core::Mutex *self);
     31  ~Mutex_impl();
     32  void GetMutex(void);
     33  void ReleaseMutex(void);
    3734//        bool IsLocked(void);
    3835#ifdef __XENO__
    39         RT_MUTEX mutex;
     36  RT_MUTEX mutex;
    4037#else
    41         pthread_mutex_t mutex;
    42         //bool flag_locked;
     38  pthread_mutex_t mutex;
     39// bool flag_locked;
    4340#endif
    4441
    45     private:
    46         flair::core::Mutex *self;
    47 
     42private:
     43  flair::core::Mutex *self;
    4844};
    4945
  • trunk/lib/FlairCore/src/unexported/Object_impl.h

    r2 r15  
    1919#define OBJECT_IMPL_H
    2020
    21 class Object_impl
    22 {
    23     public:
    24         Object_impl(const flair::core::Object* self,const flair::core::Object* parent=NULL,std::string name="",std::string type="");
    25         ~Object_impl();
    26         std::string name,type;
    27         std::vector<const flair::core::Object*> childs;
    28         std::vector<const flair::core::Object*> type_childs;
    29         void AddChild(const flair::core::Object* child);
    30         void RemoveChild(const flair::core::Object* child);
    31         bool ErrorOccured(bool recursive);
    32         bool error_occured;
    33         const flair::core::Object* parent;
     21class Object_impl {
     22public:
     23  Object_impl(const flair::core::Object *self,
     24              const flair::core::Object *parent = NULL, std::string name = "",
     25              std::string type = "");
     26  ~Object_impl();
     27  std::string name, type;
     28  std::vector<const flair::core::Object *> childs;
     29  std::vector<const flair::core::Object *> type_childs;
     30  void AddChild(const flair::core::Object *child);
     31  void RemoveChild(const flair::core::Object *child);
     32  bool ErrorOccured(bool recursive);
     33  bool error_occured;
     34  const flair::core::Object *parent;
    3435
    35     private:
    36         const flair::core::Object* self;
     36private:
     37  const flair::core::Object *self;
    3738};
    3839
  • trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h

    r2 r15  
    1414#define ONEAXISROTATION_IMPL_H
    1515
    16 namespace flair
    17 {
    18     namespace core
    19     {
    20         class Vector3D;
    21         class Euler;
    22         class Quaternion;
    23         class RotationMatrix;
    24     }
    25     namespace gui
    26     {
    27         class GroupBox;
    28         class ComboBox;
    29         class DoubleSpinBox;
    30     }
     16namespace flair {
     17namespace core {
     18class Vector3D;
     19class Euler;
     20class Quaternion;
     21class RotationMatrix;
     22}
     23namespace gui {
     24class GroupBox;
     25class ComboBox;
     26class DoubleSpinBox;
     27}
    3128}
    3229
     
    3532*
    3633*/
    37 class OneAxisRotation_impl
    38 {
    39     public:
    40         OneAxisRotation_impl(flair::gui::GroupBox* box);
    41         ~OneAxisRotation_impl();
    42         void ComputeRotation(flair::core::Vector3D& point) const;
    43         void ComputeRotation(flair::core::Quaternion& quat) const;
    44         void ComputeRotation(flair::core::RotationMatrix& matrix) const;
    45         void ComputeRotation(flair::core::Euler& euler) const;
     34class OneAxisRotation_impl {
     35public:
     36  OneAxisRotation_impl(flair::gui::GroupBox *box);
     37  ~OneAxisRotation_impl();
     38  void ComputeRotation(flair::core::Vector3D &point) const;
     39  void ComputeRotation(flair::core::Quaternion &quat) const;
     40  void ComputeRotation(flair::core::RotationMatrix &matrix) const;
     41  void ComputeRotation(flair::core::Euler &euler) const;
    4642
    47     private:
    48         flair::gui::ComboBox *rot_axe;
    49         flair::gui::DoubleSpinBox* rot_value;
     43private:
     44  flair::gui::ComboBox *rot_axe;
     45  flair::gui::DoubleSpinBox *rot_value;
    5046};
    5147
  • trunk/lib/FlairCore/src/unexported/SendData_impl.h

    r2 r15  
    2323*
    2424*/
    25 class SendData_impl
    26 {
    27     public:
    28                 SendData_impl();
    29                 ~SendData_impl();
    30         bool is_enabled;
    31         size_t send_size;
    32         uint16_t send_period;
     25class SendData_impl {
     26public:
     27  SendData_impl();
     28  ~SendData_impl();
     29  bool is_enabled;
     30  size_t send_size;
     31  uint16_t send_period;
    3332};
    3433
  • trunk/lib/FlairCore/src/unexported/SharedMem_impl.h

    r2 r15  
    2323#endif
    2424
    25 namespace flair
    26 {
    27     namespace core
    28     {
    29         class SharedMem;
    30     }
     25namespace flair {
     26namespace core {
     27class SharedMem;
     28}
    3129}
    3230
     
    3634*/
    3735
    38 class SharedMem_impl
    39 {
    40     public:
    41         SharedMem_impl(const flair::core::SharedMem* self,std::string name,size_t size);
    42         ~SharedMem_impl();
     36class SharedMem_impl {
     37public:
     38  SharedMem_impl(const flair::core::SharedMem *self, std::string name,
     39                 size_t size);
     40  ~SharedMem_impl();
    4341
    44         void Write(const char* buf,size_t size);
    45         void Read(char* buf,size_t size);
     42  void Write(const char *buf, size_t size);
     43  void Read(char *buf, size_t size);
    4644
    47     private:
    48         const flair::core::SharedMem* self;
    49         size_t size;
    50         char *mem_segment;
     45private:
     46  const flair::core::SharedMem *self;
     47  size_t size;
     48  char *mem_segment;
    5149#ifdef __XENO__
    52         RT_HEAP heap;
    53         RT_MUTEX mutex;
    54         bool heap_binded;
    55         bool mutex_binded;
     50  RT_HEAP heap;
     51  RT_MUTEX mutex;
     52  bool heap_binded;
     53  bool mutex_binded;
    5654#else
    57         int fd;
    58         sem_t *sem;
    59         std::string sem_name,shm_name;
     55  int fd;
     56  sem_t *sem;
     57  std::string sem_name, shm_name;
    6058#endif
    6159};
  • trunk/lib/FlairCore/src/unexported/Socket_impl.h

    r2 r15  
    2121#endif
    2222
    23 namespace flair
    24 {
    25     namespace core
    26     {
    27         class Socket;
    28     }
     23namespace flair {
     24namespace core {
     25class Socket;
     26}
    2927}
    3028
    31 class Socket_impl
    32 {
    33     public:
    34         Socket_impl(const flair::core::Socket* self, std::string name,std::string address,bool broadcast=false);
    35         Socket_impl(const flair::core::Socket* self, std::string name,uint16_t port);
    36         ~Socket_impl();
     29class Socket_impl {
     30public:
     31  Socket_impl(const flair::core::Socket *self, std::string name,
     32              std::string address, bool broadcast = false);
     33  Socket_impl(const flair::core::Socket *self, std::string name, uint16_t port);
     34  ~Socket_impl();
    3735
    38         void SendMessage(std::string message);
    39         void SendMessage(const char* src,size_t src_len);
    40         ssize_t RecvMessage(char* msg,size_t msg_len,flair::core::Time timeout,char* src=NULL,size_t* src_len=NULL);
     36  void SendMessage(std::string message);
     37  void SendMessage(const char *src, size_t src_len);
     38  ssize_t RecvMessage(char *msg, size_t msg_len, flair::core::Time timeout,
     39                      char *src = NULL, size_t *src_len = NULL);
    4140
    42     private:
    43         int fd;
    44         uint16_t port;
    45         std::string address;
    46         bool broadcast;
    47         void Init(void);
    48         const flair::core::Socket* self;
    49         struct sockaddr_in sock_in;
     41private:
     42  int fd;
     43  uint16_t port;
     44  std::string address;
     45  bool broadcast;
     46  void Init(void);
     47  const flair::core::Socket *self;
     48  struct sockaddr_in sock_in;
    5049#ifdef __XENO__
    51         bool is_running;
    52         static void* user(void * arg);
    53         pthread_t user_thread;
    54         RT_PIPE pipe;
     50  bool is_running;
     51  static void *user(void *arg);
     52  pthread_t user_thread;
     53  RT_PIPE pipe;
    5554#endif
    5655};
  • trunk/lib/FlairCore/src/unexported/Thread_impl.h

    r2 r15  
    2222#endif
    2323
    24 namespace flair
    25 {
    26     namespace core
    27     {
    28         class Thread;
    29         class IODevice;
    30         class ConditionVariable;
    31     }
     24namespace flair {
     25namespace core {
     26class Thread;
     27class IODevice;
     28class ConditionVariable;
     29}
    3230}
    3331
    34 class Thread_impl
    35 {
    36     public:
    37         Thread_impl(flair::core::Thread* self,uint8_t priority);
    38         ~Thread_impl();
    39         void Start(void);
    40         void Join(void);
    41         void SafeStop(void);
    42         bool ToBeStopped(void);
    43         void SetPeriodUS(uint32_t period);
    44         uint32_t GetPeriodUS(void) const;
    45         void SetPeriodMS(uint32_t period);
    46         uint32_t GetPeriodMS(void) const;
    47         void WaitPeriod(void);
    48         void Suspend(void);
    49         bool SuspendUntil (flair::core::Time date);
    50         void Resume(void);
    51         bool IsSuspended(void);
    52         int WaitUpdate(const flair::core::IODevice* device);
    53         bool period_set;
     32class Thread_impl {
     33public:
     34  Thread_impl(flair::core::Thread *self, uint8_t priority);
     35  ~Thread_impl();
     36  void Start(void);
     37  void Join(void);
     38  void SafeStop(void);
     39  bool ToBeStopped(void);
     40  void SetPeriodUS(uint32_t period);
     41  uint32_t GetPeriodUS(void) const;
     42  void SetPeriodMS(uint32_t period);
     43  uint32_t GetPeriodMS(void) const;
     44  void WaitPeriod(void);
     45  void Suspend(void);
     46  bool SuspendUntil(flair::core::Time date);
     47  void Resume(void);
     48  bool IsSuspended(void);
     49  int WaitUpdate(const flair::core::IODevice *device);
     50  bool period_set;
    5451
    55     private:
    56         flair::core::Thread* self;
    57         flair::core::ConditionVariable* cond;
    58         uint8_t priority;
    59         flair::core::Time max_jitter,min_jitter,mean_jitter;
    60         flair::core::Time last;
    61         uint64_t cpt;
    62         flair::core::Time period;
    63         bool isRunning;
    64         bool tobestopped;
    65         bool is_suspended;
    66         void PrintStats(void);
    67         void ComputeJitter(flair::core::Time time);
     52private:
     53  flair::core::Thread *self;
     54  flair::core::ConditionVariable *cond;
     55  uint8_t priority;
     56  flair::core::Time max_jitter, min_jitter, mean_jitter;
     57  flair::core::Time last;
     58  uint64_t cpt;
     59  flair::core::Time period;
     60  bool isRunning;
     61  bool tobestopped;
     62  bool is_suspended;
     63  void PrintStats(void);
     64  void ComputeJitter(flair::core::Time time);
    6865#ifdef __XENO__
    69         RT_TASK task_rt;
    70         static void main_rt(void * arg);
     66  RT_TASK task_rt;
     67  static void main_rt(void *arg);
    7168#else
    72         pthread_t task_nrt;
    73         static void* main_nrt(void * arg);
    74         flair::core::Time next_time;
     69  pthread_t task_nrt;
     70  static void *main_nrt(void *arg);
     71  flair::core::Time next_time;
    7572#endif
    7673};
  • trunk/lib/FlairCore/src/unexported/Widget_impl.h

    r2 r15  
    1717#include <io_data.h>
    1818
    19 namespace flair
    20 {
    21     namespace gui
    22     {
    23         class Widget;
    24     }
     19namespace flair {
     20namespace gui {
     21class Widget;
     22}
    2523}
    2624
     
    2826* \brief Classe representant un Widget
    2927*
    30 *  C'est une classe de base. Tout comme l'Object elle permet de gérer les liens de parenté
    31 *  et de détruire automatiquement les enfants. Elle permet en plus de gérer une communication
     28*  C'est une classe de base. Tout comme l'Object elle permet de gérer les liens
     29*de parenté
     30*  et de détruire automatiquement les enfants. Elle permet en plus de gérer une
     31*communication
    3232*  avec la station sol, et donc d'y afficher un QWidget. \n
    33 *  La comunication avec la station sol se fait par l'échange de fichiers xml. Les propriétés xml du Widget sont
     33*  La comunication avec la station sol se fait par l'échange de fichiers xml.
     34*Les propriétés xml du Widget sont
    3435*  modifiables par les fonctions appropriées. \n
    35 *  Un fichier xml de réglages par défaut du Widget est utilisé s'il a été spécifié à la construction du FrameworkManager.
     36*  Un fichier xml de réglages par défaut du Widget est utilisé s'il a été
     37*spécifié à la construction du FrameworkManager.
    3638*/
    37 class Widget_impl
    38 {
    39     friend class flair::core::FrameworkManager;
    40     friend class FrameworkManager_impl;
     39class Widget_impl {
     40  friend class flair::core::FrameworkManager;
     41  friend class FrameworkManager_impl;
    4142
    42     public:
    43         /*!
    44         * \brief Constructeur
    45         *
    46         * Construit un Widget, qui est automatiquement enfant du parent. Le fichier xml
    47         * spécifié au constructeur du FrameworkManager est utilisé pour les réglages par
    48         * défaut. \n
    49         * Sauf pour le FrameworkManager, ce constructeur doit être apellé depuis une tache temps réel
    50         * lorsque l'on utilise la librairie framework_rt.
    51         *
    52         * \param parent parent
    53         * \param name nom
    54         * \param type type
    55         */
    56         Widget_impl(flair::gui::Widget* self,const flair::gui::Widget* parent,std::string name,std::string type);
     43public:
     44  /*!
     45  * \brief Constructeur
     46  *
     47  * Construit un Widget, qui est automatiquement enfant du parent. Le fichier
     48  *xml
     49  * spécifié au constructeur du FrameworkManager est utilisé pour les réglages
     50  *par
     51  * défaut. \n
     52  * Sauf pour le FrameworkManager, ce constructeur doit être apellé depuis une
     53  *tache temps réel
     54  * lorsque l'on utilise la librairie framework_rt.
     55  *
     56  * \param parent parent
     57  * \param name nom
     58  * \param type type
     59  */
     60  Widget_impl(flair::gui::Widget *self, const flair::gui::Widget *parent,
     61              std::string name, std::string type);
    5762
    58         /*!
    59         * \brief Déstructeur
    60         *
    61         * Détruit automatiquement les enfants.
    62         * La destruction implique la destruction du QWidget associé sur la station sol.\n
    63         * Sauf pour le FrameworkManager, ce déstructeur doit être apellé depuis une tache temps réel
    64         * lorsque l'on utilise la librairie framework_rt.
    65         *
    66         */
    67         ~Widget_impl();
     63  /*!
     64  * \brief Déstructeur
     65  *
     66  * Détruit automatiquement les enfants.
     67  * La destruction implique la destruction du QWidget associé sur la station
     68  *sol.\n
     69  * Sauf pour le FrameworkManager, ce déstructeur doit être apellé depuis une
     70  *tache temps réel
     71  * lorsque l'on utilise la librairie framework_rt.
     72  *
     73  */
     74  ~Widget_impl();
    6875
    69         /*!
    70         * \brief Activer
    71         *
    72         * Active le QWidget associé sur la station sol. \n
    73         * Un QWdiget désactivé apparait grisé et n'est pas modifiable.
    74         *
    75         * \param status
    76         */
    77         void setEnabled(bool status);
     76  /*!
     77  * \brief Activer
     78  *
     79  * Active le QWidget associé sur la station sol. \n
     80  * Un QWdiget désactivé apparait grisé et n'est pas modifiable.
     81  *
     82  * \param status
     83  */
     84  void setEnabled(bool status);
    7885
    79         /*!
    80         * \brief Envoi le xml
    81         *
    82         * Envoi le xml à la station sol pour prendre en compte les changements.
    83         */
    84         void SendXml(void);
     86  /*!
     87  * \brief Envoi le xml
     88  *
     89  * Envoi le xml à la station sol pour prendre en compte les changements.
     90  */
     91  void SendXml(void);
    8592
    86         xmlNodePtr file_node;
    87         xmlNodePtr send_node;
    88         bool isenabled;
     93  xmlNodePtr file_node;
     94  xmlNodePtr send_node;
     95  bool isenabled;
    8996
    90      private:
    91         flair::gui::Widget* self;
     97private:
     98  flair::gui::Widget *self;
    9299
    93         std::vector<flair::gui::Widget*> childs;
     100  std::vector<flair::gui::Widget *> childs;
    94101
    95         void AddChild(const flair::gui::Widget* child);
    96         void RemoveChild(const flair::gui::Widget* child);
     102  void AddChild(const flair::gui::Widget *child);
     103  void RemoveChild(const flair::gui::Widget *child);
    97104
    98          /*!
    99         * \brief Efface les proriétés xml
    100         *
    101         *  Permet d'effacer toutes les propriétés XML fixées par SetVolatileXmlProp.
    102         *  A utliser lorsque l'on a plus besoin d'utiliser ces propriétés. Utile
    103         * pour réduire la taille des fichiers XML écangés avec la station sol.
    104         */
    105         void ClearXmlProps(void);
     105  /*!
     106 * \brief Efface les proriétés xml
     107 *
     108 *  Permet d'effacer toutes les propriétés XML fixées par SetVolatileXmlProp.
     109 *  A utliser lorsque l'on a plus besoin d'utiliser ces propriétés. Utile
     110 * pour réduire la taille des fichiers XML écangés avec la station sol.
     111 */
     112  void ClearXmlProps(void);
    106113
    107         //xml
    108         void ProcessXML(xmlNode *node);
    109         xmlDocPtr CopyDoc(void);
    110         static xmlNodePtr GetNodeByProp(xmlNodePtr doc,xmlChar *type,xmlChar *prop,xmlChar *value);
    111         void printSendNode();
    112         xmlDocPtr send_doc;
     114  // xml
     115  void ProcessXML(xmlNode *node);
     116  xmlDocPtr CopyDoc(void);
     117  static xmlNodePtr GetNodeByProp(xmlNodePtr doc, xmlChar *type, xmlChar *prop,
     118                                  xmlChar *value);
     119  void printSendNode();
     120  xmlDocPtr send_doc;
    113121};
    114122
  • trunk/lib/FlairCore/src/unexported/communication.h

    r2 r15  
    66#define COMMUNICATION_H
    77
    8 
    9 //messages file socket
     8// messages file socket
    109#define FILE_INFO_LITTLE_ENDIAN 0x01
    1110#define FILE_INFO_BIG_ENDIAN 0x02
     
    1918#define DATAS_BIG_ENDIAN 0xfe
    2019
    21 
    2220#endif // COMMUNICATION_H
  • trunk/lib/FlairCore/src/unexported/config.h

    r2 r15  
    1919#define CONFIG_H
    2020
    21 //stack size of nrt threads, comment it to use default value
    22 #define NRT_STACK_SIZE 1024*1024*1
     21// stack size of nrt threads, comment it to use default value
     22#define NRT_STACK_SIZE 1024 * 1024 * 1
    2323
    24 //stack size of rt threads, comment it to use default value
    25 #define RT_STACK_SIZE 1024*100
     24// stack size of rt threads, comment it to use default value
     25#define RT_STACK_SIZE 1024 * 100
    2626
    27 //rt pipe size, comment it to use system heap
    28 #define RT_PIPE_SIZE 1024*1024
     27// rt pipe size, comment it to use system heap
     28#define RT_PIPE_SIZE 1024 * 1024
    2929
    30 //nrt pipe size
    31 #define NRT_PIPE_SIZE 1024*100
     30// nrt pipe size
     31#define NRT_PIPE_SIZE 1024 * 100
    3232
    33 //rt log heap size
    34 #define LOG_HEAP 1024*100
     33// rt log heap size
     34#define LOG_HEAP 1024 * 100
    3535
    36 //xml heap size
    37 #define XML_HEAP 5*1024*1024
     36// xml heap size
     37#define XML_HEAP 5 * 1024 * 1024
    3838
    39 //nrt pipe path
     39// nrt pipe path
    4040#define NRT_PIPE_PATH "/proc/xenomai/registry/native/pipes/"
    4141
    42 //min priority for Threads
     42// min priority for Threads
    4343#define MIN_THREAD_PRIORITY 20
    4444
    45 //max priority for Threads
     45// max priority for Threads
    4646#define MAX_THREAD_PRIORITY 99
    4747
    48 //priority of the FrameworkManager task (manages udt connection)
     48// priority of the FrameworkManager task (manages udt connection)
    4949#define FRAMEWORK_TASK_PRIORITY 1
    5050
    51 //timeout in ms for select
     51// timeout in ms for select
    5252#define SELECT_TIMEOUT_MS 200
    5353
    54 //type of xml root element
     54// type of xml root element
    5555#define XML_ROOT_TYPE "root"
    5656
    57 //name of xml root element
     57// name of xml root element
    5858//#define XML_ROOT_ELEMENT "Manager"
    5959
    60 //name of main tabwidget
     60// name of main tabwidget
    6161#define XML_MAIN_TABWIDGET "Main_TabWidget"
    6262
    63 //name of app tabwidget
     63// name of app tabwidget
    6464#define XML_APP_TABWIDGET "App_TabWidget"
    6565
    66 //use compression for messages with ground station
     66// use compression for messages with ground station
    6767#define COMPRESS_FRAMES
    6868
    69 //size of buffer shunck
     69// size of buffer shunck
    7070#define COMPRESS_CHUNK 1024
    7171
  • trunk/lib/FlairCore/src/unexported/cvmatrix_impl.h

    r2 r15  
    1414#define CVMATRIX_IMPL_H
    1515
    16 
    1716#include <io_data.h>
    1817#include <cvmatrix.h>
     
    2423*
    2524*/
    26 class cvmatrix_impl
    27 {
    28     public:
    29         cvmatrix_impl(flair::core::cvmatrix* self,int rows,int cols,flair::core::ScalarType const &elementDataType,int n);
    30         cvmatrix_impl(flair::core::cvmatrix* self,const flair::core::cvmatrix_descriptor *descriptor, flair::core::ScalarType const &elementDataType,int n);
    31         ~cvmatrix_impl();
     25class cvmatrix_impl {
     26public:
     27  cvmatrix_impl(flair::core::cvmatrix *self, int rows, int cols,
     28                flair::core::ScalarType const &elementDataType, int n);
     29  cvmatrix_impl(flair::core::cvmatrix *self,
     30                const flair::core::cvmatrix_descriptor *descriptor,
     31                flair::core::ScalarType const &elementDataType, int n);
     32  ~cvmatrix_impl();
    3233
    33         CvMat* mat;
    34         flair::core::ScalarType const &elementDataType;
    35         // const since if element description is modified it would be a mess in the log
    36         const flair::core::cvmatrix_descriptor *descriptor;
     34  CvMat *mat;
     35  flair::core::ScalarType const &elementDataType;
     36  // const since if element description is modified it would be a mess in the
     37  // log
     38  const flair::core::cvmatrix_descriptor *descriptor;
    3739
    38     private:
    39         flair::core::cvmatrix* self;
    40         void Init(flair::core::cvmatrix* self,int n);
     40private:
     41  flair::core::cvmatrix *self;
     42  void Init(flair::core::cvmatrix *self, int n);
    4143};
    4244
  • trunk/lib/FlairCore/src/unexported/io_data_impl.h

    r2 r15  
    1919* \brief Abstract class for data types.
    2020*
    21 * Use this class to define a custom data type. Data types ares used for logging and graphs. \n
     21* Use this class to define a custom data type. Data types ares used for logging
     22*and graphs. \n
    2223* The reimplemented class must call SetSize() in its constructor. \n
    2324* io_data can be constructed with n samples (see io_data::io_data).
    2425* In this case, old samples can be accessed throug io_data::Prev.
    2526*/
    26 class io_data_impl
    27 {
    28     public:
    29                 io_data_impl(flair::core::io_data* self,int n);
    30                 ~io_data_impl();
    31                 void Circle(void);
    32                 bool IsConsistent(void);
    33                 void SetConsistent(bool status);
    34                 void WriteLogDescriptor(std::fstream& desc_file,int *index);
    35                 void PrintLogDescriptor(void);
    36         void AppendLogDescription(std::string description,flair::core::DataType const &datatype);
    37         size_t size;
    38         flair::core::Time time;
    39         void** circle_ptr;
     27class io_data_impl {
     28public:
     29  io_data_impl(flair::core::io_data *self, int n);
     30  ~io_data_impl();
     31  void Circle(void);
     32  bool IsConsistent(void);
     33  void SetConsistent(bool status);
     34  void WriteLogDescriptor(std::fstream &desc_file, int *index);
     35  void PrintLogDescriptor(void);
     36  void AppendLogDescription(std::string description,
     37                            flair::core::DataType const &datatype);
     38  size_t size;
     39  flair::core::Time time;
     40  void **circle_ptr;
    4041
    41     private:
    42         flair::core::io_data* self;
    43         int n;
    44         bool is_consistent;
    45         std::vector<std::string> descriptors;
     42private:
     43  flair::core::io_data *self;
     44  int n;
     45  bool is_consistent;
     46  std::vector<std::string> descriptors;
    4647};
    4748
  • trunk/lib/FlairCore/src/unexported/ui_com.h

    r2 r15  
    2525#endif
    2626
    27 namespace flair
    28 {
    29     namespace core
    30     {
    31         class Mutex;
    32         class Object;
    33     }
    34     namespace gui
    35     {
    36         class SendData;
    37     }
     27namespace flair {
     28namespace core {
     29class Mutex;
     30class Object;
     31}
     32namespace gui {
     33class SendData;
     34}
    3835}
    3936
    40 class ui_com: public flair::core::Thread
    41 {
    42     public:
    43         ui_com(const flair::core::Object *parent,UDTSOCKET sock);
    44         ~ui_com();
    45         void Send(char* buf,ssize_t size);
    46         ssize_t Receive(char* buf,ssize_t buf_size);
    47         void AddSendData(const flair::gui::SendData *obj);
    48         void UpdateSendData(const flair::gui::SendData *obj);
    49         void RemoveSendData(const flair::gui::SendData *obj);
    50         void UpdateDataToSendSize(void);
    51         void Block(void);
    52         void UnBlock(void);
    53         bool ConnectionLost(void);
     37class ui_com : public flair::core::Thread {
     38public:
     39  ui_com(const flair::core::Object *parent, UDTSOCKET sock);
     40  ~ui_com();
     41  void Send(char *buf, ssize_t size);
     42  ssize_t Receive(char *buf, ssize_t buf_size);
     43  void AddSendData(const flair::gui::SendData *obj);
     44  void UpdateSendData(const flair::gui::SendData *obj);
     45  void RemoveSendData(const flair::gui::SendData *obj);
     46  void UpdateDataToSendSize(void);
     47  void Block(void);
     48  void UnBlock(void);
     49  bool ConnectionLost(void);
    5450
    55     private:
    56         ssize_t send_size;
    57         char *send_buffer;
    58         std::vector<const flair::gui::SendData*> data_to_send;
    59         std::vector<flair::core::Time> resume_time;
    60         flair::core::Mutex *send_mutex;
    61         UDTSOCKET socket_fd;
    62         bool connection_lost;
    63         void Run(void);
    64         void SendDatas(void);
    65         static int compressBuffer(char *in, ssize_t in_size,char **out,ssize_t *out_size, int level);
    66         static int uncompressBuffer(unsigned char *in, ssize_t in_size,unsigned char **out,ssize_t *out_size);
     51private:
     52  ssize_t send_size;
     53  char *send_buffer;
     54  std::vector<const flair::gui::SendData *> data_to_send;
     55  std::vector<flair::core::Time> resume_time;
     56  flair::core::Mutex *send_mutex;
     57  UDTSOCKET socket_fd;
     58  bool connection_lost;
     59  void Run(void);
     60  void SendDatas(void);
     61  static int compressBuffer(char *in, ssize_t in_size, char **out,
     62                            ssize_t *out_size, int level);
     63  static int uncompressBuffer(unsigned char *in, ssize_t in_size,
     64                              unsigned char **out, ssize_t *out_size);
    6765#ifdef __XENO__
    68         bool is_running;
    69         static void* user_thread(void * arg);
    70         pthread_t thread;
    71         RT_PIPE pipe;
     66  bool is_running;
     67  static void *user_thread(void *arg);
     68  pthread_t thread;
     69  RT_PIPE pipe;
    7270#endif
    73 
    7471};
    7572
Note: See TracChangeset for help on using the changeset viewer.