~aleteoryx/muditaos

ref: 44d3306f280cc7d6daa718d2a9f6323e48f54616 muditaos/module-apps/application-antenna/windows/AntennaMainWindow.hpp -rw-r--r-- 1.8 KiB
44d3306f — rrandomsky [CP-1059] Fix for erase only sensitive data from logs 2 years ago
                                                                                
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
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <apps-common/ApplicationCommon.hpp>
#include <apps-common/windows/AppWindow.hpp>
#include <module-gui/gui/widgets/Text.hpp>
#include <service-antenna/ServiceAntenna.hpp>

namespace gui
{

    class AntennaMainWindow : public AppWindow
    {
      protected:
        std::vector<gui::Label *> titles;

        std::vector<gui::Label *> buttons;
        gui::Text *operators = nullptr;

        gui::Label *addLabel(const UTF8 &title,
                             std::function<bool(Item &)> activatedCallback,
                             bool visibleBorder = true);
        const std::string titlesText[4] = {"CSQ: ", "Status: ", "Band: ", "Operators: "};
        enum class labelDescripion
        {
            csq       = 0,
            status    = 1,
            band      = 2,
            operators = 3
        };

        enum buttonDescriotion
        {
            AntennaA = 0,
            AntennaB,
            StartScan,
            ScanMode,
            LockAntennaManager,
            AlgoParams
        };

      public:
        AntennaMainWindow(app::ApplicationCommon *app);

        // virtual methods
        bool onInput(const InputEvent &inputEvent) override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
        void updateDebugInfo(std::vector<std::string> &data);
        void updateOperatorsScan(std::vector<std::string> &data);
        void updateAntennaButtons(bsp::cellular::antenna antenna);
        void updateLockedButton(antenna::lockState antennaState);
    };

} /* namespace gui */