void setup()
{
+ //Communication
+ Serial.begin(9600);
+
//Motors
init_motors();
//Calibration
calibrate();
-
- //Communication
- Serial.begin(9600);
}
void loop()
#
#-------------------------------------------------
-QT += core gui serialport
+QT += core gui
TARGET = LivingDesktop
TEMPLATE = lib
SOURCES +=\
ErrorMessage.cpp \
XYPlotter.cpp \
- LivingKeyboard.cpp
+ LivingKeyboard.cpp \
+ LivingScreen.cpp \
+ LivingDevice.cpp \
+ Serial.cpp \
+ SerialLinux.cpp
HEADERS +=\
livingdesktoplibrary_global.h\
ErrorMessage.h \
XYPlotter.h \
- LivingKeyboard.h
+ LivingKeyboard.h \
+ LivingScreen.h \
+ LivingDevice.h \
+ Serial.h \
+ SerialLinux.h
unix {
target.path = /usr/lib
--- /dev/null
+#include "LivingDevice.h"
+
+#include <QDebug>
+#include <QThread>
+#include <Serial.h>
+#include <SerialLinux.h>
+
+//#define QIODEVICE_DEBUG
+
+char const *LivingDevice::serialports[] = {"/dev/ttyUSB0", "/dev/ttyUSB1", "/dev/ttyUSB2", "/dev/ttyUSB3", "/dev/ttyUSB4"};
+
+LivingDevice::LivingDevice(QString name, int timeout)
+: serialPort(NULL)
+{
+ discover(name, timeout);
+}
+
+LivingDevice::~LivingDevice()
+{
+ closeSerialPort();
+}
+
+void LivingDevice::discover(QString name, int timeout)
+{
+ qDebug() << "Discovering" << name;
+ for (int i = 0 ; i < 5 && !serialPort ; i++)
+ {
+ try{
+ serialPort = new SerialLinux(serialports[i], 9600);
+
+ qDebug() << "Trying port" << serialports[i];
+
+ //ask fo his name
+ sendCommand('I');
+ QThread::msleep(500);
+ QString answer = readAnswer();
+
+ if (answer == name)
+ qDebug() << "Found LivingKeyboard on port" << serialports[i];
+ else
+ {
+ qDebug() << "Not" << name;
+ closeSerialPort();
+ }
+ }
+ catch(ErrorMessage m)
+ {
+ qDebug() << "Port " << serialports[i] << "not responding";
+ closeSerialPort();
+ }
+ catch(char *str)
+ {
+ qDebug() << "Cannot connect to port" << serialports[i];
+ closeSerialPort();
+ }
+ }
+ if (! serialPort)
+ throw(ErrorMessage("Cannot find " + name));
+}
+
+void LivingDevice::closeSerialPort()
+{
+ if (serialPort)
+ delete serialPort;
+ serialPort = NULL;
+}
+
+void LivingDevice::sendCommand(char command)
+{
+ if (serialPort)
+ {
+ char buffer[] = {command, '\n'};
+ serialPort->WriteData(buffer, 2);
+ }
+}
+
+void LivingDevice::sendCommand(char command, int value)
+{
+ if (serialPort)
+ {
+ QString buffer = command + QString::number(value) + "\n";
+ serialPort->WriteData(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
+ }
+}
+
+void LivingDevice::sendCommand(char *command, int *value, int nb)
+{
+ QString buffer;
+ if (serialPort)
+ {
+ for (int i = 0 ; i < nb ; i++)
+ buffer += command[i] + QString::number(value[i]);
+ buffer += '\n';
+ serialPort->WriteData(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
+ }
+}
+
+QString LivingDevice::readAnswer()
+{
+ char buffer[128];
+
+ if (serialPort)
+ {
+ int nb = serialPort->ReadData(buffer, 127);
+ buffer[nb] = '\0';
+ qDebug() << "Read" << buffer;
+ return QString(buffer);
+ }
+ return "";
+}
--- /dev/null
+#ifndef LIVINGDEVICE_H
+#define LIVINGDEVICE_H
+
+#include "livingdesktoplibrary_global.h"
+#include <Serial.h>
+#include <ErrorMessage.h>
+
+class LIVINGDESKTOPLIBRARYSHARED_EXPORT LivingDevice
+{
+ public:
+ LivingDevice(QString name, int timeout=5000);
+ virtual ~LivingDevice();
+
+ void discover(QString name, int timeout=5000);
+
+ void closeSerialPort();
+
+ void sendCommand(char command);
+ void sendCommand(char command, int value);
+ void sendCommand(char *command, int *value, int nb);
+
+ QString readAnswer();
+
+ protected:
+ Serial *serialPort;
+
+ static char const *serialports[];
+};
+
+#endif // LIVINGDEVICE_H
#include "LivingKeyboard.h"
#include <QDebug>
-#include <QThread>
-
-#define QIODEVICE_DEBUG
-
-char const *LivingKeyboard::serialports[] = {"ttyUSB0", "ttyUSB1", "ttyUSB2", "ttyUSB3", "ttyUSB4"};
LivingKeyboard::LivingKeyboard()
-: serialPort(NULL)
+: LivingDevice("LivingKeyboard", 500)
{
- //Port discovery
- for (int i = 0 ; i < 5 && !serialPort ; i++)
- {
- serialPort = new QSerialPort(serialports[i]);
- if(serialPort->open(QIODevice::ReadWrite))
- {
- serialPort->setBaudRate(QSerialPort::Baud9600, QSerialPort::AllDirections);
- serialPort->setDataBits(QSerialPort::Data8);
- serialPort->setParity(QSerialPort::NoParity);
- serialPort->setStopBits(QSerialPort::OneStop);
- serialPort->setFlowControl(QSerialPort::NoFlowControl);
- serialPort->setReadBufferSize(32);
-
- qDebug() << "Trying port " << serialports[i];
-
- //ask fo his name
- serialPort->write("I\n", 2);
- serialPort->flush();
- //wait a little so that we get the whole string at once
- QThread::msleep(500);
- char buffer[32];
- //memset(buffer,0, 32*sizeof(char));
- if (serialPort->waitForReadyRead(10000))
- {
- int nb = serialPort->read(buffer, sizeof(buffer) - 1);
- buffer[nb] = 0;
- qDebug() << "Received " << nb << " bytes : '" << buffer << "'";
- if (nb <= 0)
- {
- qDebug() << "Communcation problem with port " << serialports[i];
- serialPort->close();
- serialPort = NULL;
- }
- else if (strcmp(buffer, "LivingKeyboard") == 0)
- qDebug() << "Found LivingKeyboard on port " << serialports[i];
- else
- {
- qDebug() << "Not LivingKeyboard";
- serialPort->close();
- serialPort = NULL;
- }
- }
- else
- {
- qDebug() << "Port " << serialports[i] << "not responding";
- serialPort->close();
- serialPort = NULL;
- }
- }
- else
- {
- serialPort->close();
- serialPort = NULL;
- }
- }
- if (! serialPort)
- throw(ErrorMessage("Cannot find Keyboard"));
}
LivingKeyboard::~LivingKeyboard()
{
- if (serialPort)
- {
- serialPort->close();
- delete serialPort;
- }
}
void LivingKeyboard::rotation(LivingKeyboard::tilt t, unsigned int angle)
{
- if (serialPort)
- {
- int a = angle;
- if (t == LEFT)
- a *= -1;
- QString buffer = "R" + QString::number(a) + "\n";
- serialPort->write(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
- }
+ int a = angle;
+ if (t == LEFT)
+ a *= -1;
+ sendCommand('R', a);
}
void LivingKeyboard::translation(LivingKeyboard::direction d, unsigned int distance)
{
- if (serialPort)
- {
- int dis = distance;
- if (d == BACKWARD)
- dis *= -1;
- QString buffer = "T" + QString::number(dis) + "\n";
- serialPort->write(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
- }
+ int dis = distance;
+ if (d == BACKWARD)
+ dis *= -1;
+ sendCommand('T', dis);
}
#ifndef LIVINGKEYBOARD_H
#define LIVINGKEYBOARD_H
-#include "livingdesktoplibrary_global.h"
-#include <QSerialPort>
-#include <ErrorMessage.h>
+#include <LivingDevice.h>
-class LivingKeyboard
+class LIVINGDESKTOPLIBRARYSHARED_EXPORT LivingKeyboard : public LivingDevice
{
public:
LivingKeyboard();
void rotation(tilt t, unsigned int angle);
void translation(direction d, unsigned int distance);
-
- private:
- QSerialPort* serialPort;
-
- static char const *serialports[];
};
#endif // LIVINGKEYBOARD_H
--- /dev/null
+#include "LivingScreen.h"
+
+#include <QDebug>
+
+LivingScreen::LivingScreen()
+: LivingDevice("LivingScreen", 30000)
+{
+}
+
+LivingScreen::~LivingScreen()
+{
+}
+
+void LivingScreen::rotation(LivingScreen::direction t, unsigned int angle)
+{
+ int a = angle;
+ if (t == LEFT)
+ a *= -1;
+ sendCommand('R', a);
+}
+
+void LivingScreen::translation(LivingScreen::direction d, unsigned int distance)
+{
+ int dis = distance;
+ if (d == LEFT)
+ dis *= -1;
+ sendCommand('T', dis);
+}
--- /dev/null
+#ifndef LIVINGSCREEN_H
+#define LIVINGSCREEN_H
+
+#include <LivingDevice.h>
+
+class LIVINGDESKTOPLIBRARYSHARED_EXPORT LivingScreen : public LivingDevice
+{
+ public:
+ LivingScreen();
+
+ ~LivingScreen();
+
+ enum direction{LEFT, RIGHT};
+
+ void rotation(direction t, unsigned int angle);
+ void translation(direction d, unsigned int distance);
+};
+
+#endif // LIVINGSCREEN_H
--- /dev/null
+#include "Serial.h"
+
+Serial::Serial(const char *, int /*baudrate*/)
+:_connected(false), _arduinowaittime(1)
+{
+}
+
+Serial::~Serial()
+{
+}
--- /dev/null
+#ifndef _SERIAL_
+#define _SERIAL_
+
+class Serial
+{
+ public:
+ //Initialize Serial communication with the given COM port
+ //baudrate among 300 1200 2400 4800 9600 14400 19200 38400 57600 115200
+ Serial(const char *portName, int baudrate = 57600);
+
+ //Close the connection
+ //NOTA: for some reason you can't connect again before exiting
+ //the program and running it again
+ virtual ~Serial();
+
+ //Read data in a buffer, if nbChar is greater than the
+ //maximum number of bytes available, it will return only the
+ //bytes available. The function return -1 when nothing could
+ //be read, the number of bytes actually read.
+ virtual int ReadData(void *buffer, unsigned int nbChar) const=0;
+
+ //Writes data from a buffer through the Serial connection
+ //return true on success.
+ virtual bool WriteData(const void *buffer, unsigned int nbChar) const=0;
+
+ //Check if we are actually connected
+ bool IsConnected() { return _connected; }
+
+ protected:
+ //Connection status
+ bool _connected;
+
+ int _arduinowaittime;
+};
+
+#endif // SERIAL_H
--- /dev/null
+#include "SerialLinux.h"
+
+#include <termios.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <iostream>
+using namespace std;
+
+SerialLinux::SerialLinux(const char *portName, int baudrate)
+:Serial(portName)
+{
+ _arduinowaittime = 1;
+ //Try to connect to the given port throuh CreateFile
+ _hSerial = open(portName, O_RDWR | O_NOCTTY);// | O_NDELAY);
+
+ //Check if the connection was successfull
+ if(_hSerial < 0)
+ {
+ char buffer[256];
+ sprintf(buffer, "Open error on port %s %d %s\n", portName, errno, strerror(errno));
+ throw buffer;
+ }
+
+ struct termios serialParams;
+
+ //Try to get the current
+ if (tcgetattr(_hSerial, &serialParams) < 0)
+ throw "Cannot get COM port properties";
+
+ tcflush(_hSerial, TCIFLUSH);
+
+ serialParams.c_cflag = CS8 | CREAD;
+
+ //Define serial connection parameters for the arduino board
+ switch(baudrate)
+ {
+ case 300:
+ cfsetispeed(&serialParams, B300);
+ cfsetispeed(&serialParams, B300);
+ serialParams.c_cflag |= B300;
+ break;
+ case 1200:
+ cfsetispeed(&serialParams, B1200);
+ cfsetispeed(&serialParams, B1200);
+ serialParams.c_cflag |= B1200;
+ break;
+ case 2400:
+ cfsetispeed(&serialParams, B2400);
+ cfsetispeed(&serialParams, B2400);
+ serialParams.c_cflag |= B2400;
+ break;
+ case 4800:
+ cfsetispeed(&serialParams, B4800);
+ cfsetispeed(&serialParams, B4800);
+ serialParams.c_cflag |= B4800;
+ break;
+ case 9600:
+ cfsetispeed(&serialParams, B9600);
+ cfsetispeed(&serialParams, B9600);
+ serialParams.c_cflag |= B9600;
+ break;
+/* case 14400:
+ cfsetispeed(&serialParams, B14400);
+ cfsetispeed(&serialParams, B14400);
+ serialParams.c_cflag |= B14400;
+ break;*/
+ case 19200:
+ cfsetispeed(&serialParams, B19200);
+ cfsetispeed(&serialParams, B19200);
+ serialParams.c_cflag |= B19200;
+ break;
+ case 38400:
+ cfsetispeed(&serialParams, B38400);
+ cfsetispeed(&serialParams, B38400);
+ serialParams.c_cflag |= B38400;
+ break;
+ case 57600:
+ cfsetispeed(&serialParams, B57600);
+ cfsetispeed(&serialParams, B57600);
+ serialParams.c_cflag |= B57600;
+ break;
+ case 115200:
+ cfsetispeed(&serialParams, B115200);
+ cfsetispeed(&serialParams, B115200);
+ serialParams.c_cflag |= B115200;
+ break;
+ default:
+ cfsetispeed(&serialParams, B57600);
+ cfsetispeed(&serialParams, B57600);
+ serialParams.c_cflag |= B57600;
+ break;
+ }
+ //No parity
+ serialParams.c_cflag &= ~PARENB;
+ //One stop bit
+ serialParams.c_cflag &= ~CSTOPB;
+
+ if (tcsetattr(_hSerial, TCSANOW, &serialParams) < 0)
+ throw "ERROR: Could not set Serial Port parameters";
+ else
+ {
+ //If everything went fine we're connected
+ _connected = true;
+ //We wait 2s as the arduino board will be reseting
+ sleep(_arduinowaittime);
+ //SDL_Delay(ARDUINO_WAIT_TIME);
+ }
+}
+
+SerialLinux::~SerialLinux()
+{
+ //Check if we are connected before trying to disconnect
+ if(_connected)
+ {
+ //We're no longer connected
+ _connected = false;
+ //Close the serial handler
+ close(_hSerial);
+ }
+}
+
+int SerialLinux::ReadData(void *buffer, unsigned int nbChar) const
+{
+ //Number of bytes we'll really ask to read
+ int r = 0;
+
+ if ((r = read(_hSerial, buffer, size_t(nbChar))) < 0)
+ {
+ if (errno == EAGAIN)
+ return 0;
+ else
+ cerr << "read error " << errno << " " << strerror(errno) << endl;
+ }
+
+ return r;
+}
+
+
+bool SerialLinux::WriteData(const void *buffer, unsigned int nbChar) const
+{
+ //Try to write the buffer on the Serial port
+ if(write(_hSerial, buffer, nbChar) < 0)
+ {
+ cerr << "write error " << errno << " " << strerror(errno) << endl;
+ return false;
+ }
+ return true;
+}
--- /dev/null
+#ifndef _SERIALMAC_
+#define _SERIALMAC_
+
+#include "Serial.h"
+
+class SerialLinux : public Serial
+{
+ public:
+ //Initialize Serial communication with the given COM port
+ SerialLinux(const char *portName, int baudrate = 57600);
+ //Close the connection
+ //NOTA: for some reason you can't connect again before exiting
+ //the program and running it again
+ ~SerialLinux();
+ //Read data in a buffer, if nbChar is greater than the
+ //maximum number of bytes available, it will return only the
+ //bytes available. The function return -1 when nothing could
+ //be read, the number of bytes actually read.
+ int ReadData(void *buffer, unsigned int nbChar) const;
+ //Writes data from a buffer through the Serial connection
+ //return true on success.
+ bool WriteData(const void *buffer, unsigned int nbChar) const;
+
+
+ private:
+ //Serial comm handler
+ int _hSerial;
+/* //Get various information about the connection
+ COMSTAT _status;
+ //Keep track of last error
+ DWORD _errors;*/
+};
+
+#endif // SERIALMAC_H
#include "XYPlotter.h"
-#include <QString>
#include <QDebug>
-#include <QThread>
-char const *XYPlotter::serialports[] = {"ttyUSB0", "ttyUSB1", "ttyUSB2", "ttyUSB3", "ttyUSB4"};
const int XYPlotter::toolDistance = 70;
XYPlotter::XYPlotter()
-: serialPort(NULL)
+: LivingDevice("XYPlotter", 13000)
{
- //Port discovery
- for (int i = 0 ; i < 5 && !serialPort ; i++)
- {
- serialPort = new QSerialPort(serialports[i]);
- if(serialPort->open(QIODevice::ReadWrite))
- {
- serialPort->setBaudRate(QSerialPort::Baud9600, QSerialPort::AllDirections);
- serialPort->setDataBits(QSerialPort::Data8);
- serialPort->setParity(QSerialPort::NoParity);
- serialPort->setStopBits(QSerialPort::OneStop);
- serialPort->setFlowControl(QSerialPort::NoFlowControl);
- serialPort->setReadBufferSize(32);
-
- qDebug() << "Trying port " << serialports[i];
-
- //wait the plotter to finish the calibration
- QThread::sleep(13);
- //ask fo his name
- serialPort->write("I\n", 2);
- serialPort->flush();
- char buffer[32];
- qDebug() << "Waiting for data";
- if (serialPort->waitForReadyRead(1500))
- {
- int nb = serialPort->read(buffer, sizeof(buffer) - 1);
- buffer[nb] = 0;
- qDebug() << "Received " << nb << " bytes : '" << buffer << "'";
- if (nb <= 0)
- {
- qDebug() << "Port " << serialports[i] << "not responding";
- serialPort->close();
- serialPort = NULL;
- }
- else if (strcmp(buffer, "XYPlotter") == 0)
- qDebug() << "Found XYPlotter on port " << serialports[i];
- else
- {
- qDebug() << "Not XYPlotter";
- serialPort->close();
- serialPort = NULL;
- }
- }
- else
- {
- qDebug() << "Port " << serialports[i] << "not responding";
- serialPort->close();
- serialPort = NULL;
- }
- }
- else
- {
- serialPort->close();
- serialPort = NULL;
- }
- }
- if (! serialPort)
- throw(ErrorMessage("Cannot find XYPlotter"));
}
XYPlotter::~XYPlotter()
{
- if (serialPort)
- {
- serialPort->close();
- delete serialPort;
- }
}
-void XYPlotter::moveTo(unsigned int x, unsigned int y, bool toolup=true)
+void XYPlotter::moveTo(int x, int y, bool toolup=true)
{
- if (serialPort)
- {
- QString buffer = "G00X" + QString::number(x) +
- "Y" + QString::number(y) +
- "Z" + QString::number(toolup * toolDistance) + "\n";
- //"F50000\n";
- serialPort->write(buffer.toStdString().data(), strlen(buffer.toStdString().data()));
- posX = x;
- posY = y;
- toolUp = toolup;
- }
+ char commands[] = {'G', 'X', 'Y', 'Z'};
+ int values[] = {0, x, y, toolup * toolDistance};
+ sendCommand(commands, values, 4);
}
#ifndef XYPLOTTER_H
#define XYPLOTTER_H
-#include "livingdesktoplibrary_global.h"
-#include <QSerialPort>
-#include <ErrorMessage.h>
+#include <LivingDevice.h>
-class LIVINGDESKTOPLIBRARYSHARED_EXPORT XYPlotter
+class LIVINGDESKTOPLIBRARYSHARED_EXPORT XYPlotter : public LivingDevice
{
public:
XYPlotter();
~XYPlotter();
- void moveTo(unsigned int x, unsigned int y, bool toolup);
+ void moveTo(int x, int y, bool toolup);
private:
- QSerialPort* serialPort;
-
unsigned int posX, posY;
bool toolUp;
static const int toolDistance;
- static char const *serialports[];
};
#endif // XYPLOTTER_H
try
{
keyboard = new LivingKeyboard();
- connect(ui->keyboardbutton, SIGNAL(clicked()), this, SLOT(translateKeyboard()));
- connect(ui->rotation, SIGNAL(valueChanged(int)), this, SLOT(rotateKeyboard(int)));
- ui->keyboardbutton->setEnabled(true);
+ connect(ui->keyboardmovebutton, SIGNAL(clicked()), this, SLOT(translateKeyboard()));
+ connect(ui->keyboardrotatebutton, SIGNAL(clicked()), this, SLOT(rotateKeyboard()));
+ ui->keyboardmovebutton->setEnabled(true);
+ ui->keyboardrotatebutton->setEnabled(true);
}
catch (ErrorMessage e)
{
keyboard = NULL;
qDebug() << QString(e.what());
}
+ qDebug("Connect screen");
+ try
+ {
+ //The screen may require a little time because of calibration (blocking process)
+ screen = new LivingScreen();
+ connect(ui->screenmovebutton, SIGNAL(clicked()), this, SLOT(translateScreen()));
+ connect(ui->screenrotatebutton, SIGNAL(clicked()), this, SLOT(rotateScreen()));
+ ui->screenmovebutton->setEnabled(true);
+ ui->screenrotatebutton->setEnabled(true);
+ }
+ catch (ErrorMessage e)
+ {
+ mouse = NULL;
+ qDebug() << QString(e.what());
+ }
qDebug("Connect mouse");
try
{
void MainWindow::moveMouse()
{
- unsigned int x = ui->xvalue->value();
- unsigned int y = ui->yvalue->value();
+ int x = ui->xvalue->value();
+ int y = ui->yvalue->value();
bool toolup = ui->toolupvalue->checkState() == Qt::Checked;
if (mouse)
mouse->moveTo(x, y, toolup);
void MainWindow::translateKeyboard()
{
- unsigned int distance = ui->translation->value();
+ int distance = ui->keyboardtranslation->value();
if (keyboard)
{
qDebug() << "translate keyboard " << QString::number(distance);
if (distance > 0)
keyboard->translation(LivingKeyboard::FORWARD, distance);
else
- keyboard->translation(LivingKeyboard::BACKWARD, distance);
+ keyboard->translation(LivingKeyboard::BACKWARD, -distance);
}
}
-void MainWindow::rotateKeyboard(int angle)
+void MainWindow::rotateKeyboard()
{
+ int angle = ui->keyboardrotation->value();
if (keyboard)
{
qDebug() << "rotate keyboard " << QString::number(angle);
if (angle > 0)
keyboard->rotation(LivingKeyboard::RIGHT, angle);
else
- keyboard->rotation(LivingKeyboard::LEFT, angle);
+ keyboard->rotation(LivingKeyboard::LEFT, -angle);
+ }
+}
+
+void MainWindow::translateScreen()
+{
+ int distance = ui->screentranslation->value();
+ if (screen)
+ {
+ qDebug() << "translate screen " << QString::number(distance);
+ if (distance > 0)
+ screen->translation(LivingScreen::RIGHT, distance);
+ else
+ screen->translation(LivingScreen::LEFT, -distance);
+ }
+}
+
+void MainWindow::rotateScreen()
+{
+ int angle = ui->screenrotation->value();
+ if (screen)
+ {
+ qDebug() << "rotate screen " << QString::number(angle);
+ if (angle > 0)
+ screen->rotation(LivingScreen::RIGHT, angle);
+ else
+ screen->rotation(LivingScreen::LEFT, -angle);
}
}
#include <XYPlotter.h>
#include <LivingKeyboard.h>
+#include <LivingScreen.h>
#include <QDebug>
namespace Ui {
public slots:
void moveMouse();
void translateKeyboard();
- void rotateKeyboard(int angle);
+ void rotateKeyboard();
+ void translateScreen();
+ void rotateScreen();
private:
Ui::MainWindow *ui;
XYPlotter *mouse;
LivingKeyboard *keyboard;
+ LivingScreen *screen;
};
#endif // MAINWINDOW_H
<x>0</x>
<y>0</y>
<width>400</width>
- <height>388</height>
+ <height>610</height>
</rect>
</property>
<property name="windowTitle">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
- <string>Tilt</string>
+ <string>Rotation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Translation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="keyboardtranslation">
+ <property name="minimum">
+ <number>-100</number>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
</property>
</widget>
</item>
<item row="0" column="1">
- <widget class="QSlider" name="rotation">
+ <widget class="QSpinBox" name="keyboardrotation">
<property name="minimum">
<number>-180</number>
</property>
<property name="maximum">
<number>180</number>
</property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <property name="singleStep">
+ <number>10</number>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_5">
+ <item row="1" column="1">
+ <widget class="QPushButton" name="keyboardrotatebutton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
- <string>Translation$</string>
+ <string>Tilt</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="translation">
- <property name="minimum">
- <number>-100</number>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="keyboardmovebutton">
+ <property name="enabled">
+ <bool>false</bool>
</property>
- <property name="maximum">
- <number>100</number>
- </property>
- <property name="singleStep">
- <number>10</number>
+ <property name="text">
+ <string>Move</string>
</property>
</widget>
</item>
</widget>
</item>
<item>
- <widget class="QPushButton" name="keyboardbutton">
- <property name="enabled">
- <bool>false</bool>
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- <property name="text">
- <string>Move</string>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Screen</string>
</property>
+ <layout class="QFormLayout" name="formLayout_3">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Translation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="screentranslation">
+ <property name="minimum">
+ <number>-650</number>
+ </property>
+ <property name="maximum">
+ <number>650</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Rotation</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="screenrotation">
+ <property name="minimum">
+ <number>-90</number>
+ </property>
+ <property name="maximum">
+ <number>90</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="screenrotatebutton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Rotate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="screenmovebutton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Move</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
<tabstop>yvalue</tabstop>
<tabstop>toolupvalue</tabstop>
<tabstop>mousebutton</tabstop>
- <tabstop>rotation</tabstop>
- <tabstop>translation</tabstop>
- <tabstop>keyboardbutton</tabstop>
+ <tabstop>keyboardrotation</tabstop>
+ <tabstop>keyboardrotatebutton</tabstop>
+ <tabstop>keyboardtranslation</tabstop>
+ <tabstop>keyboardmovebutton</tabstop>
+ <tabstop>screenrotation</tabstop>
+ <tabstop>screenrotatebutton</tabstop>
+ <tabstop>screentranslation</tabstop>
+ <tabstop>screenmovebutton</tabstop>
</tabstops>
<resources/>
<connections/>