Changeset 222 in flair-src


Ignore:
Timestamp:
02/26/18 09:36:16 (6 years ago)
Author:
Sanahuja Guillaume
Message:

allows realloc in graphs

Location:
trunk/tools/FlairGCS/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/ConnectionLayout.cpp

    r30 r222  
    136136
    137137QString ConnectionLayout::getRemoteName() { return remoteName; }
     138
    138139void ConnectionLayout::drawDatas(char *buf, int buf_size, uint16_t period,
    139140                                 bool big_endian) {
  • trunk/tools/FlairGCS/src/DataPlot1D.cpp

    r15 r222  
    104104  step_s = period / 1000.;
    105105  plot(datas);
     106  free(datas);
    106107}
    107108
     
    110111  if (event->button() == Qt::RightButton) {
    111112    QMenu *menu = new QMenu("nom", (QwtPlot *)this);
    112     QAction *a, *b, *z;
     113    QAction *resetX, *resetY, *clear,*action;
    113114
    114     a = menu->addAction("reset time view");
    115     b = menu->addAction("reset y view");
     115    resetX = menu->addAction("reset time view");
     116    resetY = menu->addAction("reset y view");
    116117    menu->addSeparator();
    117118
    118119    appendmenu(menu);
    119     z = execmenu((QwtPlot *)this, menu, event->globalPos());
     120   
     121    menu->addSeparator();
     122    clear = menu->addAction("clear graph");
     123   
     124    action = execmenu((QwtPlot *)this, menu, event->globalPos());
    120125    delete menu;
    121126
    122     if (z == a)
     127    if (action == resetX)
    123128      resetXView();
    124     if (z == b)
     129    if (action == resetY)
    125130      resetYView();
     131     
     132    if (action == clear)
     133      clearCurves();
    126134
    127135    return true;
  • trunk/tools/FlairGCS/src/DataRemote.cpp

    r67 r222  
    2929  menu->addSeparator();
    3030
    31   b = menu->addAction("auto refresh");
    32   b->setCheckable(true);
    33   b->setChecked(auto_refresh);
     31  autoRefresh = menu->addAction("auto refresh");
     32  autoRefresh->setCheckable(true);
     33  autoRefresh->setChecked(auto_refresh);
    3434
    35   c = menu->addAction(QString("set refresh rate (%1ms)")
     35  setRefreshRate = menu->addAction(QString("set refresh rate (%1ms)")
    3636                          .arg((uint16_t)(qRound(refresh_rate * 1000))));
    37   c->setEnabled(auto_refresh);
    38   menu->addSeparator();
     37  setRefreshRate->setEnabled(auto_refresh);
     38/*  menu->addSeparator();
    3939
    40   d = menu->addAction("log");
    41   d->setCheckable(true);
    42   d->setChecked(is_logging);
     40  log = menu->addAction("log");
     41  log->setCheckable(true);
     42  log->setChecked(is_logging);
     43  */
    4344}
    4445
    4546QAction *DataRemote::execmenu(QWidget *parent, QMenu *menu, QPoint point) {
    46   QAction *z;
     47  QAction *action;
    4748
    48   z = menu->exec(point);
     49  action = menu->exec(point);
    4950
    5051  // auto_refresh=b->isChecked();
    5152
    52   if (z == b) {
    53     SendPeriod(RefreshRate_ms(), b->isChecked());
     53  if (action == autoRefresh) {
     54    SendPeriod(RefreshRate_ms(), autoRefresh->isChecked());
    5455  }
    5556
    56   if (z == c) {
     57  if (action == setRefreshRate) {
    5758    bool ok;
    5859    // uint16_t time = QInputDialog::getInt(this, QString("Set refresh rate
     
    6465    if (ok == true && time != qRound(refresh_rate * 1000)) {
    6566      // refresh_rate=time/1000.;
    66       SendPeriod(time, b->isChecked());
     67      SendPeriod(time, autoRefresh->isChecked());
    6768    }
    6869  }
    69 
    70   return z;
     70 
     71  return action;
    7172}
    7273
  • trunk/tools/FlairGCS/src/DataRemote.h

    r15 r222  
    3636private:
    3737  void SendPeriod(int period, bool auto_refresh);
    38   QAction *b, *c, *d;
     38  QAction *autoRefresh, *setRefreshRate;
     39  //QAction **log;//todo implement this feature (log directly in gcs, in case of uav program crash)
    3940};
    4041
  • trunk/tools/FlairGCS/src/Map.cpp

    r67 r222  
    107107        tr("Failed to find any map services. Please ensure that "
    108108           "the location services plugins for Qt Mobility are "
    109            "installed and, if necessary, set the IGEP_ROOT "
     109           "installed and, if necessary, set the OECORE_HOST_SYSROOT "
    110110           "environment variable to the good location."));
    111111
  • trunk/tools/FlairGCS/src/UsSensorPlot.cpp

    r221 r222  
    102102 
    103103  firstPeakStart = new QwtPlotMarker();
    104   QwtSymbol* s=new QwtSymbol( QwtSymbol::Diamond, Qt::blue, Qt::NoPen, QSize( 10, 10 ) );
    105   firstPeakStart->setSymbol(s);
    106   //firstPeakStart->setValue( QPointF( 1000, 200 ) );
     104  QwtSymbol* s1=new QwtSymbol( QwtSymbol::Diamond, Qt::blue, Qt::NoPen, QSize( 10, 10 ) );
     105  firstPeakStart->setSymbol(s1);
    107106  //m->setLabel("toto" );
    108107  firstPeakStart->attach( plot );
    109108 
    110109  firstPeakEnd = new QwtPlotMarker();
    111   //QwtSymbol* s=new QwtSymbol( QwtSymbol::Diamond, Qt::blue, Qt::NoPen, QSize( 10, 10 ) );
    112   firstPeakEnd->setSymbol(s);
     110  QwtSymbol* s2=new QwtSymbol( QwtSymbol::Diamond, Qt::blue, Qt::NoPen, QSize( 10, 10 ) );
     111  firstPeakEnd->setSymbol(s2);
    113112  firstPeakEnd->attach( plot );
    114113 
    115114  secondPeakStart = new QwtPlotMarker();
    116   secondPeakStart->setSymbol(s);
     115  QwtSymbol* s3=new QwtSymbol( QwtSymbol::Diamond, Qt::black, Qt::NoPen, QSize( 10, 10 ) );
     116  secondPeakStart->setSymbol(s3);
    117117  secondPeakStart->attach( plot );
    118118 
    119119  secondPeakEnd = new QwtPlotMarker();
    120   secondPeakEnd->setSymbol(s);
     120  QwtSymbol* s4=new QwtSymbol( QwtSymbol::Diamond, Qt::black, Qt::NoPen, QSize( 10, 10 ) );
     121  secondPeakEnd->setSymbol(s4);
    121122  secondPeakEnd->attach( plot );
    122123}
  • trunk/tools/FlairGCS/src/main.cpp

    r45 r222  
    88#include <qmetatype.h>
    99#include <tclap/CmdLine.h>
     10#include <execinfo.h>
     11#include <signal.h>
    1012
    1113#include "Manager.h"
     
    3941}
    4042
     43void seg_fault(int sig __attribute__((unused))) {
     44  void *bt[32];
     45  int nentries;
     46
     47  printf("Segmentation fault:\n");
     48  /* Dump a backtrace of the frame which caused the segfault: */
     49  nentries = backtrace(bt, sizeof(bt) / sizeof(bt[0]));
     50  backtrace_symbols_fd(bt, nentries, fileno(stdout));
     51
     52  exit(1);
     53}
     54
    4155int main(int argc, char *argv[]) {
    4256
     
    5266
    5367  compile_info("FlairGCS");
     68 
     69  // catch segfault
     70  signal(SIGSEGV, seg_fault);
    5471
    5572  parseOptions(argc, argv);
Note: See TracChangeset for help on using the changeset viewer.