10 qDebug() <<
"Calling MacroReader without params is not allowed.";
34 c.setPosition(
macroText->toPlainText().length());
36 macroBox->appendPlainText(line.left(line.size()-1));
52 QThread::usleep(100000);
53 if(!macroFile.open(QIODevice::ReadOnly)){
55 QThread::usleep(900000);
56 for(
int i = 1; i < 10; i++){
57 if(macroFile.open(QIODevice::ReadOnly))
61 if(!macroFile.isOpen()) {
62 qDebug() << QString(
"unable to open macroFile (%1)").arg(
macroPath);
70 gettimeofday(&t, NULL);
71 double tstart = t.tv_sec+(t.tv_usec/1000000.0);
72 bool firstline =
true;
74 while(macroFile.isOpen() && (line = macroFile.readLine()).length() > 0){
75 QString text = QString::fromUtf8(line);
76 gettimeofday(&t, NULL);
77 double tnow = t.tv_sec+(t.tv_usec/1000000.0);
82 text.prepend (QString::number ((tnow - tstart) * 1000000.0,
'f', 0));
84 }
else firstline =
false;
87 metaObject()->invokeMethod(
this,
"readMacro", Qt::QueuedConnection, Q_ARG(QString, text));
89 qDebug() <<
"MacroReader::run() ends.";
MacroReader()
MacroReader Calling MacroReader without params is not allowed.
QPlainTextEdit * macroText
macroText is the other textpane used in the UI while typing new macros. That variable is used for set...
QString macroPath
macroPath holds the path for the notify channel
void run() Q_DECL_OVERRIDE
run is the notification reader main loop.
The MacroReaderThread class is responsible for reading Macro Key Values. It is created as a separate ...
QPlainTextEdit * macroBox
macroBox will receive the Macro Key Values sent from the keyboard while defining a new macro...
void startWorkInAThread(int macroNumber, QString macroPath, QPlainTextEdit *macBox, QPlainTextEdit *macText)
startWorkInAThread This member function creates the new thread object and starts it with the four par...
int macroNumber
macroNumber Filenames of nofity channels have the structure <input-device-path>/ckb1/notify<number> F...
MacroReaderThread * macroReaderThread
void readMacro(QString line)
readMacro is called for each line received by the worker thread. The method ist called via signal (me...