Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
771-8bit committed Dec 28, 2022
1 parent f68e00a commit f5511ee
Show file tree
Hide file tree
Showing 8 changed files with 458 additions and 65 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -365,5 +365,6 @@ FodyWeavers.xsd
*.drawio
secret.txt
SocialPreview.png
version.txt

SetupSerialMonitorEssential/
57 changes: 57 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="SerialMonitorEssential.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<SerialMonitorEssential.Properties.Settings>
<setting name="setting_BaudRate" serializeAs="String">
<value>5</value>
</setting>
<setting name="setting_Handshake" serializeAs="String">
<value>0</value>
</setting>
<setting name="setting_Enter" serializeAs="String">
<value>True</value>
</setting>
<setting name="setting_reconnect" serializeAs="String">
<value>False</value>
</setting>
<setting name="setting_timestamp" serializeAs="String">
<value>True</value>
</setting>
<setting name="setting_autoScroll" serializeAs="String">
<value>True</value>
</setting>
<setting name="setting_timestamp_string" serializeAs="String">
<value>0</value>
</setting>
<setting name="setting_NULL" serializeAs="String">
<value>False</value>
</setting>
<setting name="setting_CRLF" serializeAs="String">
<value>False</value>
</setting>
<setting name="setting_StopBits" serializeAs="String">
<value>0</value>
</setting>
<setting name="setting_DataBits" serializeAs="String">
<value>1</value>
</setting>
<setting name="setting_Parity" serializeAs="String">
<value>0</value>
</setting>
<setting name="setting_RtsEnable" serializeAs="String">
<value>False</value>
</setting>
<setting name="setting_DtrEnable" serializeAs="String">
<value>True</value>
</setting>
<setting name="setting_Wrap" serializeAs="String">
<value>False</value>
</setting>
<setting name="setting_sendCRLF" serializeAs="String">
<value>0</value>
</setting>
</SerialMonitorEssential.Properties.Settings>
</userSettings>
</configuration>
78 changes: 53 additions & 25 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 60 additions & 13 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,38 @@ private void Form1_Load(object sender, EventArgs e)

setEnabled(true);
}


private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
//https://dobon.net/vb/dotnet/programing/mysettings.html
Properties.Settings.Default.setting_BaudRate= cmbBaudRate.SelectedIndex;
Properties.Settings.Default.setting_Handshake = cmbHandshake.SelectedIndex;
Properties.Settings.Default.setting_Enter = checkEnter.Checked;
Properties.Settings.Default.setting_reconnect = reconnect.Checked;
Properties.Settings.Default.setting_timestamp = check_timestamp.Checked;
Properties.Settings.Default.setting_autoScroll = autoScroll.Checked;
Properties.Settings.Default.setting_timestamp_string = cmbTimestamp.SelectedIndex;
Properties.Settings.Default.setting_NULL=checkNULL.Checked;
Properties.Settings.Default.setting_CRLF = checkCRLF.Checked;
Properties.Settings.Default.setting_StopBits=cmbStopBits.SelectedIndex;
Properties.Settings.Default.setting_DataBits=cmbDataBits.SelectedIndex;
Properties.Settings.Default.setting_Parity=cmbParity.SelectedIndex;
Properties.Settings.Default.setting_RtsEnable=checkRtsEnable.Checked;
Properties.Settings.Default.setting_DtrEnable=checkDtrEnable.Checked;
Properties.Settings.Default.setting_Wrap=checkWrap.Checked;
Properties.Settings.Default.setting_sendCRLF = cmbCRLF.SelectedIndex;

Properties.Settings.Default.Save();

}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
if (serialPort1.IsOpen)
{
serialPort1.Close();
}
}

private void connectButton_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
Expand Down Expand Up @@ -357,21 +380,44 @@ private void timerReconnect_Tick(object sender, EventArgs e)
}

}
private void initSettings() {
checkDtrEnable.Checked = true;
checkRtsEnable.Checked = false;

private void initSettings() {
//https://learn.microsoft.com/ja-jp/dotnet/api/system.io.ports.serialport?view=dotnet-plat-ext-7.0
cmbDataBits.SelectedIndex= 1;//8bit
cmbParity.SelectedIndex = 0;//None
cmbStopBits.SelectedIndex = 0;//one
cmbHandshake.SelectedIndex = 0;//none
cmbBaudRate.SelectedIndex = Properties.Settings.Default.setting_BaudRate;
cmbDataBits.SelectedIndex = Properties.Settings.Default.setting_DataBits;
cmbParity.SelectedIndex = Properties.Settings.Default.setting_Parity;
checkRtsEnable.Checked = Properties.Settings.Default.setting_RtsEnable;
checkDtrEnable.Checked = Properties.Settings.Default.setting_DtrEnable;
cmbStopBits.SelectedIndex = Properties.Settings.Default.setting_StopBits;
cmbHandshake.SelectedIndex = Properties.Settings.Default.setting_Handshake;

reconnect.Checked = Properties.Settings.Default.setting_reconnect;

cmbCRLF.SelectedIndex = Properties.Settings.Default.setting_sendCRLF;
checkEnter.Checked= Properties.Settings.Default.setting_Enter;

checkWrap.Checked = Properties.Settings.Default.setting_Wrap;
checkCRLF.Checked = Properties.Settings.Default.setting_CRLF;
checkNULL.Checked = Properties.Settings.Default.setting_NULL;
autoScroll.Checked = Properties.Settings.Default.setting_autoScroll;
check_timestamp.Checked = Properties.Settings.Default.setting_timestamp;
cmbTimestamp.SelectedIndex = Properties.Settings.Default.setting_timestamp_string;

cmbTimestamp.SelectedIndex = 0;
cmbBaudRate.SelectedIndex = 5;//115200
cmbCRLF.SelectedIndex = 0;//no CRLF
serialPort1.RtsEnable = checkRtsEnable.Checked;
serialPort1.DtrEnable= checkDtrEnable.Checked;

sndTextBox.AcceptsReturn = !checkEnter.Checked;


rcvTextBox.WordWrap = checkWrap.Checked;
rcvTextBoxScroll.WordWrap = checkWrap.Checked;
if (autoScroll.Checked)
{
rcvTextBoxScroll.BringToFront();
}
else
{
rcvTextBox.BringToFront();
}
}

private void checkDtrEnable_CheckedChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -519,6 +565,7 @@ private void Form1_ResizeEnd(object sender, EventArgs e)
rcvTextBox.AppendText(resizing_buf.ToString());
rcvTextBoxScroll.AppendText(resizing_buf.ToString());
}

}

//https://ehbtj.com/info/think-about-improving-performance-of-serial-monitor/
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Loading

0 comments on commit f5511ee

Please sign in to comment.