- cambiato nome a controllo lista porte

- aggiunte nuove funzionalita' a lista porte
- aggiunta pagina macchina con lettura variabili e disegno
- implementato json di backup
This commit is contained in:
Emmanuele Sassi
2024-08-09 11:34:57 +02:00
parent d1afc92d94
commit d3314d0c1f
19 changed files with 1053 additions and 381 deletions
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
Public Class DoorListV
End Class
@@ -1,4 +1,4 @@
<Grid x:Class="DoorListV"
<Grid x:Class="DoorListPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Yellow">
@@ -19,6 +19,12 @@
<Button Content="↓"
ToolTip="Move Down"
Command="{Binding MoveDown_Command}"/>
<Button Content="Delete"
ToolTip="Delete"
Command="{Binding Delete_Command}"/>
<Button Content="Delete All"
ToolTip="Delete All"
Command="{Binding DeleteAll_Command}"/>
<Button Content="Produce"
ToolTip="Send to production"
Command="{Binding Produce_Command}"/>
@@ -0,0 +1,3 @@
Public Class DoorListPageV
End Class
@@ -1,7 +1,15 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Converters
Imports System.Windows.Threading
Imports Newtonsoft.Json.Linq
Imports Supervisor.Plugin.Interface
Public Class DoorListVM
Public Class DoorListPageVM
Inherits VMBase
Private m_BackupTimer As New DispatcherTimer
Private m_DoorList As New ObservableCollection(Of Door)
Public ReadOnly Property DoorList As ObservableCollection(Of Door)
@@ -19,14 +27,112 @@ Public Class DoorListVM
End Set
End Property
Private m_nModifyIndex As Integer = 0
Private m_nBackupindex As Integer = 0
Private m_bWritingBackup As Boolean = False
' Definizione comandi
Private m_cmdOpenCSV As ICommand
Private m_cmdSkipDoor As ICommand
Private m_cmdMoveUp As ICommand
Private m_cmdMoveDown As ICommand
Private m_cmdDelete As ICommand
Private m_cmdDeleteAll As ICommand
Private m_cmdProduce As ICommand
Private m_cmdProduceAll As ICommand
#Region "CONSTRUCTOR"
Sub New()
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
Read(sBackupFilePath)
m_BackupTimer.Interval = New TimeSpan(1000)
AddHandler m_BackupTimer.Tick, AddressOf BackupTimer_Tick
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Function ExecCAMProcess(sDDFName As String) As Boolean
' lancio esecuzione programma
Dim sCamExePath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
Dim sMainLuaPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "MainLUA", "", sMainLuaPath)
Dim sDDFDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "DDFDir", "", sDDFDirPath)
Dim sDDFFilePath As String = sDDFDirPath & "\" & sDDFName
Return Map.refSupervisorFunction.PlgExecProcess(sCamExePath, sMainLuaPath, sDDFFilePath)
End Function
Public Sub Read(FilePath As String)
If Not File.Exists(FilePath) Then Return
Dim sReadedFile As String = File.ReadAllText(FilePath)
Dim JsonDoorList As List(Of JsonDoor) = JsonConvert.DeserializeObject(Of List(Of JsonDoor))(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())
'NotifyPropertyChanged(NameOf(DoorList))
End Sub
Public Sub Write(FilePath As String)
Dim JsonDoorList As New List(Of JsonDoor)
For nDoorIndex As Integer = 0 To m_DoorList.Count - 1
JsonDoorList.Add(New JsonDoor(nDoorIndex + 1, m_DoorList(nDoorIndex)))
Next
Dim JsonFromWindow As String = JsonConvert.SerializeObject(JsonDoorList, Formatting.Indented)
If File.Exists(FilePath) Then
Dim sBackupFilePath As String = Path.ChangeExtension(FilePath, ".bck")
If File.Exists(sBackupFilePath) Then
Try
File.Delete(sBackupFilePath)
Catch ex As Exception
Map.refSupervisorFunction.PlgOutLog("Error! Impossible deleting backup file!")
End Try
End If
Try
File.Move(FilePath, sBackupFilePath)
Catch ex As Exception
Map.refSupervisorFunction.PlgOutLog("Error! Impossible renaming backup file!")
End Try
End If
File.WriteAllText(FilePath, JsonFromWindow)
End Sub
Private Sub WriteBackupCmd()
If m_bWritingBackup Then Return
m_bWritingBackup = True
m_nBackupindex = m_nModifyIndex
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
Write(sBackupFilePath)
m_bWritingBackup = False
End Sub
Friend Sub WriteBackup()
m_nModifyIndex += 1
If m_bWritingBackup Then Return
m_bWritingBackup = True
Dim sBackupDirPath As String = ""
GetPluginPrivateProfileString(S_GENERAL, "BackupDir", "", sBackupDirPath)
Dim sBackupFilePath As String = sBackupDirPath & "\Backup.json"
Write(sBackupFilePath)
m_bWritingBackup = False
End Sub
Private Sub BackupTimer_Tick(sender As Object, e As EventArgs)
If m_nBackupindex < m_nModifyIndex Then
WriteBackupCmd()
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "OpenCSV"
@@ -41,6 +147,31 @@ Public Class DoorListVM
End Property
Public Sub OpenCSV()
'' test lancio esecuzione programma
'Dim sCamExePath As String = ""
'GetPluginPrivateProfileString(S_GENERAL, "CAMExePath", "", sCamExePath)
'Dim sMainLuaPath As String = ""
'GetPluginPrivateProfileString(S_GENERAL, "MainLUA", "", sMainLuaPath)
'Dim sDDFDirPath As String = ""
'GetPluginPrivateProfileString(S_GENERAL, "DDFDir", "", sDDFDirPath)
'Dim sDDFFilePath As String = sDDFDirPath & "\both_machines.ddf"
'Dim Proc As New Process()
'Proc.StartInfo.FileName = sCamExePath
'Proc.StartInfo.RedirectStandardInput = False
'Proc.StartInfo.RedirectStandardOutput = False
'Proc.StartInfo.Arguments = 1.ToString() & " """ & sMainLuaPath & """ """ & sDDFFilePath & """" ' & """ ""1"""
''Proc.StartInfo.Arguments = """" & sDDFFilePath & """" & " ""2"""
'Proc.StartInfo.UseShellExecute = False
'Proc.StartInfo.CreateNoWindow = True
'If Proc.Start Then
' While Not Proc.HasExited
' Dim x = 3
' Threading.Thread.Sleep(100)
' End While
'End If
'Map.refSupervisorFunction.PlgOutLog("Prova di funzionamento riferimento funzioni host da Plugin!!")
Dim sDir As String = String.Empty
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
@@ -61,11 +192,11 @@ Public Class DoorListVM
Dim sHeightName As String = ""
Dim sWidthName As String = ""
Dim sThicknessName As String = ""
GetMainPrivateProfileString(S_CSV, K_DDFNAME, K_DDFNAME, sDDFName)
GetMainPrivateProfileString(S_CSV, K_QUANTITY, "", sQuantityName)
GetMainPrivateProfileString(S_CSV, K_HEIGHT, "", sHeightName)
GetMainPrivateProfileString(S_CSV, K_WIDTH, "", sWidthName)
GetMainPrivateProfileString(S_CSV, K_THICKNESS, "", sThicknessName)
GetPluginPrivateProfileString(S_CSV, K_DDFNAME, K_DDFNAME, sDDFName)
GetPluginPrivateProfileString(S_CSV, K_QUANTITY, "", sQuantityName)
GetPluginPrivateProfileString(S_CSV, K_HEIGHT, "", sHeightName)
GetPluginPrivateProfileString(S_CSV, K_WIDTH, "", sWidthName)
GetPluginPrivateProfileString(S_CSV, K_THICKNESS, "", sThicknessName)
Dim nDDFNameIndex As Integer = Array.IndexOf(Headers, sDDFName)
Dim nQuantityNameIndex As Integer = Array.IndexOf(Headers, sQuantityName)
Dim nHeightNameIndex As Integer = Array.IndexOf(Headers, sHeightName)
@@ -113,9 +244,18 @@ Public Class DoorListVM
dThickness = 0
End If
End If
Dim NewDoor As New Door(nLineIndex, Values(nDDFNameIndex), Path.GetFileName(sCSVPath),
nQuantity, dWidth, dHeight, dThickness, Headers, Values)
m_DoorList.Add(NewDoor)
For nQuantityIndex = 1 To nQuantity
Dim nId As Integer = 1
If m_DoorList.Count > 0 Then
Dim LastDoor = m_DoorList.LastOrDefault()
If Not IsNothing(LastDoor) AndAlso LastDoor.nId < 1000 Then
nId = LastDoor.nId + 1
End If
End If
Dim NewDoor As New Door(nId, nLineIndex, Values(nDDFNameIndex), Path.GetFileName(sCSVPath),
1, dWidth, dHeight, dThickness, Headers, Values)
m_DoorList.Add(NewDoor)
Next
nLineIndex += 1
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
Dim sMessage As String = "Line " & ex.Message & "is not valid and will be skipped."
@@ -127,7 +267,13 @@ Public Class DoorListVM
MessageBox.Show("The following lines are not valid and have been skipped:" & sLineErrorList, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Using
' verifico porte
'For Each Door In m_DoorList
' Dim bExecResult As Boolean = ExecCAMProcess(Door.sDDFName)
' Door.SetState(If(bExecResult, Door.DoorStates.VERIFIED, Door.DoorStates.VERIFICATION_FAILED))
'Next
End If
WriteBackup()
End Sub
#End Region ' OpenCSV
@@ -144,8 +290,9 @@ Public Class DoorListVM
End Property
Public Sub SkipDoor()
If IsNothing(SelDoor) OrElse SelDoor.nState <> Door.DoorStates.VERIFIED Then Return
SelDoor.SetState(Door.DoorStates.SKIPPED)
If IsNothing(SelDoor) OrElse (SelDoor.nState <> Door.DoorStates.VERIFIED AndAlso SelDoor.nState <> Door.DoorStates.SKIPPED) Then Return
SelDoor.SetState(If(SelDoor.nState = Door.DoorStates.VERIFIED, Door.DoorStates.SKIPPED, Door.DoorStates.VERIFIED))
WriteBackup()
End Sub
#End Region ' SkipDoor
@@ -167,6 +314,7 @@ Public Class DoorListVM
If nOldIndex = 0 Then Return
If m_DoorList(nOldIndex - 1).nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
m_DoorList.Move(nOldIndex, nOldIndex - 1)
WriteBackup()
End Sub
#End Region ' MoveUp
@@ -187,10 +335,50 @@ Public Class DoorListVM
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
If nOldIndex = m_DoorList.Count - 1 Then Return
m_DoorList.Move(nOldIndex, nOldIndex + 1)
WriteBackup()
End Sub
#End Region ' MoveDown
#Region "Delete"
Public ReadOnly Property Delete_Command As ICommand
Get
If m_cmdDelete Is Nothing Then
m_cmdDelete = New Command(AddressOf Delete)
End If
Return m_cmdDelete
End Get
End Property
Public Sub Delete()
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
If MessageBox.Show("Are you sure you want to delete the selected door?", "Info", MessageBoxButton.YesNo, MessageBoxImage.Information) = MessageBoxResult.Yes Then
m_DoorList.Remove(SelDoor)
WriteBackup()
End If
End Sub
#End Region ' Delete
#Region "DeleteAll"
Public ReadOnly Property DeleteAll_Command As ICommand
Get
If m_cmdDeleteAll Is Nothing Then
m_cmdDeleteAll = New Command(AddressOf DeleteAll)
End If
Return m_cmdDeleteAll
End Get
End Property
Public Sub DeleteAll()
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
WriteBackup()
End Sub
#End Region ' DeleteAll
#Region "Produce"
Public ReadOnly Property Produce_Command As ICommand
@@ -212,6 +400,7 @@ Public Class DoorListVM
m_DoorList.Move(nOldIndex, nNewIndex)
SelDoor.SetState(Door.DoorStates.SENT_TO_PRODUCTION)
WriteBackup()
End Sub
#End Region ' Produce
@@ -229,6 +418,7 @@ Public Class DoorListVM
Public Sub ProduceAll()
If IsNothing(SelDoor) Then Return
WriteBackup()
End Sub
#End Region ' ProduceAll
@@ -316,6 +506,8 @@ Public Class Door
End Property
Private m_nState As DoorStates = DoorStates.LOADED_FROM_CSV
<JsonProperty>
<JsonConverter(GetType(StringEnumConverter))>
Public ReadOnly Property nState As DoorStates
Get
Return m_nState
@@ -326,7 +518,8 @@ Public Class Door
NotifyPropertyChanged(NameOf(nState))
End Sub
Sub New(nCSVLine As Integer, sDDFName As String, sCSVName As String, nQuantity As Integer, dWidth As Double, dHeight As Double, dThickness As Double, HeaderList As String(), ValueList As String())
Sub New(nId As Integer, nCSVLine As Integer, sDDFName As String, sCSVName As String, nQuantity As Integer, dWidth As Double, dHeight As Double, dThickness As Double, HeaderList As String(), ValueList As String())
m_nId = nId
m_nCSVLine = nCSVLine
m_sDDFName = sDDFName
m_sCSVName = sCSVName
@@ -334,9 +527,23 @@ Public Class Door
m_dHeight = dHeight
m_dWidth = dWidth
m_dThickness = dThickness
For nParamIndex = 0 To Math.Max(HeaderList.Count, ValueList.Count) - 1
m_CustomerParameters.Add(New CustomerParameter(If(HeaderList.Count > nParamIndex, HeaderList(nParamIndex), ""), If(ValueList.Count > nParamIndex, ValueList(nParamIndex), "")))
Next
If Not IsNothing(HeaderList) AndAlso HeaderList.Count > 0 AndAlso Not IsNothing(ValueList) AndAlso ValueList.Count > 0 Then
For nParamIndex = 0 To Math.Max(HeaderList.Count, ValueList.Count) - 1
m_CustomerParameters.Add(New CustomerParameter(If(HeaderList.Count > nParamIndex, HeaderList(nParamIndex), ""), If(ValueList.Count > nParamIndex, ValueList(nParamIndex), "")))
Next
End If
End Sub
Sub New(JsonDoor As JsonDoor)
m_nId = JsonDoor.nId
m_nCSVLine = JsonDoor.nCSVLine
m_sDDFName = JsonDoor.sDDFName
m_sCSVName = JsonDoor.sCSVName
m_nQuantity = JsonDoor.nQuantity
m_dHeight = JsonDoor.dHeight
m_dWidth = JsonDoor.dWidth
m_dThickness = JsonDoor.dThickness
m_CustomerParameters = JsonDoor.CustomerParameters
End Sub
End Class
+8 -2
View File
@@ -2,10 +2,16 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Supervisor.Plugin.FiveLakes"
DataContext="{StaticResource FiveLakesUIVM}"
Background="Red">
<TabControl SelectedIndex="{Binding SelPage}">
<TabItem Name="DoorList">
<local:DoorListV DataContext="{StaticResource DoorListVM}"/>
<TabItem Name="DoorList"
Header="DoorList">
<local:DoorListPageV DataContext="{StaticResource DoorListVM}"/>
</TabItem>
<TabItem Name="Machine"
Header="Machine">
<local:MachinePageV DataContext="{StaticResource MachinePageVM}"/>
</TabItem>
</TabControl>
<!--<Grid.ColumnDefinitions>
@@ -1,5 +1,4 @@
Imports System.ComponentModel.Composition
Imports System.Text
Imports Supervisor.Plugin.Interface
<Export(GetType(IPluginControl))>
@@ -7,21 +6,18 @@ Imports Supervisor.Plugin.Interface
Public Class FiveLakesUI
Implements IPluginControl
<Import(GetType(IHost))>
Public Host As IHost
Private m_FiveLakesUIVM As FiveLakesUIVM
Sub New()
<ImportingConstructor>
Sub New(Host As IHost)
' This call is required by the designer.
InitializeComponent()
'' Add any initialization after the InitializeComponent() call.
'Host.PlgOutLog("Comando su log da Plugin!!!!!")
m_FiveLakesUIVM = New FiveLakesUIVM
Me.DataContext = m_FiveLakesUIVM
m_FiveLakesUIVM = Me.DataContext
'Me.DataContext = m_FiveLakesUIVM
AddHandler Me.Loaded, AddressOf FiveLakesUIV_Loaded
Map.SetRefSupervisorFunction(Host)
End Sub
'Private Sub Button1_Click(sender As Object, e As RoutedEventArgs) Handles Button1.Click
+7 -1
View File
@@ -1,4 +1,7 @@
Public Class FiveLakesUIVM
Imports System.ComponentModel.Composition
Imports Supervisor.Plugin.Interface
Public Class FiveLakesUIVM
Inherits VMBase
Private m_sDataRoot As String
@@ -18,6 +21,8 @@
End Sub
Sub New()
' Creo riferimento a questa classe in Map
Map.BeginInit(Me)
' Impostazione path radice per i dati
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
If GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
@@ -30,6 +35,7 @@
IniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
' Impostazione path resources dir
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
End Sub
End Class
@@ -0,0 +1,125 @@
<Grid x:Class="MachinePageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>-->
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding MachinePos0}"/>
</Grid>-->
<ItemsControl ItemsSource="{Binding VariableList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{Binding sName}"/>
<TextBlock Grid.Column="1"
Text="{Binding sIndex}"/>
<TextBlock Grid.Column="2"
Text="{Binding sValue}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<Grid Grid.Column="1">
<Grid.Resources>
<Style x:Key="Table" TargetType="Border">
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="5"/>
<Setter Property="Background" Value="LightGray"/>
</Style>
<Style x:Key="Door" TargetType="Border">
<Setter Property="BorderBrush" Value="SaddleBrown"/>
<Setter Property="BorderThickness" Value="5"/>
<Setter Property="Background" Value="SandyBrown"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Width" Value="80"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Style="{StaticResource Table}"/>
<Border Grid.Column="1"
Style="{StaticResource Table}"/>
<Border Grid.Column="2"
Style="{StaticResource Table}"/>
<Border Grid.Column="3"
Style="{StaticResource Table}"/>
<Border Grid.Column="4"
Style="{StaticResource Table}"/>
<Border Grid.Column="5"
Style="{StaticResource Table}"/>
<Border Grid.Column="6"
Style="{StaticResource Table}"/>
<Border Grid.Column="7"
Style="{StaticResource Table}"/>
<Border Grid.Column="8"
Style="{StaticResource Table}"/>
<Border Grid.Column="9"
Style="{StaticResource Table}"/>
</Grid>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding DoorOnMachineList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Canvas.Bottom="{Binding dBottomPosition}"
Canvas.Left="{Binding dLeftPosition}"
Style="{StaticResource Door}">
<TextBlock Text="{Binding nId}"
FontSize="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
--><!--<Canvas Grid.Row="1">
<Border Canvas.Top="30"
Canvas.Left="30"
Style="{StaticResource Door}">
<TextBlock Text="5"
FontSize="20"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Canvas>--><!--
</Grid>-->
</Grid>
@@ -0,0 +1,3 @@
Public Class MachinePageV
End Class
@@ -0,0 +1,185 @@
Imports System.Collections.ObjectModel
Imports System.Windows.Threading
Public Class MachinePageVM
Private m_DoorOnMachineList As New ObservableCollection(Of Door)
Public ReadOnly Property DoorOnMachineList As ObservableCollection(Of Door)
Get
Return m_DoorOnMachineList
End Get
End Property
Private m_VarTimer As New DispatcherTimer
Private m_VariableList As ObservableCollection(Of Variable)
Public ReadOnly Property VariableList As ObservableCollection(Of Variable)
Get
Return m_VariableList
End Get
End Property
Sub New()
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),
New Variable(Variable.VariableTypes.DOUBLE, "@WP_PR_03", "983", 1),
New Variable(Variable.VariableTypes.DOUBLE, "@WP_PR_04", "984", 1),
New Variable(Variable.VariableTypes.INTEGER, "@DOORN_S0", "1360", 1),
New Variable(Variable.VariableTypes.INTEGER, "@DOORN_S1", "1361", 1),
New Variable(Variable.VariableTypes.INTEGER, "@DOORN_S2", "1362", 1),
New Variable(Variable.VariableTypes.INTEGER, "@DOORN_S3", "1363", 1),
New Variable(Variable.VariableTypes.INTEGER, "@DOORN_S4", "1364", 1),
New Variable(Variable.VariableTypes.INTEGER, "@SENT_1", "1350", 1),
New Variable(Variable.VariableTypes.INTEGER, "@SENT_2", "1351", 1),
New Variable(Variable.VariableTypes.INTEGER, "@STATE", "1352", 1),
New Variable(Variable.VariableTypes.INTEGER, "@RESET_ON", "1365", 1),
New Variable(Variable.VariableTypes.INTEGER, "@MAST_OK", "1366", 1),
New Variable(Variable.VariableTypes.INTEGER, "@START_OK", "1367", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF00", "901.0", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF01", "901.1", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF02", "901.2", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF03", "901.3", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF04", "901.4", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF05", "901.5", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF06", "901.6", 1),
New Variable(Variable.VariableTypes.BOOLEAN, "@BF07", "901.7", 1)})
AddHandler m_VarTimer.Tick, AddressOf VarTimer_Tick
m_VarTimer.Interval = New TimeSpan(100)
m_VarTimer.Start()
m_DoorOnMachineList.Add(New Door(35, 1, "Test.ddf", "Produzione2024", 1, 800, 1800, 40, {""}, {""}))
End Sub
Friend Sub VarTimer_Tick()
For Each Var In m_VariableList
Select Case Var.Type
Case Variable.VariableTypes.INTEGER
Dim nIndex As Integer = 0
Integer.TryParse(Var.sIndex, nIndex)
Dim nValue As Integer = 0
If Map.refSupervisorFunction.ComReadShortVar(nIndex, nValue, Var.nMachine) Then
Var.SetValue(nValue)
Else
Map.refSupervisorFunction.PlgOutLog("Error! Reading Variable " & Var.sIndex & " on machine " & Var.nMachine & "failed!")
End If
Case Variable.VariableTypes.DOUBLE
Dim nIndex As Integer = 0
Integer.TryParse(Var.sIndex, nIndex)
Dim dValue As Double = 0
If Map.refSupervisorFunction.ComReadDoubleVar(nIndex, dValue, Var.nMachine) Then
Var.SetValue(dValue)
Else
Map.refSupervisorFunction.PlgOutLog("Error! Reading Variable " & Var.sIndex & " on machine " & Var.nMachine & "failed!")
End If
Case Variable.VariableTypes.BOOLEAN
Dim nIndex As Integer = 0
Dim nBit As Integer = 0
Dim sIndexSplit() As String = Var.sIndex.Split("."c)
Integer.TryParse(sIndexSplit(0), nIndex)
Integer.TryParse(sIndexSplit(1), nBit)
Integer.TryParse(Var.sIndex, nIndex)
Dim dValue As Double = 0
If Map.refSupervisorFunction.ComReadBitVar(nIndex, nBit, dValue, Var.nMachine) Then
Var.SetValue(dValue)
Else
Map.refSupervisorFunction.PlgOutLog("Error! Reading Variable " & Var.sIndex & " on machine " & Var.nMachine & "failed!")
End If
End Select
Next
End Sub
End Class
Public Class Variable
Inherits VMBase
Public Enum VariableTypes As Integer
[INTEGER] = 1
[DOUBLE] = 2
[BOOLEAN] = 3
End Enum
Private m_Type As VariableTypes
Public ReadOnly Property Type As Integer
Get
Return m_Type
End Get
End Property
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Private m_sIndex As String
Public ReadOnly Property sIndex As String
Get
Return m_sIndex
End Get
End Property
Private m_nMachine As Integer
Public ReadOnly Property nMachine As Integer
Get
Return m_nMachine
End Get
End Property
Private m_nValue As Integer
Private m_dValue As Double
Private m_bValue As Boolean
Public Property sValue As String
Get
Select Case Type
Case VariableTypes.INTEGER
Return m_nValue.ToString()
Case VariableTypes.DOUBLE
Return DoubleToString(m_dValue, 2)
Case VariableTypes.BOOLEAN
Return If(m_bValue, 1, 0)
End Select
End Get
Set(value As String)
Select Case Type
Case VariableTypes.INTEGER
If Not Integer.TryParse(value, m_nValue) Then
NotifyPropertyChanged(NameOf(sValue))
End If
Case VariableTypes.DOUBLE
If Not StringToDouble(value, m_dValue) Then
NotifyPropertyChanged(NameOf(sValue))
End If
Case VariableTypes.BOOLEAN
Dim nBoolean As Integer = 0
If Integer.TryParse(value, nBoolean) Then
m_bValue = If(nBoolean > 0, 1, 0)
Else
NotifyPropertyChanged(NameOf(sValue))
End If
End Select
m_nValue = value
End Set
End Property
Friend Sub SetValue(value As Integer)
m_nValue = value
NotifyPropertyChanged(NameOf(sValue))
End Sub
Friend Sub SetValue(value As Double)
m_dValue = value
NotifyPropertyChanged(NameOf(sValue))
End Sub
Friend Sub SetValue(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(sValue))
End Sub
Sub New(Type As VariableTypes, sName As String, sIndex As String, nMachine As Integer)
m_Type = Type
m_sName = sName
m_sIndex = sIndex
m_nMachine = nMachine
End Sub
End Class
@@ -6,5 +6,4 @@ Imports Supervisor.Plugin.Interface
Public Class MainMenuV
Implements IPluginControl
End Class
@@ -49,8 +49,11 @@
<Reference Include="EgtWPFLib48">
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib48.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Supervisor.Plugin.Interface">
<HintPath>..\..\Supervisor\Supervisor.Plugin.Interface\bin\Debug\Supervisor.Plugin.Interface.dll</HintPath>
<HintPath>..\..\Ngp\Supervisor.Plugin.Interface\bin\Debug\Supervisor.Plugin.Interface.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
@@ -89,14 +92,18 @@
<ItemGroup>
<Compile Include="Constants\ConstGen.vb" />
<Compile Include="Constants\ConstIni.vb" />
<Compile Include="DoorList\DoorListV.xaml.vb">
<DependentUpon>DoorListV.xaml</DependentUpon>
<Compile Include="DoorListPage\DoorListPageV.xaml.vb">
<DependentUpon>DoorListPageV.xaml</DependentUpon>
</Compile>
<Compile Include="DoorList\DoorListVM.vb" />
<Compile Include="DoorListPage\DoorListPageVM.vb" />
<Compile Include="FiveLakesUI.xaml.vb">
<DependentUpon>FiveLakesUI.xaml</DependentUpon>
</Compile>
<Compile Include="FiveLakesUIVM.vb" />
<Compile Include="MachinePage\MachinePageV.xaml.vb">
<DependentUpon>MachinePageV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePage\MachinePageVM.vb" />
<Compile Include="MainMenu\MainMenuV.xaml.vb">
<DependentUpon>MainMenuV.xaml</DependentUpon>
</Compile>
@@ -120,6 +127,8 @@
<Compile Include="Utility\Command.vb" />
<Compile Include="Utility\GenInterface.vb" />
<Compile Include="Utility\IniFile.vb" />
<Compile Include="Utility\JsonUtility.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\StringConversion.vb" />
<Compile Include="Utility\VMBase.vb" />
<EmbeddedResource Include="My Project\Resources.resx">
@@ -131,9 +140,10 @@
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Page Include="DoorList\DoorListV.xaml">
<Page Include="DoorListPage\DoorListPageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -141,6 +151,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachinePage\MachinePageV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainMenu\MainMenuV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -9,7 +9,9 @@
Assign a Key to every Panel ViewModel to use
it in xaml file(ProjectView.xaml).
-->
<local:DoorListVM x:Key="DoorListVM"/>
<local:FiveLakesUIVM x:Key="FiveLakesUIVM"/>
<local:DoorListPageVM x:Key="DoorListVM"/>
<local:MachinePageVM x:Key="MachinePageVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
@@ -26,15 +26,15 @@ Public Module IniFile
m_sPath = sPath
End Sub
Public Function GetMainPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
Public Function GetPluginPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
Return GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sPath)
End Function
Public Function GetMainPrivateProfileDouble(IpAppName As String, IpKeyName As String, dDefault As Double) As Double
Public Function GetPluginPrivateProfileDouble(IpAppName As String, IpKeyName As String, dDefault As Double) As Double
Return GetPrivateProfileDouble(IpAppName, IpKeyName, dDefault, m_sPath)
End Function
Public Function GetMainPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
Public Function GetPluginPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
End Function
@@ -0,0 +1,113 @@
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Converters
Imports Supervisor.Plugin.FiveLakes.Door
Public Class JsonDoor
Private m_nListIndex As Integer
Public ReadOnly Property nListIndex As Integer
Get
Return m_nListIndex
End Get
End Property
Private m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_nCSVLine As Integer
Public ReadOnly Property nCSVLine As Integer
Get
Return m_nCSVLine
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_nQuantity As Integer
Public ReadOnly Property nQuantity As Integer
Get
Return m_nQuantity
End Get
End Property
Private m_dWidth As Double
Public ReadOnly Property dWidth As Double
Get
Return m_dWidth
End Get
End Property
Private m_dHeight As Double
Public ReadOnly Property dHeight As Double
Get
Return m_dHeight
End Get
End Property
Private m_dThickness As Double
Public ReadOnly Property dThickness As Double
Get
Return m_dThickness
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_CustomerParameters As New List(Of CustomerParameter)
Public ReadOnly Property CustomerParameters As List(Of CustomerParameter)
Get
Return m_CustomerParameters
End Get
End Property
Private m_nState As DoorStates = DoorStates.LOADED_FROM_CSV
<JsonProperty>
<JsonConverter(GetType(StringEnumConverter))>
Public ReadOnly Property nState As DoorStates
Get
Return m_nState
End Get
End Property
<JsonConstructor>
Sub New(nListIndex As Integer, nId As Integer, nCSVLine As Integer, sDDFName As String, sCSVName As String, nQuantity As Integer, dWidth As Double, dHeight As Double, dThickness As Double, CustomerParameters As List(Of CustomerParameter))
m_nListIndex = nListIndex
m_nId = nId
m_nCSVLine = nCSVLine
m_sDDFName = sDDFName
m_sCSVName = sCSVName
m_nQuantity = nQuantity
m_dHeight = dHeight
m_dWidth = dWidth
m_dThickness = dThickness
m_CustomerParameters = CustomerParameters
End Sub
Sub New(nListIndex As Integer, Door As Door)
m_nListIndex = nListIndex
m_nId = Door.nId
m_nCSVLine = Door.nCSVLine
m_sDDFName = Door.sDDFName
m_sCSVName = Door.sCSVName
m_nQuantity = Door.nQuantity
m_dHeight = Door.dHeight
m_dWidth = Door.dWidth
m_dThickness = Door.dThickness
m_CustomerParameters = Door.CustomerParameters
End Sub
End Class
+346 -340
View File
@@ -1,427 +1,435 @@
Imports EgtWPFLib5
Imports Supervisor.Plugin.Interface
Module Map
Private m_refMainWindowVM As MainWindowVM
Private m_refMyStatusBarVM As MyStatusBarVM
Private m_refProjManagerVM As ProjManagerVM
Private m_refProjectVM As ProjectVM
Private m_refSecondaryWindowVM As SecondaryWindowVM
Private m_refSecondaryWindowV As SecondaryWindowV
Private m_refMachinePanelVM As MachinePanelVM
Private m_refLeftPanelVM As LeftPanelVM
Private m_refRightPanelVM As RightPanelVM
Private m_refDispositionPanelVM As DispositionPanelVM
Private m_refStartMachPanelVM As StartMachPanelVM
Private m_refRibPanelVM As RibPanelVM
Private m_refControllerInputPanelVM As ControllerInputPanelVM
Private m_refInstrumentPanelVM As InstrumentPanelVM
Private m_refTopPanelVM As TopPanelVM
Private m_refSliceManagerVM As SliceManagerVM
Private m_refTFSEditorVM As TFSEditorVM
Private m_refCurrMachiningPanelVM As CurrMachiningPanelVM
Private m_refMachiningDbVM As MachiningDbVM
Private m_refMaterialDbVM As MaterialDbVM
Private m_refSliderManagerVM As SliderManagerVM
Private m_refRibParamPanelVM As RibParamPanelVM
Private m_refSimulationPanelVM As SimulationPanelVM
Private m_refReferencePanelVM As ReferencePanelVM
Private m_refViewLayerManagerVM As ViewLayerManagerVM
Private m_refShellNumberPanelVM As ShellNumberPanelVM
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
Private m_refFilledSolidPanelVM As FilledSolidPanelVM
Private m_refFilledSolidParamPanelVM As FilledSolidParamPanelVM
Private m_refSplashScreen As SplashScreen
Private m_refManagePartPanelVM As ManagePartPanelVM
Private m_refMachineViewPanelVM As MachineViewPanelVM
Private m_refImportLoadingWndVM As ImportLoadingWndVM
Private m_refFiveLakesUIVM As FiveLakesUIVM
Private m_refSupervisorFunction As IHost
'Private m_refMyStatusBarVM As MyStatusBarVM
'Private m_refProjManagerVM As ProjManagerVM
'Private m_refProjectVM As ProjectVM
'Private m_refSecondaryWindowVM As SecondaryWindowVM
'Private m_refSecondaryWindowV As SecondaryWindowV
'Private m_refMachinePanelVM As MachinePanelVM
'Private m_refLeftPanelVM As LeftPanelVM
'Private m_refRightPanelVM As RightPanelVM
'Private m_refDispositionPanelVM As DispositionPanelVM
'Private m_refStartMachPanelVM As StartMachPanelVM
'Private m_refRibPanelVM As RibPanelVM
'Private m_refControllerInputPanelVM As ControllerInputPanelVM
'Private m_refInstrumentPanelVM As InstrumentPanelVM
'Private m_refTopPanelVM As TopPanelVM
'Private m_refSliceManagerVM As SliceManagerVM
'Private m_refTFSEditorVM As TFSEditorVM
'Private m_refCurrMachiningPanelVM As CurrMachiningPanelVM
'Private m_refMachiningDbVM As MachiningDbVM
'Private m_refMaterialDbVM As MaterialDbVM
'Private m_refSliderManagerVM As SliderManagerVM
'Private m_refRibParamPanelVM As RibParamPanelVM
'Private m_refSimulationPanelVM As SimulationPanelVM
'Private m_refReferencePanelVM As ReferencePanelVM
'Private m_refViewLayerManagerVM As ViewLayerManagerVM
'Private m_refShellNumberPanelVM As ShellNumberPanelVM
'Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
'Private m_refFilledSolidPanelVM As FilledSolidPanelVM
'Private m_refFilledSolidParamPanelVM As FilledSolidParamPanelVM
'Private m_refSplashScreen As SplashScreen
'Private m_refManagePartPanelVM As ManagePartPanelVM
'Private m_refMachineViewPanelVM As MachineViewPanelVM
'Private m_refImportLoadingWndVM As ImportLoadingWndVM
#Region "Get"
Public ReadOnly Property refMainWindowVM As MainWindowVM
Public ReadOnly Property refFiveLakesUIVM As FiveLakesUIVM
Get
Return m_refMainWindowVM
Return m_refFiveLakesUIVM
End Get
End Property
Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
Public ReadOnly Property refSupervisorFunction As IHost
Get
Return LibMap.refStatusBarVM
Return m_refSupervisorFunction
End Get
End Property
Public ReadOnly Property refProjManagerVM As ProjManagerVM
Get
Return m_refProjManagerVM
End Get
End Property
'Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
' Get
' Return LibMap.refStatusBarVM
' End Get
'End Property
Public ReadOnly Property refProjectVM As ProjectVM
Get
Return m_refProjectVM
End Get
End Property
'Public ReadOnly Property refProjManagerVM As ProjManagerVM
' Get
' Return m_refProjManagerVM
' End Get
'End Property
Public ReadOnly Property refSceneHostVM As MySceneHostVM
Get
Return LibMap.refSceneHostVM
End Get
End Property
'Public ReadOnly Property refProjectVM As ProjectVM
' Get
' Return m_refProjectVM
' End Get
'End Property
Public ReadOnly Property refSecondaryWindowVM As SecondaryWindowVM
Get
Return m_refSecondaryWindowVM
End Get
End Property
Public ReadOnly Property refSecondaryWindowV As SecondaryWindowV
Get
Return m_refSecondaryWindowV
End Get
End Property
'Public ReadOnly Property refSceneHostVM As MySceneHostVM
' Get
' Return LibMap.refSceneHostVM
' End Get
'End Property
Public ReadOnly Property refShowPanelVM As ShowPanelVM
Get
Return LibMap.refShowPanelVM
End Get
End Property
'Public ReadOnly Property refSecondaryWindowVM As SecondaryWindowVM
' Get
' Return m_refSecondaryWindowVM
' End Get
'End Property
'Public ReadOnly Property refSecondaryWindowV As SecondaryWindowV
' Get
' Return m_refSecondaryWindowV
' End Get
'End Property
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
Get
Return m_refMachinePanelVM
End Get
End Property
'Public ReadOnly Property refShowPanelVM As ShowPanelVM
' Get
' Return LibMap.refShowPanelVM
' End Get
'End Property
Public ReadOnly Property refLeftPanelVM As LeftPanelVM
Get
Return m_refLeftPanelVM
End Get
End Property
'Public ReadOnly Property refMachinePanelVM As MachinePanelVM
' Get
' Return m_refMachinePanelVM
' End Get
'End Property
Public ReadOnly Property refRightPanelVM As RightPanelVM
Get
Return m_refRightPanelVM
End Get
End Property
'Public ReadOnly Property refLeftPanelVM As LeftPanelVM
' Get
' Return m_refLeftPanelVM
' End Get
'End Property
Public ReadOnly Property refDispositionPanelVM As DispositionPanelVM
Get
Return m_refDispositionPanelVM
End Get
End Property
'Public ReadOnly Property refRightPanelVM As RightPanelVM
' Get
' Return m_refRightPanelVM
' End Get
'End Property
Public ReadOnly Property refStartMachPanelVM As StartMachPanelVM
Get
Return m_refStartMachPanelVM
End Get
End Property
'Public ReadOnly Property refDispositionPanelVM As DispositionPanelVM
' Get
' Return m_refDispositionPanelVM
' End Get
'End Property
Public ReadOnly Property refRibPanelVM As RibPanelVM
Get
Return m_refRibPanelVM
End Get
End Property
'Public ReadOnly Property refStartMachPanelVM As StartMachPanelVM
' Get
' Return m_refStartMachPanelVM
' End Get
'End Property
Public ReadOnly Property refControllerInputPanelVM As ControllerInputPanelVM
Get
Return m_refControllerInputPanelVM
End Get
End Property
'Public ReadOnly Property refRibPanelVM As RibPanelVM
' Get
' Return m_refRibPanelVM
' End Get
'End Property
Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
Get
Return m_refInstrumentPanelVM
End Get
End Property
'Public ReadOnly Property refControllerInputPanelVM As ControllerInputPanelVM
' Get
' Return m_refControllerInputPanelVM
' End Get
'End Property
Public ReadOnly Property refTopPanelVM As TopPanelVM
Get
Return m_refTopPanelVM
End Get
End Property
'Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
' Get
' Return m_refInstrumentPanelVM
' End Get
'End Property
Public ReadOnly Property refSliceManagerVM As SliceManagerVM
Get
Return m_refSliceManagerVM
End Get
End Property
'Public ReadOnly Property refTopPanelVM As TopPanelVM
' Get
' Return m_refTopPanelVM
' End Get
'End Property
Public ReadOnly Property refTFSEditorVM As TFSEditorVM
Get
Return m_refTFSEditorVM
End Get
End Property
'Public ReadOnly Property refSliceManagerVM As SliceManagerVM
' Get
' Return m_refSliceManagerVM
' End Get
'End Property
Public ReadOnly Property refCurrMachiningPanelVM As CurrMachiningPanelVM
Get
Return m_refCurrMachiningPanelVM
End Get
End Property
'Public ReadOnly Property refTFSEditorVM As TFSEditorVM
' Get
' Return m_refTFSEditorVM
' End Get
'End Property
Public ReadOnly Property refMachiningDbVM As MachiningDbVM
Get
Return m_refMachiningDbVM
End Get
End Property
'Public ReadOnly Property refCurrMachiningPanelVM As CurrMachiningPanelVM
' Get
' Return m_refCurrMachiningPanelVM
' End Get
'End Property
Public ReadOnly Property refMaterialDbVM As MaterialDbVM
Get
Return m_refMaterialDbVM
End Get
End Property
'Public ReadOnly Property refMachiningDbVM As MachiningDbVM
' Get
' Return m_refMachiningDbVM
' End Get
'End Property
Public ReadOnly Property refSliderManagerVM As SliderManagerVM
Get
Return m_refSliderManagerVM
End Get
End Property
'Public ReadOnly Property refMaterialDbVM As MaterialDbVM
' Get
' Return m_refMaterialDbVM
' End Get
'End Property
Public ReadOnly Property refRibParamPanelVM As RibParamPanelVM
Get
Return m_refRibParamPanelVM
End Get
End Property
'Public ReadOnly Property refSliderManagerVM As SliderManagerVM
' Get
' Return m_refSliderManagerVM
' End Get
'End Property
Public ReadOnly Property refSimulationPanelVM As SimulationPanelVM
Get
Return m_refSimulationPanelVM
End Get
End Property
'Public ReadOnly Property refRibParamPanelVM As RibParamPanelVM
' Get
' Return m_refRibParamPanelVM
' End Get
'End Property
Public ReadOnly Property refReferencePanelVM As ReferencePanelVM
Get
Return m_refReferencePanelVM
End Get
End Property
'Public ReadOnly Property refSimulationPanelVM As SimulationPanelVM
' Get
' Return m_refSimulationPanelVM
' End Get
'End Property
Public ReadOnly Property refViewLayerManagerVM As ViewLayerManagerVM
Get
Return m_refViewLayerManagerVM
End Get
End Property
'Public ReadOnly Property refReferencePanelVM As ReferencePanelVM
' Get
' Return m_refReferencePanelVM
' End Get
'End Property
Public ReadOnly Property refShellNumberPanelVM As ShellNumberPanelVM
Get
Return m_refShellNumberPanelVM
End Get
End Property
'Public ReadOnly Property refViewLayerManagerVM As ViewLayerManagerVM
' Get
' Return m_refViewLayerManagerVM
' End Get
'End Property
Public ReadOnly Property refShellNumberParamPanelVM As ShellNumberParamPanelVM
Get
Return m_refShellNumberParamPanelVM
End Get
End Property
'Public ReadOnly Property refShellNumberPanelVM As ShellNumberPanelVM
' Get
' Return m_refShellNumberPanelVM
' End Get
'End Property
Public ReadOnly Property refFilledSolidPanelVM As FilledSolidPanelVM
Get
Return m_refFilledSolidPanelVM
End Get
End Property
'Public ReadOnly Property refShellNumberParamPanelVM As ShellNumberParamPanelVM
' Get
' Return m_refShellNumberParamPanelVM
' End Get
'End Property
Public ReadOnly Property refFilledSolidParamPanelVM As FilledSolidParamPanelVM
Get
Return m_refFilledSolidParamPanelVM
End Get
End Property
'Public ReadOnly Property refFilledSolidPanelVM As FilledSolidPanelVM
' Get
' Return m_refFilledSolidPanelVM
' End Get
'End Property
Public ReadOnly Property refSplashScreen As SplashScreen
Get
Return m_refSplashScreen
End Get
End Property
'Public ReadOnly Property refFilledSolidParamPanelVM As FilledSolidParamPanelVM
' Get
' Return m_refFilledSolidParamPanelVM
' End Get
'End Property
Public ReadOnly Property refManagePartPanelVM As ManagePartPanelVM
Get
Return m_refManagePartPanelVM
End Get
End Property
'Public ReadOnly Property refSplashScreen As SplashScreen
' Get
' Return m_refSplashScreen
' End Get
'End Property
Public ReadOnly Property refMachineViewPanelVM As MachineViewPanelVM
Get
Return m_refMachineViewPanelVM
End Get
End Property
'Public ReadOnly Property refManagePartPanelVM As ManagePartPanelVM
' Get
' Return m_refManagePartPanelVM
' End Get
'End Property
Public ReadOnly Property refImportLoadingWndVM As ImportLoadingWndVM
Get
Return m_refImportLoadingWndVM
End Get
End Property
'Public ReadOnly Property refMachineViewPanelVM As MachineViewPanelVM
' Get
' Return m_refMachineViewPanelVM
' End Get
'End Property
'Public ReadOnly Property refImportLoadingWndVM As ImportLoadingWndVM
' Get
' Return m_refImportLoadingWndVM
' End Get
'End Property
#End Region ' Get
#Region "Set"
Friend Function SetRefMyStatusBarVM(MyStatusBarVM As MyStatusBarVM) As Boolean
LibMap.SetRefStatusBarVM(MyStatusBarVM)
Return Not IsNothing(LibMap.refStatusBarVM)
Friend Function SetRefSupervisorFunction(IHost As IHost) As Boolean
m_refSupervisorFunction = IHost
Return Not IsNothing(m_refSupervisorFunction)
End Function
Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
m_refProjManagerVM = ProjManagerVM
Return Not IsNothing(m_refProjManagerVM)
End Function
' Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
' m_refProjManagerVM = ProjManagerVM
' Return Not IsNothing(m_refProjManagerVM)
' End Function
Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean
m_refProjectVM = ProjectVM
Return Not IsNothing(m_refProjectVM)
End Function
' Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean
' m_refProjectVM = ProjectVM
' Return Not IsNothing(m_refProjectVM)
' End Function
Friend Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
LibMap.SetRefSceneHostVM(SceneHostVM)
Return Not IsNothing(LibMap.refSceneHostVM)
End Function
' Friend Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
' LibMap.SetRefSceneHostVM(SceneHostVM)
' Return Not IsNothing(LibMap.refSceneHostVM)
' End Function
Friend Function SetRefSecondaryWindowVM(SecondaryWindowVM As SecondaryWindowVM) As Boolean
m_refSecondaryWindowVM = SecondaryWindowVM
Return Not IsNothing(m_refSecondaryWindowVM)
End Function
Friend Function SetRefSecondaryWindowV(SecondaryWindowV As SecondaryWindowV) As Boolean
m_refSecondaryWindowV = SecondaryWindowV
Return Not IsNothing(m_refSecondaryWindowV)
End Function
' Friend Function SetRefSecondaryWindowVM(SecondaryWindowVM As SecondaryWindowVM) As Boolean
' m_refSecondaryWindowVM = SecondaryWindowVM
' Return Not IsNothing(m_refSecondaryWindowVM)
' End Function
' Friend Function SetRefSecondaryWindowV(SecondaryWindowV As SecondaryWindowV) As Boolean
' m_refSecondaryWindowV = SecondaryWindowV
' Return Not IsNothing(m_refSecondaryWindowV)
' End Function
Friend Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
m_refMachinePanelVM = MachinePanelVM
Return Not IsNothing(m_refMachinePanelVM)
End Function
' Friend Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
' m_refMachinePanelVM = MachinePanelVM
' Return Not IsNothing(m_refMachinePanelVM)
' End Function
Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
m_refLeftPanelVM = LeftPanelVM
Return Not IsNothing(m_refLeftPanelVM)
End Function
' Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
' m_refLeftPanelVM = LeftPanelVM
' Return Not IsNothing(m_refLeftPanelVM)
' End Function
Friend Function SetRefRightPanelVM(RightPanelVM As RightPanelVM) As Boolean
m_refRightPanelVM = RightPanelVM
Return Not IsNothing(m_refRightPanelVM)
End Function
' Friend Function SetRefRightPanelVM(RightPanelVM As RightPanelVM) As Boolean
' m_refRightPanelVM = RightPanelVM
' Return Not IsNothing(m_refRightPanelVM)
' End Function
Friend Function SetRefDispositionPanelVM(DispositionPanelVM As DispositionPanelVM) As Boolean
m_refDispositionPanelVM = DispositionPanelVM
Return Not IsNothing(m_refDispositionPanelVM)
End Function
' Friend Function SetRefDispositionPanelVM(DispositionPanelVM As DispositionPanelVM) As Boolean
' m_refDispositionPanelVM = DispositionPanelVM
' Return Not IsNothing(m_refDispositionPanelVM)
' End Function
Friend Function SetRefStartMachPanelVM(StartMachPanelVM As StartMachPanelVM) As Boolean
m_refStartMachPanelVM = StartMachPanelVM
Return Not IsNothing(m_refStartMachPanelVM)
End Function
' Friend Function SetRefStartMachPanelVM(StartMachPanelVM As StartMachPanelVM) As Boolean
' m_refStartMachPanelVM = StartMachPanelVM
' Return Not IsNothing(m_refStartMachPanelVM)
' End Function
Friend Function SetRefRibPanelVM(RibPanelVM As RibPanelVM) As Boolean
m_refRibPanelVM = RibPanelVM
Return Not IsNothing(m_refRibPanelVM)
End Function
' Friend Function SetRefRibPanelVM(RibPanelVM As RibPanelVM) As Boolean
' m_refRibPanelVM = RibPanelVM
' Return Not IsNothing(m_refRibPanelVM)
' End Function
Friend Function SetRefControllerInputPanelVM(ControllerInputPanelVM As ControllerInputPanelVM) As Boolean
m_refControllerInputPanelVM = ControllerInputPanelVM
Return Not IsNothing(m_refControllerInputPanelVM)
End Function
' Friend Function SetRefControllerInputPanelVM(ControllerInputPanelVM As ControllerInputPanelVM) As Boolean
' m_refControllerInputPanelVM = ControllerInputPanelVM
' Return Not IsNothing(m_refControllerInputPanelVM)
' End Function
Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
m_refInstrumentPanelVM = InstrumentPanelVM
Return Not IsNothing(m_refInstrumentPanelVM)
End Function
' Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
' m_refInstrumentPanelVM = InstrumentPanelVM
' Return Not IsNothing(m_refInstrumentPanelVM)
' End Function
Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
m_refTopPanelVM = TopPanelVM
Return Not IsNothing(m_refTopPanelVM)
End Function
' Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
' m_refTopPanelVM = TopPanelVM
' Return Not IsNothing(m_refTopPanelVM)
' End Function
Friend Function SetRefSliceManagerVM(SliceManagerVM As SliceManagerVM) As Boolean
m_refSliceManagerVM = SliceManagerVM
Return Not IsNothing(m_refSliceManagerVM)
End Function
' Friend Function SetRefSliceManagerVM(SliceManagerVM As SliceManagerVM) As Boolean
' m_refSliceManagerVM = SliceManagerVM
' Return Not IsNothing(m_refSliceManagerVM)
' End Function
Friend Function SetRefTFSEditorVM(TFSEditorVM As TFSEditorVM) As Boolean
m_refTFSEditorVM = TFSEditorVM
Return Not IsNothing(m_refTFSEditorVM)
End Function
' Friend Function SetRefTFSEditorVM(TFSEditorVM As TFSEditorVM) As Boolean
' m_refTFSEditorVM = TFSEditorVM
' Return Not IsNothing(m_refTFSEditorVM)
' End Function
Friend Function SetRefCurrMachiningPanelVM(CurrMachiningPanelVM As CurrMachiningPanelVM) As Boolean
m_refCurrMachiningPanelVM = CurrMachiningPanelVM
Return Not IsNothing(m_refCurrMachiningPanelVM)
End Function
' Friend Function SetRefCurrMachiningPanelVM(CurrMachiningPanelVM As CurrMachiningPanelVM) As Boolean
' m_refCurrMachiningPanelVM = CurrMachiningPanelVM
' Return Not IsNothing(m_refCurrMachiningPanelVM)
' End Function
Friend Function SetRefMachiningDbVM(MachiningDbVM As MachiningDbVM) As Boolean
m_refMachiningDbVM = MachiningDbVM
Return Not IsNothing(m_refMachiningDbVM)
End Function
' Friend Function SetRefMachiningDbVM(MachiningDbVM As MachiningDbVM) As Boolean
' m_refMachiningDbVM = MachiningDbVM
' Return Not IsNothing(m_refMachiningDbVM)
' End Function
Friend Function SetRefMaterialDbVM(MaterialDbVM As MaterialDbVM) As Boolean
m_refMaterialDbVM = MaterialDbVM
Return Not IsNothing(m_refMaterialDbVM)
End Function
' Friend Function SetRefMaterialDbVM(MaterialDbVM As MaterialDbVM) As Boolean
' m_refMaterialDbVM = MaterialDbVM
' Return Not IsNothing(m_refMaterialDbVM)
' End Function
Friend Function SetRefSliderManagerVM(SliderManagerVM As SliderManagerVM) As Boolean
m_refSliderManagerVM = SliderManagerVM
Return Not IsNothing(m_refSliderManagerVM)
End Function
' Friend Function SetRefSliderManagerVM(SliderManagerVM As SliderManagerVM) As Boolean
' m_refSliderManagerVM = SliderManagerVM
' Return Not IsNothing(m_refSliderManagerVM)
' End Function
Friend Function SetRefRibParamPanelVM(RibParamPanelVM As RibParamPanelVM) As Boolean
m_refRibParamPanelVM = RibParamPanelVM
Return Not IsNothing(m_refRibParamPanelVM)
End Function
' Friend Function SetRefRibParamPanelVM(RibParamPanelVM As RibParamPanelVM) As Boolean
' m_refRibParamPanelVM = RibParamPanelVM
' Return Not IsNothing(m_refRibParamPanelVM)
' End Function
Friend Function SetRefSimulationPanelVM(SimulationPanelVM As SimulationPanelVM) As Boolean
m_refSimulationPanelVM = SimulationPanelVM
Return Not IsNothing(m_refSimulationPanelVM)
End Function
' Friend Function SetRefSimulationPanelVM(SimulationPanelVM As SimulationPanelVM) As Boolean
' m_refSimulationPanelVM = SimulationPanelVM
' Return Not IsNothing(m_refSimulationPanelVM)
' End Function
Friend Function SetRefReferencePanelVM(ReferencePanelVM As ReferencePanelVM) As Boolean
m_refReferencePanelVM = ReferencePanelVM
Return Not IsNothing(m_refReferencePanelVM)
End Function
' Friend Function SetRefReferencePanelVM(ReferencePanelVM As ReferencePanelVM) As Boolean
' m_refReferencePanelVM = ReferencePanelVM
' Return Not IsNothing(m_refReferencePanelVM)
' End Function
Friend Function SetRefViewLayerManagerVM(ViewLayerManagerVM As ViewLayerManagerVM) As Boolean
m_refViewLayerManagerVM = ViewLayerManagerVM
Return Not IsNothing(m_refViewLayerManagerVM)
End Function
' Friend Function SetRefViewLayerManagerVM(ViewLayerManagerVM As ViewLayerManagerVM) As Boolean
' m_refViewLayerManagerVM = ViewLayerManagerVM
' Return Not IsNothing(m_refViewLayerManagerVM)
' End Function
Friend Function SetRefShellNumberPanelVM(ShellNumberPanelVM As ShellNumberPanelVM) As Boolean
m_refShellNumberPanelVM = ShellNumberPanelVM
Return Not IsNothing(m_refShellNumberPanelVM)
End Function
' Friend Function SetRefShellNumberPanelVM(ShellNumberPanelVM As ShellNumberPanelVM) As Boolean
' m_refShellNumberPanelVM = ShellNumberPanelVM
' Return Not IsNothing(m_refShellNumberPanelVM)
' End Function
Friend Function SetRefShellNumberParamPanelVM(ShellNumberParamPanelVM As ShellNumberParamPanelVM) As Boolean
m_refShellNumberParamPanelVM = ShellNumberParamPanelVM
Return Not IsNothing(m_refShellNumberParamPanelVM)
End Function
' Friend Function SetRefShellNumberParamPanelVM(ShellNumberParamPanelVM As ShellNumberParamPanelVM) As Boolean
' m_refShellNumberParamPanelVM = ShellNumberParamPanelVM
' Return Not IsNothing(m_refShellNumberParamPanelVM)
' End Function
Friend Function SetRefFilledSolidPanelVM(FilledSolidPanelVM As FilledSolidPanelVM) As Boolean
m_refFilledSolidPanelVM = FilledSolidPanelVM
Return Not IsNothing(m_refFilledSolidPanelVM)
End Function
' Friend Function SetRefFilledSolidPanelVM(FilledSolidPanelVM As FilledSolidPanelVM) As Boolean
' m_refFilledSolidPanelVM = FilledSolidPanelVM
' Return Not IsNothing(m_refFilledSolidPanelVM)
' End Function
Friend Function SetRefFilledSolidParamPanelVM(FilledSolidParamPanelVM As FilledSolidParamPanelVM) As Boolean
m_refFilledSolidParamPanelVM = FilledSolidParamPanelVM
Return Not IsNothing(m_refFilledSolidParamPanelVM)
End Function
' Friend Function SetRefFilledSolidParamPanelVM(FilledSolidParamPanelVM As FilledSolidParamPanelVM) As Boolean
' m_refFilledSolidParamPanelVM = FilledSolidParamPanelVM
' Return Not IsNothing(m_refFilledSolidParamPanelVM)
' End Function
Friend Function SetRefSplashScreen(SplashScreen As SplashScreen) As Boolean
m_refSplashScreen = SplashScreen
Return Not IsNothing(m_refSplashScreen)
End Function
' Friend Function SetRefSplashScreen(SplashScreen As SplashScreen) As Boolean
' m_refSplashScreen = SplashScreen
' Return Not IsNothing(m_refSplashScreen)
' End Function
Friend Function SetRefManagePartPanelVM(ManagePartPanelVM As ManagePartPanelVM) As Boolean
m_refManagePartPanelVM = ManagePartPanelVM
Return Not IsNothing(m_refManagePartPanelVM)
End Function
' Friend Function SetRefManagePartPanelVM(ManagePartPanelVM As ManagePartPanelVM) As Boolean
' m_refManagePartPanelVM = ManagePartPanelVM
' Return Not IsNothing(m_refManagePartPanelVM)
' End Function
Friend Function SetRefMachineViewPanelVM(MachineViewPanelVM As MachineViewPanelVM) As Boolean
m_refMachineViewPanelVM = MachineViewPanelVM
Return Not IsNothing(m_refMachineViewPanelVM)
End Function
' Friend Function SetRefMachineViewPanelVM(MachineViewPanelVM As MachineViewPanelVM) As Boolean
' m_refMachineViewPanelVM = MachineViewPanelVM
' Return Not IsNothing(m_refMachineViewPanelVM)
' End Function
Friend Function SetRefImportLoadingWndVM(ImportLoadingWndVM As ImportLoadingWndVM) As Boolean
m_refImportLoadingWndVM = ImportLoadingWndVM
Return Not IsNothing(m_refImportLoadingWndVM)
End Function
' Friend Function SetRefImportLoadingWndVM(ImportLoadingWndVM As ImportLoadingWndVM) As Boolean
' m_refImportLoadingWndVM = ImportLoadingWndVM
' Return Not IsNothing(m_refImportLoadingWndVM)
' End Function
#End Region ' Set
#Region "Init"
Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
m_refMainWindowVM = MainWindowVM
Return Not IsNothing(m_refMainWindowVM)
Friend Function BeginInit(FiveLakesUIVM As FiveLakesUIVM) As Boolean
m_refFiveLakesUIVM = FiveLakesUIVM
Return Not IsNothing(m_refFiveLakesUIVM)
End Function
Friend Function EndInit() As Boolean
' Verifico se tutti i pezzi necessari sono stati caricati
@@ -433,9 +441,7 @@ Module Map
' Not IsNothing(m_refNestingTabVM) AndAlso Not IsNothing(m_refSimulTabVM) AndAlso
' Not IsNothing(m_refMachiningTabVM) AndAlso
' LibMap.EndInit()
Return Not IsNothing(m_refMainWindowVM) AndAlso
Not IsNothing(LibMap.refStatusBarVM) AndAlso
LibMap.EndInit()
Return Not IsNothing(m_refFiveLakesUIVM)
End Function
#End Region ' Init
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
</packages>