diff --git a/doc/architecture.pdf b/doc/architecture.pdf new file mode 100644 index 0000000..1a8cff0 Binary files /dev/null and b/doc/architecture.pdf differ diff --git a/doc/architecture_markdown.txt b/doc/architecture_markdown.txt new file mode 100644 index 0000000..c56adb5 --- /dev/null +++ b/doc/architecture_markdown.txt @@ -0,0 +1,94 @@ +graph TB + subgraph Application Layer + MW[MainWindow] + AC[ApplicationController] + end + + subgraph Server Layer + DS[DataServer] + subgraph Server Signals + DS_DATA[Data Signal] + DS_STATE[State Signal] + DS_ERROR[Error Signal] + end + end + + subgraph Component Controllers + FC[FilterController] + SC[SpectrumController] + WC[WaveformController] + end + + subgraph Views + FV[FilterWidget] + SV[SpectrumWidget] + WV[WaveformWidget] + end + + subgraph Models + FM[FilterModel] + SM[SpectrumModel] + WM[WaveformModel] + end + + %% 应用层连接 + MW -->|creates| AC + AC -->|manages| FC + AC -->|manages| SC + AC -->|manages| WC + + %% Server信号连接 + DS_DATA -->|new_data_received| FC + DS_DATA -->|new_data_received| SC + DS_DATA -->|new_data_received| WC + DS_STATE -->|channel_state_changed| AC + DS_ERROR -->|error_occurred| AC + + %% Server控制 + AC -->|start_channel| DS + AC -->|stop_channel| DS + AC -->|configure| DS + + %% 控制器与视图和模型的连接 + FC -->|creates/updates| FV + FC -->|manages| FM + SC -->|creates/updates| SV + SC -->|manages| SM + WC -->|creates/updates| WV + WC -->|manages| WM + + %% 组件间数据流 + FC -->|processed_data_ready| SC + FC -->|processed_data_ready| WC + + %% 视图信号 + FV -.->|filter_changed| FC + FV -.->|filter_enabled_changed| FC + SV -.->|display_changed| SC + WV -.->|display_changed| WC + + %% 控制器信号 + FC -.->|filter_state_changed| AC + FC -.->|params_updated| AC + SC -.->|spectrum_updated| AC + WC -.->|waveform_updated| AC + + %% 错误处理 + FC -.->|error_occurred| AC + SC -.->|error_occurred| AC + WC -.->|error_occurred| AC + AC -.->|error_occurred| MW + + classDef controller fill:#f9f,stroke:#333,stroke-width:2px; + classDef view fill:#bbf,stroke:#333,stroke-width:2px; + classDef model fill:#bfb,stroke:#333,stroke-width:2px; + classDef server fill:#fbb,stroke:#333,stroke-width:2px; + classDef signal fill:#ffb,stroke:#333,stroke-width:1px; + classDef app fill:#fff,stroke:#333,stroke-width:4px; + + class AC,FC,SC,WC controller; + class FV,SV,WV view; + class FM,SM,WM model; + class DS server; + class DS_DATA,DS_STATE,DS_ERROR signal; + class MW app; \ No newline at end of file