- aggiunte funzioni per leggere e scrivere direttamente su ini plugin
- aggiunta funzione lua per aprire finestra ripartenza - aggiunti bottoni per gestione variabili di partenza - aggiunta descrizione porta lungo la linea - aggiunta finestra di ripartenza
This commit is contained in:
@@ -2,10 +2,69 @@ Imports KeraLua
|
||||
|
||||
Public Module Lua_General
|
||||
|
||||
Friend func_PlgGetNumberFromIni As LuaFunction = AddressOf Lua_PlgGetNumberFromIni
|
||||
Friend func_PlgGetStringFromIni As LuaFunction = AddressOf Lua_PlgGetStringFromIni
|
||||
Friend func_PlgWriteStringToIni As LuaFunction = AddressOf Lua_PlgWriteStringToIni
|
||||
Friend func_PlgExecProcess As LuaFunction = AddressOf Lua_PlgExecProcess
|
||||
Friend func_PlgExecProcessAsync As LuaFunction = AddressOf Lua_PlgExecProcessAsync
|
||||
Friend func_PlgCheckExecProcessAsync As LuaFunction = AddressOf Lua_PlgCheckExecProcessAsync
|
||||
Friend func_PlgGetNextDoor As LuaFunction = AddressOf Lua_PlgGetNextDoor
|
||||
Friend func_PlgOpenRestartWnd As LuaFunction = AddressOf Lua_PlgOpenRestartWnd
|
||||
|
||||
Private Function Lua_PlgGetNumberFromIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, dDef, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim dDef As Integer = 0
|
||||
Dim sIniFile As String = ""
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, dDef)
|
||||
LuaCheckParam(state, 4, sIniFile)
|
||||
LuaClearStack(state)
|
||||
Dim dResult As Double = GetPluginPrivateProfileDouble(sSec, sKey, dDef)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, dResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_PlgGetStringFromIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, sDef, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim sDef As String = 0
|
||||
Dim sIniFile As String = ""
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, sDef)
|
||||
LuaCheckParam(state, 4, sIniFile)
|
||||
LuaClearStack(state)
|
||||
Dim sResult As String = ""
|
||||
GetPluginPrivateProfileString(sSec, sKey, sDef, sResult)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, sResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_PlgWriteStringToIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, sVal, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim sVal As Integer = 0
|
||||
Dim sIniFile As String = ""
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, sVal)
|
||||
LuaCheckParam(state, 4, sIniFile)
|
||||
LuaClearStack(state)
|
||||
Dim bResult As Boolean = WritePluginPrivateProfileString(sSec, sKey, sVal)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, bResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_PlgExecProcess(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
@@ -60,12 +119,24 @@ Public Module Lua_General
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
Private Function Lua_PlgOpenRestartWnd(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
LuaClearStack(state)
|
||||
Dim RestartWnd As New RestartWndV(Application.Current.MainWindow, New RestartWndVM())
|
||||
RestartWnd.ShowDialog()
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
Friend Function LuaInstallGeneral(state As Lua) As Boolean
|
||||
If IsNothing(state) Then Return False
|
||||
state.Register("PlgGetNumberFromIni", func_PlgGetNumberFromIni)
|
||||
state.Register("PlgGetStringFromIni", func_PlgGetStringFromIni)
|
||||
state.Register("PlgWriteStringToIni", func_PlgWriteStringToIni)
|
||||
state.Register("PlgExecProcess", func_PlgExecProcess)
|
||||
state.Register("PlgExecProcessAsync", func_PlgExecProcessAsync)
|
||||
state.Register("PlgCheckExecProcessAsync", func_PlgCheckExecProcessAsync)
|
||||
state.Register("PlgGetNextDoor", func_PlgGetNextDoor)
|
||||
state.Register("PlgOpenRestartWnd", func_PlgOpenRestartWnd)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
<local:StringToMachineStateConverter x:Key="StringToMachineStateConverter"/>
|
||||
<local:StringToDDFCalcStateConverter x:Key="StringToDDFCalcStateConverter"/>
|
||||
<local:StringToNewDoorStateConverter x:Key="StringToNewDoorStateConverter"/>
|
||||
<local:StringToBooleanConverter x:Key="IntegerToBooleanConverter"/>
|
||||
<local:StringToBooleanConverter x:Key="StringToBooleanConverter"/>
|
||||
<local:StringToBackgroundConverter x:Key="StringToBackgroundConverter"/>
|
||||
<local:DoorToVisibilityConverter x:Key="DoorToVisibilityConverter"/>
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -47,8 +48,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid
|
||||
Visibility="{Binding MachineCommands_Visibility}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="20"/>
|
||||
@@ -109,8 +109,207 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--Bottoni di debug-->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3.8*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3.7*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3.5*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="3.8*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--M1-->
|
||||
<Grid Grid.Column="1"
|
||||
Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Reset-->
|
||||
<GroupBox Header="Reset"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[13].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1365,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1365,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Mast-->
|
||||
<GroupBox Grid.Column="2"
|
||||
Header="Master"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[14].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1366,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1366,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Start-->
|
||||
<GroupBox Grid.Column="4"
|
||||
Header="Start"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[15].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1367,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="1,1,1367,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
<!--M2-->
|
||||
<Grid Grid.Column="5"
|
||||
Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="15"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--Reset-->
|
||||
<GroupBox Header="Reset"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[38].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1365,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1365,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Mast-->
|
||||
<GroupBox Grid.Column="2"
|
||||
Header="Master"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[39].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1366,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1366,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--Start-->
|
||||
<GroupBox Grid.Column="4"
|
||||
Header="Start"
|
||||
Style="{StaticResource Parameter_MachinePage_Border}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding VariableList[40].sValue}"
|
||||
HorizontalAlignment="Center"/>
|
||||
<Grid Grid.Row="1"
|
||||
HorizontalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="0"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1367,0"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="1"
|
||||
Command="{Binding WriteVariable_Command}"
|
||||
CommandParameter="2,1,1367,1"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<!--Gestori macchine-->
|
||||
<Grid Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
@@ -167,14 +366,14 @@
|
||||
Text="Sent 1"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
IsChecked="{Binding VariableList[10].sValue, Converter={StaticResource IntegerToBooleanConverter}}"
|
||||
IsChecked="{Binding VariableList[10].sValue, Converter={StaticResource StringToBooleanConverter}}"
|
||||
Style="{StaticResource MachDrawVar_CheckBox}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Text="Sent 2"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
IsChecked="{Binding VariableList[11].sValue, Converter={StaticResource IntegerToBooleanConverter}}"
|
||||
IsChecked="{Binding VariableList[11].sValue, Converter={StaticResource StringToBooleanConverter}}"
|
||||
Style="{StaticResource MachDrawVar_CheckBox}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -219,14 +418,14 @@
|
||||
Text="Sent 1"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
Grid.Row="0"
|
||||
IsChecked="{Binding VariableList[34].sValue, Converter={StaticResource IntegerToBooleanConverter}}"
|
||||
IsChecked="{Binding VariableList[34].sValue, Converter={StaticResource StringToBooleanConverter}}"
|
||||
Style="{StaticResource MachDrawVar_CheckBox}"/>
|
||||
<TextBlock Grid.Column="0"
|
||||
Grid.Row="1"
|
||||
Text="Sent 2"/>
|
||||
<CheckBox Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
IsChecked="{Binding VariableList[35].sValue, Converter={StaticResource IntegerToBooleanConverter}}"
|
||||
IsChecked="{Binding VariableList[35].sValue, Converter={StaticResource StringToBooleanConverter}}"
|
||||
Style="{StaticResource MachDrawVar_CheckBox}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -656,6 +855,133 @@
|
||||
Style="{StaticResource MachDrawVar_TextBlock}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<!--Descrizione porte-->
|
||||
<ItemsControl Grid.Column="1"
|
||||
Grid.Row="4"
|
||||
ItemsSource="{Binding DoorOnMachineArray}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="9"/>
|
||||
</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"/>
|
||||
<TextBlock 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>
|
||||
<!--Bottoni macchina vecchi-->
|
||||
<!--<Grid Grid.Row="1">
|
||||
|
||||
@@ -62,6 +62,13 @@ Public Class MachinePageVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DoorOnMachineArray(8) As LuaDoor
|
||||
Public ReadOnly Property DoorOnMachineArray As LuaDoor()
|
||||
Get
|
||||
Return m_DoorOnMachineArray
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LuaDoorList As New ObservableCollection(Of LuaDoor)
|
||||
Public ReadOnly Property LuaDoorList As ObservableCollection(Of LuaDoor)
|
||||
Get
|
||||
@@ -252,6 +259,7 @@ Public Class MachinePageVM
|
||||
LuaGetGlobVar("ListaCircPorte." & nDoorIndex & ".tempo_scarico", lUnloadTime)
|
||||
m_LuaDoorList.Add(New LuaDoor(nId, nCircIndex, nDoorState, sDoorCode, sDoorDescription, sDDFName, sCSVName, sM1CNPath, sM2CNPath, lLoadTime, lMachining1Start, lMachining1End, lMachining2Start, lMachining2End, lUnloadTime))
|
||||
If nId > 0 Then
|
||||
' aggiorno dati in lista porte
|
||||
Dim Door As Door = Map.refDoorListPageVM.DoorList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If nDoorState <> Door.nProdState Then
|
||||
Door.SetProdState(nDoorState)
|
||||
@@ -264,6 +272,26 @@ 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
|
||||
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 LuaGetGlobVar("ListaCircPorte." & Var.nValue & ".Id", nId) Then
|
||||
m_DoorIndexOnMachine(nVarIndex - 25) = nId
|
||||
Else
|
||||
m_DoorIndexOnMachine(nVarIndex - 25) = 0
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -898,10 +926,11 @@ Public Class StringToBooleanConverter
|
||||
Implements IValueConverter
|
||||
|
||||
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
|
||||
If Not TypeOf value Is String OrElse String.IsNullOrWhiteSpace(value) Then Return False
|
||||
If Not TypeOf value Is String OrElse String.IsNullOrWhiteSpace(value) Then Return Nothing
|
||||
Dim sValue As String = value
|
||||
Dim nValue As Integer
|
||||
If Not Integer.TryParse(sValue, nValue) Then Return False
|
||||
If Not Integer.TryParse(sValue, nValue) Then Return Nothing
|
||||
If nValue = -1 Then Return Nothing
|
||||
Return nValue <> 0
|
||||
End Function
|
||||
|
||||
@@ -927,3 +956,17 @@ Public Class StringToBackgroundConverter
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
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
|
||||
Return Visibility.Visible
|
||||
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
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
Sub New(Owner As Window, ProcessManagerVM As ProcessManagerVM)
|
||||
'MyBase.New(Owner)
|
||||
Me.Owner = Owner
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = ProcessManagerVM
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<Window x:Class="RestartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Supervisor.Plugin.FiveLakes"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,19 @@
|
||||
Public Class RestartWndV
|
||||
|
||||
Private WithEvents m_RestartWndVM As RestartWndVM
|
||||
|
||||
Sub New(Owner As Window, RestartWndVM As RestartWndVM)
|
||||
'MyBase.New(Owner)
|
||||
Me.Owner = Owner
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = RestartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_RestartWndVM = RestartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_RestartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,60 @@
|
||||
Imports Newtonsoft.Json
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
|
||||
Public Class RestartWndVM
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
Dim sBackupFilePath As String = ""
|
||||
GetPluginPrivateProfileString("General", "BackupDir", "", sBackupFilePath)
|
||||
sBackupFilePath &= "/LuaBackup.json"
|
||||
|
||||
|
||||
|
||||
If File.Exists(sBackupFilePath) Then
|
||||
Dim sReadedFile As String = File.ReadAllText(sBackupFilePath)
|
||||
|
||||
Dim JsonDoorList As List(Of LuaDoor) = JsonConvert.DeserializeObject(Of List(Of LuaDoor))(sReadedFile)
|
||||
'JsonDoorList = JsonDoorList.OrderBy(Of Integer)(Function(x) x.nListIndex).ToList()
|
||||
|
||||
'm_DoorList = New ObservableCollection(Of Door)((From JsonDoor In JsonDoorList
|
||||
' Select New Door(JsonDoor)).ToList())
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -120,6 +120,10 @@
|
||||
</Compile>
|
||||
<Compile Include="MainMenu\MainMenuVM.vb" />
|
||||
<Compile Include="ProcessManager\ProcessManagerVM.vb" />
|
||||
<Compile Include="RestartWnd\RestartWndV.xaml.vb">
|
||||
<DependentUpon>RestartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RestartWnd\RestartWndVM.vb" />
|
||||
<Compile Include="StatisticsPage\StatisticsPageV.xaml.vb">
|
||||
<DependentUpon>StatisticsPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -180,6 +184,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="RestartWnd\RestartWndV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="StatisticsPage\StatisticsPageV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -65,4 +65,12 @@
|
||||
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
|
||||
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>
|
||||
|
||||
<!--Border-->
|
||||
|
||||
<Style x:Key="Parameter_MachinePage_Border" TargetType="{x:Type GroupBox}">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="DarkGray"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -58,7 +58,7 @@ Public Module IniFile
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Public Function WritePluginPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user