Skip to content

Commit

Permalink
refactor to remove mainForm where possible from subordinate forms
Browse files Browse the repository at this point in the history
  • Loading branch information
ghbyrkit committed Mar 2, 2023
1 parent d39594c commit 4ec0ce3
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 54 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="Kenwood TM742 Programmer.exe" version="1.6.0.125" publicKeyToken="f49a35439ee68522" language="neutral" processorArchitecture="msil" type="win32" />
<asmv1:assemblyIdentity name="Kenwood TM742 Programmer.exe" version="1.6.0.126" publicKeyToken="f49a35439ee68522" language="neutral" processorArchitecture="msil" type="win32" />
<description asmv2:iconFile="tm742.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
Expand Down Expand Up @@ -49,7 +49,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>pf1W1RA4QTbEMJAXhawSb5KGaAchWgxSetlBkMUsQ4Q=</dsig:DigestValue>
<dsig:DigestValue>6cVE5kXkghwce0E2+42BFRmSCy9L9z7NuN4B9JO0K5A=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -80,4 +80,4 @@
<dsig:DigestValue>gMuqX479vhVscjjcqEHyzYcE5kJhAk5eTJ/Ixt6DWKU=</dsig:DigestValue>
</hash>
</file>
<publisherIdentity name="CN=GHBLAPM771\ghbyrkit" issuerKeyHash="726f1c84525b0d51b50c961288b43ee26ad61ffb" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>UKKHoHUOnqBF1ocf1L/tUH0nqFE=</DigestValue></Reference></SignedInfo><SignatureValue>gLk9YKrnpJ68uwSyyluSl5ZVDiFFBlDM1ZPWFpYMw3rP02m2onbBSiyDQGhZJFdWd4yyF8P2PVTfamc2twXjxR2hzjOIoPd6F86/GIm8VwVU7u2zONU07zgk1YvETxhxqX0CdSd1FUUw7L2aeouB0yy8lh7WEBrr6h3WBqUXcfo=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>wl5tRcAEna5icbt2VKAFTp5CfBwEdRgxr5zsgRjxz24gFyP50Lzsemzja/ZMOIpf48Z7rK5ZdZ2H6mGS8l9IDQ18HHL4HdJitCMaZBYi7LGQXf7W6PwQ3laWdxuHno95zvTnTnclqmPKmN4jmaN/cX323VdiIeD6JovEYVPe+mE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="51a8277d50edbfd41f87d645a09e0e75a087a250" Description="" Url=""><as:assemblyIdentity name="Kenwood TM742 Programmer.exe" version="1.6.0.125" publicKeyToken="f49a35439ee68522" language="neutral" processorArchitecture="msil" type="win32" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=GHBLAPM771\ghbyrkit</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>eqirXQeG8pknFLm9uvdEypbO7b0=</DigestValue></Reference></SignedInfo><SignatureValue>MXtZar5SxmU06iZmaUuCqrYxAKxhdTdWXGdJsfq4hsleuY/OciZCWDdtl2dQ8Y+KYafKeI1hlpwvavY1mt+px53aHsbOy1BVD+aMVB8mHHaMjYZotq1HeL+SbdgEstJOz1n78DC6So2ohfjoZGNaQHxCALnYCR4rqKXD0lut3Z0=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>wl5tRcAEna5icbt2VKAFTp5CfBwEdRgxr5zsgRjxz24gFyP50Lzsemzja/ZMOIpf48Z7rK5ZdZ2H6mGS8l9IDQ18HHL4HdJitCMaZBYi7LGQXf7W6PwQ3laWdxuHno95zvTnTnclqmPKmN4jmaN/cX323VdiIeD6JovEYVPe+mE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIB5TCCAU6gAwIBAgIQHisA3e3WmJlAwmulLSF29DANBgkqhkiG9w0BAQUFADAxMS8wLQYDVQQDHiYARwBIAEIATABBAFAATQA3ADcAMQBcAGcAaABiAHkAcgBrAGkAdDAeFw0yMjA5MTkxODQwMDFaFw0yMzA5MjAwMDQwMDFaMDExLzAtBgNVBAMeJgBHAEgAQgBMAEEAUABNADcANwAxAFwAZwBoAGIAeQByAGsAaQB0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCXm1FwASdrmJxu3ZUoAVOnkJ8HAR1GDGvnOyBGPHPbiAXI/nQvOx6bONr9kw4il/jxnusrll1nYfqYZLyX0gNDXwccvgd0mK0IxpkFiLssZBd/tbo/BDeVpZ3G4eej3nO9OdOdyWqY8qY3iOZo39xffbdV2Ih4Pomi8RhU976YQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADatcAUKSQSzFYSH1hyYbERVSZ9oFEIPmZYThlYWcW0UJ5hhBWLH/LvbVo5dE7XzJiAvY2BJgzHWREbAzOKZn9K+F++2Oek4bwJ2nYY+BU3Vj2rPGVYgC9Tz3UuTBfP+Vc2fmmRpe7Ov7OFG5lGpONUj4V7eba+EjYcHTMzivYE4</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
<publisherIdentity name="CN=GHBLAPM771\ghbyrkit" issuerKeyHash="726f1c84525b0d51b50c961288b43ee26ad61ffb" /><Signature Id="StrongNameSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>jpli9SuvAToBypglww/kZJAlY0c=</DigestValue></Reference></SignedInfo><SignatureValue>wk6y1VI1tS4/vXJMhJio/4/ezgllEdRulS5w9IaCY/woO/K/4GG7j86rOu3iFpIuw+BBcdZ+zDnSKEF/2OHcW4G/mStK5xsokK/C1SpqMkIAnNysuT5JmZkALOzJ0O7Rsl4HOBt6yZLAg9f1Jo5r6YgbzJCpVnPaL3u8WKSs47s=</SignatureValue><KeyInfo Id="StrongNameKeyInfo"><KeyValue><RSAKeyValue><Modulus>wl5tRcAEna5icbt2VKAFTp5CfBwEdRgxr5zsgRjxz24gFyP50Lzsemzja/ZMOIpf48Z7rK5ZdZ2H6mGS8l9IDQ18HHL4HdJitCMaZBYi7LGQXf7W6PwQ3laWdxuHno95zvTnTnclqmPKmN4jmaN/cX323VdiIeD6JovEYVPe+mE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><msrel:RelData xmlns:msrel="http://schemas.microsoft.com/windows/rel/2005/reldata"><r:license xmlns:r="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:as="http://schemas.microsoft.com/windows/pki/2005/Authenticode"><r:grant><as:ManifestInformation Hash="4763259064e40fc32598ca013a01af2bf562998e" Description="" Url=""><as:assemblyIdentity name="Kenwood TM742 Programmer.exe" version="1.6.0.126" publicKeyToken="f49a35439ee68522" language="neutral" processorArchitecture="msil" type="win32" /></as:ManifestInformation><as:SignedBy /><as:AuthenticodePublisher><as:X509SubjectName>CN=GHBLAPM771\ghbyrkit</as:X509SubjectName></as:AuthenticodePublisher></r:grant><r:issuer><Signature Id="AuthenticodeSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>t/ZvXwVUxiz/6nCU8nf6yLgxXPI=</DigestValue></Reference></SignedInfo><SignatureValue>Ded5iQGjla9c6N7ZDPRWTTxdY7/W0n8OeNghS8V8Kh+IZhBdwStEfObo+qGNxpPNqNw4bmzNLDyThNzbtWPQ9AbNeoaRHhJlkXz3kW0kqqkIXynHo0sa/jZl6xXeDW9IcbKTZHrGEpNU/P4mIrJdoADHpQtcbSxs9tUsYnKCFg8=</SignatureValue><KeyInfo><KeyValue><RSAKeyValue><Modulus>wl5tRcAEna5icbt2VKAFTp5CfBwEdRgxr5zsgRjxz24gFyP50Lzsemzja/ZMOIpf48Z7rK5ZdZ2H6mGS8l9IDQ18HHL4HdJitCMaZBYi7LGQXf7W6PwQ3laWdxuHno95zvTnTnclqmPKmN4jmaN/cX323VdiIeD6JovEYVPe+mE=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue><X509Data><X509Certificate>MIIB5TCCAU6gAwIBAgIQHisA3e3WmJlAwmulLSF29DANBgkqhkiG9w0BAQUFADAxMS8wLQYDVQQDHiYARwBIAEIATABBAFAATQA3ADcAMQBcAGcAaABiAHkAcgBrAGkAdDAeFw0yMjA5MTkxODQwMDFaFw0yMzA5MjAwMDQwMDFaMDExLzAtBgNVBAMeJgBHAEgAQgBMAEEAUABNADcANwAxAFwAZwBoAGIAeQByAGsAaQB0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCXm1FwASdrmJxu3ZUoAVOnkJ8HAR1GDGvnOyBGPHPbiAXI/nQvOx6bONr9kw4il/jxnusrll1nYfqYZLyX0gNDXwccvgd0mK0IxpkFiLssZBd/tbo/BDeVpZ3G4eej3nO9OdOdyWqY8qY3iOZo39xffbdV2Ih4Pomi8RhU976YQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADatcAUKSQSzFYSH1hyYbERVSZ9oFEIPmZYThlYWcW0UJ5hhBWLH/LvbVo5dE7XzJiAvY2BJgzHWREbAzOKZn9K+F++2Oek4bwJ2nYY+BU3Vj2rPGVYgC9Tz3UuTBfP+Vc2fmmRpe7Ov7OFG5lGpONUj4V7eba+EjYcHTMzivYE4</X509Certificate></X509Data></KeyInfo></Signature></r:issuer></r:license></msrel:RelData></KeyInfo></Signature></asmv1:assembly>
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public ChannelListForm(MainForm mainForm)

private string recvdData = "";
private bool stopProgrammingRequested;

public bool DEBUG = false;
private const int NORMAL_RADIO_TIMING = 100; // 80;
private const int SLOW_RADIO_TIMING = 250;
private const int DEBUG_RADIO_TIMING = 500;

private readonly MainForm mainForm = null;
private readonly RadioConfig radioConfig = null;

Expand All @@ -56,19 +58,19 @@ public bool initializeForm()
utm = UTModule.findBestModule(mainForm.module1SelectorControl.GetCurrentModuleName(),
radioConfig.EType ? UTModule.BandPlanOption.EUROPEAN_BAND_PLAN : UTModule.BandPlanOption.NORTHAMERICAN_BAND_PLAN,
radioConfig.WideBand ? UTModule.WidebandOption.WIDEBAND : UTModule.WidebandOption.NORMAL);
moduleLayoutPanelTab1.initializeTab(mainForm, 0, this, utm, mainForm.module1SelectorControl, mainForm.radioConfig.getTab1StepSize());
moduleLayoutPanelTab1.initializeTab(radioConfig, 0, this, utm, mainForm.module1SelectorControl, radioConfig.getTab1StepSize());

// tab index 1, number 2
utm = UTModule.findBestModule(mainForm.module2SelectorControl.GetCurrentModuleName(),
radioConfig.EType ? UTModule.BandPlanOption.EUROPEAN_BAND_PLAN : UTModule.BandPlanOption.NORTHAMERICAN_BAND_PLAN,
radioConfig.WideBand ? UTModule.WidebandOption.WIDEBAND : UTModule.WidebandOption.NORMAL);
moduleLayoutPanelTab2.initializeTab(mainForm, 1, this, utm, mainForm.module2SelectorControl, mainForm.radioConfig.getTab2StepSize());
moduleLayoutPanelTab2.initializeTab(radioConfig, 1, this, utm, mainForm.module2SelectorControl, radioConfig.getTab2StepSize());

// tab index 2, number 3
utm = UTModule.findBestModule(mainForm.module3SelectorControl.GetCurrentModuleName(),
radioConfig.EType ? UTModule.BandPlanOption.EUROPEAN_BAND_PLAN : UTModule.BandPlanOption.NORTHAMERICAN_BAND_PLAN,
radioConfig.WideBand ? UTModule.WidebandOption.WIDEBAND : UTModule.WidebandOption.NORMAL);
moduleLayoutPanelTab3.initializeTab(mainForm, 2, this, utm, mainForm.module3SelectorControl, mainForm.radioConfig.getTab3StepSize());
moduleLayoutPanelTab3.initializeTab(radioConfig, 2, this, utm, mainForm.module3SelectorControl, radioConfig.getTab3StepSize());

ToolStripStatusLabel.Text = "";

Expand Down Expand Up @@ -101,7 +103,7 @@ private bool openSerialPort(TextBox ComPortTextBox)
bool tryDefaultPort = false;
try
{
string portString = mainForm.radioConfig.getUsbPortName();
string portString = radioConfig.getUsbPortName();
SerialPort1.PortName = portString;
SerialPort1.Open();
Sleep(3000L);
Expand All @@ -117,7 +119,7 @@ private bool openSerialPort(TextBox ComPortTextBox)
bool testMsg = SendString(" ");
if (testMsg)
{
string message = String.Format("Found Arduino on on COM port: {0}", mainForm.radioConfig.getUsbPortNumber());
string message = String.Format("Found Arduino on on COM port: {0}", radioConfig.getUsbPortNumber());
MessageBox.Show(message);
return true;
}
Expand Down Expand Up @@ -154,7 +156,7 @@ private bool openSerialPort(TextBox ComPortTextBox)
message += Convert.ToString(x);
MessageBox.Show(message);

mainForm.radioConfig.UpdateUSBComPort(x);
radioConfig.UpdateUSBComPort(x);

ComPortTextBox.Visible = false;

Expand Down Expand Up @@ -213,7 +215,7 @@ public int getRepeaterIncrement(string str)
public int getCtcssModeIndex(string str)
{
int count = 0;
if (mainForm.Tsu7CheckBox.Checked)
if (radioConfig.Tsu7Installed)
{
CTCSSModeList_NumElementsToUse = 3;
}
Expand Down Expand Up @@ -387,11 +389,11 @@ private void ProgramBandModule( ModuleSelectorControl moduleSelectorControl, Mod

Timer1.Enabled = true;

if (mainForm.normalRadioTimingButton.Checked)
if (radioConfig.TimingMode == 0)
{
toneAndButtonOnTime = NORMAL_RADIO_TIMING;
}
else if (mainForm.slowRadioTimingButton.Checked)
else if (radioConfig.TimingMode == 1)
{
toneAndButtonOnTime = SLOW_RADIO_TIMING;
}
Expand Down Expand Up @@ -453,12 +455,12 @@ private void ProgramBandModule( ModuleSelectorControl moduleSelectorControl, Mod

SendString("A"); // ENTER key. See page 61 of User Manual.

if (mainForm.wideBandCheckBox.Checked && TabControl.SelectedTab.Text.Contains("1200"))
if (radioConfig.WideBand && TabControl.SelectedTab.Text.Contains("1200"))
{
SendString(Conversions.ToString(mhzVal[mhzVal.Length - 3])); // hundreds of MHz
}

if (mainForm.wideBandCheckBox.Checked
if (radioConfig.WideBand
|| !TabControl.SelectedTab.Text.Contains("e")
|| TabControl.SelectedTab.Text.Contains("1200")
|| TabControl.SelectedTab.Text.Contains("2400"))
Expand All @@ -476,13 +478,13 @@ private void ProgramBandModule( ModuleSelectorControl moduleSelectorControl, Mod
freqCharIndex++;
}

if (mainForm.AROcheckBox.Checked)
if (radioConfig.ARO)
{
// only the UT144 and UT220 have 'Automatic Receiver Offset' feature, it seems
if (moduleIsUT144)
{
// it's a 2m module
if (!mainForm.eTypeRadioCheckBox.Checked)
if (!radioConfig.EType)
{
// USA band plan for 2m, based on 'Type E' check box being not checked
if (decFrequency < 145.1m)
Expand Down Expand Up @@ -543,7 +545,7 @@ private void ProgramBandModule( ModuleSelectorControl moduleSelectorControl, Mod
}
}
}
else if (moduleIsUT220 && !mainForm.eTypeRadioCheckBox.Checked)
else if (moduleIsUT220 && !radioConfig.EType)
{
// it's a 220 MHz module. Cannot be used in an 'e-type' radio (not legal in Europe)
if (decFrequency < 223.92m)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ private void ShowChannelLists()

channelListsForm.initializeForm();

channelListsForm.moduleLayoutPanelTab3.initTabPage(this, module3SelectorControl);
channelListsForm.moduleLayoutPanelTab3.initTabPage(radioConfig, module3SelectorControl);

channelListsForm.moduleLayoutPanelTab2.initTabPage(this, module2SelectorControl);
channelListsForm.moduleLayoutPanelTab2.initTabPage(radioConfig, module2SelectorControl);

channelListsForm.moduleLayoutPanelTab1.initTabPage(this, module1SelectorControl);
channelListsForm.moduleLayoutPanelTab1.initTabPage(radioConfig, module1SelectorControl);

// end initialize all tab pages

Expand Down
Loading

0 comments on commit 4ec0ce3

Please sign in to comment.