File tree Expand file tree Collapse file tree 6 files changed +64
-42
lines changed Expand file tree Collapse file tree 6 files changed +64
-42
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,6 +3,13 @@ name = "rs-wavelog-gate"
33version = " 0.1.0"
44edition = " 2024"
55
6+ [[bin ]]
7+ name = " rs-wavelog-gate"
8+ path = " src/main.rs"
9+
10+ [build-dependencies ]
11+ winres = " 0.1"
12+
613[dependencies ]
714config = " 0.15.8"
815serde = { version = " 1.0.128" , features = [" derive" ] }
Original file line number Diff line number Diff line change 1+ #[ cfg( windows) ]
2+ fn main ( ) {
3+ use std:: io:: Write ;
4+
5+ let mut res = winres:: WindowsResource :: new ( ) ;
6+
7+ // 设置应用程序信息
8+ res. set_version_info ( winres:: VersionInfo :: PRODUCTVERSION , 0x00010000 ) ;
9+ res. set_version_info ( winres:: VersionInfo :: FILEVERSION , 0x00010000 ) ;
10+
11+ // 设置图标(如果有的话)
12+ // res.set_icon("icon.ico");
13+
14+ // 编译资源
15+ if let Err ( e) = res. compile ( ) {
16+ eprintln ! ( "Warning: Failed to compile Windows resources: {}" , e) ;
17+ // 不要让构建失败,只是警告
18+ }
19+ }
20+
21+ #[ cfg( not( windows) ) ]
22+ fn main ( ) {
23+ // 在非Windows平台上什么都不做
24+ }
Original file line number Diff line number Diff line change 1+ #![ cfg_attr( not( debug_assertions) , windows_subsystem = "windows" ) ]
2+
13mod qso;
24mod settings;
35mod wavelog;
@@ -202,6 +204,12 @@ fn main() -> iced::Result {
202204 width : 600.0 ,
203205 height : 200.0 ,
204206 } ,
207+ min_size : Some ( iced:: Size {
208+ width : 400.0 ,
209+ height : 150.0 ,
210+ } ) ,
211+ resizable : true ,
212+ decorations : true ,
205213 ..Default :: default ( )
206214 } )
207215 . run_with ( RustWavelogGateApp :: new)
Original file line number Diff line number Diff line change @@ -22,18 +22,20 @@ impl UdpListener {
2222 let sock = UdpSocket :: bind ( & addr) . await
2323 . map_err ( |e| UdpListenerError :: BindError ( addr. clone ( ) , e) ) ?;
2424
25- let mut buf = [ 0 ; 1024 ] ;
25+ let mut buf = [ 0 ; 4096 ] ; // 增大缓冲区大小以处理更大的ADIF数据
2626
2727 loop {
2828 match sock. recv_from ( & mut buf) . await {
2929 Ok ( ( len, _src) ) => {
30- return Ok ( buf[ ..len] . to_vec ( ) ) ;
30+ if len > 0 {
31+ return Ok ( buf[ ..len] . to_vec ( ) ) ;
32+ }
3133 }
3234 Err ( e) => {
3335 // 记录错误但继续监听
3436 eprintln ! ( "UDP receive error: {}" , e) ;
3537 // 添加小延迟避免过度占用CPU
36- tokio:: time:: sleep ( Duration :: from_millis ( 10 ) ) . await ;
38+ tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . await ;
3739 }
3840 }
3941 }
You can’t perform that action at this time.
0 commit comments