Skip to content

Commit f0903a2

Browse files
committed
fixed excepiton message box
1 parent 43bfc4c commit f0903a2

8 files changed

Lines changed: 14 additions & 69 deletions

File tree

WpfApplication2/Evaluation.xaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

WpfApplication2/Evaluation.xaml.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

WpfApplication2/KDT.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@
114114
<Generator>MSBuild:Compile</Generator>
115115
<SubType>Designer</SubType>
116116
</Page>
117-
<Page Include="Evaluation.xaml">
118-
<SubType>Designer</SubType>
119-
<Generator>MSBuild:Compile</Generator>
120-
</Page>
121117
<Page Include="help_window.xaml">
122118
<SubType>Designer</SubType>
123119
<Generator>MSBuild:Compile</Generator>
@@ -137,9 +133,6 @@
137133
<Compile Include="AutoCompleteTextBox.xaml.cs">
138134
<DependentUpon>AutoCompleteTextBox.xaml</DependentUpon>
139135
</Compile>
140-
<Compile Include="Evaluation.xaml.cs">
141-
<DependentUpon>Evaluation.xaml</DependentUpon>
142-
</Compile>
143136
<Compile Include="help_window.xaml.cs">
144137
<DependentUpon>help_window.xaml</DependentUpon>
145138
</Compile>

WpfApplication2/MainWindow.xaml.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -349,17 +349,6 @@ private void Help_Click(object sender, RoutedEventArgs e)
349349
}
350350

351351

352-
353-
354-
355-
356-
357-
private void Evaluation_Click(object sender, RoutedEventArgs e)
358-
{
359-
Evaluation ew = new Evaluation();
360-
ew.ShowDialog();
361-
}
362-
363352
private void UpdateCommands_Click(object sender, RoutedEventArgs e)
364353
{
365354
string configpath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "config";
@@ -521,7 +510,7 @@ public void start_read()
521510
}
522511
catch (Exception e)
523512
{
524-
MessageBox.Show("ERROR == > " + e.ToString());
513+
//MessageBox.Show("ERROR == > " + e.ToString());
525514
}
526515
try
527516
{
@@ -540,7 +529,7 @@ public void start_read()
540529
private void RaiseAppSerialDataEvent(byte[] Data)
541530
{
542531
string Result = Encoding.Default.GetString(Data);
543-
Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, DisplayHandle, Result);
532+
Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.DataBind, DisplayHandle, Result);
544533
//panel.Dispatcher.Invoke(DisplayHandle, Result);
545534
}
546535

WpfApplication2/PortControl.xaml.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,13 @@ private void Button_Open1(object sender, RoutedEventArgs e)
238238
if (serialport.IsOpening)
239239
{
240240
//sp.ReceivedBytesThreshold = 4096;
241-
serialport.DataReceived -= new SerialDataReceivedEventHandler(serialport.Data_Received);
241+
//serialport.DataReceived -= new SerialDataReceivedEventHandler(serialport.Data_Received);
242242
serialport.Closes();
243243
SetOpbuttonOpenState(button);
244244
}
245245
else
246246
{
247+
247248
if (portconfig.portname == null)
248249
{
249250
MessageBox.Show("Please set Port!");
@@ -254,7 +255,7 @@ private void Button_Open1(object sender, RoutedEventArgs e)
254255
MessageBox.Show("Please set BaudRate!");
255256
return;
256257
}
257-
258+
FirstConfig = false;
258259
serialport.Config(portconfig);//config portname baudrate etc...
259260
serialport.ReceivedBytesThreshold = 1024;
260261
serialport.ReadTimeout = 300;
@@ -377,8 +378,8 @@ private void Ports_SelectionChanged(object sender, SelectionChangedEventArgs e)
377378

378379
portconfig.portname = cbox.SelectedItem.ToString();
379380
Close_Port();
380-
Open_Button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
381381

382+
Open_Button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
382383
}
383384

384385
//BaudRate
@@ -390,12 +391,10 @@ private void comboBox_BaudRate_SelectionChanged(object sender, SelectionChangedE
390391

391392
portconfig.baudrate = (int)cbox.SelectedItem;
392393
Close_Port();
393-
394394
if (!FirstConfig)
395395
{
396-
Open_Button.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.Primitives.ButtonBase.ClickEvent));
396+
Open_Button.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
397397
}
398-
399398
}
400399

401400

@@ -406,8 +405,8 @@ private void comboBox_Databits_SelectionChanged(object sender, SelectionChangedE
406405
if (cbox.SelectedItem == null || serialport == null)
407406
return;
408407

409-
410408
portconfig.databits = (int)cbox.SelectedItem;
409+
Close_Port();
411410
}
412411

413412

@@ -419,6 +418,7 @@ private void comboBox_StopBits_SelectionChanged(object sender, SelectionChangedE
419418
return;
420419

421420
portconfig.stopbits = getSerialStopBits(cbox);
421+
Close_Port();
422422

423423
}
424424

@@ -430,6 +430,7 @@ private void comboBox_Parity_SelectionChanged(object sender, SelectionChangedEve
430430
return;
431431

432432
portconfig.parity = getSerialParity(cbox);
433+
Close_Port();
433434

434435
}
435436

@@ -443,6 +444,7 @@ private void comboBox_HandShake_Selected(object sender, RoutedEventArgs e)
443444

444445

445446
portconfig.handshake = getSerialHandshake(cbox);
447+
Close_Port();
446448

447449
}
448450
#endregion
-1.5 KB
Binary file not shown.

WpfApplication2/bin/Release/ComDebugger.exe.manifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
</dependentAssembly>
4444
</dependency>
4545
<dependency>
46-
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ComDebugger.exe" size="270336">
46+
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ComDebugger.exe" size="268800">
4747
<assemblyIdentity name="ComDebugger" version="1.0.0.0" language="neutral" processorArchitecture="msil" />
4848
<hash>
4949
<dsig:Transforms>
5050
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
5151
</dsig:Transforms>
5252
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
53-
<dsig:DigestValue>hJRxyJtuv13yWJAfgw0ASuwBzMg=</dsig:DigestValue>
53+
<dsig:DigestValue>WdzhsOfQac+j1jgo/gDKcJL0Miw=</dsig:DigestValue>
5454
</hash>
5555
</dependentAssembly>
5656
</dependency>

package.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DisableProgramGroupPage=yes
2121
; Uncomment the following line to run in non administrative install mode (install for current user only.)
2222
;PrivilegesRequired=lowest
2323
PrivilegesRequiredOverridesAllowed=commandline
24-
OutputBaseFilename=COMDebugger
24+
OutputBaseFilename=COMDebugger_V4.0
2525
Compression=lzma
2626
SolidCompression=yes
2727
WizardStyle=modern

0 commit comments

Comments
 (0)