Browse Source

change groupctrl_grpc.

yuchuli 1 year ago
parent
commit
910c6139a9

+ 2 - 1
src/driver/driver_cloud_swap_client/grpcclient.cpp

@@ -17,7 +17,7 @@ grpcclient::grpcclient(std::string stryamlpath)
     ggrpcclient = this;
     dec_yaml(stryamlpath.data());
 
-    mpCalcPing = new CalcPing(gstrserverip,5);
+
 
     int i;
     for(i=0;i<(int)mvectormsgunit.size();i++)
@@ -259,6 +259,7 @@ void grpcclient::threadRPC(std::shared_ptr<qint64> pnrpctime,std::shared_ptr<boo
 
 void grpcclient::run()
 {
+    mpCalcPing = new CalcPing(gstrserverip,5);
             std::shared_ptr<bool> pbRun(new bool);
             *pbRun = true;
                     std::shared_ptr<qint64> pntime(new qint64);

+ 8 - 5
src/driver/driver_cloud_swap_client/grpcclient.h

@@ -68,6 +68,13 @@ class grpcclient : public QThread
 public:
     grpcclient(std::string stryamlpath);
 
+public:
+    enum ShareMode
+    {
+        Mode_ModuleShare,
+        Mode_Inter
+    };
+
 private:
     std::string gstrserverip =  "0.0.0.0";//"123.57.212.138";
     std::string gstrserverport = "50061";//"9000";
@@ -99,11 +106,7 @@ private:
 
     CalcPing * mpCalcPing;
 
-    enum ShareMode
-    {
-        Mode_ModuleShare,
-        Mode_Inter
-    };
+
 
     ShareMode mnShareMode  = Mode_ModuleShare;
 

+ 12 - 0
src/include/proto/groupctrl.proto

@@ -0,0 +1,12 @@
+syntax = "proto2";
+
+package iv.group;
+
+
+message groupctrl
+{
+	required double fGroupSpeed = 1;  //km/h
+	required double fFrontChange = 2;  //m
+	required double fRearChange = 3;  //m
+}
+

+ 8 - 2
src/tool/groupctrl_grpc/groupctrl_grpc.pro

@@ -30,7 +30,10 @@ SOURCES += \
         mainwindow.cpp \
     ../../driver/driver_cloud_swap_client/calcping.cpp \
     ../../driver/driver_cloud_swap_client/cloudswap.grpc.pb.cc \
-    ../../driver/driver_cloud_swap_client/grpcclient.cpp
+    ../../driver/driver_cloud_swap_client/grpcclient.cpp \
+    ../../include/msgtype/gpsimu.pb.cc \
+    speed.cpp \
+    ../../include/msgtype/groupctrl.pb.cc
 
 HEADERS += \
     ../../include/msgtype/cloud.pb.h \
@@ -38,7 +41,10 @@ HEADERS += \
         mainwindow.h \
     ../../driver/driver_cloud_swap_client/calcping.h \
     ../../driver/driver_cloud_swap_client/cloudswap.grpc.pb.h \
-    ../../driver/driver_cloud_swap_client/grpcclient.h
+    ../../driver/driver_cloud_swap_client/grpcclient.h \
+    ../../include/msgtype/gpsimu.pb.h \
+    speed.h \
+    ../../include/msgtype/groupctrl.pb.h
 
 FORMS += \
         mainwindow.ui

+ 2 - 0
src/tool/groupctrl_grpc/main.cpp

@@ -7,5 +7,7 @@ int main(int argc, char *argv[])
     MainWindow w;
     w.show();
 
+    w.showMaximized();
+
     return a.exec();
 }

+ 226 - 2
src/tool/groupctrl_grpc/mainwindow.cpp

@@ -1,6 +1,10 @@
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
 
+#include "gpsimu.pb.h"
+
+#include "groupctrl.pb.h"
+
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::MainWindow)
@@ -12,15 +16,235 @@ MainWindow::MainWindow(QWidget *parent) :
     mpgrpcclient_ptr1 = std::shared_ptr<grpcclient>(new grpcclient(""));
     mpgrpcclient_ptr2 = std::shared_ptr<grpcclient>(new grpcclient(""));
 
-    mpgrpcclient_ptr1->SetServerPort("127.0.0.1","50061");
-    mpgrpcclient_ptr2->SetServerPort("127.0.0.1","50061");
+    mpgrpcclient_ptr1->SetServerPort("223.84.137.240","50061");
+    mpgrpcclient_ptr2->SetServerPort("223.84.137.240","50061");
 
     mpgrpcclient_ptr1->SetNodeId("10001","1");
     mpgrpcclient_ptr2->SetNodeId("10002","2");
 
+    mpgrpcclient_ptr1->SetShareMode(grpcclient::Mode_Inter);
+    mpgrpcclient_ptr2->SetShareMode(grpcclient::Mode_Inter);
+
+    mpgrpcclient_ptr1->start();
+    mpgrpcclient_ptr2->start();
+
+    mpthread1 = new std::thread(&MainWindow::thread1recv,this);
+    mpthread2 = new std::thread(&MainWindow::thread2recv,this);
+
+    mpSpeed1 = new Speed(ui->centralWidget);
+    mpSpeed2 = new Speed(ui->centralWidget);
+
+    mpSpeed1->setGeometry(1100,100,300,300);
+    mpSpeed2->setGeometry(1100,500,300,300);
+
+    mpSpeed1->setminvalue(0);
+    mpSpeed1->setmaxvalue(100);
+
+    mpSpeed2->setminvalue(0);
+    mpSpeed2->setmaxvalue(100);
+
+    mpSpeed1->settitle("1号车");
+    mpSpeed1->setunits("km/h");
+
+    mpSpeed2->settitle("2号车");
+    mpSpeed2->setunits("km/h");
+
+    mpTimer = new QTimer(this);
+    connect(mpTimer,SIGNAL(timeout()),this,SLOT(onTimer()));
+    mpTimer->start(100);
+
+    ui->radioButton_40kmh->setChecked(true);
+    ui->radioButton_origin->setChecked(true);
+
+
 }
 
 MainWindow::~MainWindow()
 {
+    mbrecv = false;
+    mpthread1->join();
+    mpthread2->join();
     delete ui;
 }
+
+void MainWindow::thread1recv()
+{
+    while(mbrecv)
+    {
+        iv::swapmsgbuff xswap;
+        if( mpgrpcclient_ptr1->GetSwapBuffData(xswap,10) == 1)
+        {
+            if(xswap.mstrmsgname == "hcp2_gpsimu")
+            {
+                iv::gps::gpsimu xgpsimu;
+                if(xgpsimu.ParseFromArray(xswap.mpdata_ptr.get(),xswap.mndatalen))
+                {
+                    if(xgpsimu.has_speed())
+                        mfSpeed1 = xgpsimu.speed() * 3.6;
+                    else
+                    {
+                        mfSpeed1 = sqrt(pow(xgpsimu.ve(),2) + pow(xgpsimu.vn(),2)) * 3.6;
+                    }
+
+  //                  std::cout<<" speed1: "<<mfSpeed1<<std::endl;
+
+                }
+            }
+        }
+    }
+}
+
+void MainWindow::thread2recv()
+{
+    while(mbrecv)
+    {
+        iv::swapmsgbuff xswap;
+        if( mpgrpcclient_ptr2->GetSwapBuffData(xswap,10) == 1)
+        {
+            if(xswap.mstrmsgname == "hcp2_gpsimu")
+            {
+                iv::gps::gpsimu xgpsimu;
+                if(xgpsimu.ParseFromArray(xswap.mpdata_ptr.get(),xswap.mndatalen))
+                {
+                    if(xgpsimu.has_speed())
+                        mfSpeed2 = xgpsimu.speed() * 3.6;
+                    else
+                    {
+                        mfSpeed2 = sqrt(pow(xgpsimu.ve(),2) + pow(xgpsimu.vn(),2)) * 3.6;
+                    }
+                }
+            }
+        }
+    }
+}
+
+void MainWindow::onTimer()
+{
+    mpSpeed1->updatevalue(mfSpeed1);
+    mpSpeed2->updatevalue(mfSpeed2);
+
+    bool bChangeEn = true;
+    if((mfSpeed1> mfSpeedChangeLim) || (mfSpeed2 > mfSpeedChangeLim))
+    {
+        bChangeEn = false;
+    }
+
+    if(bChangeEn)
+    {
+        ui->radioButton_frontleft->setEnabled(true);
+        ui->radioButton_rearleft->setEnabled(true);
+        ui->radioButton_frontright->setEnabled(true);
+        ui->radioButton_rearright->setEnabled(true);
+        ui->radioButton_sameleft->setEnabled(true);
+        ui->radioButton_sameright->setEnabled(true);
+    }
+    else
+    {
+        ui->radioButton_frontleft->setEnabled(false);
+        ui->radioButton_rearleft->setEnabled(false);
+        ui->radioButton_frontright->setEnabled(false);
+        ui->radioButton_rearright->setEnabled(false);
+        ui->radioButton_sameleft->setEnabled(false);
+        ui->radioButton_sameright->setEnabled(false);
+    }
+
+    if(!ui->radioButton_origin->isChecked())
+    {
+        ui->radioButton_15kmh->setEnabled(false);
+        ui->radioButton_20kmh->setEnabled(false);
+        ui->radioButton_30kmh->setEnabled(false);
+        ui->radioButton_40kmh->setEnabled(false);
+        ui->radioButton_60kmh->setEnabled(false);
+        ui->radioButton_80kmh->setEnabled(false);
+    }
+    else
+    {
+        ui->radioButton_15kmh->setEnabled(true);
+        ui->radioButton_20kmh->setEnabled(true);
+        ui->radioButton_30kmh->setEnabled(true);
+        ui->radioButton_40kmh->setEnabled(true);
+        ui->radioButton_60kmh->setEnabled(true);
+        ui->radioButton_80kmh->setEnabled(true);
+    }
+
+    double fGroupSpeed = 40;
+    double fFrontChange = 0.0;
+    double fRearChange = 0.0;
+    fGroupSpeed = GetGroupSpeed();
+    GetChange(fFrontChange,fRearChange);
+    iv::group::groupctrl xctrl;
+    xctrl.set_fgroupspeed(fGroupSpeed);
+    xctrl.set_ffrontchange(fFrontChange);
+    xctrl.set_frearchange(fRearChange);
+
+    int nbytesize = xctrl.ByteSize();
+    std::shared_ptr<char> pstr_ptr = std::shared_ptr<char>(new char[nbytesize]);
+    if(xctrl.SerializeToArray(pstr_ptr.get(),nbytesize))
+    {
+        mpgrpcclient_ptr1->UpdateData(pstr_ptr.get(),nbytesize,"groupctrl");
+        mpgrpcclient_ptr2->UpdateData(pstr_ptr.get(),nbytesize,"groupctrl");
+    }
+    else
+    {
+        std::cout<<"serialize fail."<<std::endl;
+    }
+
+
+}
+
+
+double MainWindow::GetGroupSpeed()
+{
+    if(ui->radioButton_5kmh)return 5.0;
+    if(ui->radioButton_10kmh)return 10.0;
+    if(ui->radioButton_15kmh)return 15.0;
+    if(ui->radioButton_20kmh)return 20.0;
+    if(ui->radioButton_30kmh)return 30.0;
+    if(ui->radioButton_40kmh)return 40.0;
+    if(ui->radioButton_60kmh)return 60.0;
+    if(ui->radioButton_80kmh)return 80.0;
+    return 40.0;
+}
+
+void MainWindow::GetChange(double & fFrontChange, double & fRearChange)
+{
+    fFrontChange = 0.0;
+    fRearChange = 0.0;
+    double fChange = 3.5;
+    if(ui->radioButton_origin)
+    {
+        return;
+    }
+    if(ui->radioButton_frontleft)
+    {
+        fFrontChange = fChange * ( 1.0);
+        return;
+    }
+    if(ui->radioButton_rearleft)
+    {
+        fRearChange = fChange * ( 1.0);
+        return;
+    }
+    if(ui->radioButton_frontright)
+    {
+        fFrontChange = fChange * ( -1.0);
+        return;
+    }
+    if(ui->radioButton_rearright)
+    {
+        fRearChange = fChange * ( -1.0);
+        return;
+    }
+    if(ui->radioButton_sameleft)
+    {
+        fFrontChange = fChange * ( 1.0);
+        fRearChange = fChange * ( 1.0);
+        return;
+    }
+    if(ui->radioButton_sameright)
+    {
+        fFrontChange = fChange * ( -1.0);
+        fRearChange = fChange * ( -1.0);
+        return;
+    }
+}

+ 31 - 0
src/tool/groupctrl_grpc/mainwindow.h

@@ -5,6 +5,11 @@
 
 #include "grpcclient.h"
 
+#include <thread>
+#include <QTimer>
+
+#include "speed.h"
+
 namespace Ui {
 class MainWindow;
 }
@@ -17,11 +22,37 @@ public:
     explicit MainWindow(QWidget *parent = 0);
     ~MainWindow();
 
+private slots:
+    void onTimer();
+
 private:
     Ui::MainWindow *ui;
 
     std::shared_ptr<grpcclient> mpgrpcclient_ptr1;
     std::shared_ptr<grpcclient> mpgrpcclient_ptr2;
+
+    std::thread * mpthread1;
+    std::thread * mpthread2;
+    bool mbrecv = true;
+
+    double mfSpeed1,mfSpeed2; //km/h
+
+    Speed * mpSpeed1, * mpSpeed2;
+
+    QTimer * mpTimer;
+
+    double mfSpeedChangeLim = 11; //if >10 no change
+
+private:
+    double GetGroupSpeed();
+    void GetChange(double & fFrontChange, double & fRearChange);
+
+
+private:
+    void thread1recv();
+    void thread2recv();
+
+
 };
 
 #endif // MAINWINDOW_H

+ 39 - 13
src/tool/groupctrl_grpc/mainwindow.ui

@@ -198,7 +198,7 @@
       <rect>
        <x>50</x>
        <y>70</y>
-       <width>261</width>
+       <width>181</width>
        <height>111</height>
       </rect>
      </property>
@@ -209,9 +209,9 @@
     <widget class="QRadioButton" name="radioButton_frontleft">
      <property name="geometry">
       <rect>
-       <x>380</x>
-       <y>70</y>
-       <width>261</width>
+       <x>50</x>
+       <y>190</y>
+       <width>171</width>
        <height>111</height>
       </rect>
      </property>
@@ -222,9 +222,9 @@
     <widget class="QRadioButton" name="radioButton_rearleft">
      <property name="geometry">
       <rect>
-       <x>690</x>
-       <y>70</y>
-       <width>261</width>
+       <x>260</x>
+       <y>190</y>
+       <width>151</width>
        <height>111</height>
       </rect>
      </property>
@@ -235,9 +235,9 @@
     <widget class="QRadioButton" name="radioButton_frontright">
      <property name="geometry">
       <rect>
-       <x>50</x>
-       <y>180</y>
-       <width>261</width>
+       <x>470</x>
+       <y>190</y>
+       <width>151</width>
        <height>111</height>
       </rect>
      </property>
@@ -248,9 +248,9 @@
     <widget class="QRadioButton" name="radioButton_rearright">
      <property name="geometry">
       <rect>
-       <x>380</x>
-       <y>180</y>
-       <width>261</width>
+       <x>680</x>
+       <y>190</y>
+       <width>151</width>
        <height>111</height>
       </rect>
      </property>
@@ -258,6 +258,32 @@
       <string>后右</string>
      </property>
     </widget>
+    <widget class="QRadioButton" name="radioButton_sameleft">
+     <property name="geometry">
+      <rect>
+       <x>260</x>
+       <y>70</y>
+       <width>181</width>
+       <height>111</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>同左</string>
+     </property>
+    </widget>
+    <widget class="QRadioButton" name="radioButton_sameright">
+     <property name="geometry">
+      <rect>
+       <x>470</x>
+       <y>70</y>
+       <width>181</width>
+       <height>111</height>
+      </rect>
+     </property>
+     <property name="text">
+      <string>同右</string>
+     </property>
+    </widget>
    </widget>
   </widget>
   <widget class="QMenuBar" name="menuBar">

+ 199 - 0
src/tool/groupctrl_grpc/speed.cpp

@@ -0,0 +1,199 @@
+#include "speed.h"
+
+
+#include <QPainter>
+
+#include <math.h>
+
+Speed::Speed(QWidget *parent) : QWidget(parent)
+{
+    m_background = Qt::black;
+    m_foreground = Qt::green;
+
+    m_startAngle = 60;
+    m_endAngle = 60;
+    m_scaleMajor = 10;
+    m_minValue = 100;
+    m_maxValue = -100;
+    m_scaleMajor = 10;//分度
+    m_scaleMinor = 10;
+    m_units = "";
+    m_title = "Wheel";
+    m_precision = 2;
+    m_value = 0;
+}
+
+void Speed::drawCrown(QPainter *painter) //绘制表冠
+{
+    painter->save();
+    int radius = 100;
+    QLinearGradient lg1(0, -radius, 0, radius);
+
+    lg1.setColorAt(0, Qt::white); //设置渐变的颜色和路径比例
+    lg1.setColorAt(1, Qt::gray); //只是粗略的颜色,具体的可以参考RGB颜色查询对照表
+
+    painter->setBrush(lg1); // 创建QBrush对象,把这个渐变对象传递进去:
+    painter->setPen(Qt::NoPen); //边框线无色
+    painter->drawEllipse(-radius, -radius, radius << 1, radius << 1);
+    painter->setBrush(m_background = Qt::black);
+    painter->drawEllipse(-92, -92, 184, 184);
+    painter->restore();
+}
+
+void Speed::drawScaleNum(QPainter *painter) //绘制刻度数字
+{
+    painter->save();
+    painter->setPen(m_foreground);
+    //m_startAngle是起始角度,m_endAngle是结束角度,m_scaleMajor在一个量程中分成的刻度数
+    double startRad = ( 270-m_startAngle) * (3.14 / 180);
+    double deltaRad = (360 - m_startAngle - m_endAngle) * (3.14 / 180) / m_scaleMajor;
+    double sina,cosa;
+    int x, y;
+    QFontMetricsF fm(this->font());
+    double w, h, tmpVal;
+    QString str;
+
+    for (int i = 0; i <= m_scaleMajor; i++)
+    {
+        sina = sin(startRad - i * deltaRad);
+        cosa = cos(startRad - i * deltaRad);
+
+        tmpVal = 1.0 * i *((m_maxValue - m_minValue) / m_scaleMajor) + m_minValue;
+        // tmpVal = 50;
+        str = QString( "%1" ).arg(tmpVal);  //%1作为占位符   arg()函数比起 sprintf()来是类型安全的
+        w = fm.size(Qt::TextSingleLine,str).width();
+        h = fm.size(Qt::TextSingleLine,str).height();
+        x = 82 * cosa - w / 2;
+        y = -82 * sina + h / 4;
+        painter->drawText(x, y, str); //函数的前两个参数是显示的坐标位置,后一个是显示的内容,是字符类型""
+
+    }
+    painter->restore();
+}
+
+void Speed::drawScale(QPainter *painter) //绘制刻度线
+{
+    painter->save();
+    painter->rotate(m_startAngle);
+    int steps = (m_scaleMajor * m_scaleMinor); //相乘后的值是分的份数
+    double angleStep = (360.0 - m_startAngle - m_endAngle) / steps; //每一个份数的角度
+
+    // painter->setPen(m_foreground); //m_foreground是颜色的设置
+    // QPen pen = painter->pen(); //第一种方法
+    QPen pen ;
+    pen.setColor(Qt::green); //推荐使用第二种方式
+    for (int i = 0; i <= steps; i++)
+    {
+        if (i % m_scaleMinor == 0)//整数刻度显示加粗
+        {
+            pen.setWidth(1); //设置线宽
+            painter->setPen(pen); //使用面向对象的思想,把画笔关联上画家。通过画家画出来
+
+            painter->drawLine(0, 62, 0, 72); //两个参数应该是两个坐标值
+        }
+        else
+        {
+            pen.setWidth(0);
+            painter->setPen(pen);
+            painter->drawLine(0, 67, 0, 72);
+        }
+        painter->rotate(angleStep);
+    }
+    painter->restore();
+
+}
+
+void Speed::drawTitle(QPainter *painter)
+{
+    painter->save();
+    painter->setPen(m_foreground);
+    //painter->setBrush(m_foreground);
+    QString str(m_title); //显示仪表的功能
+    QFontMetricsF fm(this->font());
+    double w = fm.size(Qt::TextSingleLine,str).width();
+    painter->drawText(-w / 2, -30, str);
+    painter->restore();
+}
+
+void Speed::drawNumericValue(QPainter *painter)
+{
+    QString str = QString("%1 %2").arg(m_value, 0, 'f', m_precision).arg(m_units);
+    QFontMetricsF fm(font());
+    double w = fm.size(Qt::TextSingleLine,str).width();
+    painter->setPen(m_foreground);
+    painter->drawText(-w / 2, 42, str);
+}
+
+void Speed::drawIndicator(QPainter *painter)
+{
+    painter->save();
+    QPolygon pts;
+    pts.setPoints(3, -2, 0, 2, 0, 0, 60);	/* (-2,0)/(2,0)/(0,60) *///第一个参数是 ,坐标的个数。后边的是坐标
+
+    painter->rotate(m_startAngle);
+    double degRotate = (360.0 - m_startAngle - m_endAngle) / (m_maxValue - m_minValue)*(m_value - m_minValue);
+
+    //画指针
+    painter->rotate(degRotate);  //顺时针旋转坐标系统
+    QRadialGradient haloGradient(0, 0, 60, 0, 0);  //辐射渐变
+    haloGradient.setColorAt(0, QColor(60, 60, 60));
+    haloGradient.setColorAt(1, QColor(160, 160, 160)); //灰
+    painter->setPen(Qt::white); //定义线条文本颜色  设置线条的颜色
+    painter->setBrush(haloGradient);//刷子定义形状如何填满 填充后的颜色
+    painter->drawConvexPolygon(pts); //这是个重载函数,绘制多边形。
+    painter->restore();
+
+    //画中心点
+    QColor niceBlue(150, 150, 200);
+    QConicalGradient coneGradient(0, 0, -90.0);  //角度渐变
+    coneGradient.setColorAt(0.0, Qt::darkGray);
+    coneGradient.setColorAt(0.2, niceBlue);
+    coneGradient.setColorAt(0.5, Qt::white);
+    coneGradient.setColorAt(1.0, Qt::darkGray);
+    painter->setPen(Qt::NoPen);  //没有线,填满没有边界
+    painter->setBrush(coneGradient);
+    painter->drawEllipse(-5, -5, 10, 10);
+}
+
+void Speed ::paintEvent(QPaintEvent *)
+{
+    QPainter painter(this);//一个类中的this表示一个指向该类自己的指针
+    painter.setRenderHint(QPainter::Antialiasing);  /* 使用反锯齿(如果可用) */
+    painter.translate(width() / 2, height() / 2);   /* 坐标变换为窗体中心 */
+    int side = qMin(width(), height());
+    painter.scale(side / 200.0, side / 200.0);      /* 比例缩放 */
+
+   drawCrown(&painter);                                 /* 画表盘边框 */
+   drawScaleNum(&painter);                          /* 画刻度数值值 */
+   drawScale(&painter);                                 /* 画刻度线 */
+   drawTitle(&painter);                                     /* 画单位 */
+   drawNumericValue(&painter);                      /* 画数字显示 */
+   drawIndicator(&painter);                             /* 画表针 */
+
+}
+
+void Speed::setminvalue(int value)
+{
+    m_minValue = value;
+}
+
+void Speed::setmaxvalue(int value)
+{
+    m_maxValue = value;
+}
+
+void Speed::updatevalue(double value)
+{
+    m_value = value;
+    update();
+}
+
+void Speed::setunits(QString strunits)
+{
+    m_units = strunits;
+}
+
+void Speed::settitle(QString strtitle)
+{
+    m_title = strtitle;
+}

+ 51 - 0
src/tool/groupctrl_grpc/speed.h

@@ -0,0 +1,51 @@
+#ifndef SPEED_H
+#define SPEED_H
+
+#include <QWidget>
+
+class Speed : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit Speed(QWidget *parent = nullptr);
+
+protected:
+    void paintEvent(QPaintEvent *);
+
+    void drawCrown(QPainter *painter);
+    void drawBackground(QPainter *painter);
+    void drawScale(QPainter *painter);
+    void drawScaleNum(QPainter *painter);
+    void drawTitle(QPainter *painter);
+    void drawIndicator(QPainter *painter);
+    void drawNumericValue(QPainter *painter);
+
+private:
+    QColor m_background;
+    QColor m_foreground;
+
+
+    int m_maxValue;
+    int m_minValue;
+    int m_startAngle;
+    int m_endAngle;
+
+    int m_scaleMajor;
+    int m_scaleMinor;
+    double m_value;
+    int m_precision;
+    QTimer *m_updateTimer;
+    QString m_units;
+    QString m_title;
+    public Q_SLOTS:
+//	void UpdateAngle();
+
+public:
+    void setminvalue(int value);
+    void setmaxvalue(int value);
+    void updatevalue(double value);
+    void setunits(QString strunits);
+    void settitle(QString strtitle);
+};
+
+#endif // SPEED_H