Changeset 436 in flair-src


Ignore:
Timestamp:
Aug 24, 2021, 11:58:44 AM (3 years ago)
Author:
Sanahuja Guillaume
Message:

gcs:sync graphs

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

Legend:

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

    r269 r436  
    99#include "communication.h"
    1010
    11 ConnectionLayout::ConnectionLayout(UdtSocket *socket, QString name)
     11ConnectionLayout::ConnectionLayout(UdtSocket *socket, QString name, QTime startTime)
    1212    : Layout(NULL, name, "root") {
    1313  this->socket = socket;
    1414  this->name = name;
     15  this->startTime = startTime;
    1516}
    1617
    1718ConnectionLayout::~ConnectionLayout() {
     19}
     20
     21QTime ConnectionLayout::GetStartTime(void) {
     22    return startTime;
    1823}
    1924
  • trunk/tools/FlairGCS/src/ConnectionLayout.h

    r399 r436  
    77
    88#include "Layout.h"
     9#include <QTime>
    910
    1011class UdtSocket;
     
    1516
    1617public:
    17   ConnectionLayout(UdtSocket *socket, QString name);
     18  ConnectionLayout(UdtSocket *socket, QString name, QTime startTime);
    1819  ~ConnectionLayout();
    1920  void XmlToSend(QDomDocument doc);
     
    2324  QString getName();
    2425  static QString getDocRootName(char* buf, int size);
    25 
     26  QTime GetStartTime(void);
     27 
    2628private:
    2729  void drawDatas(char *buf, int buf_size, uint16_t period,
     
    3032  UdtSocket *socket;
    3133  QList<DataRemote *> dataremotes;
     34  QTime startTime;
    3235 
    3336private slots:
  • trunk/tools/FlairGCS/src/DataPlot1D.cpp

    r269 r436  
    44// %flair:license}
    55#include "DataPlot1D.h"
     6#include "ConnectionLayout.h"
    67#include "Layout.h"
    78#include <QMouseEvent>
    89#include <QMenu>
    910#include <QGridLayout>
     11#include <QTime>
    1012#include <qendian.h>
    1113
     
    1618
    1719  setEnabled(enabled);
     20  ResetElapsedTime((float)connectionLayout()->GetStartTime().msecsTo(QTime::currentTime())/1000.);
    1821  parent->addWidget(this, row, col);
    1922  visible_widget = this;
     
    2528
    2629void DataPlot1D::XmlEvent(QDomElement *dom) {
     30  bool previouslyEnabled=IsEnabled();
     31 
    2732  if (dom->attribute("curve") != "") {
    2833    QString type = dom->attribute("type");
     
    4651    XmlSetup(dom);
    4752  }
     53 
     54    if(previouslyEnabled!=IsEnabled() && IsEnabled())
     55        ResetElapsedTime((float)connectionLayout()->GetStartTime().msecsTo(QTime::currentTime())/1000.);
    4856}
    4957
     
    132140    if (action == clear)
    133141      clearCurves();
    134 
     142       
    135143    return true;
    136144  }
  • trunk/tools/FlairGCS/src/DataRemote.cpp

    r269 r436  
    77#include <QInputDialog>
    88#include <QtXml>
    9 #include "Manager.h"
    109#include "ConnectionLayout.h"
    1110
     
    4847
    4948  action = menu->exec(point);
    50 
    51   // auto_refresh=b->isChecked();
    5249
    5350  if (action == autoRefresh) {
  • trunk/tools/FlairGCS/src/Manager.cpp

    r399 r436  
    104104  connect(timer, SIGNAL(timeout()), this, SLOT(acceptConnections()));
    105105  timer->start(500);
     106 
     107  startTime=QTime::currentTime();
    106108}
    107109
     
    147149  UdtSocket* udtSocket=(UdtSocket *)sender();
    148150 
    149   ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name);
     151  ConnectionLayout *newLayout = new ConnectionLayout(udtSocket, name, startTime);
    150152  connect(udtSocket, SIGNAL(UDTStats(QString,QString,bool)), newLayout, SIGNAL(UDTStats(QString,QString,bool)));//connection in 2 steps to get udtsocket as sender
    151153  connect(newLayout, SIGNAL(UDTStats(QString,QString,bool)), this, SLOT(printUDTStats(QString,QString,bool)));
  • trunk/tools/FlairGCS/src/Manager.h

    r399 r436  
    88#include <QWidget>
    99#include <QIcon>
     10#include <QTime>
    1011#include <udt.h>
    1112#include <qdom.h>
     
    4849  QStatusBar *status;
    4950  QIcon icon_red,icon_green,icon_orange;
     51  QTime startTime;
    5052
    5153private slots:
Note: See TracChangeset for help on using the changeset viewer.