Changeset 15 in flair-src for trunk/lib/FlairCore/src/Vector3DSpinBox.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (6 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Vector3DSpinBox.cpp

    r2 r15  
    1111//  version:    $Id: $
    1212//
    13 //  purpose:    Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
     13//  purpose:    Class displaying 3 QDoubleSpinBox for x,y,z on the ground
     14//  station
    1415//
    1516//
     
    2021using std::string;
    2122
    22 namespace flair { namespace gui {
     23namespace flair {
     24namespace gui {
    2325
    24 Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition* position,string name,double min,double max,double step,int decimals,core::Vector3D default_value):Box(position,name,"Vector3DSpinBox") {
    25     //update value from xml file
    26     default_value.Saturate(min,max);
    27     box_value=default_value;
     26Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition *position, string name,
     27                                 double min, double max, double step,
     28                                 int decimals, core::Vector3D default_value)
     29    : Box(position, name, "Vector3DSpinBox") {
     30  // update value from xml file
     31  default_value.Saturate(min, max);
     32  box_value = default_value;
    2833
    29     SetVolatileXmlProp("min",min);
    30     SetVolatileXmlProp("max",max);
    31     SetVolatileXmlProp("step",step);
    32     SetVolatileXmlProp("decimals",decimals);
    33     GetPersistentXmlProp("value_x",box_value.x);
    34     SetPersistentXmlProp("value_x",box_value.x);
    35     GetPersistentXmlProp("value_y",box_value.y);
    36     SetPersistentXmlProp("value_y",box_value.y);
    37     GetPersistentXmlProp("value_z",box_value.z);
    38     SetPersistentXmlProp("value_z",box_value.z);
     34  SetVolatileXmlProp("min", min);
     35  SetVolatileXmlProp("max", max);
     36  SetVolatileXmlProp("step", step);
     37  SetVolatileXmlProp("decimals", decimals);
     38  GetPersistentXmlProp("value_x", box_value.x);
     39  SetPersistentXmlProp("value_x", box_value.x);
     40  GetPersistentXmlProp("value_y", box_value.y);
     41  SetPersistentXmlProp("value_y", box_value.y);
     42  GetPersistentXmlProp("value_z", box_value.z);
     43  SetPersistentXmlProp("value_z", box_value.z);
    3944
    40     SendXml();
     45  SendXml();
    4146}
    4247
    43 Vector3DSpinBox::~Vector3DSpinBox() {
    44 
    45 }
     48Vector3DSpinBox::~Vector3DSpinBox() {}
    4649/*
    4750Vector3DSpinBox::operator core::Vector3D() const {
     
    5053*/
    5154core::Vector3D Vector3DSpinBox::Value(void) const {
    52     core::Vector3D tmp;
     55  core::Vector3D tmp;
    5356
    54     GetMutex();
    55     tmp=box_value;
    56     ReleaseMutex();
     57  GetMutex();
     58  tmp = box_value;
     59  ReleaseMutex();
    5760
    58     return tmp;
     61  return tmp;
    5962}
    6063
    6164void Vector3DSpinBox::XmlEvent(void) {
    62     bool changed=false;
    63     GetMutex();
    64     if(GetPersistentXmlProp("value_x",box_value.x)) changed=true;
    65     if(GetPersistentXmlProp("value_y",box_value.y)) changed=true;
    66     if(GetPersistentXmlProp("value_z",box_value.z)) changed=true;
    67     if(changed) SetValueChanged();
    68     ReleaseMutex();
     65  bool changed = false;
     66  GetMutex();
     67  if (GetPersistentXmlProp("value_x", box_value.x))
     68    changed = true;
     69  if (GetPersistentXmlProp("value_y", box_value.y))
     70    changed = true;
     71  if (GetPersistentXmlProp("value_z", box_value.z))
     72    changed = true;
     73  if (changed)
     74    SetValueChanged();
     75  ReleaseMutex();
    6976}
    7077
Note: See TracChangeset for help on using the changeset viewer.