HamBook – Diff between revs 38 and 39
?pathlinks?
Rev 38 | Rev 39 | |||
---|---|---|---|---|
Line 63... | Line 63... | |||
63 | private MemoryChannel _tickerTextMemoryChannel; |
63 | private MemoryChannel _tickerTextMemoryChannel; |
|
64 | private Task _tickerTask; |
64 | private Task _tickerTask; |
|
65 | private volatile bool _tickerTaskRunning; |
65 | private volatile bool _tickerTaskRunning; |
|
Line 66... | Line 66... | |||
66 | |
66 | |
|
- | 67 | private ConcurrentDictionary<int, MemoryChannel> _memoryChannelStore = new ConcurrentDictionary<int, MemoryChannel>(); |
||
Line 67... | Line 68... | |||
67 | private ConcurrentDictionary<int, MemoryChannel> _memoryChannelStore = new ConcurrentDictionary<int, MemoryChannel>(); |
68 | private MemoryTune _memoryTune; |
|
Line 68... | Line 69... | |||
68 | |
69 | |
|
69 | public bool MemorySinkEnabled { get; set; } |
70 | public bool MemorySinkEnabled { get; set; } |
|
Line 200... | Line 201... | |||
200 | |
201 | |
|
201 | private async void quitToolStripMenuItem_Click(object sender, EventArgs e) |
202 | private async void quitToolStripMenuItem_Click(object sender, EventArgs e) |
|
202 | { |
203 | { |
|
203 | if(_bandScan != null) |
204 | if(_bandScan != null) |
|
204 | { |
205 | { |
|
205 | await _bandScan.Stop(); |
206 | _bandScan.Stop(); |
|
206 | _bandScan = null; |
207 | _bandScan = null; |
|
Line -... | Line 208... | |||
- | 208 | } |
||
- | 209 | |
||
- | 210 | if (_memoryTune != null) |
||
- | 211 | { |
||
- | 212 | _memoryTune.Stop(); |
||
- | 213 | _memoryTune = null; |
||
207 | } |
214 | } |
|
208 | |
215 | |
|
Line 209... | Line 216... | |||
209 | // Save configuration on quit. |
216 | // Save configuration on quit. |
|
210 | await SaveConfiguration(); |
217 | await SaveConfiguration(); |
|
Line 285... | Line 292... | |||
285 | async () => { |
292 | async () => { |
|
286 | await SaveConfiguration(); |
293 | await SaveConfiguration(); |
|
Line 287... | Line 294... | |||
287 | |
294 | |
|
288 | if(_bandScan != null) |
295 | if(_bandScan != null) |
|
289 | { |
296 | { |
|
290 | await _bandScan.Stop(); |
297 | _bandScan.Stop(); |
|
291 | _bandScan = null; |
298 | _bandScan = null; |
|
Line -... | Line 299... | |||
- | 299 | } |
||
- | 300 | |
||
- | 301 | if (_memoryTune != null) |
||
- | 302 | { |
||
- | 303 | _memoryTune.Stop(); |
||
Line 292... | Line 304... | |||
292 | } |
304 | _memoryTune = null; |
|
Line 293... | Line 305... | |||
293 | |
305 | } |
|
Line 527... | Line 539... | |||
527 | } |
539 | } |
|
528 | break; |
540 | break; |
|
529 | } |
541 | } |
|
530 | } |
542 | } |
|
Line 531... | Line 543... | |||
531 | |
543 | |
|
532 | private async void toolStripMenuItem1_Click(object sender, EventArgs e) |
544 | private void toolStripMenuItem1_Click(object sender, EventArgs e) |
|
533 | { |
545 | { |
|
534 | if (_bandScan == null) |
546 | if (_bandScan == null) |
|
535 | { |
547 | { |
|
536 | return; |
548 | return; |
|
Line 537... | Line 549... | |||
537 | } |
549 | } |
|
538 | |
550 | |
|
539 | await _bandScan.Stop(); |
551 | _bandScan.Stop(); |
|
Line -... | Line 552... | |||
- | 552 | _bandScan = null; |
||
- | 553 | } |
||
- | 554 | |
||
- | 555 | private void toolStripMenuItem38_Click(object sender, EventArgs e) |
||
- | 556 | { |
||
- | 557 | if (_memoryTune != null) |
||
- | 558 | { |
||
- | 559 | _memoryTune.Stop(); |
||
- | 560 | _memoryTune = null; |
||
- | 561 | } |
||
- | 562 | |
||
- | 563 | _memoryTune = new MemoryTune(_catAssemblies, _serialPort, Configuration); |
||
- | 564 | _memoryTune.Start(); |
||
- | 565 | } |
||
- | 566 | |
||
- | 567 | private void stopToolStripMenuItem_Click(object sender, EventArgs e) |
||
- | 568 | { |
||
- | 569 | if (_memoryTune == null) |
||
- | 570 | { |
||
- | 571 | return; |
||
- | 572 | } |
||
- | 573 | |
||
- | 574 | _memoryTune.Stop(); |
||
540 | _bandScan = null; |
575 | _memoryTune = null; |
|
541 | } |
576 | } |
|
542 | |
577 | |
|
543 | private async void scanToolStripMenuItem_Click(object sender, EventArgs e) |
578 | private void scanToolStripMenuItem_Click(object sender, EventArgs e) |
|
544 | { |
579 | { |
|
545 | if (!(sender is ToolStripMenuItem toolStripMenuItem) || |
580 | if (!(sender is ToolStripMenuItem toolStripMenuItem) || |
|
Line 568... | Line 603... | |||
568 | return; |
603 | return; |
|
569 | } |
604 | } |
|
Line 570... | Line 605... | |||
570 | |
605 | |
|
571 | if (_bandScan != null) |
606 | if (_bandScan != null) |
|
572 | { |
607 | { |
|
573 | await _bandScan.Stop(); |
608 | _bandScan.Stop(); |
|
574 | _bandScan = null; |
609 | _bandScan = null; |
|
Line 575... | Line 610... | |||
575 | } |
610 | } |
|
Line 970... | Line 1005... | |||
970 | |
1005 | |
|
971 | private async void toolStripMenuItem24_Click(object sender, EventArgs e) |
1006 | private async void toolStripMenuItem24_Click(object sender, EventArgs e) |
|
972 | { |
1007 | { |
|
973 | try |
1008 | try |
|
- | 1009 | { |
||
- | 1010 | await _catAssemblies.CatWriteAsync<TunerState>("AC", new object[] { TunerState.TUNER_ON }, _cancellationToken); |
||
- | 1011 | |
||
- | 1012 | do |
||
- | 1013 | { |
||
- | 1014 | await Task.Delay(TimeSpan.FromSeconds(1), _cancellationToken); |
||
- | 1015 | |
||
- | 1016 | try |
||
- | 1017 | { |
||
- | 1018 | var tuneState = await _catAssemblies.CatReadAsync<TunerState>("AC", new object[] { }, _cancellationToken); |
||
- | 1019 | |
||
- | 1020 | if (tuneState == TunerState.TUNER_ON) |
||
- | 1021 | { |
||
- | 1022 | break; |
||
- | 1023 | } |
||
- | 1024 | } |
||
- | 1025 | catch (Exception) |
||
- | 1026 | { |
||
- | 1027 | // retry |
||
- | 1028 | } |
||
- | 1029 | |
||
- | 1030 | } while (!_cancellationToken.IsCancellationRequested); |
||
974 | { |
1031 | |
|
975 | await _catAssemblies.CatWriteAsync<TunerState>("AC", new object[] { TunerState.TUNING_START }, _cancellationToken); |
1032 | await _catAssemblies.CatWriteAsync<TunerState>("AC", new object[] { TunerState.TUNING_START }, _cancellationToken); |
|
976 | } |
1033 | } |
|
977 | catch(Exception exception) |
1034 | catch(Exception exception) |
|
978 | { |
- | ||
- | 1035 | { |
||
979 | |
1036 | Log.Error(exception, Resources.Could_not_start_tuning); |
|
980 | } |
1037 | } |
|
Line 981... | Line 1038... | |||
981 | } |
1038 | } |
|
982 | |
1039 | |
|
Line 1033... | Line 1090... | |||
1033 | Log.Error(exception, Resources.Failed_to_read_IPO); |
1090 | Log.Error(exception, Resources.Failed_to_read_IPO); |
|
1034 | } |
1091 | } |
|
1035 | }, _cancellationToken); |
1092 | }, _cancellationToken); |
|
1036 | } |
1093 | } |
|
Line 1037... | Line -... | |||
1037 | |
- | ||
1038 | private async void toolStripMenuItem19_DropDownOpening(object sender, EventArgs e) |
- | ||
1039 | { |
- | ||
1040 | |
- | ||
1041 | } |
- | ||
1042 | |
1094 | |
|
1043 | private async void scrollableToolStripComboBox1_MouseWheel(object sender, MouseEventArgs e) |
1095 | private async void scrollableToolStripComboBox1_MouseWheel(object sender, MouseEventArgs e) |
|
1044 | { |
1096 | { |
|
1045 | var toolStripComboBox = (ScrollableToolStripComboBox)sender; |
1097 | var toolStripComboBox = (ScrollableToolStripComboBox)sender; |
|
1046 | if (int.TryParse(toolStripComboBox.Text, out var frequency)) |
1098 | if (int.TryParse(toolStripComboBox.Text, out var frequency)) |
|
Line 1209... | Line 1261... | |||
1209 | } |
1261 | } |
|
1210 | break; |
1262 | break; |
|
1211 | } |
1263 | } |
|
1212 | } |
1264 | } |
|
Line 1213... | Line 1265... | |||
1213 | |
1265 | |
|
1214 | private async void toolStripMenuItem30_Click(object sender, EventArgs e) |
1266 | private void toolStripMenuItem30_Click(object sender, EventArgs e) |
|
1215 | { |
1267 | { |
|
1216 | if (!int.TryParse(scrollableToolStripComboBox9.Text, out var start) |
1268 | if (!int.TryParse(scrollableToolStripComboBox9.Text, out var start) |
|
1217 | || !int.TryParse(scrollableToolStripComboBox10.Text, out var stop)) |
1269 | || !int.TryParse(scrollableToolStripComboBox10.Text, out var stop)) |
|
1218 | { |
1270 | { |
|
Line 1234... | Line 1286... | |||
1234 | scanDetectPause = 10; |
1286 | scanDetectPause = 10; |
|
1235 | } |
1287 | } |
|
Line 1236... | Line 1288... | |||
1236 | |
1288 | |
|
1237 | if (_bandScan != null) |
1289 | if (_bandScan != null) |
|
1238 | { |
1290 | { |
|
1239 | await _bandScan.Stop(); |
1291 | _bandScan.Stop(); |
|
1240 | _bandScan = null; |
1292 | _bandScan = null; |
|
Line 1241... | Line 1293... | |||
1241 | } |
1293 | } |