diff --git a/Supervisor.Plugin.Interface/IHost.vb b/Supervisor.Plugin.Interface/IHost.vb index d0f2e67..edfc703 100644 --- a/Supervisor.Plugin.Interface/IHost.vb +++ b/Supervisor.Plugin.Interface/IHost.vb @@ -5,10 +5,10 @@ Public Interface IHost ReadOnly Property PluginTestInfo As Integer Function PlgOutLog(sLogMsg As String) As Boolean - Function PlgGetPrivateProfileInt(lpAppName As String, lpKeyName As String, nDefault As Integer, lpFileName As String) As Integer - Function PlgGetPrivateProfileDouble(lpAppName As String, lpKeyName As String, dDefault As Double, lpFileName As String) As Double - Function PlgGetPrivateProfileString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, lpFileName As String) As Integer - Function PlgWritePrivateProfileString(lpAppName As String, lpKeyName As String, lpString As String, lpFileName As String) As Boolean + Function PlgGetPrivateProfileInt(lpAppName As String, lpKeyName As String, nDefault As Integer) As Integer + Function PlgGetPrivateProfileDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double + Function PlgGetPrivateProfileString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer + Function PlgWritePrivateProfileString(lpAppName As String, lpKeyName As String, lpString As String) As Boolean Function PlgExecProcess(sFileName As String, sMainLuaPath As String, sArguments As String) As Boolean Function PlgExecProcessAsync(sFileName As String, sMainLuaPath As String, sArguments As String) As Boolean Function PlgCheckExecProcessAsync(ByRef bHasExited As Boolean, ByRef nExitCode As Integer) As Boolean diff --git a/Supervisor/MEFPlugin/SupervisorFunctions.vb b/Supervisor/MEFPlugin/SupervisorFunctions.vb index 17227bc..bd59de9 100644 --- a/Supervisor/MEFPlugin/SupervisorFunctions.vb +++ b/Supervisor/MEFPlugin/SupervisorFunctions.vb @@ -13,20 +13,20 @@ Public Class SupervisorFunctions Return EgtOutLog(sLogMsg) End Function - Public Function PlgGetPrivateProfileInt(lpAppName As String, lpKeyName As String, nDefault As Integer, lpFileName As String) As Integer Implements IHost.PlgGetPrivateProfileInt - Return GetPrivateProfileInt(lpAppName, lpKeyName, nDefault, lpFileName) + Public Function PlgGetPrivateProfileInt(lpAppName As String, lpKeyName As String, nDefault As Integer) As Integer Implements IHost.PlgGetPrivateProfileInt + Return GetMainPrivateProfileInt(lpAppName, lpKeyName, nDefault) End Function - Public Function PlgGetPrivateProfileDouble(lpAppName As String, lpKeyName As String, dDefault As Double, lpFileName As String) As Double Implements IHost.PlgGetPrivateProfileDouble - Return GetPrivateProfileDouble(lpAppName, lpKeyName, dDefault, lpFileName) + Public Function PlgGetPrivateProfileDouble(lpAppName As String, lpKeyName As String, dDefault As Double) As Double Implements IHost.PlgGetPrivateProfileDouble + Return GetMainPrivateProfileDouble(lpAppName, lpKeyName, dDefault) End Function - Public Function PlgGetPrivateProfileString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String, lpFileName As String) As Integer Implements IHost.PlgGetPrivateProfileString - Return GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString, lpFileName) + Public Function PlgGetPrivateProfileString(lpAppName As String, lpKeyName As String, lpDefault As String, ByRef lpString As String) As Integer Implements IHost.PlgGetPrivateProfileString + Return GetMainPrivateProfileString(lpAppName, lpKeyName, lpDefault, lpString) End Function - Public Function PlgWritePrivateProfileString(lpAppName As String, lpKeyName As String, lpString As String, lpFileName As String) As Boolean Implements IHost.PlgWritePrivateProfileString - Return WritePrivateProfileString(lpAppName, lpKeyName, lpString, lpFileName) + Public Function PlgWritePrivateProfileString(lpAppName As String, lpKeyName As String, lpString As String) As Boolean Implements IHost.PlgWritePrivateProfileString + Return WriteMainPrivateProfileString(lpAppName, lpKeyName, lpString) End Function Public Function PlgExecProcess(sFileName As String, sMainLuaPath As String, sArguments As String) As Boolean Implements IHost.PlgExecProcess diff --git a/Supervisor/MainWindow/MainWindowVM.vb b/Supervisor/MainWindow/MainWindowVM.vb index c6a8617..9ba3bfa 100644 --- a/Supervisor/MainWindow/MainWindowVM.vb +++ b/Supervisor/MainWindow/MainWindowVM.vb @@ -63,14 +63,7 @@ Public Class MainWindowVM m_MachineManager = New MachineManager m_MachineManager.Init() - ' creo gestore delle macchine a stati - m_FiniteStateMachineManager = New FiniteStateMachineManager - If GetMainPrivateProfileInt(S_REDIS, K_ENABLED, 0) = 1 Then - m_RedisManager = New RedisManager - End If - - - ' recuper nome del plugin + ' recupero nome del plugin Dim sPluginName As String = "" If GetMainPrivateProfileString(S_GENERAL, K_PLUGINNAME, "", sPluginName) > 0 AndAlso Not String.IsNullOrWhiteSpace(sPluginName) Then ' aggiungo Dictionary del plugin @@ -87,6 +80,12 @@ Public Class MainWindowVM m_ContentPanel = ProjectPlugin End If + ' creo gestore delle macchine a stati + m_FiniteStateMachineManager = New FiniteStateMachineManager + If GetMainPrivateProfileInt(S_REDIS, K_ENABLED, 0) = 1 Then + m_RedisManager = New RedisManager + End If + End Sub #Region "Plugin"