| 55 | } |
| 56 | |
| 57 | void ExerciserView::drawContent() |
| 58 | { |
| 59 | if (physicalBounds.minCylinder == -1) |
| 60 | return; |
| 61 | |
| 62 | const float label_width = ImGui::GetFontSize() * 6; |
| 63 | ImGui::PushItemWidth(-label_width); |
| 64 | DEFER(ImGui::PopItemWidth()); |
| 65 | |
| 66 | int oldCylinder = selectedCylinder; |
| 67 | |
| 68 | ImGui::SliderInt("fluxengine.view.exerciser.drive"_lang, |
| 69 | &selectedDrive, |
| 70 | 0, |
| 71 | 1, |
| 72 | "%d", |
| 73 | ImGuiSliderFlags_None); |
| 74 | ImGui::SliderInt("fluxengine.view.exerciser.cylinder"_lang, |
| 75 | &selectedCylinder, |
| 76 | physicalBounds.minCylinder, |
| 77 | physicalBounds.maxCylinder, |
| 78 | "%d", |
| 79 | ImGuiSliderFlags_None); |
| 80 | |
| 81 | if (ImGui::BeginTable("nudgeTable", |
| 82 | 3, |
| 83 | ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_SizingStretchProp, |
| 84 | {ImGui::GetContentRegionAvail().x - label_width, 0})) |
| 85 | { |
| 86 | DEFER(ImGui::EndTable()); |
| 87 | |
| 88 | ImGui::TableNextColumn(); |
| 89 | if (ImGui::Button("fluxengine.view.exerciser.nudgeDown"_lang, |
| 90 | {ImGui::GetContentRegionAvail().x, 0})) |
| 91 | selectedCylinder--; |
| 92 | ImGui::TableNextColumn(); |
| 93 | if (ImGui::Button("fluxengine.view.exerciser.reset"_lang, |
| 94 | {ImGui::GetContentRegionAvail().x, 0})) |
| 95 | selectedCylinder = 0; |
| 96 | ImGui::TableNextColumn(); |
| 97 | if (ImGui::Button("fluxengine.view.exerciser.nudgeUp"_lang, |
| 98 | {ImGui::GetContentRegionAvail().x, 0})) |
| 99 | selectedCylinder++; |
| 100 | } |
| 101 | |
| 102 | selectedCylinder = std::clamp(selectedCylinder, |
| 103 | physicalBounds.minCylinder, |
| 104 | physicalBounds.maxCylinder); |
| 105 | |
| 106 | if (selectedCylinder != oldCylinder) |
| 107 | { |
| 108 | Datastore::runOnWorkerThread( |
| 109 | [=] |
| 110 | { |
| 111 | usbSetDrive( |
| 112 | selectedDrive, false, globalConfig()->drive().index_mode()); |
| 113 | usbSeek(selectedCylinder); |
| 114 | }); |
nothing calls this directly
no test coverage detected