HamBook – Diff between revs 26 and 27

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 26 Rev 27
Line 38... Line 38...
38 public partial class Form1 : Form 38 public partial class Form1 : Form
39 { 39 {
40 private ScheduledContinuation _changedConfigurationContinuation; 40 private ScheduledContinuation _changedConfigurationContinuation;
41 private ScheduledContinuation _squelchScheduledContinuation; 41 private ScheduledContinuation _squelchScheduledContinuation;
42 private ScheduledContinuation _powerScheduledContinuation; 42 private ScheduledContinuation _powerScheduledContinuation;
-   43 private ScheduledContinuation _vfoAScheduledContinuation;
-   44 private ReaderWriterLockSlim _vfoAReaderWriterLockSlim;
-   45 private ScheduledContinuation _vfoBScheduledContinuation;
-   46 private ReaderWriterLockSlim _vfoBReaderWriterLockSlim;
Line 43... Line 47...
43   47  
44 private Configuration.Configuration Configuration { get; set; } 48 private Configuration.Configuration Configuration { get; set; }
45 private SerialPortStream _serialPort; 49 private SerialPortStream _serialPort;
46 private LogMemorySink _memorySink; 50 private LogMemorySink _memorySink;
Line 74... Line 78...
74   78  
Line 75... Line 79...
75 _changedConfigurationContinuation = new ScheduledContinuation(); 79 _changedConfigurationContinuation = new ScheduledContinuation();
76   80  
-   81 _squelchScheduledContinuation = new ScheduledContinuation();
-   82 _powerScheduledContinuation = new ScheduledContinuation();
-   83 _vfoAScheduledContinuation = new ScheduledContinuation();
-   84 _vfoBScheduledContinuation = new ScheduledContinuation();
-   85  
Line 77... Line 86...
77 _squelchScheduledContinuation = new ScheduledContinuation(); 86 _vfoAReaderWriterLockSlim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
Line 78... Line 87...
78 _powerScheduledContinuation = new ScheduledContinuation(); 87 _vfoBReaderWriterLockSlim = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
79   88  
Line 430... Line 439...
430 MessageBox.Show(Resources.No_updates_available_at_this_time, Resources.HamBook, MessageBoxButtons.OK, 439 MessageBox.Show(Resources.No_updates_available_at_this_time, Resources.HamBook, MessageBoxButtons.OK,
431 MessageBoxIcon.Asterisk, 440 MessageBoxIcon.Asterisk,
432 MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false); 441 MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, false);
433 } 442 }
Line 434... Line -...
434   -  
435 private async void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) -  
436 { -  
437 var toolStripComboBox = (ToolStripComboBox)sender; -  
438 if(RadioMode.TryParse(toolStripComboBox.Text, out var radioMode)) -  
439 { -  
440 try -  
441 { -  
442 await _catAssemblies.CatSetAsync<RadioMode, bool>("MD", new object[] { radioMode }, _cancellationToken); -  
443 } -  
444 catch (Exception exception) -  
445 { -  
446 Log.Error(exception, Resources.Failed_to_set_radio_mode, radioMode); -  
447 } -  
448 } -  
449 } -  
450   443  
451 private async void onToolStripMenuItem_Click(object sender, EventArgs e) 444 private async void onToolStripMenuItem_Click(object sender, EventArgs e)
452 { 445 {
453 try 446 try
454 { 447 {
Line 470... Line 463...
470 { 463 {
471 Log.Error(exception, Resources.Failed_to_set_power_state); 464 Log.Error(exception, Resources.Failed_to_set_power_state);
472 } 465 }
473 } 466 }
Line 474... Line 467...
474   467  
475 private async void toolStripComboBox2_MouseWheel(object sender, MouseEventArgs e) 468 private void scrollableToolStripComboBox2_MouseWheel(object sender, MouseEventArgs e)
-   469 {
476 { 470 var toolStripComboBox = (ScrollableToolStripComboBox)sender;
477 using (var soundPlayer = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("HamBook.Effects.pot.wav"))) 471 if (int.TryParse(toolStripComboBox.Text, out var frequency))
478 { -  
479 var toolStripComboBox = (ScrollableToolStripComboBox)sender; 472 {
480 if (int.TryParse(toolStripComboBox.Text, out var frequency)) 473 switch (Math.Sign(e.Delta))
481 { -  
482 switch (Math.Sign(e.Delta)) -  
483 { 474 {
484 case -1: 475 case -1:
485 frequency = frequency - Configuration.Navigation.FrequencyStep; 476 frequency = frequency - Configuration.Navigation.FrequencyStep;
486 break; 477 break;
487 case 1: 478 case 1:
488 frequency = frequency + Configuration.Navigation.FrequencyStep; 479 frequency = frequency + Configuration.Navigation.FrequencyStep;
489 break; -  
490 } -  
491   -  
492 if (frequency < 0) -  
493 { -  
494 frequency = 0; -  
495 } -  
496   -  
497 soundPlayer.Play(); -  
498   -  
499 try -  
500 { -  
501 await _catAssemblies.CatSetAsync<int, bool>("FA", new object[] { frequency }, _cancellationToken); -  
502 toolStripComboBox.Text = $"{frequency}"; -  
503   -  
504 Log.Information($"{Resources.Set_VFO_A_frequency} {frequency}Hz"); -  
505 } -  
506 catch (Exception exception) -  
507 { -  
508 Log.Error(exception, Resources.Failed_to_set_VFO_A_frequency); -  
509 } 480 break;
510 } -  
511 } -  
Line 512... Line -...
512 } -  
513   -  
514 private async void scrollableToolStripComboBox1_MouseWheel(object sender, MouseEventArgs e) -  
515 { -  
516 using (var soundPlayer = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("HamBook.Effects.pot.wav"))) -  
517 { 481 }
518 var toolStripComboBox = (ScrollableToolStripComboBox)sender; 482  
519 if (int.TryParse(toolStripComboBox.Text, out var frequency)) -  
520 { -  
521 switch (Math.Sign(e.Delta)) -  
522 { -  
523 case -1: -  
524 frequency = frequency - Configuration.Navigation.FrequencyStep; -  
525 break; -  
526 case 1: -  
527 frequency = frequency + Configuration.Navigation.FrequencyStep; -  
528 break; -  
529 } -  
530   -  
531 if (frequency < 0) 483 if (frequency < 0)
532 { 484 {
533 frequency = 0; -  
534 } -  
Line -... Line 485...
-   485 frequency = 0;
535   486 }
536 soundPlayer.Play(); 487  
537   -  
538 try 488 if (!_vfoAReaderWriterLockSlim.TryEnterReadLock(250))
Line -... Line 489...
-   489 {
-   490 return;
539 { 491 }
540 await _catAssemblies.CatSetAsync<int, bool>("FB", new object[] { frequency }, _cancellationToken); 492  
-   493 try
-   494 {
541 toolStripComboBox.Text = $"{frequency}"; 495 toolStripComboBox.Value = $"{frequency}";
542   496 }
543 Log.Information($"{Resources.Set_VFO_B_frequency} {frequency}Hz"); 497 finally
544 } 498 {
545 catch (Exception exception) 499 if (_vfoAReaderWriterLockSlim.IsReadLockHeld)
546 { 500 {
547 Log.Error(exception, Resources.Failed_to_set_VFO_B_frequency); 501 _vfoAReaderWriterLockSlim.ExitReadLock();
Line 548... Line 502...
548 } 502 }
549 } 503 }
550 } 504 }
551 } 505 }
552   506  
553 private async void scrollableToolStripComboBox1_TextChanged(object sender, EventArgs e) 507 private async void scrollableToolStripComboBox2_SelectedIndexChanged(object sender, EventArgs e)
554 { 508 {
-   509 var toolStripComboBox = (ToolStripComboBox)sender;
-   510 if (int.TryParse(toolStripComboBox.Text, out var frequency))
555 var toolStripComboBox = (ToolStripComboBox)sender; 511 {
-   512 try
-   513 {
-   514 using (var soundPlayer = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("HamBook.Effects.pot.wav")))
556 if (int.TryParse(toolStripComboBox.Text, out var frequency)) 515 {
557 { 516 await _catAssemblies.CatSetAsync<int, bool>("FB", new object[] { frequency }, _cancellationToken);
558 try 517  
559 { 518 soundPlayer.Play();
560 await _catAssemblies.CatSetAsync<int, bool>("FA", new object[] { frequency }, _cancellationToken); 519 }
561 } 520 }
562 catch (Exception exception) 521 catch (Exception exception)
Line 563... Line 522...
563 { 522 {
564 Log.Error(exception, Resources.Failed_to_set_VFO_A_frequency); 523 Log.Error(exception, Resources.Failed_to_set_VFO_B_frequency);
565 } -  
566 } 524 }
567 } 525 }
-   526 }
-   527  
-   528 private void scrollableToolStripComboBox2_TextChanged(object sender, EventArgs e)
568   529 {
-   530 if (!_vfoAReaderWriterLockSlim.TryEnterReadLock(250))
-   531 {
-   532 return;
-   533 }
-   534  
569 private async void scrollableToolStripComboBox2_TextChanged(object sender, EventArgs e) 535 try
570 { 536 {
571 var toolStripComboBox = (ToolStripComboBox)sender; 537 var toolStripComboBox = (ScrollableToolStripComboBox)sender;
-   538 var frequency = toolStripComboBox.Text;
-   539  
-   540 _vfoAScheduledContinuation.Schedule(TimeSpan.FromSeconds(1), async () =>
572 if (int.TryParse(toolStripComboBox.Text, out var frequency)) 541 {
-   542 contextMenuStrip1.InvokeIfRequired(contextMenuStrip =>
-   543 {
-   544 toolStripComboBox.Value = $"{frequency}";
-   545 });
573 { 546  
574 try 547 }, _cancellationToken);
575 { 548 }
576 await _catAssemblies.CatSetAsync<int, bool>("FB", new object[] { frequency }, _cancellationToken); 549 finally
577 } 550 {
Line 578... Line 551...
578 catch (Exception exception) 551 if (_vfoAReaderWriterLockSlim.IsReadLockHeld)
Line 662... Line 635...
662 { 635 {
663 var fa = await _catAssemblies.CatReadAsync<int>("FA", new object[] { }, _cancellationToken); 636 var fa = await _catAssemblies.CatReadAsync<int>("FA", new object[] { }, _cancellationToken);
Line 664... Line 637...
664   637  
665 contextMenuStrip1.InvokeIfRequired(contextMenuStrip => 638 contextMenuStrip1.InvokeIfRequired(contextMenuStrip =>
666 { 639 {
Line 667... Line 640...
667 scrollableToolStripComboBox1.Text = $"{fa}"; 640 scrollableToolStripComboBox1.Value = $"{fa}";
Line 668... Line 641...
668   641  
669 }); 642 });
Line 678... Line 651...
678 { 651 {
679 var fb = await _catAssemblies.CatReadAsync<int>("FB", new object[] { }, _cancellationToken); 652 var fb = await _catAssemblies.CatReadAsync<int>("FB", new object[] { }, _cancellationToken);
Line 680... Line 653...
680   653  
681 contextMenuStrip1.InvokeIfRequired(contextMenuStrip => 654 contextMenuStrip1.InvokeIfRequired(contextMenuStrip =>
682 { 655 {
Line 683... Line 656...
683 scrollableToolStripComboBox2.Text = $"{fb}"; 656 scrollableToolStripComboBox2.Value = $"{fb}";
684   657  
685 }); 658 });
686 } 659 }
Line 888... Line 861...
888 { 861 {
889 Log.Error(exception, Resources.Error_while_cycling_text); 862 Log.Error(exception, Resources.Error_while_cycling_text);
890 } 863 }
891 } 864 }
Line 892... Line 865...
892   865  
893 private void scrollableToolStripComboBox5_MouseWheel(object sender, MouseEventArgs e) 866 private async void scrollableToolStripComboBox5_SelectedIndexChanged(object sender, EventArgs e)
894 { -  
895 var toolStripComboBox = (ScrollableToolStripComboBox)sender; 867 {
896 if (int.TryParse(toolStripComboBox.Text, out var memoryChannel)) 868 using (var soundPlayer = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("HamBook.Effects.pot.wav")))
-   869 {
897 { 870 var toolStripComboBox = (ToolStripComboBox)sender;
898 switch (Math.Sign(e.Delta)) 871 if (int.TryParse(toolStripComboBox.Text, out var channel))
899 { -  
900 case -1: 872 {
901 memoryChannel = memoryChannel - 1; -  
902 break; 873 if (_memoryChannelStore.TryGetValue(channel, out var memoryChannel))
903 case 1: -  
904 memoryChannel = memoryChannel + 1; 874 {
905 break; -  
906 } -  
907   -  
908   -  
909 if (memoryChannel < 0) 875 try
910 { -  
911 memoryChannel = 0; -  
912 } -  
913   876 {
Line 914... Line 877...
914 toolStripComboBox.Text = $"{memoryChannel}"; 877 await _catAssemblies.CatWriteAsync<int>("MC", new object[] { channel }, _cancellationToken);
915   -  
916 Log.Information($"{Resources.Set_VFO_A_frequency} {memoryChannel}"); -  
Line 917... Line -...
917 } -  
918 } -  
919   -  
920 private async void scrollableToolStripComboBox5_TextChanged(object sender, EventArgs e) 878  
921 { -  
922 var toolStripComboBox = (ToolStripComboBox)sender; -  
923 if (int.TryParse(toolStripComboBox.Text, out var channel)) -  
924 { -  
925 if (_memoryChannelStore.TryGetValue(channel, out var memoryChannel)) -  
926 { -  
Line 927... Line 879...
927 try 879 scrollableToolStripComboBox1.Text = $"{memoryChannel.Frequency}";
928 { 880  
929 await _catAssemblies.CatWriteAsync<int>("MC", new object[] { channel }, _cancellationToken); 881 toolStripMenuItem27.Text = memoryChannel.Text;
930   882  
931 toolStripMenuItem27.Text = memoryChannel.Text; 883 soundPlayer.Play();
-   884 }
932 } 885 catch (Exception exception)
933 catch (Exception exception) 886 {
934 { 887 Log.Error(exception, Resources.Failed_to_set_memory_channel);
935 Log.Error(exception, Resources.Failed_to_set_memory_channel); 888 }
Line 972... Line 925...
972 { 925 {
973 Log.Error(exception, Resources.Failed_tuning_current_frequency); 926 Log.Error(exception, Resources.Failed_tuning_current_frequency);
974 } 927 }
975 } 928 }
Line 976... Line -...
976   -  
977 private void scrollableToolStripComboBox7_MouseWheel(object sender, MouseEventArgs e) -  
978 { -  
979 var toolStripComboBox = (ScrollableToolStripComboBox)sender; -  
980   -  
981 contextMenuStrip1.InvokeIfRequired(async contextMenuStrip1 => -  
982 { -  
983 if (int.TryParse(toolStripComboBox.Text, out var amplification)) -  
984 { -  
985 switch (Math.Sign(e.Delta)) -  
986 { -  
987 case -1: -  
988 amplification = amplification - 1; -  
989 break; -  
990 case 1: -  
991 amplification = amplification + 1; -  
992 break; -  
993 } -  
994   -  
995 if (amplification < 0) -  
996 { -  
997 amplification = 0; -  
998 } -  
999   -  
1000 toolStripComboBox.Text = $"{amplification}"; -  
1001   -  
1002 Log.Information($"{Resources.Amplification_set} {amplification}W"); -  
1003 } -  
1004 }); -  
1005   -  
1006 } -  
1007   -  
1008 private void scrollableToolStripComboBox7_TextChanged(object sender, EventArgs e) -  
1009 { -  
1010 var toolStripComboBox = (ScrollableToolStripComboBox)sender; -  
1011   -  
1012 _powerScheduledContinuation.Schedule(TimeSpan.FromSeconds(1), () => -  
1013 { -  
1014 contextMenuStrip1.InvokeIfRequired(async contextMenuStrip1 => -  
1015 { -  
1016 if (int.TryParse(toolStripComboBox.Text, out var amplification)) -  
1017 { -  
1018   -  
1019 try -  
1020 { -  
1021 await _catAssemblies.CatWriteAsync<int>("PC", new object[] { amplification }, _cancellationToken); -  
1022   -  
1023 toolStripComboBox.Text = $"{amplification}"; -  
1024   -  
1025 Log.Information($"{Resources.Amplification_set} {amplification}W"); -  
1026 } -  
1027 catch (Exception exception) -  
1028 { -  
1029 Log.Error(exception, Resources.Failed_to_set_amplification); -  
1030 } -  
1031 } -  
1032 }); -  
1033 }, _cancellationToken); -  
1034 } -  
1035   929  
1036 private async void toolStripMenuItem22_CheckStateChanged(object sender, EventArgs e) 930 private async void toolStripMenuItem22_CheckStateChanged(object sender, EventArgs e)
1037 { 931 {
1038 var toolStripMenuItem = (ToolStripMenuItem)sender; 932 var toolStripMenuItem = (ToolStripMenuItem)sender;
1039 try 933 try
Line 1156... Line 1050...
1156 { 1050 {
1157 Log.Error(exception, Resources.Failed_to_read_squelch); 1051 Log.Error(exception, Resources.Failed_to_read_squelch);
1158 } 1052 }
1159 } 1053 }
Line 1160... Line 1054...
1160   1054  
1161 private void scrollableToolStripComboBox8_MouseWheel(object sender, MouseEventArgs e) 1055 private void scrollableToolStripComboBox1_MouseWheel(object sender, MouseEventArgs e)
1162 { 1056 {
-   1057 var toolStripComboBox = (ScrollableToolStripComboBox)sender;
-   1058 if (int.TryParse(toolStripComboBox.Text, out var frequency))
-   1059 {
-   1060 switch (Math.Sign(e.Delta))
-   1061 {
-   1062 case -1:
-   1063 frequency = frequency - Configuration.Navigation.FrequencyStep;
-   1064 break;
-   1065 case 1:
-   1066 frequency = frequency + Configuration.Navigation.FrequencyStep;
-   1067 break;
Line 1163... Line 1068...
1163 var toolStripComboBox = (ScrollableToolStripComboBox)sender; 1068 }
-   1069  
-   1070 if (frequency < 0)
-   1071 {
Line 1164... Line 1072...
1164   1072 frequency = 0;
1165 var value = _catAssemblies.CatGetDefault<int>("SQ", new object[] { }); 1073 }
1166   1074  
-   1075 if (!_vfoAReaderWriterLockSlim.TryEnterReadLock(250))
-   1076 {
-   1077 return;
1167 contextMenuStrip1.InvokeIfRequired(contextMenuStrip1 => 1078 }
1168 { 1079  
-   1080 try
-   1081 {
-   1082 toolStripComboBox.Value = $"{frequency}";
-   1083 }
1169 if (int.TryParse(toolStripComboBox.Text, out var squelch)) 1084 finally
1170 { -  
1171 switch (Math.Sign(e.Delta)) -  
1172 { -  
1173 case -1: -  
1174 squelch = squelch - value; 1085 {
1175 break; -  
1176 case 1: 1086 if (_vfoAReaderWriterLockSlim.IsReadLockHeld)
-   1087 {
-   1088 _vfoAReaderWriterLockSlim.ExitReadLock();
-   1089 }
Line -... Line 1090...
-   1090 }
-   1091 }
-   1092 }
-   1093  
-   1094 private async void scrollableToolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
1177 squelch = squelch + value; 1095 {
-   1096 var toolStripComboBox = (ToolStripComboBox)sender;
-   1097 if (int.TryParse(toolStripComboBox.Text, out var frequency))
1178 break; 1098 {
-   1099 try
1179 } 1100 {
1180   1101 using (var soundPlayer = new SoundPlayer(Assembly.GetExecutingAssembly().GetManifestResourceStream("HamBook.Effects.pot.wav")))
-   1102 {
-   1103 await _catAssemblies.CatSetAsync<int, bool>("FA", new object[] { frequency }, _cancellationToken);
-   1104 soundPlayer.Play();
-   1105 }
-   1106 }
-   1107 catch (Exception exception)
-   1108 {
Line -... Line 1109...
-   1109 Log.Error(exception, Resources.Failed_to_set_VFO_A_frequency);
-   1110 }
1181 if (squelch < 0) 1111 }
-   1112 }
-   1113  
-   1114 private void scrollableToolStripComboBox1_TextChanged(object sender, EventArgs e)
Line -... Line 1115...
-   1115 {
-   1116 if(!_vfoAReaderWriterLockSlim.TryEnterReadLock(250))
-   1117 {
-   1118 return;
-   1119 }
-   1120  
-   1121 try
-   1122 {
-   1123 var toolStripComboBox = (ScrollableToolStripComboBox)sender;
1182 { 1124 var frequency = toolStripComboBox.Text;
-   1125  
-   1126 _vfoAScheduledContinuation.Schedule(TimeSpan.FromSeconds(1), async () =>
-   1127 {
-   1128 contextMenuStrip1.InvokeIfRequired(contextMenuStrip =>
-   1129 {
-   1130 toolStripComboBox.Value = $"{frequency}";
-   1131 });
-   1132  
-   1133 }, _cancellationToken);
1183 squelch = 0; 1134 }
1184 } 1135 finally
1185   1136 {
Line 1186... Line 1137...
1186 toolStripComboBox.Text = $"{squelch}"; 1137 if (_vfoAReaderWriterLockSlim.IsReadLockHeld)
1187   1138 {
1188 Log.Information($"{Resources.Squelch_set} {squelch}"); 1139 _vfoAReaderWriterLockSlim.ExitReadLock();
Line 1189... Line 1140...
1189 } 1140 }
1190 }); 1141 }
Line 1205... Line 1156...
1205 { 1156 {
1206 await _catAssemblies.CatWriteAsync<int>("SQ", new object[] { squelch }, _cancellationToken); 1157 await _catAssemblies.CatWriteAsync<int>("SQ", new object[] { squelch }, _cancellationToken);
Line 1207... Line 1158...
1207   1158  
Line 1208... Line 1159...
1208 toolStripComboBox.Text = $"{squelch}"; 1159 toolStripComboBox.Text = $"{squelch}";
1209   1160  
1210 Log.Information($"{Resources.Squelch_set} {squelch}W"); 1161 Log.Information($"{Resources.Squelch_set} {squelch}");
1211 } 1162 }
1212 catch (Exception exception) 1163 catch (Exception exception)
1213 { 1164 {
1214 Log.Error(exception, Resources.Failed_to_set_squelch); 1165 Log.Error(exception, Resources.Failed_to_set_squelch);
1215 } 1166 }
1216 } 1167 }
1217 }); 1168 });
-   1169 }, _cancellationToken);
-   1170 }
-   1171  
-   1172 private async void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
-   1173 {
-   1174 var toolStripComboBox = (ToolStripComboBox)sender;
-   1175 if (RadioMode.TryParse(toolStripComboBox.Text, out var radioMode))
-   1176 {
-   1177 try
-   1178 {
-   1179 await _catAssemblies.CatSetAsync<RadioMode, bool>("MD", new object[] { radioMode }, _cancellationToken);
-   1180 }
-   1181 catch (Exception exception)
-   1182 {
-   1183 Log.Error(exception, Resources.Failed_to_set_radio_mode, radioMode);
-   1184 }
-   1185 }
-   1186 }
-   1187  
-   1188 private void scrollableToolStripComboBox7_SelectedIndexChanged(object sender, EventArgs e)
-   1189 {
-   1190 var toolStripComboBox = (ScrollableToolStripComboBox)sender;
-   1191  
-   1192 _powerScheduledContinuation.Schedule(TimeSpan.FromSeconds(1), () =>
-   1193 {
-   1194 contextMenuStrip1.InvokeIfRequired(async contextMenuStrip1 =>
-   1195 {
-   1196 if (int.TryParse(toolStripComboBox.Text, out var amplification))
-   1197 {
-   1198  
-   1199 try
-   1200 {
-   1201 await _catAssemblies.CatWriteAsync<int>("PC", new object[] { amplification }, _cancellationToken);
-   1202  
-   1203 toolStripComboBox.Text = $"{amplification}";
-   1204  
-   1205 Log.Information($"{Resources.Amplification_set} {amplification}W");
-   1206 }
-   1207 catch (Exception exception)
-   1208 {
-   1209 Log.Error(exception, Resources.Failed_to_set_amplification);
-   1210 }
-   1211 }
-   1212 });
-   1213 }, _cancellationToken);
1218 }, _cancellationToken); 1214 }
1219 } 1215