File: scatterometer_handler.h

package info (click to toggle)
satdump 1.2.2%2Bgb79af48-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,648 kB
  • sloc: cpp: 276,768; ansic: 164,598; lisp: 1,219; sh: 283; xml: 106; makefile: 7
file content (73 lines) | stat: -rw-r--r-- 1,818 bytes parent folder | download | duplicates (2)
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
#pragma once

#include "viewer.h"

#include "logger.h"
#include "products/scatterometer_products.h"
#include "common/widgets/image_view.h"
#include "imgui/imgui_stdlib.h"
#include "libs/ctpl/ctpl_stl.h"
#include "common/widgets/timed_message.h"

namespace satdump
{
    class ScatterometerViewerHandler : public ViewerHandler
    {
    public:
        ~ScatterometerViewerHandler();

        // Products
        ScatterometerProducts *products;

        enum SCAT_TYPE
        {
            SCAT_ASCAT,
            SCAT_FANBEAM,
        };
        SCAT_TYPE current_scat_type;

        // Visualization
        int selected_visualization_id = 0;

        // Grayscale viz
        int select_channel_image_id = 0;
        std::string select_channel_image_str;
        ImageViewWidget image_view;
        int scat_grayscale_min = 0, scat_grayscale_max = 1e7;

        nlohmann::json current_image_proj;
        image::Image current_img;

        // ASCAT-Only
        int ascat_select_channel_id = 0;
        std::string ascat_select_channel_image_str;

        // Projections
        image::Image projected_img;

        // GUI
        bool is_updating = false;

        // Overlays
        OverlayHandler overlay_handler;

        void init();

        ctpl::thread_pool handler_thread_pool = ctpl::thread_pool(1);
        std::mutex async_image_mutex;
        void asyncUpdate();
        void update();

        void drawMenu();
        void drawContents(ImVec2 win_size);
        float drawTreeMenu();

        bool canBeProjected();
        void addCurrentToProjections();

        widgets::TimedMessage proj_notif;

        static std::string getID() { return "scatterometer_handler"; }
        static std::shared_ptr<ViewerHandler> getInstance() { return std::make_shared<ScatterometerViewerHandler>(); }
    };
}