| 103 | } |
| 104 | |
| 105 | void BitViewApplication::drawPanel() |
| 106 | { |
| 107 | if (is_busy) |
| 108 | style::beginDisabled(); |
| 109 | if (ImGui::CollapsingHeader("Files##bitview", ImGuiTreeNodeFlags_DefaultOpen)) |
| 110 | { |
| 111 | ImGui::Text("Load File :"); |
| 112 | if (select_bitfile_dialog.draw() && select_bitfile_dialog.isValid()) |
| 113 | { |
| 114 | try |
| 115 | { |
| 116 | all_bit_containers.push_back(std::make_shared<BitContainer>(std::filesystem::path(select_bitfile_dialog.getPath()).stem().string(), select_bitfile_dialog.getPath())); |
| 117 | } |
| 118 | catch (std::exception &e) |
| 119 | { |
| 120 | logger->error("Could not load file: %s", e.what()); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | ImGui::Separator(); |
| 125 | |
| 126 | renderBitContainers(all_bit_containers, current_bit_container); |
| 127 | } |
| 128 | if (ImGui::CollapsingHeader("Control")) |
| 129 | { |
| 130 | if (current_bit_container) |
| 131 | { |
| 132 | double vv = current_bit_container->d_bitperiod; |
| 133 | if (ImGui::InputDouble("Period", &vv)) |
| 134 | { |
| 135 | current_bit_container->d_bitperiod = vv; |
| 136 | current_bit_container->init_bitperiod(); |
| 137 | current_bit_container->forceUpdateAll(); |
| 138 | } |
| 139 | |
| 140 | if (ImGui::RadioButton("Bits", current_bit_container->d_display_mode == 0)) |
| 141 | { |
| 142 | current_bit_container->d_display_mode = 0; |
| 143 | current_bit_container->forceUpdateAll(); |
| 144 | } |
| 145 | if (ImGui::RadioButton("Bytes", current_bit_container->d_display_mode == 1)) |
| 146 | { |
| 147 | current_bit_container->d_display_mode = 1; |
| 148 | current_bit_container->forceUpdateAll(); |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | if (is_busy) |
| 153 | style::endDisabled(); |
| 154 | if (ImGui::CollapsingHeader("Tools")) |
| 155 | { |
| 156 | if (current_bit_container) |
| 157 | { |
| 158 | for (auto &tool : all_tools) |
| 159 | { |
| 160 | ImGui::Separator(); |
| 161 | ImGui::Text("%s", tool->getName().c_str()); |
| 162 | ImGui::Separator(); |
nothing calls this directly
no test coverage detected