diff --git a/Effector.Plugin.FiveLakes/My Project/AssemblyInfo.vb b/Effector.Plugin.FiveLakes/My Project/AssemblyInfo.vb index b64acec..64cc7b3 100644 --- a/Effector.Plugin.FiveLakes/My Project/AssemblyInfo.vb +++ b/Effector.Plugin.FiveLakes/My Project/AssemblyInfo.vb @@ -55,5 +55,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/Effector.Plugin.FiveLakes/RestartWnd/RestartWndV.xaml b/Effector.Plugin.FiveLakes/RestartWnd/RestartWndV.xaml index 121f6f2..e605bb9 100644 --- a/Effector.Plugin.FiveLakes/RestartWnd/RestartWndV.xaml +++ b/Effector.Plugin.FiveLakes/RestartWnd/RestartWndV.xaml @@ -3,12 +3,16 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Lib="clr-namespace:Effector.Plugin.Lib;assembly=Effector.Plugin.Lib" xmlns:local="clr-namespace:Effector.Plugin.FiveLakes" + ShowInTaskbar="False" + IsMinimizable="False" + IsClosable="False" Title="{Binding sTitle}"> + @@ -205,29 +209,108 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 Then - 'For nIndex = 0 To 4 - ' Dim dValue As Double = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M" & m_nMachineIndex & "P" & nIndex, 0) - ' WriteVariableValueToName(nMachineIndex, "@WP_PR_0" & nIndex.ToString(), dValue) - ' Dim nValue As Integer = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M" & m_nMachineIndex & "P" & nIndex, 0) - ' WriteVariableValueToName(nMachineIndex, "@DOORN_S" & nIndex.ToString(), nValue) - 'Next For nIndex = 0 To 4 - Dim dValue As Double = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M1P" & nIndex, 0) - WriteVariableValueToName(1, "@WP_PR_0" & nIndex.ToString(), dValue) - Dim nValue As Integer = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M1P" & nIndex, 0) - WriteVariableValueToName(1, "@DOORN_S" & nIndex.ToString(), nValue) - dValue = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M2P" & nIndex, 0) - WriteVariableValueToName(2, "@WP_PR_0" & nIndex.ToString(), dValue) - nValue = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M2P" & nIndex, 0) - WriteVariableValueToName(2, "@DOORN_S" & nIndex.ToString(), nValue) + Dim dValue As Double = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M" & m_nMachineIndex & "P" & nIndex, 0) + WriteVariableValueToName(nMachineIndex, "@WP_PR_0" & nIndex.ToString(), dValue) + Dim nValue As Integer = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M" & m_nMachineIndex & "P" & nIndex, 0) + WriteVariableValueToName(nMachineIndex, "@DOORN_S" & nIndex.ToString(), nValue) Next + ' scrive tutte le variabili dell'intera linea + 'For nIndex = 0 To 4 + ' Dim dValue As Double = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M1P" & nIndex, 0) + ' WriteVariableValueToName(1, "@WP_PR_0" & nIndex.ToString(), dValue) + ' Dim nValue As Integer = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M1P" & nIndex, 0) + ' WriteVariableValueToName(1, "@DOORN_S" & nIndex.ToString(), nValue) + ' dValue = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORPRESENCE & "M2P" & nIndex, 0) + ' WriteVariableValueToName(2, "@WP_PR_0" & nIndex.ToString(), dValue) + ' nValue = GetPluginPrivateProfileDouble(S_DEBUG, K_DOORINDEX & "M2P" & nIndex, 0) + ' WriteVariableValueToName(2, "@DOORN_S" & nIndex.ToString(), nValue) + 'Next End If ' riporto lista porte su log @@ -558,6 +560,21 @@ Public Class VariableNameToVisibilityConverter End Class +Public Class ListEmptyToVisibilityConverter + Implements IValueConverter + + Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert + If IsNothing(value) OrElse Not TypeOf value Is IList Then Return Visibility.Collapsed + Dim List As IList = DirectCast(value, IList) + Return If(List.Count > 0, Visibility.Visible, Visibility.Collapsed) + End Function + + Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack + Throw New NotImplementedException() + End Function + +End Class + Public Class DoorToBeFixed Private m_nId As Integer = -1 @@ -567,6 +584,27 @@ Public Class DoorToBeFixed End Get End Property + Private m_sDDFName As String + Public ReadOnly Property sDDFName As String + Get + Return m_sDDFName + End Get + End Property + + Private m_nOldState As DoorStates + Public ReadOnly Property nOldState As DoorStates + Get + Return m_nOldState + End Get + End Property + + Private m_sCSVName As String + Public ReadOnly Property sCSVName As String + Get + Return m_sCSVName + End Get + End Property + Private m_StateList As New ObservableCollection(Of Door.DoorStates) Public ReadOnly Property StateList As ObservableCollection(Of Door.DoorStates) Get @@ -586,6 +624,9 @@ Public Class DoorToBeFixed Sub New(Door As Door, nMachineIndex As Integer) m_nId = Door.nId + m_sDDFName = Door.sDDFName + m_nOldState = Door.nState + m_sCSVName = Door.sCSVName If nMachineIndex = 1 Then m_StateList = New ObservableCollection(Of Door.DoorStates)({Door.DoorStates.READY_FOR_PRODUCTION, Door.DoorStates.NOTPRODUCE}) ElseIf nMachineIndex = 2 Then