Exemple #1
0
void BarGraph::addEnergy(int value){

  energy += value;
  if (energy > 10)
    energy = 10;
  updateBarGraph();
}
Exemple #2
0
void BarGraph::subEnergy(int value){

  energy -= value;
  if (energy < 0)
    energy = 0;
  updateBarGraph();
}
Exemple #3
0
void BarGraph::presentation_up(){
	
  for (int i = 0; i < 10; i++) {
    addEnergy(1);
    updateBarGraph();
    delay(400);
  }
}
Exemple #4
0
void BarGraph::presentation_down(){
  
  for (int i = 0; i < 10; i++){
    subEnergy(1);
    updateBarGraph();
    delay(400);
  }
}
ThrustBar::ThrustBar(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QTimer *timer = new QTimer(this);

    connect(timer, SIGNAL(timeout()), this, SLOT(update()));
    connect(timer,SIGNAL(timeout()),this,SLOT(updateBarGraph()));

    timer->start(10);
    //updateBarGraph();
    eng1 =0;
    eng2 =0;
    eng3 =0;
    eng4 =0;
    eng5 =0;
    eng6 =0;
    eng7 =0;
    eng8 =0;

    setWindowTitle(tr("Thrust Graphs"));
}
Exemple #6
0
void BarGraph::reset(){
  energy = 0;
  updateBarGraph();
}
Exemple #7
0
void BarGraph::begin(){

  energy = 0;
  updateBarGraph(); 
}