Skip to content

Commit

Permalink
working version
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Sep 1, 2017
1 parent 732ed9a commit 9cefb67
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
36 changes: 29 additions & 7 deletions windows/QMK Toolbox/Form1.Designer.cs

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

19 changes: 9 additions & 10 deletions windows/QMK Toolbox/Form1.cs
Expand Up @@ -91,7 +91,7 @@ public partial class Form1 : Form {
private void FlashButton_Click(object sender, EventArgs e) {
string hexFile = hexFileBox.Text;
if (hexFile == "") {
Print("*** Please select a file ***\n", true);
Print("*** Please select a file\n", true);
} else {
if (mcuIsAvailable()) {
RunDFU("erase --force");
Expand Down Expand Up @@ -130,7 +130,7 @@ public partial class Form1 : Form {
output += process.StandardError.ReadToEnd();
process.WaitForExit();
if (output.Contains("no device present")) {
Print("*** No device present ***\n", true);
Print("*** No device present\n", true);
return false;
} else {
return true;
Expand All @@ -149,18 +149,12 @@ public partial class Form1 : Form {

private void DeviceInsertedEvent(object sender, EventArrivedEventArgs e) {
ManagementBaseObject instance = (ManagementBaseObject)e.NewEvent["TargetInstance"];
Print("Thing inserted:", true);
foreach (var property in instance.Properties) {
Print(property.Name + " = " + property.Value + "\n");
}
Print("*** Device inserted: " + instance.GetPropertyValue("DeviceID") + "\n", true);
}

private void DeviceRemovedEvent(object sender, EventArrivedEventArgs e) {
ManagementBaseObject instance = (ManagementBaseObject)e.NewEvent["TargetInstance"];
Print("Thing removed:", true);
foreach (var property in instance.Properties) {
Print(property.Name + " = " + property.Value + "\n");
}
Print("*** Device removed: "+ instance.GetPropertyValue("DeviceID") + "\n", true);
}

private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {
Expand All @@ -179,5 +173,10 @@ public partial class Form1 : Form {
System.Threading.Thread.Sleep(2000000);
}

private void button3_Click(object sender, EventArgs e) {
if (mcuIsAvailable()) {
RunDFU("reset");
}
}
}
}
3 changes: 0 additions & 3 deletions windows/QMK Toolbox/Form1.resx
Expand Up @@ -123,9 +123,6 @@
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>26, 28</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>166, 28</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
6 changes: 3 additions & 3 deletions windows/QMK Toolbox/QMK Toolbox.csproj
Expand Up @@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -22,9 +23,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -67,7 +67,7 @@
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down

0 comments on commit 9cefb67

Please sign in to comment.