diff --git a/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml b/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml new file mode 100644 index 00000000..e0a034bb --- /dev/null +++ b/EgtBEAMWALL.Core/BeamMachiningsWindow/BeamMachiningsWindowV.xaml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb b/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb new file mode 100644 index 00000000..1d11796c --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/ConfigurationPageV.xaml.vb @@ -0,0 +1,3 @@ +Public Class ConfigurationPageV + +End Class \ No newline at end of file diff --git a/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml new file mode 100644 index 00000000..cb1967d0 --- /dev/null +++ b/EgtBEAMWALL.Core/ConfigurationPage/General_ConfigurationPageV.xaml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb new file mode 100644 index 00000000..83a5832c --- /dev/null +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class MachinePanelV + +End Class diff --git a/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb b/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb new file mode 100644 index 00000000..88351e28 --- /dev/null +++ b/EgtBEAMWALL.Core/MachinePanel/MachinePanelVM.vb @@ -0,0 +1,357 @@ +Imports System.Collections.ObjectModel +Imports System.IO +Imports EgtBEAMWALL.Core +Imports EgtUILib +Imports EgtWPFLib5 + +Public Class MachinePanelVM + Inherits EgtWPFLib5.MachinePanelVM + +#Region "FIELDS & PROPERTIES" + + ' Radice del direttorio delle macchine + Private m_sMachinesRoot As String + + ' Macchina correntemente selezionata e quindi attiva + Private m_SelectedMachine As Machine = Nothing + Public Overrides Property SelectedMachine As Machine + Get + Return m_SelectedMachine + End Get + Set(value As Machine) + If value IsNot m_SelectedMachine Then + ' imposto macchina in DbGeometrico + If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then + m_SelectedMachine = value + End If + ' Salvo impostazione macchina corrente + SaveCurrentMachine() + NotifyPropertyChanged(NameOf(SelectedMachine)) + ' inizializzo la macchina selezionata come macchina corrente + Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType + SectionXMaterial.SetType(nMachType) + If Not IsNothing(value) Then + InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType) + Else + InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType) + End If + ' mostro bottone tabella beam o wall a seconda del tipo + m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed) + NotifyPropertyChanged(NameOf(BeamTable_Visibility)) + NotifyPropertyChanged(NameOf(WallTable_Visibility)) + ' carico i Parametri Q da mostrare (Beam, Wall o entrambi) in base al tipo di macchina selezionata + If Not IsNothing(Map.refConfigurationPageVM) Then + ' carico i parametri Q dei Process letti dall'ini + Map.refConfigurationPageVM.GetQParamsList() + ' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList + If Not IsNothing(Map.refConfigurationPageVM.QBTLParamVMList) Then + Map.refConfigurationPageVM.QBTLParamVMList.Clear() + End If + For Each PRCItem In Map.refConfigurationPageVM.PRCList + For Each QBTLParam In PRCItem.QBTLParamVMList + Map.refConfigurationPageVM.QBTLParamVMList.Add(QBTLParam) + Next + Next + NotifyPropertyChanged(NameOf(Map.refConfigurationPageVM.QBTLParamVMList)) + End If + ' aggiorno nome macchina in statusbar + Map.refMyStatusBarVM.RefreshMachName() + End If + End Set + End Property + + Private m_MachPanel_IsEnabled As Boolean = True + Public Property MachPanel_IsEnabled As Boolean + Get + Return m_MachPanel_IsEnabled + End Get + Set(value As Boolean) + m_MachPanel_IsEnabled = value + NotifyPropertyChanged("MachPanel_IsEnabled") + End Set + End Property + + Private m_BeamTable_Visibility As Visibility + Public ReadOnly Property BeamTable_Visibility As Visibility + Get + Return m_BeamTable_Visibility + End Get + End Property + + Private m_WallTable_Visibility As Visibility + Public ReadOnly Property WallTable_Visibility As Visibility + Get + Return m_WallTable_Visibility + End Get + End Property + + Public ReadOnly Property SetUp_Visibility As Visibility + Get + Return If(Map.refMainWindowVM.MainWindowM.bModifySetup, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + + +#Region "Messages" + + Public ReadOnly Property ToolDBMsg As String + Get + Return EgtMsg(MSG_MACHINEPAGEUC + 6) + End Get + End Property + Public ReadOnly Property MachiningDbMsg As String + Get + Return EgtMsg(MSG_MACHINEPAGEUC + 7) + End Get + End Property + Public ReadOnly Property SetUpMsg As String + Get + Return EgtMsg(MSG_ALARMSPAGEUC + 33) + End Get + End Property + +#End Region ' Messages + +#Region "ToolTip" + + Public ReadOnly Property ToolDBToolTip As String + Get + Return EgtMsg(5003) + End Get + End Property + Public ReadOnly Property MachiningDbToolTip As String + Get + Return EgtMsg(5004) + End Get + End Property + Public ReadOnly Property SetUpToolTip As String + Get + Return EgtMsg(31501) + End Get + End Property + +#End Region ' ToolTip + + ' Definizione comandi + Private m_cmdBeamTable As ICommand + Private m_cmdWallTable As ICommand + +#End Region 'FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New() + ' Creo riferimento a questa classe in Map + Map.SetRefMachinePanelVM(Me) + ' recupero cartella radice delle macchine + m_sMachinesRoot = Map.refMainWindowVM.MainWindowM.sMachinesRoot + ' Carica macchine da cartella delle macchine + MyMachine.MachineListInit(m_sMachinesRoot, MachineList) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + + Friend Sub LoadCurrentMachine() + If MachineList.Count = 0 Then Return + Dim CurrMachine As Machine = Nothing + Dim CurrMachineName As String = String.Empty + GetMainPrivateProfileString(S_MACH, K_CURRMACH, String.Empty, CurrMachineName) + Dim bFound As Boolean = False + If Not String.IsNullOrEmpty(CurrMachineName) Then + For Each Mach In MachineList + If Mach.Name = CurrMachineName Then + bFound = True + CurrMachine = Mach + Exit For + End If + Next + End If + If Not bFound And MachineList.Count > 0 Then + CurrMachine = MachineList(0) + End If + If Not IsNothing(CurrMachine) Then + If EgtSetCurrMachine(CurrMachine.Name) Then + SelectedMachine = CurrMachine + End If + End If + End Sub + + Friend Sub SaveCurrentMachine() + If IsNothing(m_SelectedMachine) Then Return + WriteMainPrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name) + End Sub + + Friend Sub UpdateCurrentMachine() + 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext) + Dim sMachName As String = String.Empty + If EgtGetCurrMachineName(sMachName) Then + For Each Mach In MachineList + If Mach.Name = sMachName Then + SelectedMachine = Mach + Exit For + End If + Next + End If + End Sub + + Friend Function BeamMachDb() As Boolean + ' Assegno le path + Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Beam" + ' verifico se ci sono i file ini + Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini" + Dim sTabTemplPath As String = sBaseDir & "\BeamTableTemplate.ini" + If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then + ' apro finestra di gestione lavorazioni travi + Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi + Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath) + Dim BeamMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM) + BeamMchsWinV.ShowDialog() + Else + ' Impossibile aprire l'Editor delle lavorazioni delle travi.
Mancano i file di configurazione. - Errore + MessageBox.Show(EgtMsg(9009), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If + Return True + End Function + + Friend Function WallMachDb() As Boolean + ' Assegno le path + Dim sBaseDir As String = m_sMachinesRoot & "\" & m_SelectedMachine.Name & "\" & "Wall" + ' verifico se ci sono i file ini + Dim sMachTypePath As String = sBaseDir & "\MachiningTypes.ini" + Dim sTabTemplPath As String = sBaseDir & "\WallTableTemplate.ini" + If File.Exists(sMachTypePath) AndAlso File.Exists(sTabTemplPath) Then + ' apro finestra di gestione lavorazioni pareti + Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti + Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False) + Dim WallMchsWinV As New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM) + WallMchsWinV.ShowDialog() + Else + ' Impossibile aprire l'Editor delle lavorazioni delle pareti.
Mancano i file di configurazione. - Errore + MessageBox.Show(EgtMsg(9011), EgtMsg(9008), MessageBoxButton.OK, MessageBoxImage.Stop) + End If + Return True + End Function + + Public Overrides Sub ToolDb(ByVal param As Object) + If Not VerifyMachinesDir(m_sMachinesRoot) Then Return + ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) + If Not EgtTdbReload() Then + EgtOutLog("Impossible reloading tool Db") + MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + + Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam") + Dim ToolDbWindowV As New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM) + If ToolDbWindowVM.MatType <> 0 Then + ToolDbWindowV.Height = 640 + ToolDbWindowV.Width = 1024 + ToolDbWindowV.ShowDialog() + Else + Exit Sub + End If + + End Sub + + Public Overrides Sub MachDb(ByVal param As Object) + If Not VerifyMachinesDir(m_sMachinesRoot) Then Return + ' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa) + If Not EgtMdbReload() Then + EgtOutLog("Impossible reloading machining Db") + MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone") + Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) + + If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then + MachDbWindowV.Height = 768 + MachDbWindowV.Width = 1024 + MachDbWindowV.ShowDialog() + Else + Exit Sub + End If + + End Sub + + Public Overrides Sub SetUp(ByVal param As Object) + ' verifico che il file di configurazione attrezzaggio (lua) della macchina esista + If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then + EgtOutLog("SetUp error: SetUp configuration file doesn't exist ") + MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + ' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato, + ' e testa e uscita dell'utensile attrezzato + EgtLuaExecFile(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) + ' verifico che le teste riportate in configurazione esistano + Dim Index As Integer = 1 + Dim nErr As Integer = 0 + While nErr = 0 + Dim sHead As String = String.Empty + nErr = 999 + EgtLuaSetGlobIntVar("STU.INDEX", Index) + EgtLuaCallFunction("STU.GetTcPosHeadGroupFromPos") + ' Leggo variabili + EgtLuaGetGlobStringVar("STU.HEAD", sHead) + EgtLuaGetGlobIntVar("STU.ERR", nErr) + If nErr = 0 Then + If EgtGetHeadExitCount(sHead) = 0 Then + MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error) + Return + End If + End If + Index += 1 + End While + ' Reset lua + EgtLuaResetGlobVar("STU") + + Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) + SetUpWindow.Height = 614 + SetUpWindow.Width = 1024 + SetUpWindow.ShowDialog() + + End Sub + +#End Region + +#Region "COMMANDS" + +#Region "BeamTable" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property BeamTable_Command As ICommand + Get + If m_cmdBeamTable Is Nothing Then + m_cmdBeamTable = New Command(AddressOf BeamMachDb) + End If + Return m_cmdBeamTable + End Get + End Property + +#End Region ' BeamTable + +#Region "WallTable" + + ''' + ''' Returns a command that do Exec. + ''' + Public ReadOnly Property WallTable_Command As ICommand + Get + If m_cmdWallTable Is Nothing Then + m_cmdWallTable = New Command(AddressOf WallMachDb) + End If + Return m_cmdWallTable + End Get + End Property + +#End Region ' WallTable + +#End Region ' COMMANDS + +End Class diff --git a/EgtBEAMWALL.Core/Resources/ProjectManager/Save.png b/EgtBEAMWALL.Core/Resources/ProjectManager/Save.png new file mode 100644 index 00000000..0eca2603 Binary files /dev/null and b/EgtBEAMWALL.Core/Resources/ProjectManager/Save.png differ diff --git a/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml b/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml new file mode 100644 index 00000000..02bcbf79 --- /dev/null +++ b/EgtBEAMWALL.Supervisor/BeamMachiningsWindow/BeamMachiningsWindowV.xaml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb index e057bd71..8d43b4c3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/ConfigurationPageVM.vb @@ -4,11 +4,7 @@ Imports EgtUILib Imports EgtWPFLib5 Imports EgtBEAMWALL.Core Imports MS.Internal -Imports Org.BouncyCastle.X509 Imports Ionic.Zip -Imports Org.BouncyCastle.Bcpg -Imports Microsoft.VisualBasic.ApplicationServices -Imports Renci.SshNet.Security Public Class ConfigurationPageVM Inherits VMBase diff --git a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml index 49cc3924..1a271f72 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ConfigurationPage/General_ConfigurationPageV.xaml @@ -64,7 +64,7 @@ + Margin="0,2,0,5"> @@ -114,5 +114,5 @@ - + diff --git a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj index c46c1fec..82644cf7 100644 --- a/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj +++ b/EgtBEAMWALL.ViewerOptimizer/EgtBEAMWALL.ViewerOptimizer.vbproj @@ -264,15 +264,6 @@ ChangeMaterialWndV.xaml - - General_ConfigurationPageV.xaml - - - Machine_ConfigurationPageV.xaml - - - QParameter_ConfigurationPageV.xaml - @@ -280,6 +271,7 @@ FeatureListManagerV.xaml + PartInRawPartManagerWndV.xaml @@ -328,7 +320,6 @@ BeamMachiningsWindowV.xaml - BlockedWndV.xaml @@ -484,10 +475,6 @@ ConfigurationPageV.xaml - - MachinePanelV.xaml - - OptimizePanelV.xaml @@ -552,18 +539,6 @@ MSBuild:Compile Designer - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -784,10 +759,6 @@ MSBuild:Compile Designer - - MSBuild:Compile - Designer - Designer MSBuild:Compile diff --git a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml index 1e325112..6d211b1e 100644 --- a/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/MachinePanel/MachinePanelV.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5" - IsEnabled="{Binding MachPanel_IsEnabled}"> + IsEnabled="{Binding MachPanel_IsEnabled}" + Background="Green"> diff --git a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb index 1c78294f..2962d1ac 100644 --- a/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb +++ b/EgtBEAMWALL.ViewerOptimizer/Utility/CurrentMachine.vb @@ -242,9 +242,9 @@ Public Module CurrentMachine EgtLuaResetGlobVar("GWD") ' aggiorno parametro in gestore viste Core.ViewPanelVM.UpdateMachParam(m_nViewDir) - + End If ' leggo parametri macchina da WallData - ElseIf nType = MachineType.WALL Then + If nType = MachineType.WALL OrElse nType = MachineType.BOTH Then ' Assegno i dati EgtLuaCreateGlobTable("GWD") EgtLuaSetGlobStringVar("GWD.BASEDIR", Map.refMainWindowVM.MainWindowM.sWallRoot)