From fd0ad89c7c6f61aa14d6e908e9217121f4afa5c6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 9 May 2016 16:21:32 +0200 Subject: tracker/hatire: move to opentrack settings API --- tracker-hatire/ftnoir_tracker_hat_settings.cpp | 134 ------------------------- 1 file changed, 134 deletions(-) delete mode 100755 tracker-hatire/ftnoir_tracker_hat_settings.cpp (limited to 'tracker-hatire/ftnoir_tracker_hat_settings.cpp') diff --git a/tracker-hatire/ftnoir_tracker_hat_settings.cpp b/tracker-hatire/ftnoir_tracker_hat_settings.cpp deleted file mode 100755 index 8da5c1c6..00000000 --- a/tracker-hatire/ftnoir_tracker_hat_settings.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* Homepage http://facetracknoir.sourceforge.net/home/default.htm * - * * - * ISC License (ISC) * - * * - * Copyright (c) 2015, Wim Vriend * - * * - * Permission to use, copy, modify, and/or distribute this software for any * - * purpose with or without fee is hereby granted, provided that the above * - * copyright notice and this permission notice appear in all copies. * - */ -#include -#include -#include - -#include "ftnoir_tracker_hat_settings.h" -#include "opentrack-compat/options.hpp" - -// XXX TODO move to opentrack settings api -sh 20160410 - -void TrackerSettings::load_ini() -{ - QString currentFile = options::group::ini_pathname(); - QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - - iniFile.beginGroup( "HAT" ); - - SerialPortName=iniFile.value ( "PortName" ).toString(); - - EnableRoll = iniFile.value( "EnableRoll", 1 ).toBool(); - EnablePitch = iniFile.value( "EnablePitch", 1 ).toBool(); - EnableYaw = iniFile.value( "EnableYaw", 1 ).toBool(); - EnableX = iniFile.value( "EnableX", 0 ).toBool(); - EnableY = iniFile.value( "EnableY", 0 ).toBool(); - EnableZ = iniFile.value( "EnableZ", 0 ).toBool(); - EnableLogging = iniFile.value( "EnableLogging", 0).toBool(); - - InvertRoll = iniFile.value( "InvertRoll", 1 ).toBool(); - InvertPitch = iniFile.value( "InvertPitch", 1 ).toBool(); - InvertYaw = iniFile.value( "InvertYaw", 1 ).toBool(); - InvertX = iniFile.value( "InvertX", 0 ).toBool(); - InvertY = iniFile.value( "InvertY", 0 ).toBool(); - InvertZ = iniFile.value( "InvertZ", 0 ).toBool(); - - - RollAxis=iniFile.value("RollAxe",1).toInt(); - PitchAxis=iniFile.value("PitchAxe",2).toInt(); - YawAxis=iniFile.value("YawAxe",0).toInt(); - XAxis=iniFile.value("XAxe",1).toInt(); - YAxis=iniFile.value("YAxe",2).toInt(); - ZAxis=iniFile.value("ZAxe",0).toInt(); - - - CmdStart=iniFile.value ( "CmdStart").toString(); - CmdStop=iniFile.value ( "CmdStop" ).toString(); - CmdInit=iniFile.value ( "CmdInit" ).toString(); - CmdReset=iniFile.value ( "CmdReset" ).toString(); - CmdCenter=iniFile.value ( "CmdCenter" ).toString(); - CmdZero=iniFile.value ( "CmdZero" ).toString(); - - DelayInit=iniFile.value("DelayInit",0).toInt(); - DelayStart=iniFile.value("DelayStart",0).toInt(); - DelaySeq=iniFile.value("DelaySeq",0).toInt(); - - FPSArduino=iniFile.value("FPSArduino",30).toInt(); - - BigEndian=iniFile.value("BigEndian",0).toBool(); - - - pBaudRate=static_cast(iniFile.value("BaudRate",QSerialPort::Baud115200).toInt()); - pDataBits=static_cast(iniFile.value("DataBits",QSerialPort::Data8).toInt()); - pParity=static_cast(iniFile.value("Parity",QSerialPort::NoParity).toInt()); - pStopBits=static_cast(iniFile.value("StopBits",QSerialPort::OneStop).toInt()); - pFlowControl=static_cast(iniFile.value("FlowControl",QSerialPort::HardwareControl).toInt()); - - iniFile.endGroup(); -} - -void TrackerSettings::save_ini() const -{ - - QString currentFile = options::group::ini_pathname(); - - QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - - iniFile.beginGroup ( "HAT" ); - - iniFile.setValue ( "PortName",SerialPortName ); - - iniFile.setValue( "EnableRoll", EnableRoll ); - iniFile.setValue( "EnablePitch", EnablePitch ); - iniFile.setValue( "EnableYaw", EnableYaw ); - iniFile.setValue( "EnableX", EnableX ); - iniFile.setValue( "EnableY", EnableY ); - iniFile.setValue( "EnableZ", EnableZ ); - iniFile.setValue( "EnableLogging", EnableLogging ); - - iniFile.setValue( "InvertRoll", InvertRoll ); - iniFile.setValue( "InvertPitch", InvertPitch ); - iniFile.setValue( "InvertYaw", InvertYaw ); - iniFile.setValue( "InvertX", InvertX ); - iniFile.setValue( "InvertY", InvertY ); - iniFile.setValue( "InvertZ", InvertZ ); - - iniFile.setValue ( "RollAxe", RollAxis ); - iniFile.setValue ( "PitchAxe", PitchAxis ); - iniFile.setValue ( "YawAxe",YawAxis ); - iniFile.setValue ( "XAxe", XAxis ); - iniFile.setValue ( "YAxe", YAxis ); - iniFile.setValue ( "ZAxe", ZAxis ); - - iniFile.setValue ( "CmdStart",CmdStart.toLatin1()); - iniFile.setValue ( "CmdStop",CmdStop.toLatin1()); - iniFile.setValue ( "CmdInit",CmdInit.toLatin1()); - iniFile.setValue ( "CmdReset",CmdReset.toLatin1()); - iniFile.setValue ( "CmdCenter",CmdCenter.toLatin1() ); - iniFile.setValue ( "CmdZero",CmdZero.toLatin1() ); - - iniFile.setValue ( "DelayInit",DelayInit); - iniFile.setValue ( "DelayStart",DelayStart); - iniFile.setValue ( "DelaySeq",DelaySeq); - - iniFile.setValue ( "FPSArduino", FPSArduino ); - - iniFile.setValue("BigEndian",BigEndian); - - iniFile.setValue("BaudRate",pBaudRate); - iniFile.setValue("DataBits",pDataBits); - iniFile.setValue("Parity",pParity); - iniFile.setValue("StopBits",pStopBits); - iniFile.setValue("FlowControl",pFlowControl); - - - iniFile.endGroup(); -} -- cgit v1.2.3