Migliorata gestione SiemensCommand
This commit is contained in:
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports EgtWPFLib.EgtMsgBox
|
||||
|
||||
Public Class CNCommunication
|
||||
|
||||
@@ -236,6 +237,16 @@ Public Class CNCommunication
|
||||
m_bInInches = (GetPrivateProfileInt(S_AXES, K_ININCHES, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
End Sub
|
||||
|
||||
Private Sub KillSimensCom(sProcessName As String)
|
||||
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
||||
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
||||
For Each proc As System.Diagnostics.Process In pList
|
||||
If proc.ProcessName.ToString = sAppName Then
|
||||
proc.Kill()
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub InitCn()
|
||||
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
@@ -427,6 +438,7 @@ Public Class CNCommunication
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
|
||||
Dim sArg As String = "-start """ & m_sCNSiemensPath & """"
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
KillSimensCom(m_sCNSiemensHMIPath)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
|
||||
Reference in New Issue
Block a user