Skip to content

Commit

Permalink
Merge pull request #1 from lansalot/Menu
Browse files Browse the repository at this point in the history
MINOR: add help and update pipeline
  • Loading branch information
lansalot authored Feb 20, 2024
2 parents 80c6dfe + ab5bc07 commit 7d22d11
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 14 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,17 @@ jobs:
- uses: paulhatch/[email protected]
id: versioning
with:
branch: main
# The prefix to use to identify tags
tag_prefix: "v"
# A string which, if present in a git commit, indicates that a change represents a
# major (breaking) change, supports regular expressions wrapped with '/'
major_pattern: "(MAJOR)"
major_pattern: "MAJOR:"
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
minor_pattern: "(MINOR)"
minor_pattern: "MINOR:"
# A string to determine the format of the version output
version_format: "v${major}.${minor}.${patch}.${increment}"
# Optional path to check for changes. If any changes are detected in the path the
# 'changed' output will true. Enter multiple paths separated by spaces.
change_path: "./TeensyFlasher"
# Named version, will be used as suffix for name version tag
#namespace: project-b
# Indicate whether short tags like 'v1' should be supported. If false only full
# tags like 'v1.0.0' will be recognized.
# If this is set to true, *every* commit will be treated as a new version.

bump_each_commit: false

- name: Update AssemblyVersion and AssemblyFileVersion
Expand Down
13 changes: 13 additions & 0 deletions TeensyFlasher/frmMain.Designer.cs

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

67 changes: 63 additions & 4 deletions TeensyFlasher/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public partial class frmMain : Form
private string _FileName = ".\\Single.txt";
private bool isProgrammingF9P = false;
private bool isClosing = false;
private int errorCount = 0;

#region Teensy


Expand Down Expand Up @@ -275,7 +277,8 @@ private void MySerialPort_DataReceived(object sender, SerialDataReceivedEventArg
safeChat(".");
spL.Open();
break;
} else
}
else
{
break;
}
Expand All @@ -292,6 +295,12 @@ private void MySerialPort_DataReceived(object sender, SerialDataReceivedEventArg
break;
}
}
if (!spL.IsOpen)
{
// sometimes the port closes, for some reason...
safeChat("Serial port closed unexpectedly - please try again!");
return;
}
buf = new byte[spL.BytesToRead];
spL.Read(buf, 0, buf.Length);
bool ubxMessage = false;
Expand Down Expand Up @@ -342,6 +351,7 @@ private void MySerialPort_DataReceived(object sender, SerialDataReceivedEventArg
// 0x00 is NAK
else if (_ubxParseBuffer[3] == 0x00)
{
errorCount++;
_ack = false;
_waitForAckNak.Set();
ResetUbxBuffer();
Expand Down Expand Up @@ -512,8 +522,11 @@ public void ConfigureReceiver(string configurationFilename)
// Retry sending line
if (!SendLine(line))
{
//safeChat("Sending the line again did not work either");
//break;
if (errorCount > 5)
{
safeChat("Too many errors, aborting");
throw new Exception("Too many errors");
}
}
}
}
Expand All @@ -538,6 +551,7 @@ public void ConfigureReceiver(string configurationFilename)
btnConnect.Enabled = true;
btnF9PFlashFirmware.Enabled = true;
btnURefresh.Enabled = true;
errorCount = 0;
//StopReadingData();
}
}
Expand Down Expand Up @@ -717,7 +731,7 @@ private void btnConfigF9P_Click(object sender, EventArgs e)
}
if (lblFirmwareWarning.ForeColor == Color.Red)
{
MessageBox.Show("Firmware MUST be version 1.13. Please flash it first.","Error!!",MessageBoxButtons.OK,MessageBoxIcon.Error);
MessageBox.Show("Firmware MUST be version 1.13. Please flash it first.", "Error!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtSerialChat.AppendText("Firmware MUST be version 1.13. Please flash it first." + Environment.NewLine);
return;
}
Expand Down Expand Up @@ -760,6 +774,51 @@ private void lbFirmware_SelectedIndexChanged_1(object sender, EventArgs e)
btnProgram.Enabled = true;
}
}

private void btnHelp_Click(object sender, EventArgs e)
{
ContextMenuStrip contexMenu = new ContextMenuStrip();
contexMenu.Font = new Font("Microsoft Sans Serif", 14);
//contexMenu.Items.Add("Video Tutorial");
contexMenu.Items.Add("AOGConfig-O-Matic!");
contexMenu.Items.Add("AgOpenGPS Tools");
contexMenu.Items.Add("AgOpenGPS videos");
contexMenu.Items.Add("AgOpenGPS");
contexMenu.Items.Add("AgHardware");
contexMenu.Items.Add("AOG Discourse");
contexMenu.Show(Cursor.Position.X, Cursor.Position.Y);
contexMenu.ItemClicked += new ToolStripItemClickedEventHandler(
contexMenu_ItemClicked);
}

void contexMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
ToolStripItem item = e.ClickedItem;
switch (item.Text)
{
case "Video Tutorial":
System.Diagnostics.Process.Start("https://www.youtube.com/user/lansing9r");
break;
case "AgOpenGPS":
System.Diagnostics.Process.Start("https://github.com/farmerbriantee/AgOpenGPS");
break;
case "AgHardware":
System.Diagnostics.Process.Start("https://github.com/AgHardware");
break;
case "AgOpenGPS videos":
System.Diagnostics.Process.Start("https://www.youtube.com/user/lansing9r");
break;
case "AOG Discourse":
System.Diagnostics.Process.Start("https://discourse.agopengps.com/");
break;
case "AOGConfig-O-Matic!":
System.Diagnostics.Process.Start("https://github.com/lansalot/AOGConfigOMatic");
break;
case "AgOpenGPS Tools":
System.Diagnostics.Process.Start("https://github.com/lansalot/AgOpenGPS-Tools");
break;
}
}
}

}

0 comments on commit 7d22d11

Please sign in to comment.