|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2021 nono project
4: // Licensed under nono-license.txt
5: //
6:
1.1.1.4 root 7: //
8: // ステータスパネル
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "wxtextpanel.h"
1.1.1.5 root 14: #include "fdd.h"
15: #include <array>
1.1 root 16:
1.1.1.6 root 17: class Indicator;
18: class PowerDevice;
19: class Syncer;
1.1.1.7 root 20: class Status;
1.1 root 21: class WXStatusPanel;
22:
23: // ステータスパネル
24: class WXStatusPanel : public WXTextPanel
25: {
26: using inherited = WXTextPanel;
1.1.1.6 root 27:
1.1 root 28: public:
1.1.1.9 root 29: explicit WXStatusPanel(wxWindow *parent);
30: ~WXStatusPanel() override;
1.1 root 31:
1.1.1.4 root 32: void FontChanged() override;
1.1.1.10 root 33: void Fit() override;
34: bool Layout() override;
1.1 root 35:
1.1.1.11! root 36: void Init();
! 37:
1.1 root 38: private:
39: void OnClose(wxCloseEvent&);
40: void OnShow(wxShowEvent&);
41: void OnTimer(wxTimerEvent&);
42: void OnLeftDClick(wxMouseEvent&);
1.1.1.3 root 43: void OnContextMenu(wxContextMenuEvent&);
44: void OnSCSIMediaChanged(wxCommandEvent&);
1.1.1.5 root 45: void OnFDDMediaChanged(wxCommandEvent&);
46: void OnLEDChanged(wxCommandEvent&);
1.1 root 47:
48: bool UpdateStat();
1.1.1.4 root 49: void Draw() override;
1.1 root 50: void InitIndicators();
1.1.1.10 root 51: wxSize LayoutIndicators();
1.1.1.4 root 52: void DrawPerf(const Indicator *);
53: void DrawSCSI(const Indicator *);
1.1.1.8 root 54: void DrawVBlk(const Indicator *);
1.1.1.4 root 55: void DrawNet(const Indicator *);
1.1.1.5 root 56: void DrawFD(const Indicator *);
1.1.1.6 root 57: void DrawNewsLED1(const Indicator *);
58: void DrawNewsLED2(const Indicator *);
1.1.1.4 root 59: void DrawPower(const Indicator *);
60: void DrawTextLED(const Indicator *, Color fg, Color bg);
1.1.1.3 root 61: void DClickPerf(const Indicator *);
62: void ContextMenuCD(const Indicator *);
1.1.1.5 root 63: void ContextMenuFD(const Indicator *);
1.1 root 64:
1.1.1.7 root 65: // 状態
66: std::vector<Status*> stats {};
67:
1.1 root 68: // インジケータ情報
1.1.1.3 root 69: std::vector<Indicator*> indicators {};
1.1 root 70:
71: // インジケータ表示用
72: bool ispower {};
1.1.1.5 root 73: bool powerled {};
1.1.1.11! root 74: uint clock_khz {};
1.1.1.9 root 75: uint perf_mode {};
76: uint perf_rate {};
1.1.1.7 root 77: std::array<bool, 8> scsi_loaded {};
78: std::array<bool, 4> fd_loaded {};
1.1.1.6 root 79:
80: // 丸いアクセスマーク (X68k FD 用)
81: std::unique_ptr<BitmapI8> accmark /*{}*/;
1.1.1.5 root 82:
83: // 背景再描画
84: bool refresh_background {};
1.1 root 85:
1.1.1.7 root 86: PowerDevice *power {};
87: Syncer *syncer {};
88:
1.1 root 89: // タイマー
90: wxTimer timer {};
91:
92: // イベントテーブル
93: wxDECLARE_EVENT_TABLE();
1.1.1.5 root 94:
95: static const uint8 AccessMark12[];
96: static const uint8 AccessMark16[];
1.1.1.6 root 97: static const uint8 AccessMark24[];
1.1 root 98: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.