- lettura da messaggi descrizione input ed output

- ampliamento spazio variabili da leggere
- correzione lettura log su selezione pagina
- aggiunte immaginin su parametri Q
This commit is contained in:
Emmanuele Sassi
2022-08-25 18:10:56 +02:00
parent fa7d95cc53
commit 63b1f1532a
9 changed files with 77 additions and 9 deletions
+26 -1
View File
@@ -53,7 +53,7 @@ Public Class NUMFlexiumComm
Private m_ReadFXMessages As New List(Of ReadMessages)
Private m_ReadOperatorMessages As New List(Of ReadMessages)
' lista variabili in lettura
Private Shared m_ReadingVars(100) As CommVar
Private Shared m_ReadingVars(230) As CommVar
Private m_BytesTransferedCounter As Integer
Private m_LinearAxisPrecision As Integer
@@ -368,6 +368,31 @@ Public Class NUMFlexiumComm
Friend Sub FileDownload(sFileType As String, sFilePath As String)
Dim _Return_Download As Short
'' leggo variabile E30099
'Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
'Dim dTemp As Double = 0
'Dim nSendPermission As Integer = 0
'EgtOutLog("Inizio invio programma")
'While nSendPermission <> 2
' Dim bFirstWriteOne = True
' EgtOutLog("Inizio ciclo verifica diverso da 2")
' ' leggo valore
' If Not IsNothing(SendPermissionVariable.sValue) Then
' StringToDouble(SendPermissionVariable.sValue, dTemp)
' Integer.TryParse(dTemp, nSendPermission)
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
' Else
' EgtOutLog("nSendPermission = -1")
' nSendPermission = -1
' End If
' ' se uguale a zero ci scrivo uno
' If nSendPermission = 0 And bFirstWriteOne Then
' bFirstWriteOne = False
' SendPermissionVariable.sValue = 1
' EgtOutLog("Scrittura variabile E30099 = 1")
' End If
' Threading.Thread.Sleep(1000)
'End While
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
@@ -3,5 +3,7 @@
Public Const MDI_MSG As String = "MDI"
Public Const PLC_MSG As String = "PLC"
Public Const CNC_MSG As String = "CNC"
Public Const INPUT_MSG As String = "INPUT"
Public Const OUTPUT_MSG As String = "OUTPUT"
End Module
@@ -1169,7 +1169,7 @@ Public Class MachManaging
EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, "", sVariable, IpFileName)
If String.IsNullOrWhiteSpace(sVariable) Then Return Nothing
Dim sVariableValues() As String = sVariable.Split(","c)
If Not sVariableValues.Count >= 4 Then Return Nothing
'If Not sVariableValues.Count >= 4 Then Return Nothing
For Index As Integer = 0 To sVariableValues.Count - 1
sVariableValues(Index) = sVariableValues(Index).Trim()
Next
@@ -1200,7 +1200,25 @@ Public Class MachManaging
Case S_OUTPUTVARIABLES
Paragraph = Paragraphs.OUTPUT
End Select
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph)
Dim sDescription As String = ""
If sVariableValues.Length >= 5 Then
Dim nDescription As Integer
If Integer.TryParse(sVariableValues(4), nDescription) Then
Dim MsgParagraph As MsgParagraphs
Select Case Paragraph
Case Paragraphs.INPUT
MsgParagraph = MsgParagraphs.INPUT
Case Paragraphs.OUTPUT
MsgParagraph = MsgParagraphs.OUTPUT
Case Else
MsgParagraph = MsgParagraphs.INPUT
End Select
sDescription = MachMsg(MsgParagraph, nDescription)
Else
sDescription = sVariableValues(4)
End If
End If
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph, sDescription)
End Function
Private Sub ReadPLCMessages()
@@ -59,7 +59,7 @@ Public Class RWVariableManager
Public Shared Function InitVar(Name As String, Address As String, Type As CommVar.ReadTypes) As Integer
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL)
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL, "")
Return Index
End Function
@@ -101,7 +101,7 @@ Public Class RWVariableManager
Case S_OUTPUTVARIABLES
Paragraph = Paragraphs.OUTPUT
End Select
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph)
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph, "")
End Function
Public Sub RefreshVar(Name As String)
@@ -266,6 +266,7 @@ Public Class CommVar
m_sName = value
End Set
End Property
Private m_sAddress As String
Public Property sAddress As String
Get
@@ -275,12 +276,14 @@ Public Class CommVar
m_sAddress = value
End Set
End Property
Private m_nReadType As ReadTypes
Public ReadOnly Property nReadType As ReadTypes
Get
Return m_nReadType
End Get
End Property
Private m_nType As Types
Public ReadOnly Property nType As Types
Get
@@ -306,6 +309,13 @@ Public Class CommVar
If bNewValue Then RaiseEvent NewValue(Me, New NewValueEventArgs(Value))
End Sub
Private m_sDescription As String
Public ReadOnly Property sDescription As String
Get
Return m_sDescription
End Get
End Property
Private m_bReaded As Boolean
Public ReadOnly Property bReaded As Boolean
Get
@@ -324,12 +334,13 @@ Public Class CommVar
' indice usato in liste lettura NUM
Friend Index As Integer = -1
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs)
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs, sDescription As String)
m_sName = Name
m_sAddress = Address
m_nReadType = ReadType
m_nType = Type
m_Paragraph = Paragraph
m_sDescription = sDescription
End Sub
Friend Sub ResetReading()
+1 -1
View File
@@ -28,7 +28,7 @@ Public Class ProjectVM
If m_SelTabPage = TabPages.MACHINELOG Then
Map.refCALCPanelVM.SetMachineLog(False)
End If
If SelTabPage Then
If SelTabPage = TabPages.MACHINELOG Then
Map.refMachineLogPageVM.LoadMachineLogList()
End If
m_SelTabPage = SelTabPage
@@ -16,6 +16,8 @@ Public Module CurrentMachine
MDI = 1
PLC = 2
CNC = 3
INPUT = 4
OUTPUT = 5
End Enum
' Nome macchina corrente
@@ -305,6 +307,10 @@ Public Module CurrentMachine
sPar = PLC_MSG
Case MsgParagraphs.CNC
sPar = CNC_MSG
Case MsgParagraphs.INPUT
sPar = INPUT_MSG
Case MsgParagraphs.OUTPUT
sPar = OUTPUT_MSG
End Select
EgtGetStringUtf8FromIni(sPar, nId, nId, sMsg, m_sMachMessagesFile)
Return sMsg
@@ -5,7 +5,7 @@
<DataGrid ItemsSource="{Binding VariablesList}"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding sName}" Width="1*"/>
<DataGridTextColumn Header="Name" Binding="{Binding sDescription}" Width="1*"/>
<DataGridTextColumn Header="Address" Binding="{Binding sAddress}" Width="1*"/>
<DataGridTextColumn Header="Value" Binding="{Binding sValue}" Width="1*"/>
</DataGrid.Columns>
@@ -44,6 +44,12 @@ Public Class Variable
End Set
End Property
Public ReadOnly Property sDescription As String
Get
Return CommVar.sDescription
End Get
End Property
Public Property sAddress As String
Get
Return CommVar.sAddress
@@ -213,7 +213,7 @@ Public Class BTLFeatureVM
m_SelQParam = value
If Not IsNothing(m_SelQParam) Then
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath)
End If
NotifyPropertyChanged(NameOf(SelQBTLParam))
End Set