EgtDOORCreator 1.9b2 :

-aggiunta dell'HardwareManager,
-aggiunta della pagina di stampa.
This commit is contained in:
Nicola Pievani
2018-02-14 17:55:48 +00:00
parent 3c2b662cda
commit cbfdc473c2
47 changed files with 4329 additions and 303 deletions
+94 -1
View File
@@ -8,6 +8,16 @@ Imports Ionic.zip
Public Class ProjectManagerVM
Implements INotifyPropertyChanged
Public ReadOnly Property DisableHM As Visibility
Get
If OptionModule.m_DisableHM Then
Return Visibility.Visible
Else
Return Visibility.Collapsed
End If
End Get
End Property
#Region "FIELDS & PROPERTIES"
Friend m_CurrProject As Project
@@ -20,6 +30,7 @@ Public Class ProjectManagerVM
Private m_cmdInsert As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
Private m_cmdPrint As ICommand
Private m_cmdOptions As ICommand
Private m_CmdLastProject As ICommand
Private m_cmdSendFeedback As ICommand
@@ -27,6 +38,7 @@ Public Class ProjectManagerVM
Private m_cmdGuide As ICommand
Private m_cmdCopy As ICommand
Private m_cmdDuplica As ICommand
Private m_cmdHardware As ICommand
#Region "ToolTip"
@@ -100,6 +112,11 @@ Public Class ProjectManagerVM
Return "Duplicate"
End Get
End Property
Public ReadOnly Property PrintToolTip As String
Get
Return "Print"
End Get
End Property
#End Region ' ToolTip
@@ -338,9 +355,18 @@ Public Class ProjectManagerVM
Public Sub OpenLastProject()
' Apro l'ultimo progetto
Dim CurrName As String = String.Empty
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name) Then
CurrName = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
End If
End If
Dim CurrProject As Project = Map.refAssemblyManagerVM.CurrProject
' carico il percorso dell'ultimo progetto salvato (sul file Config.ini)
CurrProject.Name = OptionModule.m_sLastProject
If IsNothing(CurrProject.Name) Then
CurrProject.Name = OptionModule.m_sLastProject
End If
' ripulisco la lista di porte
CurrProject.AssemblyList.Clear()
' verifico che esista la cartella
@@ -364,8 +390,20 @@ Public Class ProjectManagerVM
'Map.refMainWindowVM.ModifyTitle(False)
' Se c'è almeno una porta la visualizzo
If CurrProject.AssemblyList.Count > 0 Then
If Not IsNothing(CurrName) Then
For IndexListAss As Integer = 0 To CurrProject.AssemblyList.Count - 1
If CurrName = CurrProject.AssemblyList(IndexListAss).Name Then
Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(IndexListAss))
Return
End If
Next
End If
Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(0))
Else
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
End If
Else
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
End If
End Sub
@@ -605,6 +643,7 @@ Public Class ProjectManagerVM
End Property
Public Sub Duplica()
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
MessageBox.Show("Project must be saved before copying", EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
@@ -673,8 +712,62 @@ Public Class ProjectManagerVM
End Sub
#End Region ' Duplica
#Region "Hardware"
Public ReadOnly Property HardwareCommand As ICommand
Get
If m_cmdHardware Is Nothing Then
m_cmdHardware = New Command(AddressOf GoToHardwarePage)
End If
Return m_cmdHardware
End Get
End Property
Public Sub GoToHardwarePage()
' se decido di annullare l'operazione di salvataggio
If Not Map.refAssemblyManagerVM.ManageModified() Then Return
' prima di continuare salvo il riferimento all'ultima cartella aperta
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage
' nascondo la visibilità del bottono goback dalla lista dei bottoni
Map.refCompoPanelHardwareVM.GoBackVisibility = Visibility.Collapsed
Map.refHardwarePageVM.VisibilityGeneral = Visibility.Collapsed
' creo una porta per il disegno dell'Hardware
Map.refHardwarePageVM.CreateDoor()
Map.refSceneManagerVM.RefreshBtn()
' carico la lista dei nomi delle geometrie
CompoMatch.LoadTableGeometry()
End Sub
#End Region ' LastProject
#Region "PrintCommand"
Public ReadOnly Property PrintCommand As ICommand
Get
If m_cmdPrint Is Nothing Then
m_cmdPrint = New Command(AddressOf Print)
End If
Return m_cmdPrint
End Get
End Property
Public Sub Print(ByVal param As Object)
If IsNothing(Map.refAssemblyManagerVM.CurrProject) Then Return
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified() Then
MessageBox.Show("Project must be saved before printing", EgtMsg(50144), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
Dim PrintWindow As New PrintWndV(Application.Current.MainWindow, New PrintWndVM)
PrintWindow.Height = 550
PrintWindow.Width = 650
PrintWindow.ShowDialog()
End Sub
#End Region ' PrintCommand
#End Region ' Commands
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged