Esempio n. 1
0
int main(int argc, char *argv[])
{
    QString b, s, h, p;
    int i;
    
    QTranslator translator;
    if(translator.load("../setupDiag/qtlogSetup_en")) qDebug()<<"Got the translation for setup.\n";
    QApplication a(argc, argv);
    a.installTranslator(&translator);

    QString home = QDir::homePath(); 
    s = home+"/.qtlog";                         // prüfe ob Ordner $HOME.qtlog vorhanden ist
    QDir dir(s);                                // Check if file exists $ HOME.qtlog
    if(!dir.exists())
       dir.mkdir(s);                            // nein; anlegen          
    
    p = "ps -e | grep mysqld > "+home+"/.qtlog/rigstatus";
    i = system(p.toAscii());                    // suche den mysqld_prozess
    h = home;
    h += "/.qtlog/rigstatus";                   // prüfe status auf erfolg
    QFile iniFile(h);                           //check status on success
    iniFile.open(QIODevice::ReadOnly);
    QTextStream istream( &iniFile);             // oeffne status_file
    p = istream.readLine(0);                    // nur 1.Zeile
    iniFile.close();
    if(p.indexOf("mysqld") != -1) {             // ist mysqld_proz vorhanden
      b = home+"/.config/QtLog/qtlog.ini";      // versuche qtlog.ini zu öffnen
      QFile iniFile(b);
      if(!iniFile.open(QIODevice::ReadOnly)) {  // wenn FEHLER - ist ini nicht vorhanden
         s = home+"/.config/QtLog";             // vorbereitung  - NEU_installation -
         QDir dir(s);
         dir.mkdir(s);                          // DIR anlegen 
         s = "cp "+home+"/log/initTable/qtlog.ini "+home+"/.config/QtLog/qtlog.ini"; // copy ini
         StartProcess(s);
      }
      else {                                   // ini.file ist vorhanden, prüfe AUDIT
        QTextStream istream( &iniFile);
        s = istream.readLine(0);               // 1.zeile [General]
        s = istream.readLine(0);               // 2.zeile audit=5.15
        b = s.mid(6);
        if(b.compare(AUDIT) != 0) {            // ist ini_audit != source_AUDIT "dann UPGRADE !"
           s = "mv "+home+"/.config/QtLog/qtlog.ini "+home+"/.config/QtLog/qtlog.old"; // rename.old
           StartProcess(s);
           s = "cp "+home+"/log/initTable/qtlog.ini "+home+"/.config/QtLog/qtlog.ini"; // copy NEW
           StartProcess(s);
        }
        iniFile.close();
      }
    }
    else {
      qDebug() << "FEHLER : Der MYSQL-Server ist nicht vorhanden";
      exit(0);
    }
    
// ------------------------------------

    setup setupD;
    setupD.show();
    return a.exec();
}
Esempio n. 2
0
void Tracker::load_settings()
{
    QMutexLocker foo(&mtx);
	QSettings settings("opentrack");
	QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );

	iniFile.beginGroup( "aruco-Tracker" );
    fov = iniFile.value("fov", 56).toFloat();
    force_fps = iniFile.value("fps", 0).toInt();
    camera_index = iniFile.value("camera-index", -1).toInt();
    int res = iniFile.value("resolution", 0).toInt();
    if (res < 0 || res >= (int)(sizeof(resolution_choices) / sizeof(resolution_tuple)))
		res = 0;
	resolution_tuple r = resolution_choices[res];
	force_width = r.width;
    force_height = r.height;
	enableRX = iniFile.value("enable-rx", true).toBool();
	enableRY = iniFile.value("enable-ry", true).toBool();
	enableRZ = iniFile.value("enable-rz", true).toBool();
	enableTX = iniFile.value("enable-tx", true).toBool();
	enableTY = iniFile.value("enable-ty", true).toBool();
	enableTZ = iniFile.value("enable-tz", true).toBool();

    for (int i = 0; i < 3; i++)
    {
        headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble();
    }
    headpitch = iniFile.value("pitch", 0).toDouble();

	iniFile.endGroup();
}
void FTNoIR_Filter::loadSettings() {
    QList<QPointF> defPoints;

    QSettings settings("Abbequerque Inc.", "FaceTrackNoIR");	// Registry settings (in HK_USER)

    QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
    QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

    defPoints.clear();
    for (int i = 0; i < NUM_OF(defScaleRotation); i++) {		// Get the default points (hardcoded!)
        defPoints.append(defScaleRotation[i]);
    }
    functionConfig.loadSettings(iniFile, defPoints);

    defPoints.clear();
    for (int i = 0; i < NUM_OF(defScaleTranslation); i++) {		// Get the default points (hardcoded!)
        defPoints.append(defScaleTranslation[i]);
    }
    translationFunctionConfig.loadSettings(iniFile, defPoints);

    iniFile.beginGroup ( "Accela" );
    kMagicNumber = iniFile.value ( "Reduction", 100 ).toFloat();
    iniFile.endGroup ();

}
//
// Load the current Settings from the currently 'active' INI-file.
//
void MOUSEControls::loadSettings() {
	qDebug() << "loadSettings says: Starting ";
	QSettings settings("Abbequerque Inc.", "FaceTrackNoIR");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	qDebug() << "loadSettings says: iniFile = " << currentFile;

	iniFile.beginGroup ( "Mouse" );
	ui.cbxSelectMouseStyle->setCurrentIndex(iniFile.value ( "Style", 1 ).toInt() - 1);
	ui.cbxSelectMouse_X->setCurrentIndex(iniFile.value ( "Mouse_X", 1 ).toInt() - 1);
	ui.cbxSelectMouse_Y->setCurrentIndex(iniFile.value ( "Mouse_Y", 1 ).toInt() - 1);
	ui.cbxSelectMouse_Wheel->setCurrentIndex(iniFile.value ( "Mouse_Wheel", 1 ).toInt() - 1);

	ui.slideSensX->setValue(iniFile.value("SensX", 10).toInt());
	ui.slideSensY->setValue(iniFile.value("SensY", 10).toInt());
	ui.slideSensWheel->setValue(iniFile.value("SensWheel", 10).toInt());

	ui.chkUseVirtualDesk->setChecked( iniFile.value ( "useVirtualDesk", 0 ).toBool() );

	iniFile.endGroup ();

	settingsDirty = false;
}
Esempio n. 5
0
// ------------------------------------------------
int rigctl::deleteServerProz()
{
     QString home, p;
      
       home = getenv("HOME"); 
       p = "ps -e | grep rigctld > "+home+"/.qtlog/rigstatus";
       i = system(p.toAscii());           // suche rigctld prozess

       home += "/.qtlog/rigstatus";       // öffne Ergebnis_file
       QFile iniFile(home);
       iniFile.open(QIODevice::ReadOnly);
       QTextStream istream( &iniFile);    // oeffne rigstatus
       p = istream.readLine(0);           // nur die 1.Zeile, falls vorhanden
       iniFile.close();
       
       if(p.indexOf("rigctld") != -1) {   // check - wenn rigctld_proz vorhanden, kill
         p.remove(0,1);
         // "7437 pts/1  S  0:00 rigctld -m 357 -r /dev/ttyUSB0 -s 19200 -p /dev/ttyUSB0 -P RTS" ...
         i = p.indexOf(" ");
         s = p.left(i);                  // 7437 
         p = "kill "+s;
         i = system(p.toAscii());        // kill proz_Id
      }
      return 0;                          // rigctld_proz entfernt - falls vorhanden war
}
//
// Load the current Settings from the currently 'active' INI-file.
//
void FilterControls::loadSettings() {
QList<QPointF> defPoints;

	QSettings settings("Abbequerque Inc.", "FaceTrackNoIR");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	qDebug() << "FTNoIR_Filter::loadSettings2 says: iniFile = " << currentFile;


	qDebug() << "FTNoIR_Filter::loadSettings2 says: size = " << NUM_OF(defScaleRotation);

	defPoints.clear();
	for (int i = 0; i < NUM_OF(defScaleRotation); i++) {		// Get the default points (hardcoded!)
		defPoints.append(defScaleRotation[i]);
	}
	functionConfig.loadSettings(iniFile, defPoints);

	defPoints.clear();
	for (int i = 0; i < NUM_OF(defScaleTranslation); i++) {		// Get the default points (hardcoded!)
		defPoints.append(defScaleTranslation[i]);
	}
	translationFunctionConfig.loadSettings(iniFile, defPoints);

	ui.translationScalingConfig->setConfig(&translationFunctionConfig, currentFile);
	ui.scalingConfig->setConfig(&functionConfig, currentFile);

	iniFile.beginGroup ( "Accela" );
	ui.slideReduction->setValue (iniFile.value ( "Reduction", 100 ).toInt());
	iniFile.endGroup ();

	settingsDirty = false;
}
Esempio n. 7
0
void LoadConfig()
{
	FILE *fp;
	Config *Conf1 = &conf;
	char szValue[256];

	string iniFile( s_strIniPath + "/zerospu2.ini" );

	fopen_s(&fp, iniFile.c_str(), "rt");//check if zerospu2.ini really exists

	if (!fp)
	{
		CreateDirectory(s_strIniPath.c_str(), NULL);
		memset(&conf, 0, sizeof(conf));
		conf.Log = 0;//default value
		conf.options = OPTION_TIMESTRETCH;
		SaveConfig();//save and return
		return ;
	}
	fclose(fp);

	GetPrivateProfileString("Interface", "Logging", NULL, szValue, 20, iniFile.c_str());
	Conf1->Log = strtoul(szValue, NULL, 10);
	GetPrivateProfileString("Interface", "Options", NULL, szValue, 20, iniFile.c_str());
	Conf1->options = strtoul(szValue, NULL, 10);
	return;

}
Esempio n. 8
0
void PerftEntityDao::readPerft() {
    IniFile iniFile(iniFileName);
    PerftEntity *task = nullptr;
    while (true) {
        pair<string, string> *parameters = iniFile.get();
        if (!parameters)break;
        if (parameters->first == "[perft]" || parameters->first == "[task]") {
            if (task) {
                perftEntity = task;
                break;
            }
            task = new PerftEntity();
        }

        if (task) {
            if (parameters->first == "perft_uuid") {
                task->setUuid(parameters->second);
            } else if (parameters->first == "depth") {
                task->setDepth(stoi(parameters->second));
            } else if (parameters->first == "fen") {
                task->setFen(parameters->second);
            }
        }
    }
    if (task)perftEntity = task;
}
//---------------------------------------------------------------------------
void TKeyControlForm::populateInputMixer()
{
   SourceComboBox->Clear();

   VKMixer *inMix = VKMixer::GetInputVKMixer();
   if ( inMix )
   {
      std::vector<std::string> reclines = inMix->getInputLines();

      for ( std::vector<std::string>::iterator i = reclines.begin(); i != reclines.end(); i++ )
      {
         String item = ( *i ).c_str();
         SourceComboBox->Items->Add( item );
      }
      SourceComboBox->ItemIndex = 0;
      std::auto_ptr<TIniFile> iniFile( new TIniFile( "Configuration\\MinosKeyer.ini" ) );
      String inputMixerLine = iniFile->ReadString( "Mixers", "InputLine", SourceComboBox->Text );

      int ip = SourceComboBox->Items->IndexOf( inputMixerLine );
      if ( ip < 0 )
      {
         ip = 0;
         inputMixerLine = SourceComboBox->Items->Strings[ 0 ].c_str();
      }
		VKMixer::GetInputVKMixer() ->setInputMixerLine( inputMixerLine.t_str() );
      SourceComboBox->ItemIndex = ip;

      TMessage msg;
      MMMixControlChange( msg );
      SaveMixerSettings( ".\\InputMixerSettings.xml" );
   }
}
Esempio n. 10
0
//---------------------------------------------------------------------------
void TKeyControlForm::populateOutputMixer()
{
   DestinationComboBox->Clear();

   VKMixer *outMix = VKMixer::GetOutputVKMixer();

   if ( outMix )
   {
      std::vector<std::string> destlines = outMix->getOutputLines();

      for ( std::vector<std::string>::iterator i = destlines.begin(); i != destlines.end(); i++ )
      {
         String item = ( *i ).c_str();
         DestinationComboBox->Items->Add( item );
      }
      DestinationComboBox->ItemIndex = 0;
      std::auto_ptr<TIniFile> iniFile( new TIniFile( "Configuration\\MinosKeyer.ini" ) );
      String outputMixerLine = iniFile->ReadString( "Mixers", "OutputLine", DestinationComboBox->Text );

      int op = DestinationComboBox->Items->IndexOf( outputMixerLine );
      if ( op < 0 )
      {
         op = 0;
         outputMixerLine = DestinationComboBox->Items->Strings[ 0 ].c_str();
      }
      VKMixer::GetOutputVKMixer() ->setOutputMixerLine( outputMixerLine.t_str() );
      DestinationComboBox->ItemIndex = op;

      TMessage msg;
      MMMixControlChange( msg );
      SaveMixerSettings( ".\\OutputMixerSettings.xml" );
   }
}
//
// Save the current Settings to the currently 'active' INI-file.
//
void TrackerControls::save() {

	QSettings settings("opentrack");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	iniFile.beginGroup ( "SMTracker" );
	iniFile.setValue ( "FilterLevel", ui.cbxFilterSetting->currentIndex() );

	iniFile.setValue ( "EnableRoll", ui.chkEnableRoll->isChecked() );
	iniFile.setValue ( "EnablePitch", ui.chkEnablePitch->isChecked() );
	iniFile.setValue ( "EnableYaw", ui.chkEnableYaw->isChecked() );
	iniFile.setValue ( "EnableX", ui.chkEnableX->isChecked() );
	iniFile.setValue ( "EnableY", ui.chkEnableY->isChecked() );
	iniFile.setValue ( "EnableZ", ui.chkEnableZ->isChecked() );

	iniFile.endGroup ();

	//
	// If the Tracker is active, let it load the new Settings.
	//
	if (theTracker) {
		theTracker->loadSettings();
	}

	settingsDirty = false;
}
Esempio n. 12
0
int PovrayMaker::render()
{
	addCamera();

	addLightSource(scale, scale, scale);

	double axLen=1.5*scale;
	double axThick=0.005*scale;
	addCylinder(0, 0,0,axLen, 0,0, axThick,1);
	addCylinder(0, 0,0,0, axLen,0, axThick,2);
	addCylinder(0, 0,0,0, 0,axLen, axThick,3);

	file->close();

	QFile iniFile(fileName+QString("%1.ini").arg(dnum));

	QString processor("D:\\Program\" \"Files\\POVRAY\\bin\\pvengine /EXIT ");
//	QString processor("notepad ");

	if(iniFile.exists())
		Povray.start(processor+fileName+QString("%1.ini").arg(dnum));
	else
		Povray.start(processor+fileName+QString("%1.pov").arg(dnum));

     if (!Povray.waitForStarted())
         return 1;
     if (!Povray.waitForFinished(-1))
         return 2;

	 if(!file->open(QIODevice::Append  | QIODevice::Text))
		 return 3;
	textOut.setDevice(file);
	 return 0;
}
Esempio n. 13
0
void setLaunchOnStartup_private(const QString &appName, const QString& guiName, bool enable)
{
    QString userAutoStartPath = getUserAutostartDir_private();
    QString desktopFileLocation = userAutoStartPath+appName+QLatin1String(".desktop");
    if (enable) {
        if (!QDir().exists(userAutoStartPath) && !QDir().mkpath(userAutoStartPath)) {
            qDebug() << "Could not create autostart directory";
            return;
        }
        QFile iniFile(desktopFileLocation);
        if (!iniFile.open(QIODevice::WriteOnly)) {
            qDebug() << "Could not write auto start entry" << desktopFileLocation;
            return;
        }
        QTextStream ts(&iniFile);
        ts.setCodec("UTF-8");
        ts << QLatin1String("[Desktop Entry]") << endl
           << QLatin1String("Name=") << guiName << endl
           << QLatin1String("GenericName=") << QLatin1String("File Synchronizer") << endl
           << QLatin1String("Exec=") << QCoreApplication::applicationFilePath() << endl
           << QLatin1String("Terminal=") << "false" << endl
           << QLatin1String("Icon=") << appName.toLower() << endl // always use lowercase for icons
           << QLatin1String("Categories=") << QLatin1String("Network") << endl
           << QLatin1String("Type=") << QLatin1String("Application") << endl
           << QLatin1String("StartupNotify=") << "false" << endl
           << QLatin1String("X-GNOME-Autostart-enabled=") << "true" << endl
            ;
    } else {
        if (!QFile::remove(desktopFileLocation)) {
            qDebug() << "Could not remove autostart desktop file";
        }
    }
}
Esempio n. 14
0
void ThemeEditorDialog::OnBnClickedButtonLoad()
{
    CString filter = _T("musikCube Theme Files (*.ini)|*.ini||");
    
    FileDialog ofdlg(
        TRUE, 
        _T("ini"), 
        NULL, 
        OFN_EXPLORER | OFN_FILEMUSTEXIST, 
        filter
   );

    if (ofdlg.DoModal() == IDOK)
    {
        std::string fn = musik::Core::utf16to8(ofdlg.GetFileName().GetBuffer(), false);
        CIniFile iniFile(fn);

        if (!iniFile.ReadFile())
        {
            MessageBox(
                _T("Failed to read theme file from disk.  Invalid access rights?"),
                _T("musikCube"),
                MB_OK | MB_ICONERROR
           );

            return;
        }

        Globals::Preferences->MUSIK_COLOR_ACTIVECAPTION = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Active Caption", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_CAPTIONTEXT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Active Caption Text", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_INACTIVECAPTION = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Inactive Caption", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_INACTIVECAPTIONTEXT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Inactive Caption Text", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_BTNFACE = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Button Face", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_BTNTEXT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Button Text", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_BTNHILIGHT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Button Hilight", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_BTNSHADOW = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Button Shadow", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_LISTCTRL = 
            StringToCOLORREF(iniFile.GetValue("Theme", "List", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_LISTCTRLTEXT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "List Text", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_HIGHLIGHT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Highlight", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->MUSIK_COLOR_HIGHLIGHTTEXT = 
            StringToCOLORREF(iniFile.GetValue("Theme", "Highlight Text", COLORREFToString(AUTOMATIC_COLOR)));
        Globals::Preferences->SetUseLightIconTheme(
            StringToBool(iniFile.GetValue("Theme", "Use Light Icons", BoolToString(false))));

        this->ReloadColors();
        AfxGetApp()->GetMainWnd()->SendMessage(WM_SYSCOLORCHANGE);
    }
}
Esempio n. 15
0
void __fastcall TKeyControlForm::DestinationComboBoxChange( TObject */*Sender*/ )
{
   std::auto_ptr<TIniFile> iniFile( new TIniFile( "Configuration\\MinosKeyer.ini" ) );
   iniFile->WriteString( "Mixers", "OutputLine", DestinationComboBox->Text );
	VKMixer::GetOutputVKMixer() ->setOutputMixerLine( DestinationComboBox->Text.t_str() );
   TMessage msg;
   MMMixControlChange( msg );
}
Esempio n. 16
0
RealTimeSqlServer::~RealTimeSqlServer() 
{
	IT_IT("RealTimeSqlServer::~RealTimeSqlServer");

	char ini_file[256]; 

	ini_file[0] = '\0';

	#ifdef WIN32
	if(GetModuleFileName(NULL, ini_file, _MAX_PATH))
	{
		*(strrchr(ini_file, '\\')) = '\0';        // Strip \\filename.exe off path
		*(strrchr(ini_file, '\\')) = '\0';        // Strip \\bin off path
    }
	#endif
	
	strcat(ini_file, "\\bin\\realtimedb.ini");
	
	Inifile iniFile(ini_file);

	char serv[INIFILE_MAX_LINELEN+2];
	char buff[INIFILE_MAX_LINELEN+2];
	char seps[]   = " ,\t\n";
	char* token;

	if(iniFile.find("online","databases"))
	{
		strcpy(buff, iniFile.find("online","databases"));
				
		token = strtok( buff, seps );
								
		for(int i = 0; token != NULL ;i++)
		{
			if( iniFile.find("address",token) && 
			    iniFile.find("port",token) )
			{
				strcpy(serv, iniFile.find("address",token));
				strcat(serv,":");
				strcat(serv,iniFile.find("port",token));
				
				dbServer* server = dbServer::find(serv);
   				if (server != NULL) 
				{
					server->stop();
					printf("Server stopped for URL %s\n", serverURL);
				} 
				else 
				{
					printf("No server was started for URL %s\n", serv);
				}
			}
			
			token = strtok( NULL, seps );
		}
	}

	dbServer::cleanup();
}
Esempio n. 17
0
File: ini.cpp Progetto: nodj/omg
void iniLoader::loadIniDoc(const string& filename, iniDoc& doc){
	loadingDoc = &doc;
	ifstream iniFile(filename, ifstream::in);
	string line;
	int i = 1;
	while(getline(iniFile,line)){
		parseline(line, i++);
	}
}
Esempio n. 18
0
void kalman_save_settings(FilterControls&) {
    QSettings settings("Abbequerque Inc.", "FaceTrackNoIR");    // Registry settings (in HK_USER)
    
    QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
    QSettings iniFile( currentFile, QSettings::IniFormat );     // Application settings (in INI-file)
    
    iniFile.beginGroup("ftnoir-filter-kalman");
    iniFile.endGroup();
}
Esempio n. 19
0
//=========================================================================================
// 功能 : 加载配置文件
//=========================================================================================
void CClientGameDlg::LoadIniConfig()
{
	CINIFile iniFile(CINIFile::GetAppPath()+"CXRobotSet.ini");

	CString strkey;
	strkey = "RobortSet";
	// 机器人快速操作开关
	m_iBoboPercentage = iniFile.GetKeyVal("RobortSet", "BoboPercentage", 80);
}
Esempio n. 20
0
void FaceTrackNoIR::startTracker( ) {
    b->save();
    loadSettings();
    bindKeyboardShortcuts();

    if (Libraries)
        delete Libraries;
    Libraries = new SelectedLibraries(this);

    if (!Libraries->correct)
    {
        QMessageBox::warning(this, "Something went wrong", "Tracking can't be initialized, probably protocol prerequisites missing", QMessageBox::Ok, QMessageBox::NoButton);
        stopTracker();
        return;
    }
    
#if defined(_WIN32)
    keybindingWorker = new KeybindingWorker(*this, keyCenter, keyToggle);
    keybindingWorker->start();
#endif

    if (tracker) {
        tracker->wait();
        delete tracker;
    }

    {
        QSettings settings("opentrack");
        QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
        QSettings iniFile( currentFile, QSettings::IniFormat );

        for (int i = 0; i < 6; i++)
        {
            axis(i).curve.loadSettings(iniFile);
            axis(i).curveAlt.loadSettings(iniFile);
        }
    }

    tracker = new Tracker ( this, s );

    if (pTrackerDialog && Libraries->pTracker) {
        pTrackerDialog->registerTracker( Libraries->pTracker );
	}
    
    if (pFilterDialog && Libraries->pFilter)
        pFilterDialog->registerFilter(Libraries->pFilter);
    
    tracker->start();

    ui.video_frame->show();

    timUpdateHeadPose.start(50);

    updateButtonState(true);
}
void ParticleFilterParams::parse(std::string filename)
{
    QString name(filename.c_str());
    QFileInfo config(name);

    if(!config.exists())
    {
        std::cout<<"error reading config.ini file"<<std::endl;
        throw;
    }

    QSettings iniFile(name, QSettings::IniFormat);

    iniFile.beginGroup("PARTICLE_FILTER");
    NUMBER_OF_PARTICLES = iniFile.value("NUMBER_OF_PARTICLES", "100").toInt();

    TRANS_X_STD = iniFile.value("TRANS_X_STD", "100").toFloat();
    TRANS_Y_STD = iniFile.value("TRANS_Y_STD", "100").toFloat();
    TRANS_SCALE_STD = iniFile.value("TRANS_SCALE_STD", "100").toFloat();

    DYNAMICS_A1 = iniFile.value("DYNAMICS_A1", "100").toFloat();
    DYNAMICS_A2 = iniFile.value("DYNAMICS_A2", "100").toFloat();
    DYNAMICS_B0 = iniFile.value("DYNAMICS_B0", "100").toFloat();

    LAMBDA = iniFile.value("LAMBDA", "100").toDouble();

    DYNAMIC_MODEL_CV = iniFile.value("DYNAMIC_MODEL_CV", "false").toBool();

    REINIT_ENABLE = iniFile.value("REINIT_ENABLE", "false").toBool();
    REINIT_THRESHOLD = iniFile.value("REINIT_THRESHOLD", "0.1").toDouble();
    REINIT_TRANS_X_STD = iniFile.value("REINIT_TRANS_X_STD", "100").toFloat();
    REINIT_TRANS_Y_STD = iniFile.value("REINIT_TRANS_Y_STD", "100").toFloat();
    REINIT_TRANS_SCALE_STD = iniFile.value("REINIT_TRANS_SCALE_STD", "100").toFloat();

    std::cout << "PARTICLE_FILTER " << std::endl;
    std::cout << "NUMBER_OF_PARTICLES " << NUMBER_OF_PARTICLES << std::endl;
    std::cout << "TRANS_X_STD " << TRANS_X_STD << std::endl;
    std::cout << "TRANS_Y_STD " << TRANS_Y_STD << std::endl;
    std::cout << "TRANS_SCALE_STD " << TRANS_SCALE_STD << std::endl;
    std::cout << "DYNAMICS_A1 " << DYNAMICS_A1 << std::endl;
    std::cout << "DYNAMICS_A2 " << DYNAMICS_A2 << std::endl;
    std::cout << "DYNAMICS_B0 " << DYNAMICS_B0 << std::endl;
    std::cout << "LAMBDA      " << LAMBDA << std::endl;
    std::cout << "DYNAMIC_MODEL_CV " << (int)DYNAMIC_MODEL_CV << std::endl;

    std::cout << "REINIT_ENABLE " << REINIT_ENABLE << std::endl;
    std::cout << "REINIT_THRESHOLD " << REINIT_THRESHOLD << std::endl;

    std::cout << "REINIT_TRANS_X_STD " << REINIT_TRANS_X_STD << std::endl;
    std::cout << "REINIT_TRANS_Y_STD " << REINIT_TRANS_Y_STD << std::endl;
    std::cout << "REINIT_TRANS_SCALE_STD " << REINIT_TRANS_SCALE_STD << std::endl;

    iniFile.endGroup();

}
//
// Load the current Settings from the currently 'active' INI-file.
//
void FTNoIR_Protocol::loadSettings() {
	QSettings settings("opentrack");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	iniFile.beginGroup ( "Mouse" );
	Mouse_X = (FTN_AngleName) (iniFile.value ( "Mouse_X", 0 ).toInt());
	Mouse_Y = (FTN_AngleName) (iniFile.value ( "Mouse_Y", 0 ).toInt());
	iniFile.endGroup ();
}
Esempio n. 23
0
//
// Load the current Settings from the currently 'active' INI-file.
//
void FTNoIR_Protocol::loadSettings() {
	QSettings settings("opentrack");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	iniFile.beginGroup ( "FSUIPC" );
	LocationOfDLL = iniFile.value ( "LocationOfDLL", FSUIPC_FILENAME ).toString();
	qDebug() << "FSUIPCServer::loadSettings() says: Location of DLL = " << LocationOfDLL;
	iniFile.endGroup ();
}
Esempio n. 24
0
void TrackerControls::loadSettings()
{
	ui.cameraName->clear();
	QList<QString> names = get_camera_names();
	names.prepend("Any available");
	ui.cameraName->addItems(names);
	QSettings settings("opentrack");
	QString currentFile = settings.value( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );
	iniFile.beginGroup( "aruco-Tracker" );
	ui.cameraName->setCurrentIndex(iniFile.value("camera-index", -1).toInt() + 1);
    ui.cameraFOV->setValue(iniFile.value("fov", 56).toFloat());
	int fps;
	switch (iniFile.value("fps", 0).toInt())
	{
	default:
	case 0:
		fps = 0;
		break;
	case 30:
		fps = 1;
		break;
	case 60:
		fps = 2;
		break;
	case 120:
		fps = 3;
		break;
	}
	ui.cameraFPS->setCurrentIndex(fps);
	ui.rx->setCheckState(iniFile.value("enable-rx", true).toBool() ? Qt::Checked : Qt::Unchecked);
	ui.ry->setCheckState(iniFile.value("enable-ry", true).toBool() ? Qt::Checked : Qt::Unchecked);
	ui.rz->setCheckState(iniFile.value("enable-rz", true).toBool() ? Qt::Checked : Qt::Unchecked);
	ui.tx->setCheckState(iniFile.value("enable-tx", true).toBool() ? Qt::Checked : Qt::Unchecked);
	ui.ty->setCheckState(iniFile.value("enable-ty", true).toBool() ? Qt::Checked : Qt::Unchecked);
	ui.tz->setCheckState(iniFile.value("enable-tz", true).toBool() ? Qt::Checked : Qt::Unchecked);
    ui.resolution->setCurrentIndex(iniFile.value("resolution", 0).toInt());

    QDoubleSpinBox* headpos[] = {
        ui.cx,
        ui.cy,
        ui.cz
    };

    for (int i = 0; i < 3; i++)
    {
        headpos[i]->setValue(iniFile.value(QString("headpos-%1").arg(i)).toDouble());
    }

    ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble());

	iniFile.endGroup();
	settingsDirty = false;
}
Esempio n. 25
0
void __fastcall TTestRigMain::FormResize( TObject */*Sender*/ )
{
   if ( saveResize )
   {
      std::auto_ptr<TIniFile> iniFile( new TIniFile( "Configuration\\TestRig.ini" ) );
      iniFile->WriteInteger( "Display", "Left", Left );
      iniFile->WriteInteger( "Display", "Top", Top );
      iniFile->WriteInteger( "Display", "Width", Width );
      iniFile->WriteInteger( "Display", "Height", Height );
      iniFile->UpdateFile();
   }
}
Esempio n. 26
0
void ThemeEditorDialog::OnBnClickedButtonSave()
{
    CString filter = _T("musikCube Theme Files (*.ini)|*.ini||");
    
    FileDialog sfdlg(
        FALSE, 
        _T("ini"), 
        NULL, 
        OFN_EXPLORER | OFN_OVERWRITEPROMPT, 
        filter
   );

    if (sfdlg.DoModal() == IDOK)
    {
        CIniFile iniFile(musik::Core::utf16to8(sfdlg.GetFileName().GetBuffer(), false));

        iniFile.SetValue(
            "Theme", "Active Caption", COLORREFToString(Globals::Preferences->MUSIK_COLOR_ACTIVECAPTION));
        iniFile.SetValue(
            "Theme", "Active Caption Text", COLORREFToString(Globals::Preferences->MUSIK_COLOR_CAPTIONTEXT));
        iniFile.SetValue(
            "Theme", "Inactive Caption", COLORREFToString(Globals::Preferences->MUSIK_COLOR_INACTIVECAPTION));
        iniFile.SetValue(
            "Theme", "Inactive Caption Text", COLORREFToString(Globals::Preferences->MUSIK_COLOR_INACTIVECAPTIONTEXT));
        iniFile.SetValue(
            "Theme", "Button Face", COLORREFToString(Globals::Preferences->MUSIK_COLOR_BTNFACE));
        iniFile.SetValue(
            "Theme", "Button Text", COLORREFToString(Globals::Preferences->MUSIK_COLOR_BTNTEXT));
        iniFile.SetValue(
            "Theme", "Button Hilight", COLORREFToString(Globals::Preferences->MUSIK_COLOR_BTNHILIGHT));
        iniFile.SetValue(
            "Theme", "Button Shadow", COLORREFToString(Globals::Preferences->MUSIK_COLOR_BTNSHADOW));
        iniFile.SetValue(
            "Theme", "List", COLORREFToString(Globals::Preferences->MUSIK_COLOR_LISTCTRL));
        iniFile.SetValue(
            "Theme", "List Text", COLORREFToString(Globals::Preferences->MUSIK_COLOR_LISTCTRLTEXT));
        iniFile.SetValue(
            "Theme", "Highlight", COLORREFToString(Globals::Preferences->MUSIK_COLOR_HIGHLIGHT));
        iniFile.SetValue(
            "Theme", "Highlight Text", COLORREFToString(Globals::Preferences->MUSIK_COLOR_HIGHLIGHTTEXT));
        iniFile.SetValue(
            "Theme", "Use Light Icons", BoolToString(Globals::Preferences->UseLightIconTheme()));

        if (!iniFile.WriteFile())
        {
            MessageBox(
                _T("Failed to write theme file to disk.  Invalid access rights?"),
                _T("musikCube"),
                MB_OK | MB_ICONERROR
           );
        }
    }
}
Esempio n. 27
0
void SaveConfig()
{
	Config *Conf1 = &conf;
	char szValue[256];

	string iniFile( s_strIniPath + "/zerospu2.ini" );

	sprintf_s(szValue,"%u",Conf1->Log);
	WritePrivateProfileString("Interface", "Logging",szValue, iniFile.c_str());
	sprintf_s(szValue,"%u",Conf1->options);
	WritePrivateProfileString("Interface", "Options",szValue, iniFile.c_str());
}
Esempio n. 28
0
void QgsServerSettings::logSummary() const
{
  const QMetaEnum metaEnumSrc( QMetaEnum::fromType<QgsServerSettingsEnv::Source>() );
  const QMetaEnum metaEnumEnv( QMetaEnum::fromType<QgsServerSettingsEnv::EnvVar>() );

  QgsMessageLog::logMessage( "Qgis Server Settings: ", "Server", Qgis::Info );
  for ( Setting s : mSettings )
  {
    const QString src = metaEnumSrc.valueToKey( s.src );
    const QString var = metaEnumEnv.valueToKey( s.envVar );

    const QString msg = "  - " + var + " / '" + s.iniKey + "' (" + s.descr + "): '" + value( s.envVar ).toString() + "' (read from " + src + ")";
    QgsMessageLog::logMessage( msg, "Server", Qgis::Info );
  }

  if ( ! iniFile().isEmpty() )
  {
    const QString msg = "Ini file used to initialize settings: " + iniFile();
    QgsMessageLog::logMessage( msg, "Server", Qgis::Info );
  }
}
Esempio n. 29
0
void __fastcall TKeyControlForm::OutputMixerComboBoxChange( TObject */*Sender*/ )
{
   unloadKeyers();
   VKMixer::closeMixer();

   std::auto_ptr<TIniFile> iniFile( new TIniFile( "Configuration\\MinosKeyer.ini" ) );
   iniFile->WriteString( "Mixers", "OutputId", OutputMixerComboBox->Text );

   Close();
   //   populateMixerList();
   //   loadKeyers();
}
static void save_settings(const struct face_detect_settings* in) {

	QSettings settings("Abbequerque Inc.", "FaceTrackNoIR");	// Registry settings (in HK_USER)

	QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
	QSettings iniFile( currentFile, QSettings::IniFormat );		// Application settings (in INI-file)

	iniFile.beginGroup ( "FaceDetectTracker" );
	iniFile.setValue("RedetectMs", in->redetect_ms);
	iniFile.setValue("CameraId", in->camera_id);
	iniFile.setValue("VideoWidget", in->widgetp);
	iniFile.endGroup ();
}