Example #1
0
//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)");
    }
}
Example #2
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+")");
}
Example #3
0
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+")");
}
Example #4
0
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("");
}
Example #5
0
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."));
    }
}
Example #6
0
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();
}
Example #7
0
void MainWindow::on_K_YELLOW_clicked() { sendMessageToServer("tux_remote(K_YELLOW)"); }
Example #8
0
void MainWindow::on_K_HANGUP_clicked() { sendMessageToServer("tux_remote(K_HANGUP)"); }
Example #9
0
void MainWindow::on_btnBothLedOff_clicked()
{
    sendMessageToServer("Tux_Leds(Both,Off)");
}
Example #10
0
void MainWindow::on_K_PLAYPAUSE_clicked() { sendMessageToServer("tux_remote(K_PLAYPAUSE)"); }
Example #11
0
void MainWindow::on_K_PREVIOUS_clicked() { sendMessageToServer("tux_remote(K_PREVIOUS)"); }
Example #12
0
void MainWindow::on_K_STANDBY_clicked() { sendMessageToServer("tux_remote(K_STANDBY)"); }
Example #13
0
void MainWindow::on_K_FASTREWIND_clicked() { sendMessageToServer("tux_remote(K_FASTREWING)"); }
Example #14
0
void MainWindow::on_btnReset_clicked()
{
    sendMessageToServer("Tux_Reset()");
}
Example #15
0
void MainWindow::on_btnSendCmd_clicked()
{
    sendMessageToServer(ui->rawCmd->toPlainText());
    ui->rawCmd->setPlainText("");
}
Example #16
0
void MainWindow::on_btnRightLedOff_clicked()
{
    sendMessageToServer("Tux_Leds(Right,Off)");
}
Example #17
0
void MainWindow::on_btnRightLedBlink_clicked()
{
    sendMessageToServer("Tux_Leds(right,blink,6,1.0)");
}
Example #18
0
void MainWindow::on_btnFlashSnd_clicked()
{
    sendMessageToServer("Tux_Flash("+QString::number(ui->flashSnd->value())+",100)");
}
Example #19
0
void MainWindow::on_K_CHANNELMINUS_clicked() { sendMessageToServer("tux_remote(K_CHANNELMINUS)"); }
Example #20
0
void MainWindow::on_K_VOLUMEPLUS_clicked() { sendMessageToServer("tux_remote(K_VOLUMEPLUS)"); }
Example #21
0
void MainWindow::on_K_DOWN_click() { sendMessageToServer("tux_remote(K_DOWN)"); }
Example #22
0
void MainWindow::on_K_ESCAPE_clicked() { sendMessageToServer("tux_remote(K_ESCAPE)"); }
Example #23
0
void MainWindow::on_K_FASTFORWARD_clicked() { sendMessageToServer("tux_remote(K_FASTFORWARD)"); }
Example #24
0
void MainWindow::on_btnLeftLedOn_clicked()
{
    sendMessageToServer("Tux_Leds(Left,On)");
}
Example #25
0
void MainWindow::on_K_RECORDING_clicked() { sendMessageToServer("tux_remote(K_RECORDING)"); }
Example #26
0
void MainWindow::on_K_STARTVOIP_clicked() { sendMessageToServer("tux_remote(K_STARTVOIP)"); }
Example #27
0
void MainWindow::on_K_ALT_clicked() { sendMessageToServer("tux_remote(K_ALT)"); }
Example #28
0
void MainWindow::on_K_RECEIVECALL_clicked() { sendMessageToServer("tux_remote(K_RECEIVECALL)"); }
Example #29
0
void MainWindow::on_K_BACKSPACE_clicked() { sendMessageToServer("tux_remote(K_BACKSPACE)"); }
Example #30
0
void MainWindow::on_btnBothLedBlink_clicked()
{
    sendMessageToServer("Tux_Leds(both,blink,6,1.0)");
}