Rev | Line | |
---|
[2] | 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/10/28
|
---|
| 6 | // filename: Box.cpp
|
---|
| 7 | //
|
---|
| 8 | // author: Guillaume Sanahuja
|
---|
| 9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 10 | //
|
---|
| 11 | // version: $Id: $
|
---|
| 12 | //
|
---|
| 13 | // purpose: Abstract class to display a box on the ground station
|
---|
| 14 | //
|
---|
| 15 | //
|
---|
| 16 | /*********************************************************************/
|
---|
| 17 | #include "Box.h"
|
---|
| 18 | #include "Layout.h"
|
---|
| 19 | #include "LayoutPosition.h"
|
---|
| 20 |
|
---|
| 21 | using std::string;
|
---|
| 22 |
|
---|
| 23 | namespace flair
|
---|
| 24 | {
|
---|
| 25 | namespace gui
|
---|
| 26 | {
|
---|
| 27 |
|
---|
| 28 | Box::Box(const LayoutPosition* position,string name,string type): Widget(position->getLayout(),name,type)
|
---|
| 29 | {
|
---|
| 30 | value_changed=true;
|
---|
| 31 | SetVolatileXmlProp("row",position->Row());
|
---|
| 32 | SetVolatileXmlProp("col",position->Col());
|
---|
| 33 | delete position;
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 | Box::~Box()
|
---|
| 37 | {
|
---|
| 38 | core::Object::ObjectName();
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | bool Box::ValueChanged(void)
|
---|
| 42 | {
|
---|
| 43 | bool ret;
|
---|
| 44 |
|
---|
| 45 | GetMutex();
|
---|
| 46 | if(value_changed==true)
|
---|
| 47 | {
|
---|
| 48 | value_changed=false;
|
---|
| 49 | ret=true;
|
---|
| 50 | }
|
---|
| 51 | else
|
---|
| 52 | {
|
---|
| 53 | ret=false;
|
---|
| 54 | }
|
---|
| 55 | ReleaseMutex();
|
---|
| 56 |
|
---|
| 57 | return ret;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | void Box::SetValueChanged(void)
|
---|
| 61 | {
|
---|
| 62 | value_changed=true;
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | void Box::GetMutex(void) const
|
---|
| 66 | {
|
---|
| 67 | ((Layout*)Parent())->mutex->GetMutex();
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 | void Box::ReleaseMutex(void) const
|
---|
| 71 | {
|
---|
| 72 | ((Layout*)Parent())->mutex->ReleaseMutex();
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | } // end namespace gui
|
---|
| 76 | } // end namespace flair
|
---|
Note:
See
TracBrowser
for help on using the repository browser.