- creazione dictionary
- creazione lista porte
This commit is contained in:
Binary file not shown.
@@ -19,8 +19,8 @@ Global
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|x64.Build.0 = Debug|x64
|
||||
{38BEE4BF-9238-459F-AF89-4DD94C4FD0DA}.Debug|x86.ActiveCfg = Debug|x86
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstGen.vb Data : 08.05.24 Versione : 2.6e1
|
||||
' Contenuto : Modulo costanti generali.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.05.24 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
Public Module ConstGen
|
||||
|
||||
' File con direttorio radice dei dati
|
||||
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
|
||||
Public Const S_DATA As String = "Data"
|
||||
Public Const K_DATAROOT As String = "DataRoot"
|
||||
|
||||
'' File con dati di licenza
|
||||
'Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
|
||||
'Public Const S_LICENCE As String = "Licence"
|
||||
'Public Const K_LOCKID As String = "LockId"
|
||||
'Public Const K_KEY As String = "Key"
|
||||
|
||||
|
||||
' Abilitazioni licenza
|
||||
Public Enum KEY_OPT As UInteger
|
||||
SUPERVISOR = 1
|
||||
End Enum
|
||||
|
||||
' Sottodirettorio di configurazione
|
||||
Public Const CONF_DIR As String = "Config"
|
||||
' Sottodirettorio delle risorse
|
||||
Public Const RES_DIR As String = "Resources"
|
||||
' Sottodirettorio script
|
||||
Public Const SCRIPT_DIR As String = "Script"
|
||||
' Sottodirettorio temporaneo
|
||||
Public Const TEMP_DIR As String = "Temp"
|
||||
'' Sottodirettorio per Cam automatico
|
||||
'Public Const PROJS_DIR As String = "Projs"
|
||||
'' Sottodirettorio per Csv automatico
|
||||
'Public Const PRODS_DIR As String = "Prods"
|
||||
'' Sottodirettorio per Macro
|
||||
'Public Const MACRO_DIR As String = "Macro"
|
||||
'' Sottodirettorio per Magazzino
|
||||
'Public Const WAREHOUSE_DIR As String = "Warehouse"
|
||||
'' Sottodirettorio per lavorazioni travi
|
||||
'Public Const BEAM_DIR As String = "Beam"
|
||||
'' Sottodirettorio per lavorazioni pareti
|
||||
'Public Const WALL_DIR As String = "Wall"
|
||||
'' Sottodirettorio di default per il salvataggio con nome
|
||||
'Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
|
||||
'' Sottodirettorio di default per le macchine
|
||||
'Public Const MACHINES_DFL_DIR As String = "Machines"
|
||||
'' Sottodirettorio di default per toolmakers
|
||||
'Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
|
||||
'' Nome file Lua con le funzioni di attrezzaggio
|
||||
'Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
'' Nome eseguibile per stampa
|
||||
'Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
|
||||
'' Sottodirettorio di default per macro
|
||||
'Public Const MACRO_DFL_DIR As String = "Macro"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,26 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2015-2024
|
||||
'----------------------------------------------------------------------------
|
||||
' File : ConstIni.vb Data : 08.05.24 Versione : 2.6e1
|
||||
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.05.24 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
Module ConstIni
|
||||
|
||||
Public Const INI_FILE_NAME As String = "Supervisor.Plugin.FiveLakes.ini"
|
||||
|
||||
Public Const S_GENERAL As String = "General"
|
||||
|
||||
Public Const S_CSV As String = "CSV"
|
||||
Public Const K_DDFNAME As String = "DDFName"
|
||||
Public Const K_QUANTITY As String = "Quantity"
|
||||
Public Const K_HEIGHT As String = "Height"
|
||||
Public Const K_WIDTH As String = "Width"
|
||||
Public Const K_THICKNESS As String = "Thickness"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,63 @@
|
||||
<Grid x:Class="DoorListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="Yellow">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="CSV"
|
||||
ToolTip="Open CSV file"
|
||||
Command="{Binding OpenCSV_Command}"/>
|
||||
<Button Content="Skip Door"
|
||||
ToolTip="Skip Door"
|
||||
Command="{Binding SkipDoor_Command}"/>
|
||||
<Button Content="↑"
|
||||
ToolTip="Move Up"
|
||||
Command="{Binding MoveUp_Command}"/>
|
||||
<Button Content="↓"
|
||||
ToolTip="Move Down"
|
||||
Command="{Binding MoveDown_Command}"/>
|
||||
<Button Content="Produce"
|
||||
ToolTip="Send to production"
|
||||
Command="{Binding Produce_Command}"/>
|
||||
<Button Content="Produce All"
|
||||
ToolTip="Send all to production"
|
||||
Command="{Binding ProduceAll_Command}"/>
|
||||
</StackPanel>
|
||||
<DataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding DoorList}"
|
||||
SelectedItem="{Binding SelDoor}"
|
||||
AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header=""
|
||||
Binding="{Binding nId}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Line"
|
||||
Binding="{Binding nCSVLine}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="DDF"
|
||||
Binding="{Binding sDDFName}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Quantity"
|
||||
Binding="{Binding nQuantity}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="State"
|
||||
Binding="{Binding nState}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Height"
|
||||
Binding="{Binding dHeight}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Width"
|
||||
Binding="{Binding dWidth}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Thickness"
|
||||
Binding="{Binding dThickness}"
|
||||
Width="Auto"/>
|
||||
<DataGridTextColumn Header="Csv"
|
||||
Binding="{Binding sCSVName}"
|
||||
Width="Auto"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class DoorListV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,365 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
|
||||
Public Class DoorListVM
|
||||
|
||||
Private m_DoorList As New ObservableCollection(Of Door)
|
||||
Public ReadOnly Property DoorList As ObservableCollection(Of Door)
|
||||
Get
|
||||
Return m_DoorList
|
||||
End Get
|
||||
End Property
|
||||
Private m_SelDoor As Door
|
||||
Public Property SelDoor As Door
|
||||
Get
|
||||
Return m_SelDoor
|
||||
End Get
|
||||
Set(value As Door)
|
||||
m_SelDoor = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOpenCSV As ICommand
|
||||
Private m_cmdSkipDoor As ICommand
|
||||
Private m_cmdMoveUp As ICommand
|
||||
Private m_cmdMoveDown As ICommand
|
||||
Private m_cmdProduce As ICommand
|
||||
Private m_cmdProduceAll As ICommand
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "OpenCSV"
|
||||
|
||||
Public ReadOnly Property OpenCSV_Command As ICommand
|
||||
Get
|
||||
If m_cmdOpenCSV Is Nothing Then
|
||||
m_cmdOpenCSV = New Command(AddressOf OpenCSV)
|
||||
End If
|
||||
Return m_cmdOpenCSV
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub OpenCSV()
|
||||
Dim sDir As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".csv",
|
||||
.Filter = "CSV (*.csv)|*.csv",
|
||||
.InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If OpenFileDialog.ShowDialog() Then
|
||||
Dim sCSVPath As String = OpenFileDialog.FileName
|
||||
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(sCSVPath)
|
||||
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||
MyReader.SetDelimiters(";")
|
||||
' leggo intestazione
|
||||
Dim Headers As String() = MyReader.ReadFields()
|
||||
Dim sDDFName As String = ""
|
||||
Dim sQuantityName As String = ""
|
||||
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)
|
||||
Dim nDDFNameIndex As Integer = Array.IndexOf(Headers, sDDFName)
|
||||
Dim nQuantityNameIndex As Integer = Array.IndexOf(Headers, sQuantityName)
|
||||
Dim nHeightNameIndex As Integer = Array.IndexOf(Headers, sHeightName)
|
||||
Dim nWidthNameIndex As Integer = Array.IndexOf(Headers, sWidthName)
|
||||
Dim nThicknessNameIndex As Integer = Array.IndexOf(Headers, sThicknessName)
|
||||
If nDDFNameIndex = -1 Then
|
||||
Dim sMessage As String = "Error! DDFName column not found! Csv file will not be read!"
|
||||
' egtoutlog(sMessage)
|
||||
MessageBox.Show(sMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
Dim Values As String()
|
||||
Dim nLineIndex As Integer = 1
|
||||
Dim sLineErrorList As String = ""
|
||||
While Not MyReader.EndOfData
|
||||
Try
|
||||
Values = MyReader.ReadFields()
|
||||
Dim nQuantity As Integer = 1
|
||||
If nQuantityNameIndex >= 0 AndAlso nQuantityNameIndex < Values.Count Then
|
||||
If Not Integer.TryParse(Values(nQuantityNameIndex), nQuantity) OrElse nQuantity < 1 Then
|
||||
nQuantity = 1
|
||||
Dim sLine As String = ""
|
||||
For nValueIndex = 0 To Values.Count - 1
|
||||
sLine &= Values(nValueIndex) & If(nValueIndex < Values.Count, ";", "")
|
||||
Next
|
||||
sLineErrorList &= "Quantity not readable in line " & sLine & ". This line will be skipped"
|
||||
Continue While
|
||||
End If
|
||||
End If
|
||||
Dim dWidth As Double = 0
|
||||
If nWidthNameIndex >= 0 AndAlso nWidthNameIndex < Values.Count Then
|
||||
If Not StringToDouble(Values(nWidthNameIndex), dWidth) OrElse dWidth < 0 Then
|
||||
dWidth = 0
|
||||
End If
|
||||
End If
|
||||
Dim dHeight As Double = 0
|
||||
If nHeightNameIndex >= 0 AndAlso nHeightNameIndex < Values.Count Then
|
||||
If Not StringToDouble(Values(nHeightNameIndex), dHeight) OrElse dHeight < 0 Then
|
||||
dHeight = 0
|
||||
End If
|
||||
End If
|
||||
Dim dThickness As Double = 0
|
||||
If nThicknessNameIndex >= 0 AndAlso nThicknessNameIndex < Values.Count Then
|
||||
If Not StringToDouble(Values(nThicknessNameIndex), dThickness) OrElse dThickness < 0 Then
|
||||
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)
|
||||
nLineIndex += 1
|
||||
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
|
||||
Dim sMessage As String = "Line " & ex.Message & "is not valid and will be skipped."
|
||||
' egtoutlog(sMessage)
|
||||
sLineErrorList &= Environment.NewLine & ex.Message
|
||||
End Try
|
||||
End While
|
||||
If Not String.IsNullOrWhiteSpace(sLineErrorList) Then
|
||||
MessageBox.Show("The following lines are not valid and have been skipped:" & sLineErrorList, "Error", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
End If
|
||||
End Using
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenCSV
|
||||
|
||||
#Region "SkipDoor"
|
||||
|
||||
Public ReadOnly Property SkipDoor_Command As ICommand
|
||||
Get
|
||||
If m_cmdSkipDoor Is Nothing Then
|
||||
m_cmdSkipDoor = New Command(AddressOf SkipDoor)
|
||||
End If
|
||||
Return m_cmdSkipDoor
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub SkipDoor()
|
||||
If IsNothing(SelDoor) OrElse SelDoor.nState <> Door.DoorStates.VERIFIED Then Return
|
||||
SelDoor.SetState(Door.DoorStates.SKIPPED)
|
||||
End Sub
|
||||
|
||||
#End Region ' SkipDoor
|
||||
|
||||
#Region "MoveUp"
|
||||
|
||||
Public ReadOnly Property MoveUp_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveUp Is Nothing Then
|
||||
m_cmdMoveUp = New Command(AddressOf MoveUp)
|
||||
End If
|
||||
Return m_cmdMoveUp
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub MoveUp()
|
||||
If IsNothing(SelDoor) Then Return
|
||||
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
|
||||
If nOldIndex = 0 Then Return
|
||||
If m_DoorList(nOldIndex - 1).nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
|
||||
m_DoorList.Move(nOldIndex, nOldIndex - 1)
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveUp
|
||||
|
||||
#Region "MoveDown"
|
||||
|
||||
Public ReadOnly Property MoveDown_Command As ICommand
|
||||
Get
|
||||
If m_cmdMoveDown Is Nothing Then
|
||||
m_cmdMoveDown = New Command(AddressOf MoveDown)
|
||||
End If
|
||||
Return m_cmdMoveDown
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub MoveDown()
|
||||
If IsNothing(SelDoor) OrElse SelDoor.nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
|
||||
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
|
||||
If nOldIndex = m_DoorList.Count - 1 Then Return
|
||||
m_DoorList.Move(nOldIndex, nOldIndex + 1)
|
||||
End Sub
|
||||
|
||||
#End Region ' MoveDown
|
||||
|
||||
#Region "Produce"
|
||||
|
||||
Public ReadOnly Property Produce_Command As ICommand
|
||||
Get
|
||||
If m_cmdProduce Is Nothing Then
|
||||
m_cmdProduce = New Command(AddressOf Produce)
|
||||
End If
|
||||
Return m_cmdProduce
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Produce()
|
||||
If IsNothing(SelDoor) OrElse SelDoor.nState = Door.DoorStates.SKIPPED OrElse
|
||||
SelDoor.nState = Door.DoorStates.VERIFICATION_FAILED OrElse
|
||||
SelDoor.nState >= Door.DoorStates.SENT_TO_PRODUCTION Then Return
|
||||
' la sposto dopo l'ultima da produrre
|
||||
Dim nNewIndex As Integer = m_DoorList.IndexOf(m_DoorList.FirstOrDefault(Function(x) x.nState < Door.DoorStates.SENT_TO_PRODUCTION))
|
||||
Dim nOldIndex As Integer = m_DoorList.IndexOf(SelDoor)
|
||||
|
||||
m_DoorList.Move(nOldIndex, nNewIndex)
|
||||
SelDoor.SetState(Door.DoorStates.SENT_TO_PRODUCTION)
|
||||
End Sub
|
||||
|
||||
#End Region ' Produce
|
||||
|
||||
#Region "ProduceAll"
|
||||
|
||||
Public ReadOnly Property ProduceAll_Command As ICommand
|
||||
Get
|
||||
If m_cmdProduceAll Is Nothing Then
|
||||
m_cmdProduceAll = New Command(AddressOf ProduceAll)
|
||||
End If
|
||||
Return m_cmdProduceAll
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub ProduceAll()
|
||||
If IsNothing(SelDoor) Then Return
|
||||
End Sub
|
||||
|
||||
#End Region ' ProduceAll
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Door
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum DoorStates As Integer
|
||||
NULL = 0
|
||||
LOADED_FROM_CSV = 1
|
||||
VERIFIED = 10
|
||||
VERIFICATION_FAILED = 11
|
||||
SKIPPED = 20
|
||||
SENT_TO_PRODUCTION = 30
|
||||
IN_PRODUCTION = 31
|
||||
PRODUCED = 32
|
||||
SCRAP = 40
|
||||
End Enum
|
||||
|
||||
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
|
||||
Public ReadOnly Property nState As DoorStates
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetState(value As DoorStates)
|
||||
m_nState = value
|
||||
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())
|
||||
m_nCSVLine = nCSVLine
|
||||
m_sDDFName = sDDFName
|
||||
m_sCSVName = sCSVName
|
||||
m_nQuantity = nQuantity
|
||||
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
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class CustomerParameter
|
||||
|
||||
Private m_sHeader As String
|
||||
Public ReadOnly Property sHeader As String
|
||||
Get
|
||||
Return m_sHeader
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sValue As String
|
||||
Public ReadOnly Property sValue As String
|
||||
Get
|
||||
Return m_sValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(sHeader As String, sValue As String)
|
||||
m_sHeader = sHeader
|
||||
m_sValue = sValue
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1,17 +1,18 @@
|
||||
<Grid x:Class="FiveLakesUI"
|
||||
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"
|
||||
Background="Red">
|
||||
<Grid.ColumnDefinitions>
|
||||
<TabControl SelectedIndex="{Binding SelPage}">
|
||||
<TabItem Name="DoorList">
|
||||
<local:DoorListV DataContext="{StaticResource DoorListVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<!--<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding TextTest}" Background="Green"/>
|
||||
<Button Grid.Column="1"
|
||||
x:Name="Button1"/>
|
||||
x:Name="Button1"/>-->
|
||||
</Grid>
|
||||
|
||||
@@ -3,7 +3,7 @@ Imports System.Text
|
||||
Imports Supervisor.Plugin.Interface
|
||||
|
||||
<Export(GetType(IPluginControl))>
|
||||
<ExportMetadata("Name", "Supervisor.Plugin.FiveLakes")>
|
||||
<ExportMetadata("Name", "Project")>
|
||||
Public Class FiveLakesUI
|
||||
Implements IPluginControl
|
||||
|
||||
@@ -24,9 +24,9 @@ Public Class FiveLakesUI
|
||||
AddHandler Me.Loaded, AddressOf FiveLakesUIV_Loaded
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As RoutedEventArgs) Handles Button1.Click
|
||||
'TextBlockTest.Text = Host.PluginTestInfo
|
||||
End Sub
|
||||
'Private Sub Button1_Click(sender As Object, e As RoutedEventArgs) Handles Button1.Click
|
||||
' 'TextBlockTest.Text = Host.PluginTestInfo
|
||||
'End Sub
|
||||
|
||||
Private Sub FiveLakesUIV_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
m_FiveLakesUIVM.SetTextTest("Prova 1!!")
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
Public Class FiveLakesUIVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_sDataRoot As String
|
||||
Private m_sConfigDir As String
|
||||
Private m_sIniFile As String
|
||||
Private m_sResourcesRoot As String
|
||||
|
||||
Private m_TextTest As String
|
||||
Public ReadOnly Property TextTest As String
|
||||
Get
|
||||
@@ -12,5 +17,19 @@
|
||||
NotifyPropertyChanged(NameOf(TextTest))
|
||||
End Sub
|
||||
|
||||
Sub New()
|
||||
' 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
|
||||
m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
|
||||
End If
|
||||
m_sDataRoot &= "\" & "Plugin\Supervisor.Plugin.FiveLakes"
|
||||
' Impostazione direttorio di configurazione
|
||||
m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
|
||||
' Impostazione path Ini file
|
||||
IniFile.SetIniFile(m_sConfigDir & "\" & INI_FILE_NAME)
|
||||
' Impostazione path resources dir
|
||||
m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<Grid x:Class="MainMenuV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Content="Door List"
|
||||
Command="{Binding DoorList_Command}"/>
|
||||
<Button Grid.Column="1"
|
||||
Content="Machine Status"
|
||||
Command="{Binding MachineStatus_Command}"/>
|
||||
<Button Grid.Column="2"
|
||||
Content="Statistics"
|
||||
Command="{Binding Statistics_Command}"/>
|
||||
</Grid>
|
||||
@@ -0,0 +1,10 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports Supervisor.Plugin.Interface
|
||||
|
||||
<Export(GetType(IPluginControl))>
|
||||
<ExportMetadata("Name", "MainMenu")>
|
||||
Public Class MainMenuV
|
||||
Implements IPluginControl
|
||||
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,29 @@
|
||||
Public Class MainMenuVM
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDoorList As ICommand
|
||||
Private m_cmdMachineStatus As ICommand
|
||||
Private m_cmdStatistics As ICommand
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DoorList"
|
||||
|
||||
Public ReadOnly Property DoorList_Command As ICommand
|
||||
Get
|
||||
If m_cmdDoorList Is Nothing Then
|
||||
m_cmdDoorList = New Command(AddressOf DoorList)
|
||||
End If
|
||||
Return m_cmdDoorList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DoorList()
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region ' DoorList
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,155 @@
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<RootNamespace>Supervisor.Plugin.FiveLakes</RootNamespace>
|
||||
<AssemblyName>Supervisor.Plugin.FiveLakes</AssemblyName>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<MyType>Custom</MyType>
|
||||
<Deterministic>true</Deterministic>
|
||||
<ProjectGuid>{7C77F537-8235-40AB-B24A-4E71CFB96D2C}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>true</IncrementalBuild>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>Supervisor.Plugin.FiveLakes.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<IncrementalBuild>false</IncrementalBuild>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>Supervisor.Plugin.FiveLakes.xml</DocumentationFile>
|
||||
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtWPFLib48">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib48.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Supervisor.Plugin.Interface">
|
||||
<HintPath>..\..\Supervisor\Supervisor.Plugin.Interface\bin\Debug\Supervisor.Plugin.Interface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows" />
|
||||
<Import Include="System.Windows.Controls" />
|
||||
<Import Include="System.Windows.Data" />
|
||||
<Import Include="System.Windows.Documents" />
|
||||
<Import Include="System.Windows.Input" />
|
||||
<Import Include="System.Windows.Shapes" />
|
||||
<Import Include="System.Windows.Media" />
|
||||
<Import Include="System.Windows.Media.Imaging" />
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DoorList\DoorListV.xaml.vb">
|
||||
<DependentUpon>DoorListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DoorList\DoorListVM.vb" />
|
||||
<Compile Include="FiveLakesUI.xaml.vb">
|
||||
<DependentUpon>FiveLakesUI.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FiveLakesUIVM.vb" />
|
||||
<Compile Include="MainMenu\MainMenuV.xaml.vb">
|
||||
<DependentUpon>MainMenuV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainMenu\MainMenuVM.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\Dictionary.xaml.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
</EmbeddedResource>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="DoorList\DoorListV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FiveLakesUI.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainMenu\MainMenuV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtData\Supervisor\Plugin\Supervisor.Plugin.FiveLakes\Supervisor.Plugin.FiveLakes.dll
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -46,6 +46,9 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EgtWPFLib48">
|
||||
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib48.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Supervisor.Plugin.Interface">
|
||||
<HintPath>..\..\Supervisor\Supervisor.Plugin.Interface\bin\Debug\Supervisor.Plugin.Interface.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -84,10 +87,23 @@
|
||||
<Import Include="System.Windows.Navigation" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Constants\ConstGen.vb" />
|
||||
<Compile Include="Constants\ConstIni.vb" />
|
||||
<Compile Include="DoorList\DoorListV.xaml.vb">
|
||||
<DependentUpon>DoorListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DoorList\DoorListVM.vb" />
|
||||
<Compile Include="FiveLakesUI.xaml.vb">
|
||||
<DependentUpon>FiveLakesUI.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FiveLakesUIVM.vb" />
|
||||
<Compile Include="MainMenu\MainMenuV.xaml.vb">
|
||||
<DependentUpon>MainMenuV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainMenu\MainMenuVM.vb" />
|
||||
<Compile Include="Utility\Dictionary.xaml.vb">
|
||||
<DependentUpon>Dictionary.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\AssemblyInfo.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -101,6 +117,10 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Utility\Command.vb" />
|
||||
<Compile Include="Utility\GenInterface.vb" />
|
||||
<Compile Include="Utility\IniFile.vb" />
|
||||
<Compile Include="Utility\StringConversion.vb" />
|
||||
<Compile Include="Utility\VMBase.vb" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
@@ -113,13 +133,30 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="DoorList\DoorListV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FiveLakesUI.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainMenu\MainMenuV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Utility\Dictionary.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\pre-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) c:\EgtData\Supervisor\Plugin\Supervisor.Plugin.FiveLakes\Supervisor.Plugin.FiveLakes.dll
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
''' <summary>
|
||||
''' A command whose sole purpose is to
|
||||
''' relay its functionality to other
|
||||
''' objects by invoking delegates. The
|
||||
''' default return value for the CanExecute
|
||||
''' method is 'true'.
|
||||
''' </summary>
|
||||
Public Class Command
|
||||
Implements ICommand
|
||||
|
||||
#Region "Fields"
|
||||
|
||||
Private ReadOnly _execute As Action(Of Object)
|
||||
Private ReadOnly _canExecute As Predicate(Of Object)
|
||||
|
||||
#End Region ' Fields
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command that can always execute.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object))
|
||||
Me.New(execute, Nothing)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
''' <param name="canExecute">The execution status logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
|
||||
If execute Is Nothing Then
|
||||
Throw New ArgumentNullException("execute")
|
||||
End If
|
||||
|
||||
_execute = execute
|
||||
_canExecute = canExecute
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ICommand Members"
|
||||
|
||||
<DebuggerStepThrough> _
|
||||
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
|
||||
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
|
||||
End Function
|
||||
|
||||
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
|
||||
AddHandler(ByVal value As EventHandler)
|
||||
AddHandler CommandManager.RequerySuggested, value
|
||||
End AddHandler
|
||||
RemoveHandler(ByVal value As EventHandler)
|
||||
RemoveHandler CommandManager.RequerySuggested, value
|
||||
End RemoveHandler
|
||||
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
|
||||
_execute(parameter)
|
||||
End Sub
|
||||
|
||||
#End Region ' ICommand Members
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,58 @@
|
||||
<ResourceDictionary x:Class="Dictionary"
|
||||
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"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
>
|
||||
|
||||
<!--
|
||||
Assign a Key to every Panel ViewModel to use
|
||||
it in xaml file(ProjectView.xaml).
|
||||
-->
|
||||
<local:DoorListVM x:Key="DoorListVM"/>
|
||||
|
||||
<!--Colori predefiniti-->
|
||||
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF4D84C4" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue2" Color="#FF7096CE" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue3" Color="#FF90ABD9" />
|
||||
<SolidColorBrush x:Key="EgaltechBlue4" Color="#FFB2C3E4" />
|
||||
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
|
||||
<SolidColorBrush x:Key="EgaltechGray" Color="#FF585858" />
|
||||
<SolidColorBrush x:Key="EgaltechLightGray" Color="LightGray" />
|
||||
<SolidColorBrush x:Key="EgaltechUltralightGray" Color="#FFF2F2F2" />
|
||||
<SolidColorBrush x:Key="EgaltechGreen" Color="#FF00FF00" />
|
||||
|
||||
<!--#92908d-->
|
||||
<Color x:Key="Icarus_Gray_Color" R="146" G="144" B="141" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Gray" Color="{StaticResource Icarus_Gray_Color}" />
|
||||
<!--#3c89c9-->
|
||||
<Color x:Key="Icarus_LightBlue_Color" R="60" G="137" B="201" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_LightBlue" Color="{StaticResource Icarus_LightBlue_Color}" />
|
||||
<!--#2e5a81-->
|
||||
<Color x:Key="Icarus_Blue_Color" R="46" G="90" B="129" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Blue" Color="{StaticResource Icarus_Blue_Color}" />
|
||||
<!--#50A388-->
|
||||
<Color x:Key="Icarus_Green_Color" R="80" G="163" B="136" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Green" Color="{StaticResource Icarus_Green_Color}" />
|
||||
<!--#BC373E-->
|
||||
<Color x:Key="Icarus_Orange_Color" R="188" G="55" B="62" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Orange" Color="{StaticResource Icarus_Orange_Color}" />
|
||||
<!--#A74C77-->
|
||||
<Color x:Key="Icarus_Purple_Color" R="167" G="76" B="119" A="255"/>
|
||||
<SolidColorBrush x:Key="Icarus_Purple" Color="{StaticResource Icarus_Purple_Color}" />
|
||||
|
||||
<!--Colori per EgtWPFLib5-->
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
|
||||
|
||||
<!--Risorsa che toglie le animazioni dai menù popup per evitare che i menù mru di scelta dei file rimangano aperti se il file è grosso -->
|
||||
<!--o viene eseguito un lua che non aggiorna l'interfaccia-->
|
||||
<PopupAnimation x:Key="{x:Static SystemParameters.MenuPopupAnimationKey}">None</PopupAnimation>
|
||||
|
||||
<!--convertert per visibilita' stringa di testo con misure in StatusBar--><!--
|
||||
<PrintApp:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>-->
|
||||
|
||||
<GridLength x:Key="TitleBarHeight">30</GridLength>
|
||||
<Thickness x:Key="WindowBorder_Thickness">2</Thickness>
|
||||
<sys:Double x:Key="WindowBorder_Height">2</sys:Double>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,108 @@
|
||||
Imports System.ComponentModel.Composition
|
||||
Imports System.Globalization
|
||||
Imports Supervisor.Plugin.Interface
|
||||
|
||||
<Export(GetType(IPluginControl))>
|
||||
<ExportMetadata("Name", "Dictionary")>
|
||||
Public Class Dictionary
|
||||
Inherits ResourceDictionary
|
||||
Implements IPluginControl
|
||||
|
||||
Public Shared ReadOnly MySceneHostVM As String = "MySceneHostVM"
|
||||
|
||||
#Region "Colors"
|
||||
|
||||
'Private m_Omag_Red As SolidColorBrush = Brushes.Red
|
||||
'Public ReadOnly Property Omag_Red As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Omag_Red
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Button_Static_Background As SolidColorBrush = New BrushConverter().ConvertFrom("#FFDDDDDD")
|
||||
'Public Shared ReadOnly Property Button_Static_Background As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Button_Static_Background
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_TabControl_Header_Background As LinearGradientBrush = Application.Current.FindResource("TabItem.Static.Background")
|
||||
'Public Shared ReadOnly Property TabControl_Header_Background As LinearGradientBrush
|
||||
' Get
|
||||
' Return m_TabControl_Header_Background
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
|
||||
'Private Shared m_Icarus_Gray As SolidColorBrush = Application.Current.FindResource("Icarus_Gray")
|
||||
'Public Shared ReadOnly Property Icarus_Gray As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_Gray
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Icarus_LightBlue As SolidColorBrush = Application.Current.FindResource("Icarus_LightBlue")
|
||||
'Public Shared ReadOnly Property Icarus_LightBlue As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_LightBlue
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Icarus_Blue As SolidColorBrush = Application.Current.FindResource("Icarus_Blue")
|
||||
'Public Shared ReadOnly Property Icarus_Blue As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_Blue
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Icarus_Green As SolidColorBrush = Application.Current.FindResource("Icarus_Green")
|
||||
'Public Shared ReadOnly Property Icarus_Green As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_Green
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Icarus_Orange As SolidColorBrush = Application.Current.FindResource("Icarus_Orange")
|
||||
'Public Shared ReadOnly Property Icarus_Orange As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_Orange
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'Private Shared m_Icarus_Purple As SolidColorBrush = Application.Current.FindResource("Icarus_Purple")
|
||||
'Public Shared ReadOnly Property Icarus_Purple As SolidColorBrush
|
||||
' Get
|
||||
' Return m_Icarus_Purple
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
'<SolidColorBrush x : Key="Icarus_Gray" Color="#92908d" />
|
||||
'<SolidColorBrush x : Key="Icarus_LightBlue" Color="#3c89c9" />
|
||||
'<SolidColorBrush x : Key="Icarus_Blue" Color="#2e5a81" />
|
||||
'<SolidColorBrush x : Key="Icarus_Green" Color="#40826d" />
|
||||
'<SolidColorBrush x : Key="Icarus_Orange" Color="#C37636" />
|
||||
'<SolidColorBrush x : Key="Icarus_Purple" Color="#990066" />
|
||||
|
||||
#End Region ' Colors
|
||||
|
||||
End Class
|
||||
|
||||
Public Class CenterToolTipConverter
|
||||
Implements IMultiValueConverter
|
||||
|
||||
Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
|
||||
For Each value In values
|
||||
If TypeOf (value) IsNot Double Then
|
||||
Return Double.NaN
|
||||
End If
|
||||
Next
|
||||
Dim dPlacementTarget As Double = CDbl(values(0))
|
||||
Dim dToolTip As Double = CDbl(values(1))
|
||||
Return (dPlacementTarget / 2.0) - (dToolTip / 2.0)
|
||||
End Function
|
||||
|
||||
Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
|
||||
Throw New NotSupportedException()
|
||||
End Function
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,76 @@
|
||||
Imports System.Globalization
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text
|
||||
|
||||
Public Module GenInterface
|
||||
|
||||
'-------------------------------- IniFile : Get --------------------------------------------------
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Public Function GetPrivateProfileInt(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
nDefault As Integer,
|
||||
lpFileName As String) As Integer
|
||||
End Function
|
||||
|
||||
Public Function GetPrivateProfileDouble(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
dDefault As Double,
|
||||
lpFileName As String) As Double
|
||||
Dim sValue As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, dDefault.ToString(), sValue, lpFileName)
|
||||
Dim nPos As Integer = sValue.IndexOf(";")
|
||||
If nPos >= 0 Then
|
||||
sValue = sValue.Remove(nPos)
|
||||
End If
|
||||
Dim dValue As Double
|
||||
If Not Double.TryParse(sValue, NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, dValue) Then
|
||||
dValue = dDefault
|
||||
End If
|
||||
Return dValue
|
||||
End Function
|
||||
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Private Function GetPrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpDefault As String,
|
||||
lpReturnedString As StringBuilder,
|
||||
nSize As Integer,
|
||||
lpFileName As String) As Integer
|
||||
End Function
|
||||
Public Function GetPrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpDefault As String,
|
||||
ByRef lpString As String,
|
||||
lpFileName As String) As Integer
|
||||
Dim sb As New StringBuilder(1024)
|
||||
Dim nRet As Integer = GetPrivateProfileString(lpAppName, lpKeyName, lpDefault, sb, sb.Capacity, lpFileName)
|
||||
lpString = sb.ToString
|
||||
Return nRet
|
||||
End Function
|
||||
|
||||
'-------------------------------- IniFile : Write ------------------------------------------------
|
||||
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
|
||||
Public Function WritePrivateProfileString(
|
||||
lpAppName As String,
|
||||
lpKeyName As String,
|
||||
lpString As String,
|
||||
lpFileName As String) As Boolean
|
||||
End Function
|
||||
|
||||
'-------------------------------- Windows --------------------------------------------------------
|
||||
Public Enum SW As Integer
|
||||
HIDE = 0
|
||||
SHOWMAXIMIZED = 3
|
||||
RESTORE = 9
|
||||
End Enum
|
||||
|
||||
<DllImport("user32.dll")>
|
||||
Public Function ShowWindow(hWnd As IntPtr, nCmdShow As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,65 @@
|
||||
'----------------------------------------------------------------------------
|
||||
' EgalTech 2017-2017
|
||||
'----------------------------------------------------------------------------
|
||||
' File : IniFile.vb Data : 08.05.24 Versione : 2.6e1
|
||||
' Contenuto : Modulo IniFile per gestione lettura/scrittura da file INI.
|
||||
'
|
||||
'
|
||||
'
|
||||
' Modifiche : 08.05.24 ES Creazione modulo.
|
||||
'
|
||||
'
|
||||
'----------------------------------------------------------------------------
|
||||
|
||||
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Module IniFile
|
||||
|
||||
Private m_sPath As String
|
||||
Public ReadOnly Property sPath As String
|
||||
Get
|
||||
Return m_sPath
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetIniFile(sPath)
|
||||
m_sPath = sPath
|
||||
End Sub
|
||||
|
||||
Public Function GetMainPrivateProfileInt(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
|
||||
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
|
||||
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,443 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
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
|
||||
|
||||
#Region "Get"
|
||||
|
||||
Public ReadOnly Property refMainWindowVM As MainWindowVM
|
||||
Get
|
||||
Return m_refMainWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
|
||||
Get
|
||||
Return LibMap.refStatusBarVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refProjManagerVM As ProjManagerVM
|
||||
Get
|
||||
Return m_refProjManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refProjectVM As ProjectVM
|
||||
Get
|
||||
Return m_refProjectVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSceneHostVM As MySceneHostVM
|
||||
Get
|
||||
Return LibMap.refSceneHostVM
|
||||
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 refShowPanelVM As ShowPanelVM
|
||||
Get
|
||||
Return LibMap.refShowPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
|
||||
Get
|
||||
Return m_refMachinePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refLeftPanelVM As LeftPanelVM
|
||||
Get
|
||||
Return m_refLeftPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refRightPanelVM As RightPanelVM
|
||||
Get
|
||||
Return m_refRightPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refDispositionPanelVM As DispositionPanelVM
|
||||
Get
|
||||
Return m_refDispositionPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refStartMachPanelVM As StartMachPanelVM
|
||||
Get
|
||||
Return m_refStartMachPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refRibPanelVM As RibPanelVM
|
||||
Get
|
||||
Return m_refRibPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refControllerInputPanelVM As ControllerInputPanelVM
|
||||
Get
|
||||
Return m_refControllerInputPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
|
||||
Get
|
||||
Return m_refInstrumentPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refTopPanelVM As TopPanelVM
|
||||
Get
|
||||
Return m_refTopPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSliceManagerVM As SliceManagerVM
|
||||
Get
|
||||
Return m_refSliceManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refTFSEditorVM As TFSEditorVM
|
||||
Get
|
||||
Return m_refTFSEditorVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refCurrMachiningPanelVM As CurrMachiningPanelVM
|
||||
Get
|
||||
Return m_refCurrMachiningPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refMachiningDbVM As MachiningDbVM
|
||||
Get
|
||||
Return m_refMachiningDbVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refMaterialDbVM As MaterialDbVM
|
||||
Get
|
||||
Return m_refMaterialDbVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSliderManagerVM As SliderManagerVM
|
||||
Get
|
||||
Return m_refSliderManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refRibParamPanelVM As RibParamPanelVM
|
||||
Get
|
||||
Return m_refRibParamPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSimulationPanelVM As SimulationPanelVM
|
||||
Get
|
||||
Return m_refSimulationPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refReferencePanelVM As ReferencePanelVM
|
||||
Get
|
||||
Return m_refReferencePanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refViewLayerManagerVM As ViewLayerManagerVM
|
||||
Get
|
||||
Return m_refViewLayerManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refShellNumberPanelVM As ShellNumberPanelVM
|
||||
Get
|
||||
Return m_refShellNumberPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refShellNumberParamPanelVM As ShellNumberParamPanelVM
|
||||
Get
|
||||
Return m_refShellNumberParamPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refFilledSolidPanelVM As FilledSolidPanelVM
|
||||
Get
|
||||
Return m_refFilledSolidPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refFilledSolidParamPanelVM As FilledSolidParamPanelVM
|
||||
Get
|
||||
Return m_refFilledSolidParamPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refSplashScreen As SplashScreen
|
||||
Get
|
||||
Return m_refSplashScreen
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refManagePartPanelVM As ManagePartPanelVM
|
||||
Get
|
||||
Return m_refManagePartPanelVM
|
||||
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)
|
||||
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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)
|
||||
End Function
|
||||
Friend Function EndInit() As Boolean
|
||||
' Verifico se tutti i pezzi necessari sono stati caricati
|
||||
'Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refProjectVM) AndAlso
|
||||
' Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjectManagerVM) AndAlso
|
||||
' Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
|
||||
' Not IsNothing(m_refVeinMatchPanelVM) AndAlso
|
||||
' Not IsNothing(m_refOptionPanelVM) AndAlso Not IsNothing(m_refRawPartTabVM) AndAlso
|
||||
' 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()
|
||||
End Function
|
||||
|
||||
#End Region ' Init
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,66 @@
|
||||
Imports System.Globalization
|
||||
|
||||
Public Module StringConversion
|
||||
|
||||
Public Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
|
||||
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
|
||||
If nNumDec > 0 Then
|
||||
Return sVal.TrimEnd("0".ToCharArray()).TrimEnd(".".ToCharArray)
|
||||
Else
|
||||
Return sVal
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean
|
||||
' Return EgtLuaEvalNumExpr(sVal, dVal)
|
||||
Return Double.TryParse(sVal, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, dVal)
|
||||
End Function
|
||||
|
||||
'Public Function StringToDoubleAdv(ByVal sVal As String, ByRef dVal As Double, Optional bEval As Boolean = False) As Boolean
|
||||
' If bEval Then
|
||||
' Return EgtLuaEvalNumExpr(sVal, dVal)
|
||||
' Else
|
||||
' Return Double.TryParse(sVal, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, dVal)
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
Public Function StringToInt(sVal As String, ByRef nVal As Integer) As Boolean
|
||||
Dim dVal As Double = 0
|
||||
If Not StringToDouble(sVal, dVal) Then Return False
|
||||
nVal = CInt(Math.Round(dVal))
|
||||
Return True
|
||||
End Function
|
||||
|
||||
'Public Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String
|
||||
' Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||
'End Function
|
||||
|
||||
'Public Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean
|
||||
' If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
' dVal = EgtFromUiUnits(dVal)
|
||||
' Return True
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
'Public Function StringToLenAdv(ByVal sVal As String, ByRef dVal As Double, Optional bEval As Boolean = False) As Boolean
|
||||
' If bEval Then
|
||||
' If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||
' dVal = EgtFromUiUnits(dVal)
|
||||
' Return True
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
' Else
|
||||
' If Double.TryParse(sVal, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat, dVal) Then
|
||||
' dVal = EgtFromUiUnits(dVal)
|
||||
' Return True
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user