OChess v0.0.2
Programmer's Manual
LiveEngineDialog.hpp
1#pragma once
2
3#include "UCI.hpp"
4#include "ochess.hpp"
5#include <wx/timer.h>
6#include <algorithm>
7
8wxDECLARE_EVENT(SHOW_ENGINE_EVALUATION, wxCommandEvent);
9
11typedef struct EngineEvaluation {
12 std::vector<std::string> best_lines;
13 float eval=0;
15
21 uciadapter::UCI *engine;
22 std::string engine_name;
23 std::string confGroup;
24 std::string optmultipv;
25
26 wxTimer timer;
28 std::uint32_t interval;
34 void OnTimerTick(wxTimerEvent &event);
35 void OnClose(wxCloseEvent &e);
40 void InitEngine();
42 void TogglePauseEngine(wxCommandEvent &event);
43public:
44 LiveEngineDialog(wxWindow *parent, std::uint32_t engine_id);
51 void SetFEN(std::string fen);
52 void StopEngine();
53 void StartEngine();
54};
Class DialogLiveEngine.
Definition: gui.h:125
Dialog to control the current running engine on the game tab.
Definition: LiveEngineDialog.hpp:20
std::uint32_t interval
The following time interval definitely need to be configure in the user settings (set to 1s for now)
Definition: LiveEngineDialog.hpp:28
void TogglePauseEngine(wxCommandEvent &event)
Pause/Resume evaluation.
Definition: LiveEngineDialog.cpp:85
void InitEngine()
Create the engine sub process using the uciadapter library.
Definition: LiveEngineDialog.cpp:29
void OnTimerTick(wxTimerEvent &event)
Called to fetch last evaluation from the engine subprocess (stockfish, fritz etc.)
Definition: LiveEngineDialog.cpp:118
void SetFEN(std::string fen)
Used setup a new position to evaluate.
Definition: LiveEngineDialog.cpp:75
Contains the current engine evaluation (sorted vector of best lines + position score in cp)
Definition: LiveEngineDialog.hpp:11