Changeset 15 in flair-src for trunk/lib/FlairCore/src/unexported
- Timestamp:
- Apr 8, 2016, 3:40:57 PM (9 years ago)
- Location:
- trunk/lib/FlairCore/src/unexported
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/unexported/ConditionVariable_impl.h
r2 r15 23 23 24 24 namespace flair { 25 26 27 25 namespace core { 26 class ConditionVariable; 27 } 28 28 } 29 29 … … 32 32 * 33 33 */ 34 class ConditionVariable_impl 35 { 34 class ConditionVariable_impl { 36 35 37 38 ConditionVariable_impl(flair::core::ConditionVariable*self);39 40 41 42 36 public: 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); 43 42 44 45 flair::core::ConditionVariable*self;43 private: 44 flair::core::ConditionVariable *self; 46 45 #ifdef __XENO__ 47 46 RT_COND m_ResumeCond; 48 47 #else 49 48 pthread_cond_t m_ResumeCond; 50 49 #endif 51 50 }; -
trunk/lib/FlairCore/src/unexported/DataPlot_impl.h
r2 r15 16 16 #include <vector> 17 17 18 namespace flair 19 { 20 namespace core 21 { 22 class IODataElement; 23 } 18 namespace flair { 19 namespace core { 20 class IODataElement; 21 } 24 22 } 25 23 … … 28 26 * 29 27 */ 30 class DataPlot_impl 31 { 32 public: 33 DataPlot_impl(); 34 ~DataPlot_impl(); 28 class DataPlot_impl { 29 public: 30 DataPlot_impl(); 31 ~DataPlot_impl(); 35 32 36 std::vector<const flair::core::IODataElement*> tosend;33 std::vector<const flair::core::IODataElement *> tosend; 37 34 }; 38 35 -
trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h
r2 r15 24 24 #endif 25 25 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 } 26 namespace flair { 27 namespace core { 28 class FrameworkManager; 29 class IODevice; 30 class Watchdog; 31 } 32 namespace gui { 33 class TabWidget; 34 class PushButton; 35 class Layout; 36 } 40 37 } 41 38 42 39 class ui_com; 43 40 44 class FrameworkManager_impl : public flair::core::Thread45 { 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 51 52 53 54 55 char*GetBuffer(size_t sz);56 void ReleaseBuffer(char*buf);57 void WriteLog(const char* buf,size_t size);41 class FrameworkManager_impl : public flair::core::Thread { 42 public: 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); 58 55 59 60 61 62 63 64 56 /*! 57 * \brief Affiche le xml 58 * 59 * Pour debug. 60 */ 61 void PrintXml(void) const; 65 62 66 67 68 69 70 71 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; 72 69 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; 75 72 76 73 xmlDocPtr file_doc; 77 74 78 79 const flair::core::IODevice*device;80 81 82 75 typedef struct { 76 const flair::core::IODevice *device; 77 size_t size; 78 flair::core::Time time; 79 } log_header_t; 83 80 84 85 86 UDTSOCKET file_sock,com_sock;87 UDTSOCKET GetSocket(std::string address,uint16_t port);88 89 void SendFile(std::string path,std::string name);90 91 std::string FileName(flair::core::IODevice*device);92 void SaveXmlChange(char*buf);93 94 95 81 private: 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; 96 93 #ifdef __XENO__ 97 int CreatePipe(RT_PIPE* fd,std::string name);98 int DeletePipe(RT_PIPE*fd);99 100 101 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; 102 99 #else 103 int CreatePipe(int (*fd)[2],std::string name);104 105 106 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]; 107 104 #endif 108 //logger109 bool continuer;//a enlever, avoir un seul bool pour toutes les taches110 static void* write_log_user(void *arg);111 112 113 114 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; 116 113 117 118 flair::core::IODevice*device;119 120 121 122 114 typedef struct { 115 flair::core::IODevice *device; 116 size_t size; 117 hdfile_t *dbtFile; 118 bool running; 119 } log_desc_t; 123 120 124 125 126 flair::core::Watchdog*gcs_watchdog;127 121 std::vector<log_desc_t> logs; 122 std::vector<std::string> xml_changes; 123 flair::core::Watchdog *gcs_watchdog; 124 void ConnectionLost(void); 128 125 }; 129 126 130 namespace 131 { 132 inline ui_com* getUiCom(void) { 133 return FrameworkManager_impl::com; 134 } 127 namespace { 128 inline ui_com *getUiCom(void) { return FrameworkManager_impl::com; } 135 129 136 inline FrameworkManager_impl*getFrameworkManagerImpl(void) {137 138 130 inline FrameworkManager_impl *getFrameworkManagerImpl(void) { 131 return FrameworkManager_impl::_this; 132 } 139 133 } 140 134 -
trunk/lib/FlairCore/src/unexported/IODevice_impl.h
r2 r15 17 17 #include <Object.h> 18 18 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 } 19 namespace flair { 20 namespace core { 21 class io_data; 22 class IODevice; 23 class Thread; 24 class Mutex; 25 class FrameworkManager; 26 class SharedMem; 27 } 30 28 } 31 29 32 30 class FrameworkManager_impl; 33 31 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); 32 class IODevice_impl { 33 public: 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); 51 48 52 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 61 62 49 private: 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; 63 60 }; 64 61 -
trunk/lib/FlairCore/src/unexported/Mutex_impl.h
r2 r15 20 20 #endif 21 21 22 namespace flair 23 { 24 namespace core 25 { 26 class Mutex; 27 } 22 namespace flair { 23 namespace core { 24 class Mutex; 25 } 28 26 } 29 27 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); 28 class Mutex_impl { 29 public: 30 Mutex_impl(flair::core::Mutex *self); 31 ~Mutex_impl(); 32 void GetMutex(void); 33 void ReleaseMutex(void); 37 34 // bool IsLocked(void); 38 35 #ifdef __XENO__ 39 36 RT_MUTEX mutex; 40 37 #else 41 42 //bool flag_locked;38 pthread_mutex_t mutex; 39 // bool flag_locked; 43 40 #endif 44 41 45 private: 46 flair::core::Mutex *self; 47 42 private: 43 flair::core::Mutex *self; 48 44 }; 49 45 -
trunk/lib/FlairCore/src/unexported/Object_impl.h
r2 r15 19 19 #define OBJECT_IMPL_H 20 20 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; 21 class Object_impl { 22 public: 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; 34 35 35 36 const flair::core::Object*self;36 private: 37 const flair::core::Object *self; 37 38 }; 38 39 -
trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h
r2 r15 14 14 #define ONEAXISROTATION_IMPL_H 15 15 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 } 16 namespace flair { 17 namespace core { 18 class Vector3D; 19 class Euler; 20 class Quaternion; 21 class RotationMatrix; 22 } 23 namespace gui { 24 class GroupBox; 25 class ComboBox; 26 class DoubleSpinBox; 27 } 31 28 } 32 29 … … 35 32 * 36 33 */ 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; 34 class OneAxisRotation_impl { 35 public: 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; 46 42 47 48 49 flair::gui::DoubleSpinBox*rot_value;43 private: 44 flair::gui::ComboBox *rot_axe; 45 flair::gui::DoubleSpinBox *rot_value; 50 46 }; 51 47 -
trunk/lib/FlairCore/src/unexported/SendData_impl.h
r2 r15 23 23 * 24 24 */ 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; 25 class SendData_impl { 26 public: 27 SendData_impl(); 28 ~SendData_impl(); 29 bool is_enabled; 30 size_t send_size; 31 uint16_t send_period; 33 32 }; 34 33 -
trunk/lib/FlairCore/src/unexported/SharedMem_impl.h
r2 r15 23 23 #endif 24 24 25 namespace flair 26 { 27 namespace core 28 { 29 class SharedMem; 30 } 25 namespace flair { 26 namespace core { 27 class SharedMem; 28 } 31 29 } 32 30 … … 36 34 */ 37 35 38 class SharedMem_impl 39 { 40 public:41 SharedMem_impl(const flair::core::SharedMem* self,std::string name,size_t size);42 36 class SharedMem_impl { 37 public: 38 SharedMem_impl(const flair::core::SharedMem *self, std::string name, 39 size_t size); 40 ~SharedMem_impl(); 43 41 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); 46 44 47 48 const flair::core::SharedMem*self;49 50 45 private: 46 const flair::core::SharedMem *self; 47 size_t size; 48 char *mem_segment; 51 49 #ifdef __XENO__ 52 53 54 55 50 RT_HEAP heap; 51 RT_MUTEX mutex; 52 bool heap_binded; 53 bool mutex_binded; 56 54 #else 57 58 59 std::string sem_name,shm_name;55 int fd; 56 sem_t *sem; 57 std::string sem_name, shm_name; 60 58 #endif 61 59 }; -
trunk/lib/FlairCore/src/unexported/Socket_impl.h
r2 r15 21 21 #endif 22 22 23 namespace flair 24 { 25 namespace core 26 { 27 class Socket; 28 } 23 namespace flair { 24 namespace core { 25 class Socket; 26 } 29 27 } 30 28 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 29 class Socket_impl { 30 public: 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(); 37 35 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); 41 40 42 43 44 45 46 47 48 const flair::core::Socket*self;49 41 private: 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; 50 49 #ifdef __XENO__ 51 52 static void* user(void *arg);53 54 50 bool is_running; 51 static void *user(void *arg); 52 pthread_t user_thread; 53 RT_PIPE pipe; 55 54 #endif 56 55 }; -
trunk/lib/FlairCore/src/unexported/Thread_impl.h
r2 r15 22 22 #endif 23 23 24 namespace flair 25 { 26 namespace core 27 { 28 class Thread; 29 class IODevice; 30 class ConditionVariable; 31 } 24 namespace flair { 25 namespace core { 26 class Thread; 27 class IODevice; 28 class ConditionVariable; 29 } 32 30 } 33 31 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; 32 class Thread_impl { 33 public: 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; 54 51 55 56 flair::core::Thread*self;57 flair::core::ConditionVariable*cond;58 59 flair::core::Time max_jitter,min_jitter,mean_jitter;60 61 62 63 64 65 66 67 52 private: 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); 68 65 #ifdef __XENO__ 69 70 static void main_rt(void *arg);66 RT_TASK task_rt; 67 static void main_rt(void *arg); 71 68 #else 72 73 static void* main_nrt(void *arg);74 69 pthread_t task_nrt; 70 static void *main_nrt(void *arg); 71 flair::core::Time next_time; 75 72 #endif 76 73 }; -
trunk/lib/FlairCore/src/unexported/Widget_impl.h
r2 r15 17 17 #include <io_data.h> 18 18 19 namespace flair 20 { 21 namespace gui 22 { 23 class Widget; 24 } 19 namespace flair { 20 namespace gui { 21 class Widget; 22 } 25 23 } 26 24 … … 28 26 * \brief Classe representant un Widget 29 27 * 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 32 32 * 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 34 35 * 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. 36 38 */ 37 class Widget_impl 38 { 39 friend class flair::core::FrameworkManager; 40 friend class FrameworkManager_impl; 39 class Widget_impl { 40 friend class flair::core::FrameworkManager; 41 friend class FrameworkManager_impl; 41 42 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); 43 public: 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); 57 62 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(); 68 75 69 70 71 72 73 74 75 76 77 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); 78 85 79 80 81 82 83 84 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); 85 92 86 87 88 93 xmlNodePtr file_node; 94 xmlNodePtr send_node; 95 bool isenabled; 89 96 90 91 flair::gui::Widget*self;97 private: 98 flair::gui::Widget *self; 92 99 93 std::vector<flair::gui::Widget*> childs;100 std::vector<flair::gui::Widget *> childs; 94 101 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); 97 104 98 99 100 101 102 103 104 105 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); 106 113 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; 113 121 }; 114 122 -
trunk/lib/FlairCore/src/unexported/communication.h
r2 r15 6 6 #define COMMUNICATION_H 7 7 8 9 //messages file socket 8 // messages file socket 10 9 #define FILE_INFO_LITTLE_ENDIAN 0x01 11 10 #define FILE_INFO_BIG_ENDIAN 0x02 … … 19 18 #define DATAS_BIG_ENDIAN 0xfe 20 19 21 22 20 #endif // COMMUNICATION_H -
trunk/lib/FlairCore/src/unexported/config.h
r2 r15 19 19 #define CONFIG_H 20 20 21 // stack size of nrt threads, comment it to use default value22 #define NRT_STACK_SIZE 1024 *1024*121 // stack size of nrt threads, comment it to use default value 22 #define NRT_STACK_SIZE 1024 * 1024 * 1 23 23 24 // stack size of rt threads, comment it to use default value25 #define RT_STACK_SIZE 1024 *10024 // stack size of rt threads, comment it to use default value 25 #define RT_STACK_SIZE 1024 * 100 26 26 27 // rt pipe size, comment it to use system heap28 #define RT_PIPE_SIZE 1024 *102427 // rt pipe size, comment it to use system heap 28 #define RT_PIPE_SIZE 1024 * 1024 29 29 30 // nrt pipe size31 #define NRT_PIPE_SIZE 1024 *10030 // nrt pipe size 31 #define NRT_PIPE_SIZE 1024 * 100 32 32 33 // rt log heap size34 #define LOG_HEAP 1024 *10033 // rt log heap size 34 #define LOG_HEAP 1024 * 100 35 35 36 // xml heap size37 #define XML_HEAP 5 *1024*102436 // xml heap size 37 #define XML_HEAP 5 * 1024 * 1024 38 38 39 // nrt pipe path39 // nrt pipe path 40 40 #define NRT_PIPE_PATH "/proc/xenomai/registry/native/pipes/" 41 41 42 // min priority for Threads42 // min priority for Threads 43 43 #define MIN_THREAD_PRIORITY 20 44 44 45 // max priority for Threads45 // max priority for Threads 46 46 #define MAX_THREAD_PRIORITY 99 47 47 48 // priority of the FrameworkManager task (manages udt connection)48 // priority of the FrameworkManager task (manages udt connection) 49 49 #define FRAMEWORK_TASK_PRIORITY 1 50 50 51 // timeout in ms for select51 // timeout in ms for select 52 52 #define SELECT_TIMEOUT_MS 200 53 53 54 // type of xml root element54 // type of xml root element 55 55 #define XML_ROOT_TYPE "root" 56 56 57 // name of xml root element57 // name of xml root element 58 58 //#define XML_ROOT_ELEMENT "Manager" 59 59 60 // name of main tabwidget60 // name of main tabwidget 61 61 #define XML_MAIN_TABWIDGET "Main_TabWidget" 62 62 63 // name of app tabwidget63 // name of app tabwidget 64 64 #define XML_APP_TABWIDGET "App_TabWidget" 65 65 66 // use compression for messages with ground station66 // use compression for messages with ground station 67 67 #define COMPRESS_FRAMES 68 68 69 // size of buffer shunck69 // size of buffer shunck 70 70 #define COMPRESS_CHUNK 1024 71 71 -
trunk/lib/FlairCore/src/unexported/cvmatrix_impl.h
r2 r15 14 14 #define CVMATRIX_IMPL_H 15 15 16 17 16 #include <io_data.h> 18 17 #include <cvmatrix.h> … … 24 23 * 25 24 */ 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(); 25 class cvmatrix_impl { 26 public: 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(); 32 33 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; 37 39 38 39 flair::core::cvmatrix*self;40 void Init(flair::core::cvmatrix* self,int n);40 private: 41 flair::core::cvmatrix *self; 42 void Init(flair::core::cvmatrix *self, int n); 41 43 }; 42 44 -
trunk/lib/FlairCore/src/unexported/io_data_impl.h
r2 r15 19 19 * \brief Abstract class for data types. 20 20 * 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 22 23 * The reimplemented class must call SetSize() in its constructor. \n 23 24 * io_data can be constructed with n samples (see io_data::io_data). 24 25 * In this case, old samples can be accessed throug io_data::Prev. 25 26 */ 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 38 39 void**circle_ptr;27 class io_data_impl { 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, 37 flair::core::DataType const &datatype); 38 size_t size; 39 flair::core::Time time; 40 void **circle_ptr; 40 41 41 42 flair::core::io_data*self;43 44 45 42 private: 43 flair::core::io_data *self; 44 int n; 45 bool is_consistent; 46 std::vector<std::string> descriptors; 46 47 }; 47 48 -
trunk/lib/FlairCore/src/unexported/ui_com.h
r2 r15 25 25 #endif 26 26 27 namespace flair 28 { 29 namespace core 30 { 31 class Mutex; 32 class Object; 33 } 34 namespace gui 35 { 36 class SendData; 37 } 27 namespace flair { 28 namespace core { 29 class Mutex; 30 class Object; 31 } 32 namespace gui { 33 class SendData; 34 } 38 35 } 39 36 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); 37 class ui_com : public flair::core::Thread { 38 public: 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); 54 50 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); 51 private: 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); 67 65 #ifdef __XENO__ 68 69 static void* user_thread(void *arg);70 71 66 bool is_running; 67 static void *user_thread(void *arg); 68 pthread_t thread; 69 RT_PIPE pipe; 72 70 #endif 73 74 71 }; 75 72
Note:
See TracChangeset
for help on using the changeset viewer.