-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventFunctions.cpp
More file actions
650 lines (538 loc) · 22.6 KB
/
Copy pathEventFunctions.cpp
File metadata and controls
650 lines (538 loc) · 22.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
#include "MainFrame.h"
void MainFrame::OnCloseEvt(wxCloseEvent& event) {
SaveProjectOptions(true);
ConfirmClose();
}
void MainFrame::OnFileDropEvt(wxDropFilesEvent& event) {
wxString* droppedFiles = event.GetFiles();
if (droppedFiles && droppedFiles[0].IsEmpty()) {
dataset_input->SetPath(droppedFiles[0]);
}
event.Skip(); // Allow default processing of the event
}
void MainFrame::OnMenuNew(wxCommandEvent& event) {
Status("Fields cleared to add new things");
// Clear project name input
project_name_input->Clear();
// Clear dataset input
dataset_input->SetPath(wxEmptyString);
event.Skip();
}
void MainFrame::OnMenuOpen(wxCommandEvent& event) {
Status("Select a project from the list");
// Create a new wxFrame for listing projects
wxFrame* projectListFrame = new wxFrame(this, wxID_ANY, "Project List", wxDefaultPosition, wxSize(300, 400));
// Set wxArt icon
wxIcon icon;
icon.CopyFromBitmap(wxArtProvider::GetBitmap(wxART_FILE_OPEN)); // Replace with the desired wxArt icon type
projectListFrame->SetIcon(icon);
// Create a wxScrolledWindow to host the project list
wxScrolledWindow* scrolledWindow = new wxScrolledWindow(projectListFrame, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
// Create a wxListBox to display project names
wxListBox* listBox = new wxListBox(scrolledWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize);
// Get all directories (projects) from "Projects/" folder
wxString projectsFolder = "Projects/";
wxDir projectsDir(projectsFolder);
if (projectsDir.IsOpened()) {
wxString projectName;
bool cont = projectsDir.GetFirst(&projectName, wxEmptyString, wxDIR_DIRS);
while (cont) {
// Add each project name to the list box
listBox->Append(projectName);
cont = projectsDir.GetNext(&projectName);
}
}
// Bind selection event
listBox->Bind(wxEVT_LISTBOX, &MainFrame::OnProjectSelection, this);
// Set up layout
wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(listBox, 1, wxEXPAND);
scrolledWindow->SetSizer(sizer);
scrolledWindow->FitInside();
// Show the project list frame
projectListFrame->Show();
event.Skip();
}
void MainFrame::OnProjectSelection(wxCommandEvent& event) {
wxListBox* listBox = dynamic_cast<wxListBox*>(event.GetEventObject());
if (listBox) {
int selectedIdx = listBox->GetSelection();
if (selectedIdx != wxNOT_FOUND) {
wxString projectName = listBox->GetString(selectedIdx);
project_name = projectName;
ReadProjectOptions();
// Update project_name_input
project_name_input->SetValue(projectName);
// Update dataset_input
wxString datasetPath = "Projects/" + projectName + "/raw.pcd";
if (!wxFileExists(datasetPath)) {
datasetPath = "Projects/" + projectName + "/raw.txt";
if (!wxFileExists(datasetPath)) {
datasetPath = wxEmptyString;
}
}
dataset_input->SetPath(datasetPath);
}
}
}
void MainFrame::OnMenuDelete(wxCommandEvent& event) {
// Get project name from input field
project_name = project_name_input->GetValue();
// Check if project name is empty
if (project_name.empty()) {
// Show a message or do nothing because project name is not provided
wxMessageBox("Please enter a project name to delete.", "Delete Project", wxOK | wxICON_INFORMATION);
return; // Exit function early
}
// Construct the folder path
wxString projectFolderPath = "Projects/" + project_name;
// Convert wxString to std::string for filesystem operations
std::string projectFolderStdString = std::string(projectFolderPath.mb_str());
// Confirm deletion with a message box
wxMessageDialog dialog(this, "Are you sure you want to delete this project?", "Confirm Deletion", wxYES_NO | wxICON_QUESTION);
int result = dialog.ShowModal();
if (result == wxID_YES) {
// Attempt to delete the directory and its contents
try {
std::filesystem::remove_all(projectFolderStdString);
status_bar->SetStatusText("Project folder deleted successfully.");
}
catch (const std::filesystem::filesystem_error& e) {
status_bar->SetStatusText("Failed to delete project folder: " + wxString(e.what(), wxConvUTF8));
}
}
Status("Project deleted");
event.Skip(); // Continue handling the event normally
}
void MainFrame::OnMenuExit(wxCommandEvent& event) {
Status("Select 'Yes' to exit");
SaveProjectOptions(true);
ConfirmClose();
}
void MainFrame::OnHelpDocs(wxCommandEvent& event) {
Status("README.MD in the repository was opened");
wxLaunchDefaultBrowser("https://github.com/AlexMattyou/PointCloudSegmentation/blob/master/README.md");
event.Skip();
}
void MainFrame::OnHelpReport(wxCommandEvent& event) {
Status("Issues in the repository was opened, you can write the problems there");
wxLaunchDefaultBrowser("https://github.com/AlexMattyou/PointCloudSegmentation/issues");
event.Skip();
}
void MainFrame::OpenInFileManager(const wxString& path) {
#ifdef _WIN32
wxExecute("explorer " + path);
#elif __APPLE__
wxExecute("open " + path);
#else
wxExecute("xdg-open " + path);
#endif
}
void MainFrame::ViewProjectEvt(wxMouseEvent& event) {
// Get project name from input field
project_name = project_name_input->GetValue();
// Check if project name is empty
if (project_name.empty()) {
wxMessageBox("Please enter a project name to view the project folder.", "View Project", wxOK | wxICON_INFORMATION);
return;
}
// Construct the project folder path
wxString projectFolderPath = "Projects/" + project_name;
// Get the absolute path
wxFileName projectFolderAbsPath(projectFolderPath);
wxString absolutePath = projectFolderAbsPath.GetFullPath();
// Check if project folder exists
if (!std::filesystem::exists(std::string(absolutePath.mb_str()))) {
wxMessageBox("Project folder not found. Please check the project name.", "View Project", wxOK | wxICON_INFORMATION);
return;
}
// Open the project folder in the file manager
Status("Project folder opened");
OpenInFileManager(absolutePath);
event.Skip();
}
void MainFrame::ViewSegmentationEvt(wxMouseEvent& event) {
// Get project name from input field
project_name = project_name_input->GetValue();
// Check if project name is empty
if (project_name.empty()) {
wxMessageBox("Please enter a project name to view its segments.", "View Segments", wxOK | wxICON_INFORMATION);
return;
}
// Construct the segments folder path
wxString segmentsFolderPath = "Projects/" + project_name + "/Segments";
// Get the absolute path
wxFileName segmentsFolderAbsPath(segmentsFolderPath);
wxString absolutePath = segmentsFolderAbsPath.GetFullPath();
// Check if segments folder exists
if (!std::filesystem::exists(std::string(absolutePath.mb_str()))) {
wxMessageBox("Segments folder not found. Please perform segmentation first.", "View Segments", wxOK | wxICON_INFORMATION);
return;
}
// Open the segments folder in the file manager
Status("Segmentation folder opened");
OpenInFileManager(absolutePath);
event.Skip();
}
void MainFrame::OpenFeaturesEvt(wxMouseEvent& event) {
// Get project name from input field
project_name = project_name_input->GetValue();
// Check if project name is empty
if (project_name.empty()) {
wxMessageBox("Please enter a project name to view the feature file.", "Open Feature File", wxOK | wxICON_INFORMATION);
return;
}
// Construct the feature file path
wxString featureFilePath = "Projects/" + project_name + "/feature.csv";
// Get the absolute path
wxFileName featureFileAbsPath(featureFilePath);
wxString absolutePath = featureFileAbsPath.GetFullPath();
// Check if feature file exists
if (!std::filesystem::exists(std::string(absolutePath.mb_str()))) {
wxMessageBox("Feature file not found. Please check if the feature file exists in the project folder.", "Open Feature File", wxOK | wxICON_INFORMATION);
return;
}
// Open the feature file in the default application
Status("Extracted feature.csv opened");
OpenInFileManager(absolutePath);
event.Skip();
}
void MainFrame::StartProcessEvt(wxMouseEvent& event) {
// Show initial status message
SaveProjectOptions(false);
start_button->Enable(false);
CalculateScale();
Status("Process started");
std::filesystem::remove("Projects/" + project_name + "/feature.csv");
std::thread myThread(&MainFrame::ProcessThreadFunction, this);
myThread.detach();
}
////////////////////////////////////////////////////////////////////////////////////
void MainFrame::ConfirmClose() {
Status("Your projects will be saved");
wxMessageDialog confirmDialog(
this,
"Are you sure you want to exit?",
"Confirm Exit",
wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION
);
if (confirmDialog.ShowModal() == wxID_YES) {
Destroy(); // Destroy the frame, avoids triggering the close event again
}
}
void MainFrame::SaveOptions(bool exit) {
project_name = std::string(project_name_input->GetValue().mb_str());
// Get the absolute path of the dataset
wxFileName datasetFile(dataset_input->GetPath());
datasetFile.MakeAbsolute();
dataset = std::string(datasetFile.GetFullPath().mb_str());
// Check if project_name or dataset is empty
if (project_name.empty() || dataset.empty()) {
if (not exit) {
wxMessageBox("Project name or dataset path cannot be empty.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
wxString segment_choice = segmant_type_input->GetStringSelection();
segment_type = segment_choice.SubString(0, 3).ToStdString(); // Store only first 4 characters
// Validate and convert input values
try {
voxel_resolution = std::stof(voxel_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid voxel resolution. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
seed_resolution = std::stof(seed_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid seed resolution. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
color_importance = std::stof(color_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid color importance. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
spatial_importance = std::stof(spatial_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid spatial importance. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
normal_importance = std::stof(normal_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid normal importance. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
concavity_tolerance_threshold = std::stof(concavity_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid concavity tolerance threshold. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
smoothness_threshold = std::stof(smoothness_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid smoothness threshold. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
try {
min_segment_size = std::stoul(segment_size_input->GetValue().ToStdString());
}
catch (const std::exception&) {
if (not exit) {
wxMessageBox("Invalid minimum segment size. Please enter a valid number.", "Invalid Input", wxOK | wxICON_WARNING);
}
return;
}
save_normal_bool = action_normal->GetValue();
segmentation_bool = action_segmantation->GetValue();
extract_features_bool = action_feature_extraction->GetValue();
if (dataset.ends_with(".pcd")) {
pcl_convert_bool = false;
}
else if (dataset.ends_with(".txt")) {
pcl_convert_bool = true;
}
else {
if (not exit) {
wxMessageBox("Please choose a .txt or .pcd file.", "Invalid File Type", wxOK | wxICON_INFORMATION);
}
return;
}
use_supervoxel_refinement = refinement_check->GetValue();
use_extended_convexity = convexty_check->GetValue();
use_sanity_criterion = sanity_check->GetValue();
features_need.clear();
if (geometrical_check->GetValue()) features_need.push_back("Geometrical");
if (statistical_check->GetValue()) features_need.push_back("Statistical");
if (shape_check->GetValue()) features_need.push_back("Shape");
if (density_check->GetValue()) features_need.push_back("Density");
if (color_check->GetValue()) features_need.push_back("Color");
if (area_check->GetValue()) features_need.push_back("Area");
// Combine all variables into a single message
/*
std::stringstream msg;
msg << "project_name: " << project_name << "\n";
msg << "dataset: " << dataset << "\n";
msg << "segment_type: " << segment_type << "\n";
msg << "voxel_resolution: " << voxel_resolution << "\n";
msg << "seed_resolution: " << seed_resolution << "\n";
msg << "color_importance: " << color_importance << "\n";
msg << "spatial_importance: " << spatial_importance << "\n";
msg << "normal_importance: " << normal_importance << "\n";
msg << "concavity_tolerance_threshold: " << concavity_tolerance_threshold << "\n";
msg << "smoothness_threshold: " << smoothness_threshold << "\n";
msg << "min_segment_size: " << min_segment_size << "\n";
msg << "save_normal_bool: " << save_normal_bool << "\n";
msg << "segmentation_bool: " << segmentation_bool << "\n";
msg << "extract_features_bool: " << extract_features_bool << "\n";
msg << "pcl_convert_bool: " << pcl_convert_bool << "\n";
msg << "use_single_cam_transform: " << use_single_cam_transform << "\n";
msg << "use_supervoxel_refinement: " << use_supervoxel_refinement << "\n";
msg << "use_extended_convexity: " << use_extended_convexity << "\n";
msg << "use_sanity_criterion: " << use_sanity_criterion << "\n";
msg << "features_need: ";
for (const auto& feature : features_need) {
msg << feature << " ";
}
// Show the message box
wxMessageBox(msg.str(), "Saved Options", wxOK | wxICON_INFORMATION);
*/
}
void MainFrame::SaveProjectOptions(bool exit) {
SaveOptions(exit);
// Check if project_name is empty
if (project_name.empty()) {
return; // Do not save if project name is empty
}
std::string path = "Projects/" + project_name;
if (!std::filesystem::exists(path)) {
return; // Do not save if the folder does not exist
}
nlohmann::json jsonData;
jsonData["project_name"] = project_name;
jsonData["dataset"] = dataset;
jsonData["segment_type"] = segment_type;
jsonData["voxel_resolution"] = voxel_resolution;
jsonData["seed_resolution"] = seed_resolution;
jsonData["color_importance"] = color_importance;
jsonData["spatial_importance"] = spatial_importance;
jsonData["normal_importance"] = normal_importance;
jsonData["concavity_tolerance_threshold"] = concavity_tolerance_threshold;
jsonData["smoothness_threshold"] = smoothness_threshold;
jsonData["min_segment_size"] = min_segment_size;
jsonData["save_normal_bool"] = save_normal_bool;
jsonData["segmentation_bool"] = segmentation_bool;
jsonData["extract_features_bool"] = extract_features_bool;
jsonData["pcl_convert_bool"] = pcl_convert_bool;
jsonData["use_single_cam_transform"] = use_single_cam_transform;
jsonData["use_supervoxel_refinement"] = use_supervoxel_refinement;
jsonData["use_extended_convexity"] = use_extended_convexity;
jsonData["use_sanity_criterion"] = use_sanity_criterion;
for (const auto& feature : features_need) {
jsonData["features_need"].push_back(feature);
}
std::string optionsPath = path + "/options.json";
std::ofstream file(optionsPath);
file << jsonData.dump(4); // Pretty print with 4 spaces
file.close();
}
void MainFrame::ReadProjectOptions() {
std::string path = "Projects/" + project_name + "/options.json";
std::ifstream file(path);
if (!file.is_open()) {
return; // Silently pass if the file does not exist
}
nlohmann::json jsonData;
file >> jsonData;
file.close();
project_name_input->SetValue(jsonData["project_name"].get<std::string>());
dataset_input->SetPath(jsonData["dataset"].get<std::string>());
segment_type = jsonData["segment_type"].get<std::string>();
auto setFloatValue = [](wxTextCtrl* ctrl, float value) {
std::ostringstream oss;
oss << std::fixed << std::setprecision(2) << value;
ctrl->SetValue(oss.str());
};
setFloatValue(voxel_input, jsonData["voxel_resolution"].get<float>());
setFloatValue(seed_input, jsonData["seed_resolution"].get<float>());
setFloatValue(color_input, jsonData["color_importance"].get<float>());
setFloatValue(spatial_input, jsonData["spatial_importance"].get<float>());
setFloatValue(normal_input, jsonData["normal_importance"].get<float>());
setFloatValue(concavity_input, jsonData["concavity_tolerance_threshold"].get<float>());
setFloatValue(smoothness_input, jsonData["smoothness_threshold"].get<float>());
segment_size_input->SetValue(std::to_string(jsonData["min_segment_size"].get<unsigned long>()));
action_normal->SetValue(jsonData["save_normal_bool"].get<bool>());
action_segmantation->SetValue(jsonData["segmentation_bool"].get<bool>());
action_feature_extraction->SetValue(jsonData["extract_features_bool"].get<bool>());
pcl_convert_bool = jsonData["pcl_convert_bool"].get<bool>();
refinement_check->SetValue(jsonData["use_supervoxel_refinement"].get<bool>());
convexty_check->SetValue(jsonData["use_extended_convexity"].get<bool>());
sanity_check->SetValue(jsonData["use_sanity_criterion"].get<bool>());
features_need.clear();
for (const auto& feature : jsonData["features_need"]) {
features_need.push_back(feature.get<std::string>());
}
geometrical_check->SetValue(std::find(features_need.begin(), features_need.end(), "Geometrical") != features_need.end());
statistical_check->SetValue(std::find(features_need.begin(), features_need.end(), "Statistical") != features_need.end());
shape_check->SetValue(std::find(features_need.begin(), features_need.end(), "Shape") != features_need.end());
density_check->SetValue(std::find(features_need.begin(), features_need.end(), "Density") != features_need.end());
color_check->SetValue(std::find(features_need.begin(), features_need.end(), "Color") != features_need.end());
area_check->SetValue(std::find(features_need.begin(), features_need.end(), "Area") != features_need.end());
Status("Project options recovered");
}
void MainFrame::Status(const std::string& text) {
status_bar->SetStatusText(wxString(text), 0);
}
void MainFrame::CalculateScale() {
save_normal_bool = action_normal->GetValue();
segmentation_bool = action_segmantation->GetValue();
extract_features_bool = action_feature_extraction->GetValue();
if (dataset.ends_with(".pcd")) {
pcl_convert_bool = false;
}
else if (dataset.ends_with(".txt")) {
pcl_convert_bool = true;
}
scale = 0;
int pclPoints = 3;
int normalPoints = 4;
int segmentPoints = 10;
int extractFeaturesPoints = 2;
scale = (1 + (pcl_convert_bool * pclPoints) + (save_normal_bool * normalPoints) + (segmentation_bool * segmentPoints) + (extract_features_bool + extractFeaturesPoints)) / (pcl_convert_bool + save_normal_bool + segmentation_bool + extract_features_bool);
}
void MainFrame::ProgressBar(int increment) {
if (scale == 0) {
return; // Avoid updating if scale is zero
}
score += increment * scale;
this->gauge->SetValue(score);
}
void MainFrame::Log(const std::string& text) {
log_output->SetLabel(text);
}
void MainFrame::ProcessThreadFunction() {
CheckAndCreateProject(project_name);
CheckAndCreateProject(project_name + "/Segments");
std::string input_data;
std::string raw_pcd = "Projects/" + project_name + "/raw.pcd";
std::string normal_pcd = "Projects/" + project_name + "/normal.pcd";
std::string segments_folder = "Projects/" + project_name + "/Segments";
std::string project_loc = "Projects/" + project_name;
// [] 1
if (pcl_convert_bool) {
input_data = dataset;
std::unordered_map<std::string, int> columnIndex;
Txt2pcd(input_data, raw_pcd, columnIndex);
input_data = raw_pcd;
Status("text data converted to pcd");
}
else {
input_data = dataset;
}
// [] 2
if (save_normal_bool) {
SaveNormals(input_data, normal_pcd);
Status("Normal calculation done");
}
// [] 3
if (segmentation_bool) {
SegmentPointCloud(
input_data,
normal_pcd,
segments_folder,
voxel_resolution,
seed_resolution,
color_importance,
spatial_importance,
normal_importance,
use_single_cam_transform,
use_supervoxel_refinement,
concavity_tolerance_threshold,
smoothness_threshold,
min_segment_size,
use_extended_convexity,
use_sanity_criterion,
color_importance != 0.0,
segment_type);
Status("Segmentation done");
ProgressBar(1);
}
// [] 4
if (extract_features_bool) {
AllFeatureExtract(project_loc, features_need);
Status("Feature extraction done");
ProgressBar(1);
}
start_button->Enable(true);
scale = 0.0;
score = 0.0;
Log("All process finished successfully");
start_button->Enable(true);
Status(" ");
this->gauge->SetValue(0);
}