diff --git a/Supervisor.Plugin.Interface/IHost.vb b/Supervisor.Plugin.Interface/IHost.vb index edfc703..5240bfe 100644 --- a/Supervisor.Plugin.Interface/IHost.vb +++ b/Supervisor.Plugin.Interface/IHost.vb @@ -4,6 +4,7 @@ Public Interface IHost ReadOnly Property PluginTestInfo As Integer + ' ReadOnly Property FiniteStateMachineList As List(Of FiniteStateMachine) Function PlgOutLog(sLogMsg 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 diff --git a/Supervisor/FiniteStateMachine.vb b/Supervisor/FiniteStateMachine.vb index 8ee2764..204064f 100644 --- a/Supervisor/FiniteStateMachine.vb +++ b/Supervisor/FiniteStateMachine.vb @@ -16,6 +16,16 @@ End Get End Property + Private m_sMessageText As String = "" + Friend ReadOnly Property sMessageText As String + Get + Return m_sMessageText + End Get + End Property + Friend Sub SetMessageText(sText As String) + m_sMessageText = sText + End Sub + Sub New(sLuaPath As String) m_sLuaPath = sLuaPath m_bLuaExecuted = LuaManager.ExecFile(Map.refMainWindowVM.MainWindowM.sScriptDir & "\" & sLuaPath) diff --git a/Supervisor/FiniteStateMachineManager/FiniteStateMachineManager.vb b/Supervisor/FiniteStateMachineManager/FiniteStateMachineManager.vb index d6e0a71..b1b6230 100644 --- a/Supervisor/FiniteStateMachineManager/FiniteStateMachineManager.vb +++ b/Supervisor/FiniteStateMachineManager/FiniteStateMachineManager.vb @@ -6,6 +6,11 @@ Public Class FiniteStateMachineManager Private m_FiniteStateMachineTimer As New DispatcherTimer Private m_FiniteStateMachineList As New List(Of FiniteStateMachine) + Friend ReadOnly Property FiniteStateMachineList As List(Of FiniteStateMachine) + Get + Return m_FiniteStateMachineList + End Get + End Property Private m_PreProcPath As String = "" Private m_PostProcPath As String = "" diff --git a/Supervisor/LUA/Lua_General.vb b/Supervisor/LUA/Lua_General.vb index e7fd30a..8484f35 100644 --- a/Supervisor/LUA/Lua_General.vb +++ b/Supervisor/LUA/Lua_General.vb @@ -40,6 +40,7 @@ Public Module Lua_General Friend func_EntDeleteFile As LuaFunction = AddressOf Lua_EntDeleteFile Friend func_EntFileLength As LuaFunction = AddressOf Lua_EntFileLength Friend func_EntExecProcess As LuaFunction = AddressOf Lua_EntExecProcess + Friend func_EntStateMachineOutText As LuaFunction = AddressOf Lua_EntStateMachineOutText Friend func_RdsStringGet As LuaFunction = AddressOf Lua_RdsStringGet Friend func_RdsStringSetAsync As LuaFunction = AddressOf Lua_RdsStringSetAsync Friend func_RdsPublishAsync As LuaFunction = AddressOf Lua_RdsPublishAsync @@ -500,6 +501,18 @@ Public Module Lua_General End If End Function + Private Function Lua_EntStateMachineOutText(ByVal p As IntPtr) As Integer + Dim state = Lua.FromIntPtr(p) + Dim sMessage As String = "" + Dim nStateMachine As Integer = 0 + LuaCheckParam(state, 1, sMessage) + LuaCheckParam(state, 2, nStateMachine) + LuaClearStack(state) + Dim StateMachine As FiniteStateMachine = Map.refMainWindowVM.FiniteStateMachineManager.FiniteStateMachineList(nStateMachine - 1) + StateMachine.SetMessageText(sMessage) + Return 0 + End Function + Friend Function LuaInstallGeneral(state As Lua) As Boolean If IsNothing(state) Then Return False state.Register("EntIs64bit", func_EntIs64bit) @@ -520,6 +533,7 @@ Public Module Lua_General state.Register("EntFileLength", func_EntFileLength) state.Register("EntDeleteFile", func_EntDeleteFile) state.Register("EntExecProcess", func_EntExecProcess) + state.Register("EntStateMachineOutText", func_EntStateMachineOutText) state.Register("RdsStringGet", func_RdsStringGet) state.Register("RdsStringSetAsync", func_RdsStringSetAsync) state.Register("RdsPublishAsync", func_RdsPublishAsync)