diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-09 16:36:48 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-09 16:36:48 +0100 |
| commit | f4108bc06cd9fa1977267836e9176118e8863b57 (patch) | |
| tree | 3cd663f6547c6915d4f0fe8cf137fe68a9a1bec4 /src/game_tab/right_panel/LiveEngineDialog.cpp | |
| parent | 30b7577ab321e70b5ebb2c4ec1b9edfe1d3c0a44 (diff) | |
Bind live engine analysis to BoardCanvas
Diffstat (limited to 'src/game_tab/right_panel/LiveEngineDialog.cpp')
| -rw-r--r-- | src/game_tab/right_panel/LiveEngineDialog.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game_tab/right_panel/LiveEngineDialog.cpp b/src/game_tab/right_panel/LiveEngineDialog.cpp index 9184216..347c32e 100644 --- a/src/game_tab/right_panel/LiveEngineDialog.cpp +++ b/src/game_tab/right_panel/LiveEngineDialog.cpp @@ -104,12 +104,16 @@ void LiveEngineDialog::OnTimerTick(wxTimerEvent &event) { wxLogDebug("Tick!"); lines_list->DeleteAllItems(); engine->SyncAfter(0); + EngineEvaluation *eval=new EngineEvaluation(); for (auto const &line : engine->GetLines()) { long index = lines_list->InsertItem(0, std::to_string(line.first)); std::string line_moves; for (std::string move : line.second.pv) { line_moves += move + " "; } + if(line.second.pv.size()>0){ + eval->best_lines.push_back(line.second.pv[0]); + } std::string cp_str = std::to_string(line.second.score_cp); if (line.second.score_cp > 0) { cp_str = "+" + cp_str; @@ -117,5 +121,10 @@ void LiveEngineDialog::OnTimerTick(wxTimerEvent &event) { lines_list->SetItem(index, 1, cp_str); lines_list->SetItem(index, 2, line_moves); } - wxLogDebug("%s", engine->GetBuffer()); + //wxLogDebug("%s", engine->GetBuffer()); + // Notify GameTab + wxCommandEvent notifyEvent(SHOW_ENGINE_EVALUATION,GetId()); + notifyEvent.SetEventObject(this); + notifyEvent.SetClientData(eval); + ProcessEvent(notifyEvent); }
\ No newline at end of file |
