Changeset 50 in flair-src for branches/mavlink/tools


Ignore:
Timestamp:
07/26/16 17:28:43 (8 years ago)
Author:
Thomas Fuhrmann
Message:

Waypoints add and remove is working in GUI

Location:
branches/mavlink/tools/Controller/Mavlink
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/mavlink/tools/Controller/Mavlink/src/Mavlink_test.cpp

    r47 r50  
    6565  add_wptGroupBox = new GroupBox(settingsTab->NewRow(), "Add waypoint");
    6666  latField = new DoubleSpinBox(add_wptGroupBox->NewRow(), "Latitude",
    67                                 -90, 90, 0.0001, 4, 3);
     67                                -90, 90, 0.001, 3, 3);
    6868  lonField = new DoubleSpinBox(add_wptGroupBox->LastRowLastCol(), "Longitude",
    69                                 -180, 180, 0.0001, 4, 3);
     69                                -180, 180, 0.001, 3, 3);
    7070  btn_add_mission_wpt = new PushButton(add_wptGroupBox->NewRow(), "Add mission wpt");
    7171  btn_add_entrance_wpt = new PushButton(add_wptGroupBox->LastRowLastCol(), "Add entrance wpt");
     
    135135  while (!ToBeStopped()) {
    136136    // Thread::Info("Debug: Mavlink acquisition loop\n");
    137     Thread::SleepMS(1000);
     137    Thread::SleepMS(500);
    138138    // latValue = latField->Value();
    139139    // lonValue = lonField->Value();
    140140       
    141         // Check the values of the buttons
    142         // First tab
    143141        if (btn_initialize->Clicked()) {
    144142                MissionInitialize();
     
    153151                MissionKill();
    154152    }
    155         // Second tab
    156153        if (btn_add_mission_wpt->Clicked()) {
    157       std::ostringstream stringStream;
    158       stringStream.precision(3);
    159       stringStream << fixed;
    160       stringStream << latField->Value() << " - " << lonField->Value();
    161                 list_mission_wpt->AddItem(stringStream.str());
     154                list_mission_wpt->AddItem(GetWptLatLon());
    162155    }
    163156        if (btn_add_entrance_wpt->Clicked()) {
    164                 EntranceWptAdd();
     157                list_entrance_wpt->AddItem(GetWptLatLon());
    165158    }
    166159        if (btn_add_exit_wpt->Clicked()) {
    167                 ExitWptAdd();
     160                list_exit_wpt->AddItem(GetWptLatLon());
    168161    }
    169162    if (btn_remove_mission_wpt->Clicked()) {
     
    275268  }
    276269  Thread::Info("Debug: end of decode loop\n");
     270}
     271
     272std::string Mavlink::GetWptLatLon() {
     273  std::ostringstream stringStream;
     274  stringStream.precision(3);
     275  stringStream << fixed;
     276  stringStream << latField->Value() << " - " << lonField->Value();
     277  return stringStream.str();
    277278}
    278279
  • branches/mavlink/tools/Controller/Mavlink/src/Mavlink_test.h

    r47 r50  
    8484  gui::PushButton* btn_remove_entrance_wpt;
    8585  gui::PushButton* btn_remove_exit_wpt; 
    86   // gui::Label* label_mission_wpt;
    87   // gui::Label* label_mission_wpt_list;
    88   // gui::Label* label_entrance_wpt;
    89   // gui::Label* label_entrance_wpt_list;
    90   // gui::Label* label_exit_wpt;
    91   // gui::Label* label_exit_wpt_list;
    92 
    93   // Remove wpt groupbox
    94   // gui::GroupBox* show_wptGroupBox;
    95   // gui::ComboBox* cmb_box_mission_wpt;
    96   // gui::ComboBox* cmb_box_mission_wpt;
    97   // gui::ComboBox* cmb_box_mission_wpt;
    9886
    9987  // Action wpt groupbox
     
    10896  // reimplement the run of the Thread class
    10997  void Run();
     98
     99  std::string GetWptLatLon();
    110100 
    111101  // First tab callbacks
Note: See TracChangeset for help on using the changeset viewer.