satdump/plugins/bitview_app/bitview.h

54 lines
1.2 KiB
C
Raw Permalink Normal View History

2024-05-18 18:05:04 +02:00
#pragma once
#include "handlers/handler.h"
2024-05-18 18:05:04 +02:00
#include "imgui/imgui.h"
#include "imgui/imgui_internal.h"
#include <thread>
#include <vector>
2025-05-03 12:12:36 +02:00
#include "imgui/dialogs/widget.h"
2024-05-18 18:05:04 +02:00
#include "bit_container.h"
2024-05-19 15:16:25 +02:00
#include "libs/ctpl/ctpl_stl.h"
#include "tool.h"
2024-05-18 18:05:04 +02:00
namespace satdump
{
class BitViewHandler : public handlers::Handler
2024-05-18 18:05:04 +02:00
{
protected:
2024-05-18 18:54:57 +02:00
bool is_busy = false;
2025-02-10 20:09:03 +01:00
void drawMenu();
void drawContents(ImVec2 win_size);
void drawMenuBar();
2024-05-18 18:05:04 +02:00
private:
FileSelectWidget select_bitfile_dialog = FileSelectWidget("File", "Select File", false, true);
std::shared_ptr<BitContainer> current_bit_container;
private:
float process_progress = 0;
2024-05-19 15:16:25 +02:00
ctpl::thread_pool process_threadp = ctpl::thread_pool(4);
2024-05-18 18:05:04 +02:00
2024-05-19 15:16:25 +02:00
std::vector<std::shared_ptr<BitViewTool>> all_tools;
2024-05-18 18:05:04 +02:00
public:
2025-02-10 20:09:03 +01:00
BitViewHandler();
BitViewHandler(std::shared_ptr<BitContainer> c);
~BitViewHandler();
2024-05-18 18:05:04 +02:00
public:
2025-02-10 20:09:03 +01:00
std::string getID() { return "bitview_handler"; }
std::string getName()
{
if (current_bit_container)
return current_bit_container->getName();
else
2025-05-24 20:17:10 +02:00
return "BitView";
2025-02-10 20:09:03 +01:00
}
2024-05-18 18:05:04 +02:00
};
2025-05-03 12:12:36 +02:00
}; // namespace satdump