Skip to content

Commit

Permalink
issue #76 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
remo-buhlergroup committed Mar 17, 2023
1 parent 4401d21 commit 9944b91
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 22 deletions.
5 changes: 3 additions & 2 deletions IEC Mate/IEC Mate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PrimaryVersionType>AssemblyVersionAttribute</PrimaryVersionType>
<AssemblyFileVersionSettings>None.None.Increment.DateStamp</AssemblyFileVersionSettings>
<AssemblyInfoVersionSettings>None.None.Increment.DateStamp</AssemblyInfoVersionSettings>
<AssemblyVersion>1.0.1701.21256</AssemblyVersion>
<AssemblyVersion>1.0.1715.23076</AssemblyVersion>
<PublishUrl>C:\Users\r.scheidegger\Downloads\IEC Mate\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -42,7 +42,7 @@
<ProductName>IEC-Mate</ProductName>
<PublisherName>Remo Scheidegger</PublisherName>
<ApplicationRevision>19222</ApplicationRevision>
<ApplicationVersion>1.0.1701.21256</ApplicationVersion>
<ApplicationVersion>1.0.1715.23076</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down Expand Up @@ -319,6 +319,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.en-GB.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
Expand Down
39 changes: 28 additions & 11 deletions IEC Mate/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3175,33 +3175,50 @@ private void Bt_simStarten_Click(object sender, RoutedEventArgs e)
Log.Error(ex, "Error");
}
}
private void Bt_simStopen_Click(object sender, RoutedEventArgs e)
private async void Bt_simStopen_Click(object sender, RoutedEventArgs e)
{
try
{
foreach (var process in Process.GetProcessesByName("putty"))
// Reguläres beenden der Simulation mit dem bat File
string open = text_projktpfad_helfer.Text + Properties.Paths.Stop_Simulation;
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = open,
WorkingDirectory = Path.GetDirectoryName(open)
}
};
process.Start();

// Warten von 5 Sekunden
// Danach wird überprüft, ob noch Prozesse laufen. Falls dies der Fall ist, werden diese beendet.
// So ist eine abwärts Kompatibilität gewährleistet und es funktioniert auch, wenn die Simu sofort wieder gestoppt wird.
await Task.Delay(5000);

foreach (var p in Process.GetProcessesByName("putty"))
{
process.Kill();
p.Kill();
}

foreach (var process in Process.GetProcessesByName("K2Ctrl"))
foreach (var p in Process.GetProcessesByName("K2Ctrl"))
{
process.Kill();
p.Kill();
}

foreach (var process in Process.GetProcessesByName("cmd"))
foreach (var p in Process.GetProcessesByName("cmd"))
{
process.Kill();
p.Kill();
}

foreach (var process in Process.GetProcessesByName("DataView"))
foreach (var p in Process.GetProcessesByName("DataView"))
{
process.Kill();
p.Kill();
}

foreach (var process in Process.GetProcessesByName("java"))
foreach (var p in Process.GetProcessesByName("java"))
{
process.Kill();
p.Kill();
}

Log.Information("Helfer: Simulation wurde beendet.");
Expand Down
8 changes: 5 additions & 3 deletions IEC Mate/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -51,5 +51,7 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1701.21256")]
[assembly: AssemblyFileVersion("1.0.1701.21256")]
[assembly: AssemblyVersion("1.0.1715.23076")]
[assembly: AssemblyFileVersion("1.0.1715.23076")]

[assembly: AssemblyInformationalVersion("0.0.14.23076")]
11 changes: 10 additions & 1 deletion IEC Mate/Properties/Paths.Designer.cs

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

3 changes: 3 additions & 0 deletions IEC Mate/Properties/Paths.resx
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,7 @@
<data name="hmiCfg2" xml:space="preserve">
<value>\\hmiCfg.properties.nt2</value>
</data>
<data name="Stop_Simulation" xml:space="preserve">
<value>\\Stopp_Simulation.bat</value>
</data>
</root>
4 changes: 2 additions & 2 deletions IEC Mate/Properties/Resources.Designer.cs

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

2 changes: 1 addition & 1 deletion IEC Mate/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<value>Startet die Simulation im angegebenen Projektverzeichnis.</value>
</data>
<data name="tt_stop_sim" xml:space="preserve">
<value>Stopt die Prozesse "K2Ctrl", "putty", "DataView", "java" und "cmd". Dies kann auch unbeabsichtigt andere Programme beenden.</value>
<value>Stoppt die Simulation im angegebenen Projektverzeichnis.</value>
</data>
<data name="tt_visu_datanet" xml:space="preserve">
<value>Startet eine Dat@net Visualisierung im angegebenen Projektverzeichnis.</value>
Expand Down
2 changes: 1 addition & 1 deletion IEC Mate/Properties/Resources.en-GB.resx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<value>Starts the simulation in the specified project directory.</value>
</data>
<data name="tt_stop_sim" xml:space="preserve">
<value>Stops the processes "K2Ctrl", "putty", "DataView", "java" and "cmd". This can also unintentionally terminate other programs.</value>
<value>Stops the simulation in the specified project directory.</value>
</data>
<data name="tt_visu_datanet" xml:space="preserve">
<value>Starts a Dat@net visualization in the specified project directory.</value>
Expand Down
2 changes: 1 addition & 1 deletion IEC Mate/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<value>Startet die Simulation im angegebenen Projektverzeichnis.</value>
</data>
<data name="tt_stop_sim" xml:space="preserve">
<value>Stopt die Prozesse "K2Ctrl", "putty", "DataView", "java" und "cmd". Dies kann auch unbeabsichtigt andere Programme beenden.</value>
<value>Stoppt die Simulation im angegebenen Projektverzeichnis.</value>
</data>
<data name="tt_visu_datanet" xml:space="preserve">
<value>Startet eine Dat@net Visualisierung im angegebenen Projektverzeichnis.</value>
Expand Down

0 comments on commit 9944b91

Please sign in to comment.