コード例 #1
0
ファイル: analysiswidget.cpp プロジェクト: Kojirion/ChessX
void AnalysisWidget::slotReconfigure()
{
    QString oldEngineName = ui.engineList->currentText();
    if(oldEngineName.isEmpty())
    {
        QString key = QString("/") + objectName() + "/Engine";
        oldEngineName = AppSettings->value(key).toString();
    }

    EngineList enginesList;
    enginesList.restore();
    QStringList names = enginesList.names();
    ui.engineList->clear();
    ui.engineList->insertItems(0,	names);
    int index = names.indexOf(oldEngineName);
    if(index != -1)
    {
        ui.engineList->setCurrentIndex(index);
    }
    else
    {
        ui.engineList->setCurrentIndex(0);
        stopEngine();
    }

    int fontSize = AppSettings->getValue("/General/ListFontSize").toInt();
    QFont f = ui.variationText->font();
    f.setPointSize(fontSize);
    setFont(f);
    ui.variationText->setFont(f);
}
コード例 #2
0
int USHIEngineTester::debugTest(QApplication & app, QString bin)
{
/*    SBoard b;
    b.setStandardPosition();
    //b.setToMove(Black);
    Move m = b.parseMove("16-23");
    qDebug() << m.isLegal() << m.sideMoving();
    b.doMove(m);
    b.fromSPN(b.toSPN());
    qDebug() << b.toMove();
    m = b.parseMove("46-39");
    qDebug() << m.isLegal() << m.sideMoving();
    return 0;
    SQSSRSBRB/K/1SSSSSS/S6/7/2s4/7/ss1ssss/k/brbsrssqs w Tt - 41 2 2
*/    
//    const QString bin =
//        "/home/defgsus/prog/shatra/sources/build-sdev55-Desktop_Qt_5_1_1_GCC_64bit-Release/sdev55";

    // use defined engine if no override
    if (bin.isEmpty())
    {
        EngineList elist;
        elist.restore();
        bin = elist[0].command;
    }

    qDebug() << "--- TESTING SDEV<->SDEV with " << bin;

    // setup tester class
    USHIEngineTester match;
    match.connect(&match, SIGNAL(stopped()), &app, SLOT(quit()));
    match.setBinary(0, bin);
    match.setBinary(1, bin);

    if (!match.startTests())
    {
        qDebug() << "--- START TEST FAILED";
        return -1;
    }

    // start event loop
    app.exec();

    qDebug() << "--- END";

    // print game
    Output out(Output::Sgn);
    Game g(match.game());
    qDebug() << out.output(&g);

    return 0;
}
コード例 #3
0
ファイル: sci_decoder.cpp プロジェクト: gkalab/cb2pgn
void
Decoder::decodeEngines(ByteStream& strm, EngineList& engines)
{
	uint8_t count = strm.get();

	engines.reserve(count);

	for (unsigned i = 0; i < count; ++i)
	{
		mstl::string engine;
		strm.get(engine);
		engines.addEngine(engine);
	}
}
コード例 #4
0
void
SimEngineManager::UpdateEngineList()
{
    EngineList newEL;
    EngineProperties props(engine->GetEngineProperties());

    newEL.GetEngineName().push_back(engineKey.HostName());
    newEL.GetSimulationName().push_back(engineKey.SimName());
    newEL.AddProperties(props);

    // Send the engine list to the viewer's client.
    *(GetViewerState()->GetEngineList()) = newEL;
    GetViewerState()->GetEngineList()->Notify();
}
コード例 #5
0
ファイル: playgameengine.cpp プロジェクト: franzm/shatrabase
bool PlayGameEngine::createEngine_()
{
    SB_PLAY_DEBUG("PlayGameEngine::createEngine_()");

    stopBetweenMoves_ = AppSettings->getValue("/PlayGame/restartEngineBetweenMoves").toBool();

    if (engine_)
        destroyEngine_();

    EngineList elist;
    elist.restore();

    int i = elist.names().indexOf(name_);
    if (i >= 0)
    {
        engine_ = Engine::newEngine(i);

        connect(engine_, SIGNAL(activated()), SLOT(engineActivated_()));
        connect(engine_, SIGNAL(readyOk()), SLOT(engineReadyOk_()));
        connect(engine_, SIGNAL(error(QProcess::ProcessError)),
                        SLOT(engineError_(QProcess::ProcessError)));
        connect(engine_, SIGNAL(deactivated()), SLOT(engineDeactivated_()));
        connect(engine_, SIGNAL(analysisUpdated(Analysis)),
                                    SLOT(engineAnalysis_(const Analysis&)));
        connect(engine_, SIGNAL(bestMoveSend(SHATRA::Move)),
                        SLOT(engineBestMove_(SHATRA::Move)));

        // debug
        if (engineDebug_)
        {
            connect(engine_, SIGNAL(engineDebug(Engine*,Engine::DebugType,QString)),
                    engineDebug_, SLOT(slotEngineDebug(Engine*,Engine::DebugType,QString)));
        }
        connect(engine_, SIGNAL(engineDebug(Engine*,Engine::DebugType,QString)),
                         SIGNAL(engineDebug(Engine*,Engine::DebugType,QString)));

        //if (!stopBetweenMoves_)
            engine_->activate();

        SB_PLAY_DEBUG("PlayGameEngine::createEngine_(): created Engine " << name_);
        return true;
    }
    else
    {
        SB_PLAY_DEBUG("PlayGameEngine::createEngine_(): unknown Engine name " << name_);
        return false;
    }
}