Exemplo n.º 1
0
void handleLcdButtons(){

	int but = lcdReadButtons(uart1);

	int shouldsave = 0;

	while (but == 1){
		shouldsave = 1;
		but = lcdReadButtons(uart1);
		delay(25);
	}

	if (shouldsave == 1){ //save values
		saveValues();
		showAnnounce("Saved");
	}

	else if (but == 2){
		bot = calib;
	}

	else if (but == 4){
		bot = control;
	}

}
Exemplo n.º 2
0
void TimeWidget::startState()
{
  // Save selected values
  saveValues();

  // Get max value
  const auto time_to_wait = timeToWait();

  // Protection against wrong value
  if( time_to_wait <= 0 )
  {
		QMessageBox::warning(this, tr("Wrong values"), tr("You need to specify a time superior to 0"));
		return;
  }

  // Set active and update button text
  m_active = true;
  m_widget_button->setText(tr("Cancel"));

  // Update the progresss bar
  m_widget_progress->setMaximum(time_to_wait);
  m_widget_progress->setValue(time_to_wait);
	updateProgressText(timesFromSeconds( remainingSeconds() ));
  m_widget_progress->setTextVisible(true);

  // Start the timer
  m_timer->start(1000); // In milliseconds

  emit started();
}
Exemplo n.º 3
0
void SettingsDialog::ok(){
    saveValues();

    updateMainStatus();

    accept();
}
Exemplo n.º 4
0
MarkerProperties::MarkerProperties(Marker* mk, QWidget* parent)
   : QDialog(parent)
      {
      marker = mk;
      setupUi(this);
      label->setText(marker->label());
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 5
0
TempoProperties::TempoProperties(TempoText* tt, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      tempoText = tt;
      tempo->setValue(tempoText->tempo() * 60.0);
      followText->setChecked(tempoText->followText());
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 6
0
void  Singledata::save(vector<string> liBigEntries)
{

     printlog( "Save Data = " ,ID ) ;
     readEntries();
     printlog( "Save Data = ", ID ) ;
     saveValues();

}
Exemplo n.º 7
0
void  Singledata::saveAM(vector<string> liBigEntries)
{

     
  
  
     saveValues();

}
Exemplo n.º 8
0
MarkerProperties::MarkerProperties(Marker* mk, QWidget* parent)
   : QDialog(parent)
      {
      marker = mk;
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      label->setText(marker->label());
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 9
0
JumpProperties::JumpProperties(Jump* jp, QWidget* parent)
   : QDialog(parent)
      {
      jump = jp;
      setupUi(this);
      jumpTo->setText(jump->jumpTo());
      playUntil->setText(jump->playUntil());
      continueAt->setText(jump->continueAt());
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 10
0
ArticulationProperties::ArticulationProperties(Articulation* na, QWidget* parent)
   : QDialog(parent)
      {
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);

      articulation = na;

      ChordRest* cr = articulation->chordRest();
      if (cr) {
            Segment* segment       = cr->segment();
            Part* part             = articulation->staff()->part();
            Instrument* instrument = part->instr(segment->tick());

//      const QList<NamedEventList>& midiActions() const;
//      const QList<MidiArticulation>& articulation() const;
//      const QList<Channel>& channel() const;

            foreach(const Channel& a, instrument->channel()) {
                  if (a.name.isEmpty() || a.name == "normal")
                        channelList->addItem(tr("normal"));
                  else
                        channelList->addItem(a.name);
                  }
            foreach(const NamedEventList& el, instrument->midiActions()) {
                  midiActionList->addItem(el.name);
                  }
            }

#if 0
      foreach(const NamedEventList& e, instrument->midiActions)
            midiActionList->addItem(e.name);
      articulationChange->setChecked(!articulation->articulationName().isEmpty());
      midiAction->setChecked(!articulation->midiActionName().isEmpty());

      if (!articulation->articulationName().isEmpty()) {
            QList<QListWidgetItem*> wl = articulationList
               ->findItems(st->articulationName(), Qt::MatchExactly);
            if (!wl.isEmpty())
                  articulationList->setCurrentRow(articulationList->row(wl[0]));
            }
      if (!articulation->midiActionName().isEmpty()) {
            QList<QListWidgetItem*> wl = midiActionList
               ->findItems(st->midiActionName(), Qt::MatchExactly);
            if (!wl.isEmpty())
                  midiActionList->setCurrentRow(midiActionList->row(wl[0]));
            }
#endif

      direction->setCurrentIndex(int(articulation->direction()));
      anchor->setCurrentIndex(int(articulation->anchor()));

      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 11
0
JumpProperties::JumpProperties(Jump* jp, QWidget* parent)
   : QDialog(parent)
      {
      jump = jp;
      setupUi(this);
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      jumpTo->setText(jump->jumpTo());
      playUntil->setText(jump->playUntil());
      continueAt->setText(jump->continueAt());
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      }
Exemplo n.º 12
0
void WaypointImpFilterDialog::showEvent( QShowEvent *event )
{
    Q_UNUSED( event )

    // The unit can be changed in the meantime. Therefore we do update it here.
    QString distUnit = Distance::getUnitText();
    radiusUnit->setText( tr("Radius") + " (" + distUnit + "):" );

    // Load airfield data into combo box. Can be changed in the meantime.
    loadAirfieldComboBox();

    // Save all values for restore in reject case.
    saveValues();
}
Exemplo n.º 13
0
//--------------------------------------------------------------
bool GuiContainer::touchUp(int _x, int _y, int button) {
	if(!enabled) return false;
	moving = false;
	bool foundFocus = false;
	
	for(int i = controls.size()-1; i >= 0; i--) {
		if(controls[i]->isContainer()) { // if we're a container, call touchUp to propagate to children.
			foundFocus = controls[i]->touchUp(_x-x, _y-y, button);
		} else {
			foundFocus = controls[i]->_touchUp(_x-x, _y-y, button);
		} 
		if(foundFocus) {
			if(autoSaving) {
				saveValues(autoSaveFile);
			}
			return true;
		}
	}
	return false;
}
Exemplo n.º 14
0
void CTDLearner::saveValues(char *filename) {
    FILE *stream = fopen (filename, "w");
	
    saveValues(stream);
    fclose (stream);
}
Exemplo n.º 15
0
void PreferencesDialog::quit()
{
    saveValues(); // save Options
    emit accept();   // send accept signal and exit
}
Exemplo n.º 16
0
StaffTextProperties::StaffTextProperties(const StaffTextBase* st, QWidget* parent)
   : QDialog(parent)
      {
      setObjectName("StaffTextProperties");
      setupUi(this);
      if (st->systemFlag()) {
            setWindowTitle(tr("System Text Properties"));
            tabWidget->removeTab(tabWidget->indexOf(tabAeolusStops)); // Aeolus settings  for staff text only
            //if (!enableExperimental) tabWidget->removeTab(tabWidget->indexOf(tabMIDIAction));
            tabWidget->removeTab(tabWidget->indexOf(tabChangeChannel)); // Channel switching  for staff text only
            }
      else {
            setWindowTitle(tr("Staff Text Properties"));
            //tabWidget->removeTab(tabWidget->indexOf(tabSwingSettings)); // Swing settings for system text only, could be disabled here, if desired
#ifndef AEOLUS
            tabWidget->removeTab(tabWidget->indexOf(tabAeolusStops));
#endif
            //if (!enableExperimental) tabWidget->removeTab(tabWidget->indexOf(tabMIDIAction));
            }
      setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
      _staffText = static_cast<StaffTextBase*>(st->clone());

      vb[0][0] = voice1_1;
      vb[0][1] = voice1_2;
      vb[0][2] = voice1_3;
      vb[0][3] = voice1_4;

      vb[1][0] = voice2_1;
      vb[1][1] = voice2_2;
      vb[1][2] = voice2_3;
      vb[1][3] = voice2_4;

      vb[2][0] = voice3_1;
      vb[2][1] = voice3_2;
      vb[2][2] = voice3_3;
      vb[2][3] = voice3_4;

      vb[3][0] = voice4_1;
      vb[3][1] = voice4_2;
      vb[3][2] = voice4_3;
      vb[3][3] = voice4_4;

      channelCombo[0] = channelCombo1;
      channelCombo[1] = channelCombo2;
      channelCombo[2] = channelCombo3;
      channelCombo[3] = channelCombo4;

      //---------------------------------------------------
      // setup "switch channel"
      //---------------------------------------------------

      for (int i = 0; i < 4; ++i)
            initChannelCombo(channelCombo[i], _staffText);

      Part* part = _staffText->staff()->part();
      int tick = static_cast<Segment*>(st->parent())->tick();
      int n = part->instrument(tick)->channel().size();
      int rows = 0;
      for (int voice = 0; voice < VOICES; ++voice) {
            if (_staffText->channelName(voice).isEmpty())
                  continue;
            for (int i = 0; i < n; ++i) {
                  const Channel* a = part->instrument(tick)->channel(i);
                  if (a->name != _staffText->channelName(voice))
                        continue;
                  int row = 0;
                  for (row = 0; row < rows; ++row) {
                        if (channelCombo[row]->currentIndex() == i) {
                              vb[voice][row]->setChecked(true);
                              break;
                              }
                        }
                  if (row == rows) {
                        vb[voice][rows]->setChecked(true);
                        channelCombo[row]->setCurrentIndex(i);
                        ++rows;
                        }
                  break;
                  }
            }
      QSignalMapper* mapper = new QSignalMapper(this);
      for (int row = 0; row < 4; ++row) {
            for (int col = 0; col < 4; ++col) {
                  connect(vb[col][row], SIGNAL(clicked()), mapper, SLOT(map()));
                  mapper->setMapping(vb[col][row], (col << 8) + row);
                  }
            }

      if (_staffText->swing()) {
            setSwingBox->setChecked(true);
            if (_staffText->swingParameters()->swingUnit == MScore::division/2) {
                  swingBox->setEnabled(true);
                  swingEighth->setChecked(true);
                  swingBox->setValue(_staffText->swingParameters()->swingRatio);
                  }
            else if (_staffText->swingParameters()->swingUnit == MScore::division/4) {
                  swingBox->setEnabled(true);
                  swingSixteenth->setChecked(true);
                  swingBox->setValue(_staffText->swingParameters()->swingRatio);
                  }
            else if (_staffText->swingParameters()->swingUnit == 0) {
                 swingBox->setEnabled(false);
                 SwingOff->setChecked(true);
                 swingBox->setValue(_staffText->swingParameters()->swingRatio);
                 }
            }

      connect(mapper, SIGNAL(mapped(int)), SLOT(voiceButtonClicked(int)));
      connect(SwingOff, SIGNAL(toggled(bool)), SLOT(setSwingControls(bool)));
      connect(swingEighth, SIGNAL(toggled(bool)), SLOT(setSwingControls(bool)));
      connect(swingSixteenth, SIGNAL(toggled(bool)), SLOT(setSwingControls(bool)));

      //---------------------------------------------------
      //    setup midi actions
      //---------------------------------------------------

      QTreeWidgetItem* selectedItem = 0;
      for (int i = 0; i < n; ++i) {
            const Channel* a = part->instrument(tick)->channel(i);
            QTreeWidgetItem* item = new QTreeWidgetItem(channelList);
            item->setData(0, Qt::UserRole, i);
            if (a->name.isEmpty() || a->name == "normal")
                  item->setText(0, tr("normal"));
            else
                  item->setText(0, qApp->translate("InstrumentsXML", a->name.toUtf8().data()));
            item->setText(1, qApp->translate("InstrumentsXML", a->descr.toUtf8().data()));
            if (i == 0)
                  selectedItem = item;
            }
      connect(channelList, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
         SLOT(channelItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
      connect(this, SIGNAL(accepted()), SLOT(saveValues()));
      channelList->setCurrentItem(selectedItem);

      //---------------------------------------------------
      //    setup aeolus stops
      //---------------------------------------------------

      changeStops->setChecked(_staffText->setAeolusStops());

      for (int i = 0; i < 4; ++i) {
            for (int k = 0; k < 16; ++k)
                  stops[i][k] = 0;
            }
      stops[0][0]  = stop_3_0;
      stops[0][1]  = stop_3_1;
      stops[0][2]  = stop_3_2;
      stops[0][3]  = stop_3_3;
      stops[0][4]  = stop_3_4;
      stops[0][5]  = stop_3_5;
      stops[0][6]  = stop_3_6;
      stops[0][7]  = stop_3_7;
      stops[0][8]  = stop_3_8;
      stops[0][9]  = stop_3_9;
      stops[0][10] = stop_3_10;
      stops[0][11] = stop_3_11;

      stops[1][0]  = stop_2_0;
      stops[1][1]  = stop_2_1;
      stops[1][2]  = stop_2_2;
      stops[1][3]  = stop_2_3;
      stops[1][4]  = stop_2_4;
      stops[1][5]  = stop_2_5;
      stops[1][6]  = stop_2_6;
      stops[1][7]  = stop_2_7;
      stops[1][8]  = stop_2_8;
      stops[1][9]  = stop_2_9;
      stops[1][10] = stop_2_10;
      stops[1][11] = stop_2_11;
      stops[1][12] = stop_2_12;

      stops[2][0]  = stop_1_0;
      stops[2][1]  = stop_1_1;
      stops[2][2]  = stop_1_2;
      stops[2][3]  = stop_1_3;
      stops[2][4]  = stop_1_4;
      stops[2][5]  = stop_1_5;
      stops[2][6]  = stop_1_6;
      stops[2][7]  = stop_1_7;
      stops[2][8]  = stop_1_8;
      stops[2][9]  = stop_1_9;
      stops[2][10] = stop_1_10;
      stops[2][11] = stop_1_11;
      stops[2][12] = stop_1_12;
      stops[2][13] = stop_1_13;
      stops[2][14] = stop_1_14;
      stops[2][15] = stop_1_15;

      stops[3][0]  = stop_p_0;
      stops[3][1]  = stop_p_1;
      stops[3][2]  = stop_p_2;
      stops[3][3]  = stop_p_3;
      stops[3][4]  = stop_p_4;
      stops[3][5]  = stop_p_5;
      stops[3][6]  = stop_p_6;
      stops[3][7]  = stop_p_7;
      stops[3][8]  = stop_p_8;
      stops[3][9]  = stop_p_9;
      stops[3][10] = stop_p_10;
      stops[3][11] = stop_p_11;
      stops[3][12] = stop_p_12;
      stops[3][13] = stop_p_13;
      stops[3][14] = stop_p_14;
      stops[3][15] = stop_p_15;

      curTabIndex = tabWidget->currentIndex();
      connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(tabChanged(int)));

      MuseScore::restoreGeometry(this);
      }