//Gestion du résultat de l'ASR void MainWindow::manageASR(QString _asr) { QString asr = _asr.replace("é", "e"); asr = asr.replace("è", "e"); if (asr.contains("nageoire") || asr.contains("aile")) { if(asr.contains("haut") || asr.contains("leve")) sendMessageToServer("Tux_Flippers(up)"); if(asr.contains("bas") || asr.contains("baisse")) sendMessageToServer("Tux_Flippers(down)"); } if (asr.contains("bouche")) { if (asr.contains("ouvre") || asr.contains("ouvrir") || asr.contains("ouverture")) sendMessageToServer("Tux_Open(Mouth)"); if (asr.contains("ferme")) sendMessageToServer("Tux_Close(Mouth)"); } if (asr.contains("yeux")) { if (asr.contains("ouvre") || asr.contains("ouvrir") || asr.contains("ouverture")) sendMessageToServer("Tux_Open(Eyes)"); if (asr.contains("ferme")) sendMessageToServer("Tux_Close(Eyes)"); if (asr.contains("clignote")) sendMessageToServer("Tux_Leds(both,blink,6,1.0)"); } }
void MainWindow::on_btnPlayAtt_clicked() { if(!connected) return; QString file = QFileDialog::getOpenFileName( this, tr( "Sélection d'une attitune" ), "./", tr( "Attitunes (*.att)" ) ); if( !file.isNull()) sendMessageToServer("Tux_PlayAatt("+file+")"); }
void MainWindow::on_btnPlaySnd_clicked() { if(!connected) return; QString file = QFileDialog::getOpenFileName( this, tr( "Sélection d'un fichier audio" ), "./", tr( "Fichiers audio (*.*)" ) ); if( !file.isNull() ) sendMessageToServer("Tux_Audio(PlayMusic,"+file+")"); }
void MainWindow::on_btnTTSSpeak_clicked() { QString ttsVoice = ui->voice->currentText(); QString ttsPitch = QString::number(ui->pitch->value()); QString ttsSpeed = QString::number(ui->pitch->value()); QString ttsMsg = ui->ttsMessage->toPlainText().replace(",","."); sendMessageToServer("Tux_TTS(\""+ttsMsg+"\","+ttsVoice+","+ttsPitch+","+ttsSpeed+",1,1)"); ui->ttsMessage->setPlainText(""); }
void kitchenFrame::OnButton6Click(wxCommandEvent& event) { wxString message = TextCtrl2->GetValue(); if(SocketClient1->IsConnected()) { sendMessageToServer(SocketClient1, _T("m:") + message); TextCtrl2->Clear(); TextCtrl1->AppendText(_("Kitchen: ") + message + _T("\n")); } else { wxMessageBox(_T("Host computer is not connected!\n Message was not sent.")); } }
void kitchenFrame::OnUrlClick(wxHtmlLinkEvent& event) { long templong; wxString link = event.GetLinkInfo().GetHref(); link.Mid(0,link.Find(_T(":"))).ToLong(&templong); href=true; int num = templong; wxString temp; temp << num; mysqlpp::Query query = conn->query(); wxString dishId = link.Mid(link.Find(_T(":"))+1); query <<"UPDATE `orders_dishes` SET `ready` = '1' \ WHERE `orders_dishes`.`id` =" << wx2std(dishId, wxConvUI) << " LIMIT 1"; query.execute(); //we just set to ready only one dish from order int orderId; query << "SELECT `order_id` FROM `orders_dishes` WHERE `id`="<< wx2std(dishId, wxConvUI); mysqlpp::StoreQueryResult res = query.store(); if(res) { mysqlpp::Row row; row = res.at(0); orderId = int(row["order_id"]); } query << "SELECT `id` FROM `orders_dishes` WHERE `ready`=0 AND `order_id`="<< orderId; res = query.store(); if(res) { if(!res.num_rows()) //no dishes to prepare { query << "UPDATE `orders` SET `status` = '4' WHERE `orders`.`id` ="<< orderId <<" LIMIT 1 "; query.execute(); //set the whole order to ready state //redo the pages to update status fillAll(); wxString tem; tem << _T("r:") << orderId; sendMessageToServer(SocketClient1, tem); } } wxString prodName = StaticText9->GetLabel(); fillDetails(prodName); fillMain(); }
void MainWindow::on_K_YELLOW_clicked() { sendMessageToServer("tux_remote(K_YELLOW)"); }
void MainWindow::on_K_HANGUP_clicked() { sendMessageToServer("tux_remote(K_HANGUP)"); }
void MainWindow::on_btnBothLedOff_clicked() { sendMessageToServer("Tux_Leds(Both,Off)"); }
void MainWindow::on_K_PLAYPAUSE_clicked() { sendMessageToServer("tux_remote(K_PLAYPAUSE)"); }
void MainWindow::on_K_PREVIOUS_clicked() { sendMessageToServer("tux_remote(K_PREVIOUS)"); }
void MainWindow::on_K_STANDBY_clicked() { sendMessageToServer("tux_remote(K_STANDBY)"); }
void MainWindow::on_K_FASTREWIND_clicked() { sendMessageToServer("tux_remote(K_FASTREWING)"); }
void MainWindow::on_btnReset_clicked() { sendMessageToServer("Tux_Reset()"); }
void MainWindow::on_btnSendCmd_clicked() { sendMessageToServer(ui->rawCmd->toPlainText()); ui->rawCmd->setPlainText(""); }
void MainWindow::on_btnRightLedOff_clicked() { sendMessageToServer("Tux_Leds(Right,Off)"); }
void MainWindow::on_btnRightLedBlink_clicked() { sendMessageToServer("Tux_Leds(right,blink,6,1.0)"); }
void MainWindow::on_btnFlashSnd_clicked() { sendMessageToServer("Tux_Flash("+QString::number(ui->flashSnd->value())+",100)"); }
void MainWindow::on_K_CHANNELMINUS_clicked() { sendMessageToServer("tux_remote(K_CHANNELMINUS)"); }
void MainWindow::on_K_VOLUMEPLUS_clicked() { sendMessageToServer("tux_remote(K_VOLUMEPLUS)"); }
void MainWindow::on_K_DOWN_click() { sendMessageToServer("tux_remote(K_DOWN)"); }
void MainWindow::on_K_ESCAPE_clicked() { sendMessageToServer("tux_remote(K_ESCAPE)"); }
void MainWindow::on_K_FASTFORWARD_clicked() { sendMessageToServer("tux_remote(K_FASTFORWARD)"); }
void MainWindow::on_btnLeftLedOn_clicked() { sendMessageToServer("Tux_Leds(Left,On)"); }
void MainWindow::on_K_RECORDING_clicked() { sendMessageToServer("tux_remote(K_RECORDING)"); }
void MainWindow::on_K_STARTVOIP_clicked() { sendMessageToServer("tux_remote(K_STARTVOIP)"); }
void MainWindow::on_K_ALT_clicked() { sendMessageToServer("tux_remote(K_ALT)"); }
void MainWindow::on_K_RECEIVECALL_clicked() { sendMessageToServer("tux_remote(K_RECEIVECALL)"); }
void MainWindow::on_K_BACKSPACE_clicked() { sendMessageToServer("tux_remote(K_BACKSPACE)"); }
void MainWindow::on_btnBothLedBlink_clicked() { sendMessageToServer("Tux_Leds(both,blink,6,1.0)"); }