--- nono/wx/wxstatuspanel.h 2026/04/29 17:05:12 1.1.1.5 +++ nono/wx/wxstatuspanel.h 2026/04/29 17:05:19 1.1.1.7 @@ -12,11 +12,12 @@ #include "wxtextpanel.h" #include "fdd.h" -#include "scsibus.h" #include class Indicator; -class HostNetDevice; +class PowerDevice; +class Syncer; +class Status; class WXStatusPanel; // インジケータ情報 (ほぼ構造体) @@ -36,27 +37,42 @@ class Indicator SCSI5, SCSI6, SCSI7, - LAN, + LAN0, + LAN1, FDD0, FDD1, FDD2, FDD3, + NEWSLED1, + NEWSLED2, }; protected: using dispfunc_t = void (WXStatusPanel::*)(const Indicator *); using eventfunc_t = void (WXStatusPanel::*)(const Indicator *); public: Indicator() { } - Indicator(int id_, int minlen_, dispfunc_t draw_) { + // 文字列の長さだけ指定する場合 + Indicator(int id_, dispfunc_t draw_, int minlen_, Status *stat_) { id = id_; - minlen = minlen_; draw = draw_; + stat = stat_; + minlen = minlen_; + } + // 文字列で指定する場合 + Indicator(int id_, dispfunc_t draw_, const std::string& text_, + Status *stat_) + : Indicator(id_, draw_, text_.length(), stat_) + { + text = text_; } virtual ~Indicator() = default; // インジケータ識別子 int id {}; + // 対応する状態 + Status *stat {}; + // 枠内の最小文字列長。 // 枠の大きさはこの文字列長と text.length() の長いほうで描画される。 int minlen {}; @@ -94,6 +110,7 @@ class Indicator class WXStatusPanel : public WXTextPanel { using inherited = WXTextPanel; + public: WXStatusPanel(wxWindow *parent); virtual ~WXStatusPanel() override; @@ -119,12 +136,17 @@ class WXStatusPanel : public WXTextPanel void DrawSCSI(const Indicator *); void DrawNet(const Indicator *); void DrawFD(const Indicator *); + void DrawNewsLED1(const Indicator *); + void DrawNewsLED2(const Indicator *); void DrawPower(const Indicator *); void DrawTextLED(const Indicator *, Color fg, Color bg); void DClickPerf(const Indicator *); void ContextMenuCD(const Indicator *); void ContextMenuFD(const Indicator *); + // 状態 + std::vector stats {}; + // インジケータ情報 std::vector indicators {}; @@ -133,27 +155,18 @@ class WXStatusPanel : public WXTextPanel bool powerled {}; int perf_mode {}; int perf_rate {}; - std::shared_ptr scsibus {}; - uint8 scsi_bsy {}; - bool scsi_out {}; - uint8 scsi_loaded {}; - enum { - NOT_AVAILABLE = -1, // 存在しない (Nereid なし X68k とか) - DISABLE = 0, // 存在してホスト側が無効 (driver = none) - ENABLE = 1, // 存在してホスト側が有効 - } net_ok {}; - HostNetDevice *hostnet {}; - uint64 net_tx_pkts {}; - uint64 net_rx_pkts {}; - bool net_tx_active {}; - bool net_rx_active {}; + std::array scsi_loaded {}; std::array fd_loaded {}; - std::array fd_access_led {}; - std::array fd_eject_led {}; + + // 丸いアクセスマーク (X68k FD 用) + std::unique_ptr accmark /*{}*/; // 背景再描画 bool refresh_background {}; + PowerDevice *power {}; + Syncer *syncer {}; + // タイマー wxTimer timer {}; @@ -162,6 +175,5 @@ class WXStatusPanel : public WXTextPanel static const uint8 AccessMark12[]; static const uint8 AccessMark16[]; + static const uint8 AccessMark24[]; }; - -extern WXStatusPanel *gStatusPanel;