- spostati style in Dictionary
- trasformato array in observablecollection per mostrare dati porte in lavorazione - inizio lettura stati porte su macchina per finestra restart
This commit is contained in:
@@ -56,6 +56,7 @@ Public Class DoorListPageVM
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' imposto riferimento in Map
|
||||
Map.SetRefDoorListPageVM(Me)
|
||||
Dim sBackupDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
|
||||
|
||||
@@ -74,32 +74,6 @@
|
||||
<Grid Grid.Row="1"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.Resources>
|
||||
<Style x:Key="Table" TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="Gray"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
</Style>
|
||||
<Style x:Key="Door" TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="SaddleBrown"/>
|
||||
<Setter Property="BorderThickness" Value="5"/>
|
||||
<Setter Property="Background" Value="SandyBrown"/>
|
||||
</Style>
|
||||
<Style x:Key="Advancement_Button" TargetType="Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="Sensor" TargetType="Ellipse">
|
||||
<Setter Property="Height" Value="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"/>
|
||||
</Style>
|
||||
<Style x:Key="MachDrawVar_TextBlock" TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="MachDrawVar_CheckBox" TargetType="CheckBox">
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -236,7 +210,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[38].sValue}"
|
||||
<TextBlock Text="{Binding VariableList[37].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
@@ -263,7 +237,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[39].sValue}"
|
||||
<TextBlock Text="{Binding VariableList[38].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
@@ -290,7 +264,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[40].sValue}"
|
||||
<TextBlock Text="{Binding VariableList[39].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
|
||||
@@ -55,8 +55,15 @@ Public Class MachinePageVM
|
||||
NotifyPropertyChanged(NameOf(nNewDoorState))
|
||||
End Sub
|
||||
|
||||
Private m_DoorOnMachineArray(8) As LuaDoor
|
||||
Public ReadOnly Property DoorOnMachineArray As LuaDoor()
|
||||
'Private m_DoorOnMachineArray(8) As LuaDoor
|
||||
'Public ReadOnly Property DoorOnMachineArray As LuaDoor()
|
||||
' Get
|
||||
' Return m_DoorOnMachineArray
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Private m_DoorOnMachineArray As New ObservableCollection(Of LuaDoor)
|
||||
Public ReadOnly Property DoorOnMachineArray As ObservableCollection(Of LuaDoor)
|
||||
Get
|
||||
Return m_DoorOnMachineArray
|
||||
End Get
|
||||
@@ -99,6 +106,8 @@ Public Class MachinePageVM
|
||||
Private m_cmdManageMachining As ICommand
|
||||
|
||||
Sub New()
|
||||
' imposto riferimento in Map
|
||||
Map.SetRefMachinePageVM(Me)
|
||||
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableTypes.DOUBLE, "@WP_PR_00", "980", 1),
|
||||
New Variable(Variable.VariableTypes.DOUBLE, "@WP_PR_01", "981", 1),
|
||||
New Variable(Variable.VariableTypes.DOUBLE, "@WP_PR_02", "982", 1),
|
||||
@@ -154,6 +163,10 @@ Public Class MachinePageVM
|
||||
Dim sResourcesDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_RESOURCESDIR, "", sResourcesDirPath)
|
||||
m_sMachineImagePath = sResourcesDirPath & "\FiveLakesMachine.png"
|
||||
' creo posti in lista descrizioni
|
||||
For nIndex As Integer = 0 To 8
|
||||
m_DoorOnMachineArray.Add(Nothing)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub VarTimer_Tick()
|
||||
@@ -280,7 +293,6 @@ Public Class MachinePageVM
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
For nVarIndex As Integer = 0 To m_VariableList.Count - 1
|
||||
Dim Var As Variable = m_VariableList(nVarIndex)
|
||||
If nVarIndex >= 5 AndAlso nVarIndex <= 9 Then
|
||||
@@ -300,6 +312,25 @@ Public Class MachinePageVM
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
'For nVarIndex As Integer = 0 To m_VariableList.Count - 1
|
||||
' Dim Var As Variable = m_VariableList(nVarIndex)
|
||||
' If nVarIndex >= 5 AndAlso nVarIndex <= 9 Then
|
||||
' Dim nId As Integer = -1
|
||||
' If Var.nValue > 0 Then
|
||||
' m_DoorOnMachineArray(nVarIndex - 5) = m_LuaDoorList(Var.nValue - 1)
|
||||
' Else
|
||||
' m_DoorOnMachineArray(nVarIndex - 5) = Nothing
|
||||
' End If
|
||||
' End If
|
||||
' If nVarIndex >= 30 AndAlso nVarIndex <= 33 Then
|
||||
' Dim nId As Integer = -1
|
||||
' If Var.nValue > 0 Then
|
||||
' m_DoorOnMachineArray(nVarIndex - 25) = m_LuaDoorList(Var.nValue - 1)
|
||||
' Else
|
||||
' m_DoorOnMachineArray(nVarIndex - 25) = Nothing
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
|
||||
NotifyPropertyChanged(NameOf(DoorOnMachineArray))
|
||||
End Sub
|
||||
@@ -984,7 +1015,7 @@ Public Class DoorToVisibilityConverter
|
||||
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 LuaDoor Then Return Visibility.Collapsed
|
||||
If IsNothing(value) OrElse (Not TypeOf value Is LuaDoor AndAlso Not TypeOf value Is RestartDoor) Then Return Visibility.Hidden
|
||||
Return Visibility.Visible
|
||||
End Function
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Window.Resources>
|
||||
<local:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
|
||||
<local:DoorToVisibilityConverter x:Key="DoorToVisibilityConverter"/>
|
||||
<local:StateToVisibilityConverter x:Key="StateToVisibilityConverter"/>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
@@ -14,7 +16,197 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding RestartDoorList}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Source="{Binding sMachineImagePath}"
|
||||
Stretch="Uniform"/>
|
||||
<!--Porte-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.7*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="0.7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2.15*"/>
|
||||
<RowDefinition Height="0.6*"/>
|
||||
<RowDefinition Height="2.15*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding VariableList[0].sValue, Converter={StaticResource StringToVisibilityConverter}}"
|
||||
Style="{StaticResource Door}">
|
||||
<TextBlock Text="{Binding DoorOnMachineArray[0].nId}"
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Column="3"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding VariableList[1].sValue, Converter={StaticResource StringToVisibilityConverter}}"
|
||||
Style="{StaticResource Door}">
|
||||
<TextBlock Text="{Binding DoorOnMachineArray[1].nId}"
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Column="5"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding VariableList[2].sValue, Converter={StaticResource StringToVisibilityConverter}}"
|
||||
Style="{StaticResource Door}">
|
||||
<TextBlock Text="{Binding DoorOnMachineArray[2].nId}"
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Column="7"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding VariableList[3].sValue, Converter={StaticResource StringToVisibilityConverter}}"
|
||||
Style="{StaticResource Door}">
|
||||
<TextBlock Text="{Binding DoorOnMachineArray[3].nId}"
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
<Border Grid.Column="9"
|
||||
Grid.Row="1"
|
||||
Visibility="{Binding VariableList[4].sValue, Converter={StaticResource StringToVisibilityConverter}}"
|
||||
Style="{StaticResource Door}">
|
||||
<TextBlock Text="{Binding DoorOnMachineArray[4].nId}"
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--Descrizione porte-->
|
||||
<ItemsControl Grid.Row="1"
|
||||
ItemsSource="{Binding DoorOnMachineArray}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="5"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Visibility="{Binding Converter={StaticResource DoorToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="0"
|
||||
Text="Id"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
Text="{Binding nId}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Text="Circular Index"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Text="{Binding nCircIndex}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Text="State"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
Text="{Binding nState}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Text="DDF Name"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="3"
|
||||
Text="{Binding sDDFName}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="4"
|
||||
Text="CSV Name"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
Text="{Binding sCSVName}"/>
|
||||
<!--<TextBlock Grid.Column="0"
|
||||
Grid.Row="5"
|
||||
Text="DoorCode"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="5"
|
||||
Text="{Binding sDoorCode}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="6"
|
||||
Text="DoorDescription"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="6"
|
||||
Text="{Binding sDoorDescription}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="7"
|
||||
Text="M1 CN Path"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="7"
|
||||
Text="{Binding sM1CNPath}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="8"
|
||||
Text="M2 CN Path"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="8"
|
||||
Text="{Binding sM2CNPath}"/>-->
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="9"
|
||||
Text="Load Time"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="9"
|
||||
Text="{Binding sLoadTime}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="10"
|
||||
Text="Machining 1 Start"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="10"
|
||||
Text="{Binding sMachining1Start}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="11"
|
||||
Text="Machining 1 End"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="11"
|
||||
Text="{Binding sMachining1End}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="12"
|
||||
Text="Machining 2 Start"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="12"
|
||||
Text="{Binding sMachining2Start}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="13"
|
||||
Text="Machining 2 End"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="13"
|
||||
Text="{Binding sMachining2End}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="14"
|
||||
Text="UnloadTime"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="14"
|
||||
Text="{Binding sUnloadTime}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
<!--<ItemsControl ItemsSource="{Binding RestartDoorList}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Rows="1"/>
|
||||
@@ -43,9 +235,9 @@
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Text="Circular Index"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Text="{Binding nCircIndex}"/>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Text="{Binding nCircIndex}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="2"
|
||||
Text="State"/>
|
||||
@@ -55,7 +247,7 @@
|
||||
<ComboBox Grid.Column="1"
|
||||
Grid.Row="2"
|
||||
ItemsSource="{Binding DoorStateList}"
|
||||
SelectedItem="{Binding SelStateList}"/>
|
||||
SelectedItem="{Binding SelDoorState}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="3"
|
||||
Text="DDF Name"/>
|
||||
@@ -72,7 +264,7 @@
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ItemsControl>-->
|
||||
<Button Grid.Row="1"
|
||||
Content="Ok"
|
||||
Command="{Binding Ok_Command}"/>
|
||||
|
||||
@@ -4,19 +4,47 @@ Imports System.Globalization
|
||||
Imports System.IO
|
||||
|
||||
Public Class RestartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
Private m_RestartDoorList As ObservableCollection(Of JsonLuaDoor)
|
||||
Public ReadOnly Property RestartDoorList As ObservableCollection(Of JsonLuaDoor)
|
||||
Private m_RestartDoorList As ObservableCollection(Of RestartDoor)
|
||||
Public ReadOnly Property RestartDoorList As ObservableCollection(Of RestartDoor)
|
||||
Get
|
||||
Return m_RestartDoorList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sMachineImagePath As String
|
||||
Public ReadOnly Property sMachineImagePath As String
|
||||
Get
|
||||
Return m_sMachineImagePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'Private m_DoorOnMachineArray(4) As RestartDoor
|
||||
'Public ReadOnly Property DoorOnMachineArray As RestartDoor()
|
||||
' Get
|
||||
' Return m_DoorOnMachineArray
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Private m_DoorOnMachineArray As New ObservableCollection(Of RestartDoor)
|
||||
Public ReadOnly Property DoorOnMachineArray As ObservableCollection(Of RestartDoor)
|
||||
Get
|
||||
Return m_DoorOnMachineArray
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property VariableList As ObservableCollection(Of Variable)
|
||||
Get
|
||||
Return Map.refMachinePageVM.VariableList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
@@ -24,36 +52,68 @@ Public Class RestartWndVM
|
||||
GetPluginPrivateProfileString("General", "BackupDir", "", sBackupFilePath)
|
||||
sBackupFilePath &= "\LuaBackup.json"
|
||||
|
||||
|
||||
|
||||
Dim JsonLuaDoorList As List(Of JsonLuaDoor)
|
||||
If File.Exists(sBackupFilePath) Then
|
||||
Dim sReadedFile As String = File.ReadAllText(sBackupFilePath)
|
||||
|
||||
Dim JsonLuaDoorList As List(Of JsonLuaDoor) = JsonConvert.DeserializeObject(Of List(Of JsonLuaDoor))(sReadedFile)
|
||||
JsonLuaDoorList = JsonConvert.DeserializeObject(Of List(Of JsonLuaDoor))(sReadedFile)
|
||||
JsonLuaDoorList = JsonLuaDoorList.OrderBy(Of Integer)(Function(x) x.nCircIndex).ToList()
|
||||
|
||||
m_RestartDoorList = New ObservableCollection(Of JsonLuaDoor)((From JsonLuaDoor In Map.refDoorListPageVM.DoorList
|
||||
Select New JsonLuaDoor(JsonLuaDoor)).ToList())
|
||||
For JsonLuaDoorIndex = 0 To JsonLuaDoorList.Count - 1
|
||||
Dim JsonLuaDoor As JsonLuaDoor = JsonLuaDoorList(JsonLuaDoorIndex)
|
||||
Dim RestartDoor As JsonLuaDoor = m_RestartDoorList.FirstOrDefault(Function(x) x.nId = JsonLuaDoor.nId)
|
||||
If Not IsNothing(RestartDoor) Then
|
||||
RestartDoor.Update(JsonLuaDoor)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
' creo posti in lista descrizioni
|
||||
For nIndex As Integer = 0 To 4
|
||||
m_DoorOnMachineArray.Add(Nothing)
|
||||
Next
|
||||
|
||||
' leggo presenze porta
|
||||
For nPositionIndex As Integer = 4 To 0 Step -1
|
||||
If GetVariableFromName(1, "@WP_PR_0" & nPositionIndex.ToString()).dValue <> 0 Then
|
||||
' verifico indice
|
||||
Dim nCircindex As Integer = GetVariableFromName(1, "@DOORN_S" & nPositionIndex.ToString()).nValue
|
||||
If nCircindex <> 0 Then
|
||||
m_DoorOnMachineArray(nPositionIndex) = New RestartDoor(JsonLuaDoorList(nCircindex - 1))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(DoorOnMachineArray))
|
||||
|
||||
|
||||
'If File.Exists(sBackupFilePath) Then
|
||||
' Dim sReadedFile As String = File.ReadAllText(sBackupFilePath)
|
||||
|
||||
' Dim JsonLuaDoorList As List(Of JsonLuaDoor) = JsonConvert.DeserializeObject(Of List(Of JsonLuaDoor))(sReadedFile)
|
||||
' JsonLuaDoorList = JsonLuaDoorList.OrderBy(Of Integer)(Function(x) x.nCircIndex).ToList()
|
||||
|
||||
' m_RestartDoorList = New ObservableCollection(Of RestartDoor)((From JsonLuaDoor In Map.refDoorListPageVM.DoorList
|
||||
' Select New RestartDoor(JsonLuaDoor)).ToList())
|
||||
' For JsonLuaDoorIndex = 0 To JsonLuaDoorList.Count - 1
|
||||
' Dim JsonLuaDoor As JsonLuaDoor = JsonLuaDoorList(JsonLuaDoorIndex)
|
||||
' Dim RestartDoor As RestartDoor = m_RestartDoorList.FirstOrDefault(Function(x) x.nId = JsonLuaDoor.nId)
|
||||
' If Not IsNothing(RestartDoor) Then
|
||||
' RestartDoor.Update(JsonLuaDoor)
|
||||
' End If
|
||||
|
||||
|
||||
' Next
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
|
||||
' se macchina 1
|
||||
Dim sResourcesDirPath As String = ""
|
||||
GetPluginPrivateProfileString(S_GENERAL, K_RESOURCESDIR, "", sResourcesDirPath)
|
||||
m_sMachineImagePath = sResourcesDirPath & "\Multiax-C1223Ripartenza.png"
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Function GetVariableFromName(nMachIndex As Integer, sName As String) As Variable
|
||||
Return Map.refMachinePageVM.VariableList.FirstOrDefault(Function(x) x.nMachine = nMachIndex AndAlso x.sName = sName)
|
||||
End Function
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
@@ -130,13 +190,12 @@ Public Class RestartDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelDoorState As IdNameStruct
|
||||
Public Property SelDoorState As IdNameStruct
|
||||
Get
|
||||
Return m_SelDoorState
|
||||
Return m_DoorStateList.FirstOrDefault(Function(x) x.Id = m_nState)
|
||||
End Get
|
||||
Set(value As IdNameStruct)
|
||||
m_SelDoorState = value
|
||||
m_nState = value.Id
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -260,4 +319,20 @@ Public Class RestartDoor
|
||||
m_dtUnloadTime = DateTime.MinValue
|
||||
End Sub
|
||||
|
||||
Friend Sub New(JsonLuaDoor As JsonLuaDoor)
|
||||
m_nId = JsonLuaDoor.nId
|
||||
m_nCircIndex = JsonLuaDoor.nCircIndex
|
||||
m_nState = JsonLuaDoor.nState
|
||||
m_sDDFName = JsonLuaDoor.sDDFName
|
||||
m_sCSVName = JsonLuaDoor.sCSVName
|
||||
m_sM1CNPath = JsonLuaDoor.sM1CNPath
|
||||
m_sM2CNPath = JsonLuaDoor.sM2CNPath
|
||||
m_dtLoadTime = JsonLuaDoor.dtLoadTime
|
||||
m_dtMachining1Start = JsonLuaDoor.dtMachining1Start
|
||||
m_dtMachining1End = JsonLuaDoor.dtMachining1End
|
||||
m_dtMachining2Start = JsonLuaDoor.dtMachining2Start
|
||||
m_dtMachining2End = JsonLuaDoor.dtMachining2End
|
||||
m_dtUnloadTime = JsonLuaDoor.dtUnloadTime
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -65,6 +65,35 @@
|
||||
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
|
||||
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>
|
||||
|
||||
<!--Stili per disegno macchina con porte-->
|
||||
|
||||
<Style x:Key="Table" TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="Gray"/>
|
||||
<Setter Property="BorderThickness" Value="2"/>
|
||||
</Style>
|
||||
<Style x:Key="Door" TargetType="Border">
|
||||
<Setter Property="BorderBrush" Value="SaddleBrown"/>
|
||||
<Setter Property="BorderThickness" Value="5"/>
|
||||
<Setter Property="Background" Value="SandyBrown"/>
|
||||
</Style>
|
||||
<Style x:Key="Advancement_Button" TargetType="Button">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="Sensor" TargetType="Ellipse">
|
||||
<Setter Property="Height" Value="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"/>
|
||||
</Style>
|
||||
<Style x:Key="MachDrawVar_TextBlock" TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="MachDrawVar_CheckBox" TargetType="CheckBox">
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
|
||||
<!--Border-->
|
||||
|
||||
<Style x:Key="Parameter_MachinePage_Border" TargetType="{x:Type GroupBox}">
|
||||
|
||||
@@ -282,6 +282,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtLoadTime.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtLoadTime As DateTime
|
||||
Get
|
||||
Return m_dtLoadTime
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining1Start As DateTime
|
||||
Public ReadOnly Property sMachining1Start As String
|
||||
@@ -289,6 +294,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtMachining1Start.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtMachining1Start As DateTime
|
||||
Get
|
||||
Return m_dtMachining1Start
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining1End As DateTime
|
||||
Public ReadOnly Property sMachining1End As String
|
||||
@@ -296,6 +306,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtMachining1End.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtMachining1End As DateTime
|
||||
Get
|
||||
Return m_dtMachining1End
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining2Start As DateTime
|
||||
Public ReadOnly Property sMachining2Start As String
|
||||
@@ -303,6 +318,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtMachining2Start.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtMachining2Start As DateTime
|
||||
Get
|
||||
Return m_dtMachining2Start
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtMachining2End As DateTime
|
||||
Public ReadOnly Property sMachining2End As String
|
||||
@@ -310,6 +330,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtMachining2End.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtMachining2End As DateTime
|
||||
Get
|
||||
Return m_dtMachining2End
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_dtUnloadTime As DateTime
|
||||
Public ReadOnly Property sUnloadTime As String
|
||||
@@ -317,6 +342,11 @@ Public Class JsonLuaDoor
|
||||
Return m_dtUnloadTime.ToString("yy/MM/dd HH:mm:ss")
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property dtUnloadTime As DateTime
|
||||
Get
|
||||
Return m_dtUnloadTime
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<JsonConstructor>
|
||||
Sub New(nId As Integer, nCircIndex As Integer, nState As Integer, sDoorCode As String, sDoorDescription As String, sDDFName As String, sCSVName As String,
|
||||
|
||||
@@ -4,6 +4,7 @@ Module Map
|
||||
|
||||
Private m_refFiveLakesUIVM As FiveLakesUIVM
|
||||
Private m_refDoorListPageVM As DoorListPageVM
|
||||
Private m_refMachinePageVM As MachinePageVM
|
||||
Private m_refSupervisorFunction As IHost
|
||||
|
||||
'Private m_refMyStatusBarVM As MyStatusBarVM
|
||||
@@ -53,6 +54,12 @@ Module Map
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refMachinePageVM As MachinePageVM
|
||||
Get
|
||||
Return m_refMachinePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSupervisorFunction As IHost
|
||||
Get
|
||||
Return m_refSupervisorFunction
|
||||
@@ -276,6 +283,11 @@ Module Map
|
||||
Return Not IsNothing(m_refDoorListPageVM)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefMachinePageVM(MachinePageVM As MachinePageVM) As Boolean
|
||||
m_refMachinePageVM = MachinePageVM
|
||||
Return Not IsNothing(m_refMachinePageVM)
|
||||
End Function
|
||||
|
||||
' Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
|
||||
' m_refProjManagerVM = ProjManagerVM
|
||||
' Return Not IsNothing(m_refProjManagerVM)
|
||||
|
||||
Reference in New Issue
Block a user