Commits

Pierre Surply committed a325e7e

Added roadmaster-core

Comments (0)

Files changed (29)

 *.o
 *~
 screen/
-src/Makefile
+gui/Makefile
 roadmaster
-test_gpio/
+test_gpio/
+roadmaster-core
+.moc/
+.ui/
 ## <pierre.surply@gmail.com>
 ## 
 ## Started on  Mon Mar 25 12:46:24 2013 Pierre Surply
-## Last update Mon Mar 25 13:30:54 2013 Pierre Surply
+## Last update Wed Mar 27 14:57:05 2013 Pierre Surply
 ##
 
-TARGET		= arm
-QDIR		= /opt/FriendlyARM/mini2440/$(TARGET)-qtopia/qtopia-2.2.0-FriendlyARM
+QDIR		= /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM
 
 QPEDIR		= $(QDIR)/qtopia
 QTDIR		= $(QDIR)/qt2
+DQTDIR		= $(QDIR)/dqt
 PATH 		:= $(QPEDIR)/bin:$(QTDIR)/bin:$(DQTDIR)/bin:$(PATH)
 LD_LIBRARY_PATH := $(QPEDIR)/lib:$(QTDIR)/lib:$(DQTDIR)/lib:$(LD_LIBRARY_PATH)
 
+export QPEDIR
+export QTDIR
+export DQTDIR
+export PATH
+
 SPEC		= $(QPEDIR)/mkspecs/qws/linux-arm-g++
 
 QMAKE		= qmake
 DESIGNER	= designer
 
 DESIGN		= src/roadmaster_base.ui
-EXEC		= roadmaster
+EXEC_GUI	= roadmaster
+EXEC_CORE	= roadmaster-core
+
+export EXEC_CORE
+
+PRO		= gui/roadmaster.pro
+SRC_GUI		= $(PRO)		\
+		  $(wildcard gui/*.c)	\
+		  $(wildcard gui/*.h)
+
+SRC_CORE	= $(wildcard core/*.c)	\
+		  $(wildcard core/*.h)
 
-PRO		= $(wildcard src/*.pro)
-SRC		= $(PRO)		\
-		  $(wildcard src/*.c)	\
-		  $(wildcard src/*.h)
+GUI_DIR		= gui
+CORE_DIR	= core
 
-MAKESRC		= src/Makefile
+all: $(EXEC_GUI) $(EXEC_CORE)
 
-all: $(EXEC)
+$(EXEC_CORE): $(SRC_CORE)
+	$(MAKE) -C $(CORE_DIR)
 
-$(EXEC): $(SRC)
-	$(QMAKE) -spec $(SPEC) -o $(MAKESRC) $(PRO)
-	$(MAKE) -C src
+$(EXEC_GUI): $(SRC_GUI)
+	$(QMAKE) -spec $(SPEC) -o $(GUI_DIR)/Makefile $(PRO)
+	$(MAKE) -C $(GUI_DIR)
 
 design:
 	$(DESIGNER) $(DESIGN)
 
 clean::
-	$(MAKE) -C src clean
-	rm -f $(EXEC) $(MAKESRC)
+	$(MAKE) -C gui clean
+	$(MAKE) -C core clean
+	rm -f $(EXEC_CORE) $(EXEC_GUI)

build-x86

-#!/bin/bash
-
-source /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/setQpeEnv 
-qmake -o Makefile -spec /opt/FriendlyARM/mini2440/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-generic-g++ *.pro 
-
-make clean
-make
+##
+## Makefile for RoadMaster in /core
+## 
+## Made by Pierre Surply
+## <pierre.surply@gmail.com>
+## 
+## Started on  Mon Mar 25 12:46:24 2013 Pierre Surply
+## Last update Wed Mar 27 14:57:44 2013 Pierre Surply
+##
+
+CC	= arm-linux-gcc
+FLAGS	= -Wall -Werror
+
+SRC	= gpio.c main.c
+OBJ	= $(SRC:.c=.o)
+
+all: $(EXEC_CORE)
+
+$(EXEC_CORE): $(OBJ)
+	$(CC) $(FLAGS) $^ -o ../$@
+
+%.o: %.c
+	$(CC) $(FLAGS) -c $< -o $@
+
+clean::
+	rm -r *.o
+/*
+** gpio.c for RoadMaster
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Wed Mar 27 14:22:45 2013 Pierre Surply
+** Last update Wed Mar 27 14:53:58 2013 Pierre Surply
+*/
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <err.h>
+
+#include "gpio.h"
+
+#define MAP_SIZE   4094UL
+#define MAP_MASK   (MAP_SIZE - 1)
+
+#define GPIO_BASE  0x56000000
+#define GPF        (0x54)
+#define GPG        (0x64)
+
+gpio gpio_init(void)
+{
+  gpio g;
+
+  g = malloc(sizeof(struct t_gpio));
+  if ((g->fd_mem = open("/dev/mem", O_RDWR)) < 0)
+    errx(EXIT_FAILURE, "Cannot open /dev/mem");
+
+  g->addr = mmap(0, getpagesize(),
+		  PROT_READ | PROT_WRITE, MAP_SHARED,
+		  g->fd_mem, GPIO_BASE) + GPG;
+  return g;
+}
+
+inline
+size_t gpio_read(gpio g)
+{
+  return *(g->addr);
+}
+
+void gpio_free(gpio g)
+{
+  close(g->fd_mem);
+  munmap(g->addr, MAP_SIZE);
+  free(g);
+}
+/*
+** gpio.h for RoadMaster
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Wed Mar 27 14:34:23 2013 Pierre Surply
+** Last update Wed Mar 27 14:51:32 2013 Pierre Surply
+*/
+
+#ifndef GPIO_H_
+#define GPIO_H_
+
+struct t_gpio
+{
+  int		fd_mem;
+  size_t	*addr;
+};
+
+typedef struct t_gpio *gpio;
+
+gpio	gpio_init(void);
+size_t	gpio_read(gpio g);
+void	gpio_free(gpio g);
+
+#endif /* GPIO_H_ */
+/*
+** main.c for RoadMaster
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Wed Mar 27 14:12:04 2013 Pierre Surply
+** Last update Wed Mar 27 15:24:59 2013 Pierre Surply
+*/
+
+#include "gpio.h"
+
+int main(void)
+{
+  gpio	g;
+
+  g = gpio_init();
+  
+  gpio_free();
+
+  return 0;
+}

gui/calibration.cpp

+//
+// calibration.cpp for RoadMaster in /home/surply_p
+// 
+// Made by Pierre Surply
+// <pierre.surply@gmail.com>
+// 
+// Started on  Thu Apr 19 18:00:37 2012 Pierre Surply
+// Last update Mon Mar 25 14:35:24 2013 Pierre Surply
+//
+
+#include "sensor.h"
+#include "calibration.h"
+
+Calibr::Calibr(Sensor* sensor)
+{
+  m_run = false;
+  m_sensor = sensor;
+  m_distance_parc = 1000;
+  m_nbr_imp = 1014;
+}
+
+Calibr::~Calibr()
+{
+}
+
+void Calibr::set(const bool run)
+{
+  m_run = run;
+  if (m_run)
+    {
+      m_sensor->set_tpm(1);
+      m_nbr_imp = 0;
+      m_sensor->reset();
+    }
+  else
+    {
+      m_nbr_imp = m_sensor->get_distance_tot()/10;
+      this->set_tpm();
+      m_sensor->reset();
+    }
+}
+
+void Calibr::set_tpm()
+{
+  m_sensor->set_tpm(((float)m_nbr_imp / 
+		     (float) m_distance_parc) * 10.0);
+}
+
+bool Calibr::is_running() const
+{
+  return m_run;
+}
+
+void Calibr::incr_imp(const int step)
+{
+  m_nbr_imp += step;
+  if (m_nbr_imp < 1)
+    m_nbr_imp = 1;
+  this->set_tpm();
+}
+
+int Calibr::get_distance_parc() const
+{
+  return m_distance_parc;
+}
+
+int Calibr::get_nbr_imp() const
+{
+  return m_nbr_imp;
+}
+
+void Calibr::set_nbr_imp(int nbr)
+{
+  m_nbr_imp = nbr;
+}

gui/calibration.h

+/*
+** calibration.h for RoadMaster in /home/surply_p
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Thu Apr 19 18:02:11 2012 Pierre Surply
+** Last update Sun May 20 14:44:31 2012 Pierre Surply
+*/
+
+#ifndef CAL_H_
+#define CAL_H_
+
+#define DISTANCE_MIN	500
+#define DISTANCE_MAX	1500
+
+class Sensor;
+
+class Calibr
+{
+ public:
+  Calibr(Sensor* sensor);
+  ~Calibr();
+  void		set(const bool run);
+  bool		is_running() const;
+  void		incr_imp(const int step);
+  int		get_distance_parc() const;
+  void		set_tpm();
+  int		get_nbr_imp() const;
+  void		set_nbr_imp(int nbr);
+
+ private:
+  bool		m_run;
+  Sensor*	m_sensor;
+  int		m_nbr_imp;
+  int		m_distance_parc; //m
+};
+
+#endif /* CAL_H_ */
+/*
+** gpio.h for RoadMaster in /home/surply_p
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Thu Apr 19 18:02:29 2012 Pierre Surply
+** Last update Thu Apr 19 21:59:54 2012 Pierre Surply
+*/
+
+#ifndef GPIO_H_
+#define GPIO_H_
+
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#define MAP_SIZE	4094UL
+#define MAP_MASK	(MAP_SIZE - 1)
+
+#define GPIO_BASE	0x56000000
+#define GPF		(0x54)
+#define GPG		(0x64)
+
+#endif /* GPIO_H_ */
+//
+// main.cpp for RoadMaster in /home/surply_p
+// 
+// Made by Pierre Surply
+// <pierre.surply@gmail.com>
+// 
+// Started on  Thu Apr 19 18:01:41 2012 Pierre Surply
+// Last update Thu Apr 19 18:01:45 2012 Pierre Surply
+//
+
+#include "roadmaster.h"
+#include <qtopia/qpeapplication.h>
+
+QTOPIA_ADD_APPLICATION("RoadMaster", RoadMaster)
+QTOPIA_MAIN
+

gui/roadmaster.cpp

+//
+// roadmaster.cpp for  in /home/surply_p
+// 
+// Made by Pierre Surply
+// <pierre.surply@gmail.com>
+// 
+// Started on  Thu Apr 19 18:01:22 2012 Pierre Surply
+// Last update Mon Mar 25 15:57:39 2013 Pierre Surply
+//
+
+#include "roadmaster.h"
+
+#include <qpushbutton.h>
+#include <qlcdnumber.h>
+#include <qgroupbox.h>
+#include <qspinbox.h>
+#include <qmessagebox.h>
+#include <qcolor.h>
+#include <qpalette.h>
+
+RoadMaster::RoadMaster(QWidget* parent,
+		       const char* name,
+		       WFlags fl):RoadMasterBase(parent, name, fl)
+{
+  m_sensor = new Sensor(this);
+  m_calibr = new Calibr(m_sensor);
+  m_timer_vitesse = new QTimer(this);
+  m_timer = new QTimer(this);
+  m_tps_part = QTime();
+
+  m_timer->start(1000, TRUE);
+  m_timer_vitesse->start(DELTA_T, TRUE);
+
+  m_pause_chrono = true;
+  m_distance_begin_part= 0;
+  m_distance_epr= 0;
+  m_distance_part= 0;
+  m_vitesse_part= 0;
+
+  this->update();
+  this->update_timer();
+  this->update_vitesse();
+
+  char buf[256];
+  sprintf(buf, "%d", (m_calibr->get_nbr_imp()));
+  NbrImpuls->display(buf);
+
+  // Buttons
+  connect(SetEta, SIGNAL(clicked()), this, SLOT(run_calibr()));
+  connect(IncrDist, SIGNAL(clicked()), this, SLOT(incr_distance()));
+  connect(IncrDist_2, SIGNAL(clicked()), this, SLOT(incr_distance()));
+  connect(DecrDist, SIGNAL(clicked()), this, SLOT(decr_distance()));
+  connect(DecrDist_2, SIGNAL(clicked()), this, SLOT(decr_distance()));
+  connect(ResetMoyen, SIGNAL(clicked()), this, SLOT(reset_vitesse()));
+  connect(ResetChrono, SIGNAL(clicked()), this, SLOT(reset_chrono()));
+  connect(PauseChrono, SIGNAL(clicked()), this, SLOT(pause_chrono()));
+  connect(IncrDistEta, SIGNAL(clicked()), this, SLOT(incr_distance_eta()));
+  connect(DecrDistEta, SIGNAL(clicked()), this, SLOT(decr_distance_eta()));
+  connect(MarcheArr, SIGNAL(clicked()), this, SLOT(marche_arr()));
+
+  // Settings
+  connect(UpdateDistTot, SIGNAL(clicked()), this, SLOT(set_distance_parc()));
+  connect(SetDistEpr, SIGNAL(valueChanged(int)), this, SLOT(set_distance_epr(int)));
+  connect(SetDistPart, SIGNAL(valueChanged(int)), this, SLOT(set_distance_part(int)));
+  connect(SetVitessPart, SIGNAL(valueChanged(int)), this, SLOT(set_vitesse_part(int)));
+  connect(SetTpsPartHour, SIGNAL(valueChanged(int)), this, SLOT(set_tps_part_hour(int)));
+  connect(SetTpsPartMin, SIGNAL(valueChanged(int)), this, SLOT(set_tps_part_min(int)));
+  connect(SetTpsPartSec, SIGNAL(valueChanged(int)), this, SLOT(set_tps_part_sec(int)));
+  connect(CalcDistPart, SIGNAL(pressed()), this, SLOT(calc_distance_part()));
+  connect(CalcVitessPart, SIGNAL(pressed()), this, SLOT(calc_vitesse_part()));
+  connect(CalcTpsPart, SIGNAL(pressed()), this, SLOT(calc_tps_part()));
+
+  // Timers
+  connect(m_timer, SIGNAL(timeout()), this, SLOT(update_timer()));
+  connect(m_timer_vitesse, SIGNAL(timeout()), this, SLOT(update_vitesse()));
+}
+
+RoadMaster::~RoadMaster()
+{
+}
+
+void RoadMaster::update()
+{
+  int	tmp;
+  char	buf[256];
+
+  if (m_calibr->is_running())
+    {
+      sprintf(buf, "%d", (m_sensor->get_distance_tot()/10));
+      NbrImpuls->display(buf);
+    }
+  else
+    {
+      // Distance tot
+      tmp = m_sensor->get_distance_tot();
+      sprintf(buf, "%d.%02d", tmp/1000, (tmp % 1000) / 10);
+      DistanceTot->display(buf);
+      DistanceTot_2->display(buf);
+
+      tmp = m_distance_epr - tmp;
+      if (tmp < 0)
+	tmp = 0;
+      sprintf(buf, "%d.%02d", tmp/1000, (tmp % 1000) / 10);
+      DistRestTot->display(buf);
+
+      tmp = m_distance_begin_part +
+	m_distance_part -
+	m_sensor->get_distance_tot();
+      if (tmp < 0)
+	tmp = 0;
+      sprintf(buf, "%d.%02d", tmp/1000, (tmp % 1000) / 10);
+      DistRestPart->display(buf);
+
+      // Distance Part
+      tmp = m_sensor->get_distance_part();
+      sprintf(buf, "%d.%02d", tmp/1000, (tmp % 1000) / 10);
+      DistancePart->display(buf);
+      DistancePart_2->display(buf);
+    }
+}
+
+void	RoadMaster::run_calibr()
+{
+  if (!m_calibr->is_running() &&
+      QMessageBox::warning(this, "Etalonnage",
+			   "L'ancienne valeur d'etalonnage \nsera perdue.\n"
+			   "Etes-vous sur de vouloir \ncommencer l'etalonnage ?",
+			   QMessageBox::Yes,
+			   QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes)
+    {
+      m_calibr->set(true);
+      SetEta->setText("Fin de zone");
+    }
+  else
+    {
+      m_calibr->set(false);
+      SetEta->setText("Depart de zone");
+    }
+}
+
+void	RoadMaster::update_vitesse()
+{
+  int	tmp;
+  char	buf[256];
+
+  // Vitesse moy
+  tmp = m_sensor->get_vitesse_moy();
+  sprintf(buf, "%d.%d", tmp / 1000, (tmp % 1000) / 100);
+  VitesseMoy->display(buf);
+
+  m_timer_vitesse->start(DELTA_T, TRUE);
+}
+
+void	RoadMaster::print_vit_inst(int vit)
+{
+  char buf[256];
+
+  // Vitesse inst
+  sprintf(buf, "%d.%d", vit / 1000, (vit % 1000) / 100);
+  VitesseInst->display(buf);
+  VitesseInst_2->display(vit / 1000);
+  VitesseInst_3->display(vit / 1000);
+}
+
+void	RoadMaster::set_bg_color(int r, int g, int b)
+{
+  DistanceTot->setPalette(QPalette(QColor(255,255,255),
+				   QColor(r, g, b)));
+  DistanceTot_2->setPalette(QPalette(QColor(255,255,255),
+				   QColor(r, g, b)));
+}
+
+void	RoadMaster::update_timer()
+{
+  if (!m_pause_chrono)
+    {
+      Chrono->display(m_chrono.toString());
+      Minuterie->display((QTime().addSecs(m_chrono.secsTo(m_tps_part))).toString());
+      m_chrono = m_chrono.addSecs(1);
+    }
+  Horloge->display(QTime::currentTime().toString());
+  m_timer->start(1000, TRUE);
+}
+
+void	RoadMaster::incr_distance()
+{
+  m_sensor->add_distance(10);
+  this->update();
+}
+
+void	RoadMaster::decr_distance()
+{
+  m_sensor->add_distance(-10);
+  this->update();
+}
+
+void	RoadMaster::reset_vitesse()
+{
+  m_sensor->reset_vitesse_moy();
+  this->update_vitesse();
+}
+
+void	RoadMaster::reset_chrono()
+{
+  m_chrono = QTime(0,0,0);
+  Chrono->display(m_chrono.toString());
+  Minuterie->display(m_tps_part.toString());
+}
+
+void	RoadMaster::run_chrono()
+{
+  m_pause_chrono = false;
+}
+
+void	RoadMaster::stop_chrono()
+{
+  m_pause_chrono = true;
+}
+
+void	RoadMaster::pause_chrono()
+{
+  m_pause_chrono = !m_pause_chrono;
+}
+
+void	RoadMaster::incr_distance_eta()
+{
+  this->set_distance_eta(1);
+}
+
+void	RoadMaster::decr_distance_eta()
+{
+  this->set_distance_eta(-1);
+}
+
+void	RoadMaster::set_distance_parc()
+{
+  m_sensor->set_distance_tot(InDistTot->value());
+  this->update();
+}
+
+void	RoadMaster::set_distance_eta(const int step)
+{
+  char	buf[256];
+
+  m_calibr->incr_imp(step);
+
+  sprintf(buf, "%d", (m_calibr->get_nbr_imp()));
+  NbrImpuls->display(buf);
+}
+
+void	RoadMaster::set_distance_epr(int dist)
+{
+  m_distance_epr = dist;
+  SetDistEpr->setValue(m_distance_epr);
+}
+
+void	RoadMaster::set_distance_part(int dist)
+{
+  m_distance_part = dist;
+  SetDistPart->setValue(m_distance_part);
+}
+
+void	RoadMaster::set_vitesse_part(int vit)
+{
+  m_vitesse_part = vit;
+  SetVitessPart->setValue(m_vitesse_part);
+  ObjVitessMoy->display(m_vitesse_part/1000);
+}
+
+void	RoadMaster::set_tps_part_hour(int hour)
+{
+  m_tps_part = QTime(hour, 
+		     m_tps_part.minute(),
+		     m_tps_part.second());
+  SetTpsPartHour->setValue(hour);
+}
+
+void	RoadMaster::set_tps_part_min(int min)
+{
+  m_tps_part = QTime(m_tps_part.hour(), 
+		     min,
+		     m_tps_part.second());
+  SetTpsPartMin->setValue(min);
+}
+
+void	RoadMaster::set_tps_part_sec(int sec)
+{
+  m_tps_part = QTime(m_tps_part.hour(), 
+		     m_tps_part.minute(),
+		     sec);
+  SetTpsPartSec->setValue(sec);
+}
+
+void	RoadMaster::calc_distance_part()
+{
+  this->set_distance_part((m_vitesse_part)*
+			  (m_tps_part.hour()*3600 +
+			   m_tps_part.minute()*60 +
+			   m_tps_part.second())/3600);
+}
+
+void	RoadMaster::calc_vitesse_part()
+{
+  this->set_vitesse_part(m_distance_part /
+			 (float)((m_tps_part.hour()*3600 +
+				  m_tps_part.minute()*60 +
+				  m_tps_part.second())/3600.0));
+}
+
+void	RoadMaster::calc_tps_part()
+{
+  int	tps;
+  int	h;
+  int	m;
+  int	s;
+  tps = (int)((float)((float)m_distance_part / (float)m_vitesse_part) * 3600.0);
+  h = tps / 3600;
+  m = (tps % 3600) / 60;
+  s = tps % 60;
+  
+  this->set_tps_part_hour(h);
+  this->set_tps_part_min(m);
+  this->set_tps_part_sec(s);
+}
+
+void	RoadMaster::begin_partiel()
+{
+  m_distance_begin_part = m_sensor->get_distance_tot();
+}
+
+void	RoadMaster::marche_arr()
+{
+  if (m_sensor->get_marche_arr())
+    this->set_bg_color(0, 0, 0);
+  else
+    this->set_bg_color(250, 60, 60);
+  m_sensor->set_marche_arr();
+}
+
+void	RoadMaster::save()
+{
+  /*
+  QSettings settings;
+  settings.setPath("Pierre Surply", "RoadMaster");
+  
+  settings.writeEntry("/rally/distance", m_sensor->get_distance_tot());
+  settings.writeEntry("/calibration/impuls", m_calibr->get_nbr_imp());
+  settings.writeEntry("/settings/distance_epr", m_distance_epr);
+  settings.writeEntry("/settings/distance_part", m_distance_part);
+  settings.writeEntry("/settings/vitesse_part", m_vitesse_part);
+  settings.writeEntry("/settings/hours_part", m_tps_part.hour());
+  settings.writeEntry("/settings/min_part", m_tps_part.minute());
+  settings.writeEntry("/settings/sec_part", m_tps_part.second());
+  */
+}
+
+void	RoadMaster::load()
+{
+  /*  char buf[256];
+  int tmp;
+  QSettings settings;
+
+  settings.setPath("Pierre Surply", "RoadMaster");
+  
+  m_sensor->reset();
+  m_sensor->set_distance_tot(settings.readNumEntry("/rally/distance", 0));
+
+  tmp = settings.readNumEntry("/calibration/impuls", 1000);
+  m_calibr->set_nbr_imp(tmp);
+  sprintf(buf, "%d", (tmp));
+  NbrImpuls->display(buf);
+
+  this->set_distance_epr(settings.readNumEntry("/settings/distance_epr", 0));
+  this->set_distance_part(settings.readNumEntry("/settings/distance_part", 0));
+  this->set_vitesse_part(settings.readNumEntry("/settings/vitesse_part", 0));
+  this->set_tps_part_hour(settings.readNumEntry("/settings/hours_part", 0));
+  this->set_tps_part_min(settings.readNumEntry("/settings/min_part", 0));
+  this->set_tps_part_sec(settings.readNumEntry("/settings/sec_part", 0));
+  */
+}
+/*
+** roadmaster.h for RoadMaster in /home/surply_p
+** 
+** Made by Pierre Surply
+** <pierre.surply@gmail.com>
+** 
+** Started on  Thu Apr 19 18:02:49 2012 Pierre Surply
+** Last update Sat May 26 20:51:34 2012 Pierre Surply
+*/
+
+#ifndef ROADMASTER_H_
+#define ROADMASTER_H_
+
+#include <qtimer.h>
+#include <qdatetime.h>
+
+#include "roadmaster_base.h"
+#include "calibration.h"
+#include "sensor.h"
+
+#define DELTA_T	       2500
+
+class RoadMaster : public RoadMasterBase
+{
+  Q_OBJECT
+
+ public:
+  RoadMaster(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+  ~RoadMaster();
+  void	update();
+  void	begin_partiel();
+  
+ public slots:
+  // home
+  void	update_vitesse();
+  void	print_vit_inst(int vit);
+  void	update_timer();
+  void	set_bg_color(int r, int g, int b);
+  void	incr_distance();
+  void	decr_distance();
+  void	reset_vitesse();
+  void	run_chrono();
+  void	stop_chrono();
+  void	reset_chrono();
+  void	pause_chrono();
+  void	marche_arr();
+
+  // Calibration
+  void	run_calibr();
+  void	incr_distance_eta();
+  void	decr_distance_eta();
+  
+  // Settings
+  void	set_distance_parc();
+  void	set_distance_epr(int dist);
+  void	set_distance_part(int dist);
+  void	set_vitesse_part(int vit);
+  void	set_tps_part_hour(int hour);
+  void	set_tps_part_min(int min);
+  void	set_tps_part_sec(int sec);
+  void	calc_distance_part();
+  void	calc_vitesse_part();
+  void	calc_tps_part();
+
+  void	save();
+  void	load();
+
+ private:
+  void		set_distance_eta(const int step);
+  
+  Sensor*	m_sensor;
+  Calibr*	m_calibr;
+
+  QTimer*	m_timer;
+  QTimer*	m_timer_vitesse;
+
+  // Chrono
+  QTime		m_chrono;
+  bool		m_pause_chrono;
+
+  // Settings
+  int		m_distance_epr; //m
+  int		m_distance_part;
+  int		m_vitesse_part;
+  QTime		m_tps_part;
+
+  // Epreuve Partiel
+  int		m_distance_begin_part;
+};
+
+#endif /* ROADMASTER_H_ */

gui/roadmaster.pro

+CONFIG += qtopiaapp
+CONFIG -= buildQuicklaunch
+DESTDIR = $(PWD)
+
+HEADERS = calibration.h \
+          gpio.h        \
+          sensor.h      \
+          roadmaster.h 
+          
+          
+
+SOURCES = calibration.cpp \
+          sensor.cpp      \
+          roadmaster.cpp  \
+
+SOURCES += main.cpp
+
+
+INTERFACES = roadmaster_base.ui
+LIBS += -lpthread
+TARGET = roadmaster

gui/roadmaster_base.ui

+<!DOCTYPE UI><UI>
+<class>RoadMasterBase</class>
+<widget>
+    <class>QWidget</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>RoadMasterBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>346</width>
+            <height>428</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>minimumSize</name>
+        <size>
+            <width>240</width>
+            <height>320</height>
+        </size>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>RoadMaster - Pierre Surply</string>
+    </property>
+    <widget>
+        <class>QTabWidget</class>
+        <property stdset="1">
+            <name>name</name>
+            <cstring>Tab</cstring>
+        </property>
+        <property stdset="1">
+            <name>geometry</name>
+            <rect>
+                <x>0</x>
+                <y>5</y>
+                <width>240</width>
+                <height>300</height>
+            </rect>
+        </property>
+        <property stdset="1">
+            <name>palette</name>
+            <palette>
+                <active>
+                    <color>
+                        <red>170</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>192</red>
+                        <green>192</green>
+                        <blue>192</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>223</red>
+                        <green>223</green>
+                        <blue>223</blue>
+                    </color>
+                    <color>
+                        <red>96</red>
+                        <green>96</green>
+                        <blue>96</blue>
+                    </color>
+                    <color>
+                        <red>128</red>
+                        <green>128</green>
+                        <blue>128</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                </active>
+                <disabled>
+                    <color>
+                        <red>128</red>
+                        <green>128</green>
+                        <blue>128</blue>
+                    </color>
+                    <color>
+                        <red>192</red>
+                        <green>192</green>
+                        <blue>192</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>220</red>
+                        <green>220</green>
+                        <blue>220</blue>
+                    </color>
+                    <color>
+                        <red>96</red>
+                        <green>96</green>
+                        <blue>96</blue>
+                    </color>
+                    <color>
+                        <red>128</red>
+                        <green>128</green>
+                        <blue>128</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>128</red>
+                        <green>128</green>
+                        <blue>128</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                </disabled>
+                <inactive>
+                    <color>
+                        <red>170</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>192</red>
+                        <green>192</green>
+                        <blue>192</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>220</red>
+                        <green>220</green>
+                        <blue>220</blue>
+                    </color>
+                    <color>
+                        <red>96</red>
+                        <green>96</green>
+                        <blue>96</blue>
+                    </color>
+                    <color>
+                        <red>128</red>
+                        <green>128</green>
+                        <blue>128</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>0</red>
+                        <green>0</green>
+                        <blue>0</blue>
+                    </color>
+                    <color>
+                        <red>255</red>
+                        <green>255</green>
+                        <blue>255</blue>
+                    </color>
+                </inactive>
+            </palette>
+        </property>
+        <widget>
+            <class>QWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>tab</cstring>
+            </property>
+            <attribute>
+                <name>title</name>
+                <string>Home</string>
+            </attribute>
+            <widget>
+                <class>QFrame</class>
+                <property stdset="1">
+                    <name>name</name>
+                    <cstring>Frame5</cstring>
+                </property>
+                <property stdset="1">
+                    <name>geometry</name>
+                    <rect>
+                        <x>0</x>
+                        <y>-30</y>
+                        <width>270</width>
+                        <height>310</height>
+                    </rect>
+                </property>
+                <property stdset="1">
+                    <name>palette</name>
+                    <palette>
+                        <active>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>192</red>
+                                <green>192</green>
+                                <blue>192</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>223</red>
+                                <green>223</green>
+                                <blue>223</blue>
+                            </color>
+                            <color>
+                                <red>96</red>
+                                <green>96</green>
+                                <blue>96</blue>
+                            </color>
+                            <color>
+                                <red>128</red>
+                                <green>128</green>
+                                <blue>128</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                        </active>
+                        <disabled>
+                            <color>
+                                <red>128</red>
+                                <green>128</green>
+                                <blue>128</blue>
+                            </color>
+                            <color>
+                                <red>192</red>
+                                <green>192</green>
+                                <blue>192</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>220</red>
+                                <green>220</green>
+                                <blue>220</blue>
+                            </color>
+                            <color>
+                                <red>96</red>
+                                <green>96</green>
+                                <blue>96</blue>
+                            </color>
+                            <color>
+                                <red>128</red>
+                                <green>128</green>
+                                <blue>128</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>128</red>
+                                <green>128</green>
+                                <blue>128</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                        </disabled>
+                        <inactive>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>192</red>
+                                <green>192</green>
+                                <blue>192</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>220</red>
+                                <green>220</green>
+                                <blue>220</blue>
+                            </color>
+                            <color>
+                                <red>96</red>
+                                <green>96</green>
+                                <blue>96</blue>
+                            </color>
+                            <color>
+                                <red>128</red>
+                                <green>128</green>
+                                <blue>128</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>0</red>
+                                <green>0</green>
+                                <blue>0</blue>
+                            </color>
+                            <color>
+                                <red>255</red>
+                                <green>255</green>
+                                <blue>255</blue>
+                            </color>
+                        </inactive>
+                    </palette>
+                </property>
+                <property stdset="1">
+                    <name>frameShape</name>
+                    <enum>StyledPanel</enum>
+                </property>
+                <property stdset="1">
+                    <name>frameShadow</name>
+                    <enum>Raised</enum>
+                </property>
+                <widget>
+                    <class>QLCDNumber</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Horloge</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>geometry</name>
+                        <rect>
+                            <x>-50</x>
+                            <y>210</y>
+                            <width>287</width>
+                            <height>70</height>
+                        </rect>
+                    </property>
+                    <property stdset="1">
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>4</hsizetype>
+                            <vsizetype>4</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>helvetica</family>
+                            <pointsize>9</pointsize>
+                            <bold>1</bold>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>smallDecimalPoint</name>
+                        <bool>true</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>numDigits</name>
+                        <number>10</number>
+                    </property>
+                    <property stdset="1">
+                        <name>segmentStyle</name>
+                        <enum>Flat</enum>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QLCDNumber</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>VitesseInst_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>geometry</name>
+                        <rect>
+                            <x>0</x>
+                            <y>30</y>
+                            <width>260</width>
+                            <height>90</height>
+                        </rect>
+                    </property>
+                    <property stdset="1">
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>4</hsizetype>
+                            <vsizetype>4</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>helvetica</family>
+                            <pointsize>9</pointsize>
+                            <bold>1</bold>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>smallDecimalPoint</name>
+                        <bool>true</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>numDigits</name>
+                        <number>3</number>
+                    </property>
+                    <property stdset="1">
+                        <name>segmentStyle</name>
+                        <enum>Flat</enum>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>PixmapLabel1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>geometry</name>
+                        <rect>
+                            <x>-1</x>
+                            <y>112</y>
+                            <width>240</width>
+                            <height>112</height>
+                        </rect>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>