- inizio modifica per mostrare messaggi da finitestatemachine

This commit is contained in:
Emmanuele Sassi
2024-09-18 11:04:47 +02:00
parent fc95ec8882
commit 66fd112ef7
4 changed files with 30 additions and 0 deletions
+1
View File
@@ -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
+10
View File
@@ -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)
@@ -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 = ""
+14
View File
@@ -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)