diff --git a/Assembly/Assembly.vb b/Assembly/Assembly.vb
index ee648de..e1a7a09 100644
--- a/Assembly/Assembly.vb
+++ b/Assembly/Assembly.vb
@@ -7,16 +7,6 @@ Imports System.Text.RegularExpressions
Public Class Assembly
Implements INotifyPropertyChanged
- Private m_NewAssembly As Boolean = True
- Public Property NewAssembly As Boolean
- Get
- Return m_NewAssembly
- End Get
- Set(value As Boolean)
- m_NewAssembly = value
- End Set
- End Property
-
Private m_OneDoorProperty As Boolean
Public Property OneDoorProperty As Boolean
Get
@@ -28,6 +18,7 @@ Public Class Assembly
End Property
#Region "Light Up/Bottom"
+
Private m_LightUp As String
Public Property LightUp As String
Get
@@ -37,7 +28,7 @@ Public Class Assembly
m_LightUp = value
HeightJamb(GetArrayPartDoor(0).Door.Height)
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetLightUp(sLightUp As String)
@@ -55,7 +46,7 @@ Public Class Assembly
' modifico le dimensioni dei Jambs
HeightJamb(GetArrayPartDoor(0).Door.Height)
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetLightBottom(sLightBottom As String)
@@ -65,6 +56,7 @@ Public Class Assembly
#End Region ' Light Up/Bottom
#Region "Light Hinge/Lock"
+
Private m_LightHinge As String
Public Property LightHinge As String
Get
@@ -75,7 +67,7 @@ Public Class Assembly
'SetWidthJamb()
TopBottomWidth()
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetLightHinge(sSetLightHinge As String)
@@ -93,7 +85,7 @@ Public Class Assembly
TopBottomWidth()
'SetWidthJamb()
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetLightLock(sLightLock As String)
@@ -114,7 +106,7 @@ Public Class Assembly
HeightJamb(GetArrayPartDoor(0).Door.Height)
TopRabbetJamb()
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetThicknessHead(sThicknessHead As String)
@@ -133,7 +125,7 @@ Public Class Assembly
' modifico le dimensioni dei Jambs
'DoorVisibilityNew()
TopBottomWidth()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
'SetWidthJamb()
TopRabbetJamb()
HingeRabbetJamb()
@@ -156,7 +148,7 @@ Public Class Assembly
' modifico le dimensioni dei Jambs
'DoorVisibilityNew()
TopBottomWidth()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
'SetWidthJamb()
TopRabbetJamb()
HingeRabbetJamb()
@@ -176,7 +168,7 @@ Public Class Assembly
End Get
Set(value As String)
m_OverlapTop = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
HeightJamb(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height)
SetWidthJamb()
HingeRabbetJamb()
@@ -196,7 +188,7 @@ Public Class Assembly
End Get
Set(value As String)
m_DeltaThickness = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
HingeRabbetJamb()
UpDateAllCompo()
End Set
@@ -236,7 +228,7 @@ Public Class Assembly
TopRabbetJamb()
ReplaceHardware()
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
HingeRabbetJamb()
BottomRabbetJamb()
End Set
@@ -256,7 +248,7 @@ Public Class Assembly
m_Thickness = value
SetThicKnessJamb()
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetThickness(sThickness As String)
@@ -274,7 +266,7 @@ Public Class Assembly
HeightJamb(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.Height)
SetWidthJamb()
UpDateAllCompo()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetWidth(sWidth As String)
@@ -297,14 +289,14 @@ Public Class Assembly
Get
If m_LockEdgeType.IsActive = Visibility.Collapsed Then
m_LockEdgeType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_LockEdgeType
End Get
Set(value As EdgeType)
m_LockEdgeType = value
NotifyPropertyChanged("LockEdgeType")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.LockEdgeType = value
m_RightJamb.LockEdgeType = value
m_TopJamb.LockEdgeType = value
@@ -321,14 +313,14 @@ Public Class Assembly
Get
If m_HingeEdgeType.IsActive = Visibility.Collapsed Then
m_HingeEdgeType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_HingeEdgeType
End Get
Set(value As EdgeType)
m_HingeEdgeType = value
NotifyPropertyChanged("HingeEdgeType")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.HingeEdgeType = value
m_RightJamb.HingeEdgeType = value
m_TopJamb.HingeEdgeType = value
@@ -345,14 +337,14 @@ Public Class Assembly
Get
If m_TopType.IsActive = Visibility.Collapsed Then
m_TopType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_TopType
End Get
Set(value As EdgeType)
m_TopType = value
NotifyPropertyChanged("TopType")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.TopType = value
m_RightJamb.TopType = value
m_TopJamb.TopType = value
@@ -369,14 +361,14 @@ Public Class Assembly
Get
If m_BottomType.IsActive = Visibility.Collapsed Then
m_BottomType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_BottomType
End Get
Set(value As EdgeType)
m_BottomType = value
NotifyPropertyChanged("BottomType")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.BottomType = value
m_RightJamb.BottomType = value
m_TopJamb.BottomType = value
@@ -395,7 +387,7 @@ Public Class Assembly
End Get
Set(value As Boolean)
m_TopMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.TopMachining = m_TopMachining
m_RightJamb.TopMachining = m_TopMachining
m_TopJamb.TopMachining = m_TopMachining
@@ -414,8 +406,8 @@ Public Class Assembly
End Get
Set(value As Boolean)
m_LockEdgeMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.LockEdgeMachining = m_LockEdgeMachining
m_RightJamb.LockEdgeMachining = m_LockEdgeMachining
m_TopJamb.LockEdgeMachining = m_LockEdgeMachining
@@ -434,7 +426,7 @@ Public Class Assembly
End Get
Set(value As Boolean)
m_HingeEdgeMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.HingeEdgeMachining = value
m_RightJamb.HingeEdgeMachining = value
m_TopJamb.HingeEdgeMachining = value
@@ -453,7 +445,7 @@ Public Class Assembly
End Get
Set(value As Boolean)
m_BottomMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.BottomMachining = value
m_RightJamb.BottomMachining = value
m_TopJamb.BottomMachining = value
@@ -482,7 +474,7 @@ Public Class Assembly
Else
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.LockEdgeOverMaterial = value
m_RightJamb.LockEdgeOverMaterial = value
m_TopJamb.LockEdgeOverMaterial = value
@@ -507,7 +499,7 @@ Public Class Assembly
Else
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.HingeEdgeOverMaterial = value
m_RightJamb.HingeEdgeOverMaterial = value
m_TopJamb.HingeEdgeOverMaterial = value
@@ -532,7 +524,7 @@ Public Class Assembly
Else
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.TopOverMaterial = value
m_RightJamb.TopOverMaterial = value
m_TopJamb.TopOverMaterial = value
@@ -557,7 +549,7 @@ Public Class Assembly
Else
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
m_LeftJamb.BottomOverMaterial = value
m_RightJamb.BottomOverMaterial = value
m_TopJamb.BottomOverMaterial = value
@@ -569,7 +561,7 @@ Public Class Assembly
NotifyPropertyChanged("BottomOverMaterial")
End Sub
-#End Region ' OverMterial
+#End Region ' OverMaterial
#Region "Lista Porte"
@@ -619,7 +611,7 @@ Public Class Assembly
HeightJamb(GetArrayPartDoor(1).Door.Height)
End If
ReplaceHardware()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetDoorNumber(sDoorNumber As String)
@@ -952,8 +944,7 @@ Public Class Assembly
If String.IsNullOrEmpty(Local_Door.TypePart) Then Local_Door.TypePart = "DO_1"
Dim sDoorPiece As String = Local_Door.TypePart
' per eliminare lo swing associato al jamb FL_L --> FL_
- If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then Local_Door.IsNotAssembly = True
- If Not Local_Door.IsNotAssembly Then
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
If sDoorPiece.Count > 3 AndAlso sDoorPiece.Contains("F") Then
sDoorPiece = sDoorPiece.Remove(3)
End If
@@ -961,14 +952,11 @@ Public Class Assembly
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
Else
' significa che stiamo per leggere una porta singola
- Local_Door.IsNotAssembly = True
Local_Door.IsActive = True
Local_PartDoor.Door = Local_Door
Local_PartDoor.Door.SwingTypeList = OptionModule.m_SwingTypeList
Local_PartDoor.SetIsChecked(Local_Door.IsActive)
SetArrayPartDoor(Local_PartDoor, 0)
- DdfFile.WriteDDFPart(GetArrayPartDoor(0).Door, IniFile.m_sTempDir & "\" & TEMP_FILE, True, False)
- ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
Map.refPartPageVM.CurrPart = Local_Door
Map.refCompoPanelVM.GoBackVisibility = Visibility.Collapsed
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
@@ -1146,7 +1134,7 @@ Public Class Assembly
End If
Next
If Not IsNothing(GetArrayPartDoor(0).Door) Then
- If GetArrayPartDoor(0).Door.IsNotAssembly = True Then m_DoorNumber = "1"
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then m_DoorNumber = "1"
End If
If m_DoorNumber = "1" Then
OneDoorProperty = True
@@ -1563,6 +1551,7 @@ Public Class Assembly
m_LeftJamb.SetThickness(m_Thickness)
m_RightJamb.SetThickness(m_Thickness)
End Sub
+
' questa funzione può essere richiamata solo dopo che sono state create tutte le porte!
Private Sub TopBottomWidth()
Dim dLightHinge As Double
@@ -1603,6 +1592,7 @@ Public Class Assembly
End If
End Select
End Sub
+
' dimensione gli spessori dei Jamb (l'unico diverso dagli altri è quello top)
Public Sub SetWidthJamb()
m_BottomJamb.SetHeight(m_Width)
@@ -1610,13 +1600,14 @@ Public Class Assembly
m_LeftJamb.SetWidth(m_Width)
m_RightJamb.SetWidth(m_Width)
End Sub
+
' ricalcola il valore degli swing dalla modifica dello swing della porta
Public Sub UpdateSwing(sSwing As String)
Dim bInvertDoor As Boolean = False
Select Case DoorNumber
Case "1"
' aggiorno l'elenco dello swing della porta
- If Not GetArrayPartDoor(0).Door.IsNotAssembly Then
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
GetArrayPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeListSinlgeDoor
GetArrayPartDoor(0).Door.SetSwing(GetArrayPartDoor(0).Door.SwingTypeList(GetArrayPartDoor(0).Door.SwingTypeList.IndexOf(sSwing)))
' aggiorno gli swing sui Jamb (tutti hanno lo stesso swing)
diff --git a/Assembly/AssemblyPageVM.vb b/Assembly/AssemblyPageVM.vb
index e442c46..52bd777 100644
--- a/Assembly/AssemblyPageVM.vb
+++ b/Assembly/AssemblyPageVM.vb
@@ -6,15 +6,14 @@ Imports EgtUILib
Public Class AssemblyPageVM
Implements INotifyPropertyChanged
- Private m_CurrAssembly As Assembly
- Public Property CurrAssembly As Assembly
+ Public ReadOnly Property CurrAssembly As Assembly
Get
- Return m_CurrAssembly
+ If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ Else
+ Return Nothing
+ End If
End Get
- Set(value As Assembly)
- m_CurrAssembly = value
- NotifyPropertyChanged("CurrAssembly")
- End Set
End Property
' Definizione comando
@@ -24,9 +23,6 @@ Public Class AssemblyPageVM
Sub New()
Map.SetRefJambPageVM(Me)
- If IsNothing(m_CurrAssembly) Then
- m_CurrAssembly = New Assembly
- End If
End Sub
#Region "Messages"
@@ -253,9 +249,10 @@ Public Class AssemblyPageVM
End Property
Public Sub ShowOrder()
- Map.refAssemblyManagerVM.NewAssembly = True
- Map.refAssemblyManagerVM.OpenSelectedAssembly(Map.refAssemblyManagerVM.SelectedAssembly)
+ Dim OrderWnd As New OrderV(Application.Current.MainWindow, New OrderVM())
+ OrderWnd.ShowDialog()
End Sub
+
#End Region ' Comand
#Region "METHODS"
diff --git a/Assembly/PartDoor.vb b/Assembly/PartDoor.vb
index ef9db94..d789793 100644
--- a/Assembly/PartDoor.vb
+++ b/Assembly/PartDoor.vb
@@ -27,7 +27,7 @@ Public Class PartDoor
IsChecked = bIsChecked
m_Door.IsActive = IsChecked
NotifyPropertyChanged("IsChecked")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
Private m_IsVisible As Visibility
diff --git a/AssemblyManager/AssemblyManagerV.xaml b/AssemblyManager/AssemblyManagerV.xaml
index 9076c4e..8f33219 100644
--- a/AssemblyManager/AssemblyManagerV.xaml
+++ b/AssemblyManager/AssemblyManagerV.xaml
@@ -22,7 +22,7 @@
@@ -58,14 +58,14 @@
diff --git a/AssemblyManager/AssemblyManagerV.xaml.vb b/AssemblyManager/AssemblyManagerV.xaml.vb
index 438431a..25d6bf5 100644
--- a/AssemblyManager/AssemblyManagerV.xaml.vb
+++ b/AssemblyManager/AssemblyManagerV.xaml.vb
@@ -2,7 +2,7 @@
Private Sub Door_MouseLeftButtonDown(sender As Object, e As MouseButtonEventArgs)
Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
- e.Handled = Map.refAssemblyManagerVM.OpenSelectedAssembly(DirectCast(Item.DataContext, AssemblyName))
+ e.Handled = Map.refAssemblyManagerVM.Open(DirectCast(Item.DataContext, AssemblyName))
End Sub
End Class
diff --git a/AssemblyManager/AssemblyManagerVM.vb b/AssemblyManager/AssemblyManagerVM.vb
index fa571bd..4378a48 100644
--- a/AssemblyManager/AssemblyManagerVM.vb
+++ b/AssemblyManager/AssemblyManagerVM.vb
@@ -1,18 +1,10 @@
Imports System.Collections.ObjectModel
-Imports System.ComponentModel
Imports System.IO
Imports EgtUILib
+Imports EgtWPFLib5
Public Class AssemblyManagerVM
- Implements INotifyPropertyChanged
-
- ' percorso della porta corrente (creata o già esistente nella cartella)
-
- Friend NewAssembly As Boolean = False
- Friend DeleteNewPart As Integer = 1
-
- Private SelAssembly As New Assembly
- Friend MsgResult As MessageBoxResult
+ Inherits VMBase
' creiamo un nuovo progetto: un nome e una lista di porte
Private m_CurrProject As New Project
@@ -25,18 +17,8 @@ Public Class AssemblyManagerVM
End Set
End Property
- Private m_SelectedAssembly As New AssemblyName
- Public Property SelectedAssembly As AssemblyName
- Get
- Return m_SelectedAssembly
- End Get
- Set(value As AssemblyName)
- m_SelectedAssembly = value
- NotifyPropertyChanged("SelectedAssembly")
- End Set
- End Property
-
#Region "MESSAGES"
+
Public ReadOnly Property AddNewDoorToolTip As String
Get
Return EgtMsg(50302)
@@ -48,158 +30,138 @@ Public Class AssemblyManagerVM
Return EgtMsg(50303)
End Get
End Property
+
#End Region 'MESSAGES
' Definizione comandi
Private m_cmdAddAssembly As ICommand
- Private m_cmdRemoveDoor As ICommand
+ Private m_cmdRemoveAssembly As ICommand
Sub New()
Map.SetRefDoorManagerVM(Me)
End Sub
#Region "METHODS"
- Private CreateRabbet As Boolean = False
+
#Region "Apertura e salvataggio"
- Public Sub RemoveFromAssemblyList()
- NewAssembly = False
- Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
- m_CurrProject.AssemblyList.Remove(m_SelectedAssembly)
- CurrProject.NotifyPropertyChanged("AssemblyList")
+
+ Public Sub NewCmd(NewAssName As AssemblyName)
+ ' segno come modificato il nome dell'assemblato
+ CurrProject.SelAssemblyName.IsModified = True
+ ' definisco e rimuovo file temporaneo di assemblato
+ Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
+ Try
+ File.Delete(sTempFile)
+ Catch ex As Exception
+ End Try
+ ' creo nuovo assemblato
+ m_CurrProject.SelAssemblyName.SelAssembly = CreateNewAssembly(CurrProject.SelAssemblyName.Name)
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
+ DdfFile.WriteDDFPart(NewAssName.SelAssembly.GetArrayPartDoor(0).Door, sTempFile, False, False)
+ ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile)
+ Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
+ Else
+ DdfFile.WriteDDFAssembly(NewAssName.SelAssembly, sTempFile, False)
+ ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile)
+ Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
+ End If
+ Return
+ End Sub
+
+ Public Function Save(SavedAssName As AssemblyName) As Boolean
+ If IsNothing(SavedAssName) Then Return False
+ ' Salvo
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
+ DdfFile.WriteDDFPart(SavedAssName.SelAssembly.GetArrayPartDoor(0).Door, SavedAssName.Name, True, False)
+ Else
+ DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
+ End If
+ SavedAssName.IsModified = False
+ SavedAssName.NotifyPropertyChanged("IsModify")
+ Return True
+ End Function
+
+ Public Function Open(OpenedAssName As AssemblyName) As Boolean
+ If IsNothing(OpenedAssName) Then Return False
+ If Not File.Exists(OpenedAssName.Name) Then Return False
+ ' Seleziono questo AssemblyName
+ CurrProject.SelAssemblyName = OpenedAssName
+ ' resetto errori sui bevel edge
+ Part.FirstReadingEdge = False
+ ' leggo il ddf e creo relativo assemblato
+ OpenedAssName.SelAssembly = CreateNewAssembly(OpenedAssName.Name)
+ Assembly.ReadDDFAssembly(OpenedAssName.Name, OpenedAssName.SelAssembly)
+ ' definisco e rimuovo file temporaneo di assemblato
+ Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
+ Try
+ File.Delete(sTempFile)
+ Catch ex As Exception
+ End Try
+ ' se l'apertura di un assemblato genera un errore esco
+ If IsNothing(OpenedAssName.SelAssembly) Then Return False
+ OpenedAssName.IsModified = Part.FirstReadingEdge
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
+ DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.GetArrayPartDoor(0).Door, sTempFile, True, False)
+ ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile)
+ Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
+ Else
+ DdfFile.WriteDDFAssembly(OpenedAssName.SelAssembly, sTempFile, True)
+ ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile)
+ Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
+ End If
+ Return True
+ End Function
+
+ Public Sub Delete(DeleteAssName As AssemblyName)
+ ' Se il file esiste eliminalo
+ If File.Exists(DeleteAssName.Name) Then
+ Try
+ File.Delete(DeleteAssName.Name)
+ Catch ex As Exception
+ ' non è un problema
+ End Try
+ End If
+ ' Elimino anche il temporaneo
+ Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
+ Try
+ File.Delete(sTempFile)
+ Catch ex As Exception
+ End Try
+ ' Salvo indice posizione elemento da eliminare
+ Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(DeleteAssName)
+ m_CurrProject.AssemblyList.Remove(DeleteAssName)
If m_CurrProject.AssemblyList.Count > 0 Then
' aggiorno la porta da visualizzare
If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
- m_SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
- OpenSelectedAssembly(SelectedAssembly)
+ m_CurrProject.SelAssemblyName = m_CurrProject.AssemblyList(m_CurrProject.AssemblyList.Count - 1)
+ Open(m_CurrProject.SelAssemblyName)
Else
- m_SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
- OpenSelectedAssembly(SelectedAssembly)
+ m_CurrProject.SelAssemblyName = m_CurrProject.AssemblyList(SelIndex)
+ Open(m_CurrProject.SelAssemblyName)
End If
- CurrProject.NotifyPropertyChanged("AssemblyList")
- ' se non ci sono altre porte nella lista allora
+ ' se non ci sono altre porte nella lista allora
Else
' elimino qualsiasi resto di porta
- Map.refAssemblyPageVM.CurrAssembly = Nothing
- ' aggiorni l'immagine a nulla
+ m_CurrProject.SelAssemblyName = Nothing
+ ' pulisco entry page
+ Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
+ ' aggiorno l'immagine a nulla
EgtNewFile()
EgtZoom(ZM.ALL)
End If
End Sub
- ' salva il file corrente o se è stato appena creato lo elimina dalla lista
- Friend Function SaveCurrentAssembly() As Boolean
- ' Se nessun elemento è selezionato allora continua
- If IsNothing(m_SelectedAssembly) Then Return True
- ' Se l'elemento non è modificato allora continua
- If Not m_SelectedAssembly.IsModify Then Return True
- ' Gestisco salvataggio dell'elemento
- Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_SelectedAssembly.Name))
- MsgResult = MessageBox.Show(sText, EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
- ' Salvo
- If MsgResult = MessageBoxResult.Yes Then
- m_SelectedAssembly.IsModify = False
- Part.FirstReadingEdge = False
- SelectedAssembly.NotifyPropertyChanged("IsModify")
- If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
- DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, m_SelectedAssembly.Name, True, False)
- Else
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, m_SelectedAssembly.Name, True)
- End If
- Return True
- ' Non salvo
- ElseIf MsgResult = MessageBoxResult.No Then
- ' devo eliminare dall'elenco degli assemblati o non salvare nulla
- Part.FirstReadingEdge = False
- If Not File.Exists(m_SelectedAssembly.Name) Then
- CurrProject.AssemblyList.Remove(m_SelectedAssembly)
- Else
- m_SelectedAssembly.IsModify = False
- End If
- Return True
- ' Interrompo operazione
- Else
- Return False
- End If
- End Function
- ' Apre il File in selezionato o crea un nuovo oggetto
- Friend bSaveCurrent As Boolean = True
- Public Function OpenSelectedAssembly(value As AssemblyName) As Boolean
- If Not IsNothing(SelectedAssembly) Then
- If Not IsNothing(m_SelectedAssembly.Name) AndAlso m_SelectedAssembly.Name = value.Name Then
- Dim OrderWindow As New OrderV(Application.Current.MainWindow, Map.refOrderVM)
- bSaveCurrent = True
- If NewAssembly Then
- OrderWindow.ShowDialog()
- NewAssembly = False
- End If
- Else
- bSaveCurrent = SaveCurrentAssembly()
- SelectedAssembly = value
- End If
- Else
- bSaveCurrent = SaveCurrentAssembly()
- SelectedAssembly = value
- End If
- If bSaveCurrent Then
- If File.Exists(m_SelectedAssembly.Name) Then
- Map.refAssemblyPageVM.CurrAssembly = CreateNewAssembly(m_SelectedAssembly.Name)
- Assembly.ReadDDFAssembly(m_SelectedAssembly.Name, Map.refAssemblyPageVM.CurrAssembly)
- ' se l'apertura di un assemblato genera un errore interrompi tutto
- If IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
- Return False
- End If
- If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
- DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, m_SelectedAssembly.Name, True, False)
- Else
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
- End If
- NotifyPropertyChanged("SelectedAssembly")
- ' se è avvenuta la modifica dei valori dei bevel devo avvisare che vi è stata una modifica
- ' dopo aver caricato tutti i valori all'apertura del progetto devo riportare la modifica a false
- m_SelectedAssembly.IsModify = Part.FirstReadingEdge
- If Not Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
- ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, False)
- Map.refSceneManagerVM.ComposeAssembly(SceneManagerVM.nComposeAssembly)
- End If
- Return True
- Else
- ' modifico il nome dell'assemblato
- m_SelectedAssembly.IsModify = True
- CreateRabbet = True
- Map.refAssemblyPageVM.CurrAssembly = CreateNewAssembly(m_SelectedAssembly.Name)
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
-
- If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
- Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly = True
- End If
- If Not Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
- Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
- ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, False)
- Map.refSceneManagerVM.ComposeAssembly(SceneManagerVM.nComposeAssembly)
- CreateRabbet = False
- Else
- Assembly.ReadDDFAssembly(IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, Map.refAssemblyPageVM.CurrAssembly)
- End If
- NotifyPropertyChanged("SelectedAssembly")
- Return True
- End If
- NewAssembly = False
- 'NotifyPropertyChanged("SelectedAssembly")
- Else
- Return False
- End If
- End Function
#End Region ' Apertura e salvataggio
#Region "Creazione e caricamento degli oggetti dell'assemblato"
+
' Caricamento dei dati della pagina generale degli assemblati
Friend Function CreateNewAssembly(value As String) As Assembly
'' se non esisteva nessuna porta allora posso procedere
- 'm_SelectedAssembly.Name = value
+ 'CurrProject.SelAssemblyName.Name = value
'NotifyPropertyChanged("SelectedAssembly")
' costruisco un nuvo assemblato e lo carico con i valori
Dim Local_SelAssembly As New Assembly
- Local_SelAssembly.NewAssembly = NewAssembly
Local_SelAssembly.SetExterior(OptionModule.m_Exterior)
Local_SelAssembly.DoorListNumber = OptionModule.m_DoorsListNumber
' Carico tutti i vettori in sola lettura (i metodi set non contengono nessuna operazione)
@@ -211,7 +173,7 @@ Public Class AssemblyManagerVM
Local_SelAssembly.SetLightHinge(OptionModule.m_LightHinge)
Local_SelAssembly.SetThicknessHead(OptionModule.m_ThicknessHead)
Local_SelAssembly.SetOverlapHinge(OptionModule.m_OverlapHinge)
- Local_SelAssembly.SetOverlapLock(OptionModule.m_OverlapLock)
+ Local_SelAssembly.SetOverlapLock(OptionModule.m_OverlapLock)
Local_SelAssembly.SetOverlapTop(OptionModule.m_OverlapTop)
Local_SelAssembly.SetDeltaThickness(OptionModule.m_DeltaThickness)
Local_SelAssembly.SetLockEdgeType(OptionModule.m_LockEdgeTypeAssembly)
@@ -230,7 +192,7 @@ Public Class AssemblyManagerVM
' costruisco e carico le parti
CreatePart(Local_SelAssembly)
' carico l'assemblato che sto creando in locale (così da poter gestire i Jamb)
- Map.refAssemblyPageVM.CurrAssembly = Local_SelAssembly
+ m_CurrProject.SelAssemblyName.SelAssembly = Local_SelAssembly
CreateDoor(Local_SelAssembly)
' calcolo la dimensione dei Jambs in funzione del numero di porte visibili
Local_SelAssembly.DoorVisibilityNew()
@@ -328,62 +290,13 @@ Public Class AssemblyManagerVM
#End Region ' Creazione e caricamento degli oggetti dell'assemblato
- ' controllo che tutti gli oggetti siano stati creati
- Private Function CurrAssembyIsNotEmpty(ref_CurrAssembly As Assembly) As Boolean
- Dim bJambExist As Boolean = False
- Dim bDoorExist As Boolean = False
- If Not IsNothing(ref_CurrAssembly.BottomJamb) Or Not IsNothing(ref_CurrAssembly.LeftJamb) Or Not IsNothing(ref_CurrAssembly.RightJamb) Or Not IsNothing(ref_CurrAssembly.TopJamb) Then
- bJambExist = True
- End If
- If CInt(ref_CurrAssembly.DoorNumber) > 0 Then
- bDoorExist = True
- End If
- If bJambExist And bDoorExist Then
- Return True
- Else
- Return False
- End If
- Return False
- End Function
-
- Private Sub DeleteDoorFromList()
- Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
- Dim ExtensionFile As String = Path.GetExtension(m_SelectedAssembly.Name)
- Dim FileName As String = Path.GetFileName(m_SelectedAssembly.Name)
- ' modifico l'estensione del file
- FileName = FileName.Replace(ExtensionFile, ".err")
- ' qui modifico il nome del file, ma ancora non è sostituito nel sistema
- m_SelectedAssembly.Name = m_SelectedAssembly.Name.Replace(Path.GetFileName(m_SelectedAssembly.Name), FileName)
- m_CurrProject.AssemblyList.RemoveAt(SelIndex)
- CurrProject.NotifyPropertyChanged("AssemblyList")
- ' se la lista non è rimasta vuota
- If m_CurrProject.AssemblyList.Count > 0 Then
- ' aggiorno la porta da visualizzare
- If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
- SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
- Else
- SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
- End If
- ' se non ci sono altre porte nella lista allora
- Else
- ' elimino qualsiasi resto di porta
- Map.refPartPageVM.CurrPart = Nothing
- ' aggiorni l'immagine a nulla
- EgtNewFile()
- EgtZoom(ZM.ALL)
- End If
- End Sub
-
#End Region ' METHODS
#Region "COMMANDS"
-#Region "AddDoorCommand"
+#Region "AddDoor"
- '''
- ''' Returns a command that do New.
- '''
- Public ReadOnly Property AddAssemblyCommand As ICommand
+ Public ReadOnly Property AddAssembly_Command As ICommand
Get
If m_cmdAddAssembly Is Nothing Then
m_cmdAddAssembly = New Command(AddressOf AddAssembly)
@@ -392,18 +305,23 @@ Public Class AssemblyManagerVM
End Get
End Property
- '''
- ''' Execute the New. This method is invoked by the NewCommand.
- '''
Public Sub AddAssembly()
- If Not SaveCurrentAssembly() Then
- Exit Sub
+ ' verifico se selezionato esiste e modificato
+ If Not IsNothing(m_CurrProject.SelAssemblyName) AndAlso m_CurrProject.SelAssemblyName.IsModified Then
+ Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_CurrProject.SelAssemblyName.Name))
+ Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
+ Case MessageBoxResult.Yes
+ Save(m_CurrProject.SelAssemblyName)
+ Case MessageBoxResult.No
+ Delete(m_CurrProject.SelAssemblyName)
+ Case MessageBoxResult.Cancel
+ Return
+ End Select
End If
- Dim NameExist As Boolean = True
- Dim ImportTemplate As String = String.Empty
'---------------------------------------------------------------------------------------------------------------------------------------------------
' CHIEDO SE SI VUOLE IMPORTARE UN TEMPLATE
'Prima di tutto chiedo se vuole aprire un template
+ 'Dim ImportTemplate As String = String.Empty
'If MessageBox.Show(EgtMsg(50146), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' ' Apro la finestra di dialogo aperta direttamente sulla cartella cercata
' Dim OpenFileDialog As New Microsoft.Win32.OpenFileDialog() With {
@@ -417,16 +335,15 @@ Public Class AssemblyManagerVM
' ImportTemplate = OpenFileDialog.FileName
'End If
'----------------------------------------------------------------------------------------------------------------------------------------------------
- ' lancio la finestra per la creazione di una nuova porta
+ ' Creo nuovo assembly
+ ' Lancio la finestra per chiedere il nome dell'assemblato
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
SaveFileDialog.Title = K_NEWDOOR
SaveFileDialog.Directory = m_CurrProject.Name
SaveFileDialog.Extension = K_DDFEXTENSION
- ' se decido di chiuedere la finestra
- If Not SaveFileDialog.EgtShowDialog Then
- Return
- End If
- ' Controllo se ha estensione il nome della porta
+ ' Se annullo esco
+ If Not SaveFileDialog.EgtShowDialog Then Return
+ ' Controllo se il nome della porta ha estensione
If Path.HasExtension(SaveFileDialog.FileName) Then
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
If Not sExtension.ToLower = K_DDFEXTENSION Then
@@ -435,33 +352,41 @@ Public Class AssemblyManagerVM
Else
SaveFileDialog.FileName &= K_DDFEXTENSION
End If
- ' controllo che il nome non sia presente nella lista
+ ' controllo che il nome non sia presente nella lista degli assemblati
Dim bNameExist As Boolean = False
Dim IndexDoorList As Integer
- For IndexDoorList = 0 To CurrProject.AssemblyList.Count - 1
- If CurrProject.AssemblyList(IndexDoorList).Name = SaveFileDialog.FileName Then
+ For IndexDoorList = 0 To m_CurrProject.AssemblyList.Count - 1
+ If m_CurrProject.AssemblyList(IndexDoorList).Name = SaveFileDialog.FileName Then
' se il nome è nella lista allora esco dal ciclo e rendo falsa la variabile bNameExist
bNameExist = True
Exit For
End If
bNameExist = False
Next
- ' se il nome è nella lista allora sovrascirvo sulla porta esistente
+ ' se il nome è nella lista allora sovrascrivo la porta esistente
If bNameExist Then
' elimino la porta esistente
- File.Delete(SaveFileDialog.FileName)
+ If File.Exists(SaveFileDialog.FileName) Then
+ Try
+ File.Delete(SaveFileDialog.FileName)
+ Catch ex As FileNotFoundException
+ ' non è un problema
+ Catch ex As Exception
+ ' non è un problema
+ End Try
+ End If
' elimino dalla lista
m_CurrProject.AssemblyList.RemoveAt(IndexDoorList)
- CurrProject.NotifyPropertyChanged("AssemblyList")
+ ' ''CurrProject.NotifyPropertyChanged("AssemblyList")
End If
-
' aggiungo il nome del file alla lista degli assemblati
Dim Local_AssemblyName As New AssemblyName
Local_AssemblyName.Name = SaveFileDialog.FileName
- Local_AssemblyName.IsModify = False
- CurrProject.AssemblyList.Add(Local_AssemblyName)
+ m_CurrProject.AssemblyList.Add(Local_AssemblyName)
+ ' Seleziono AssembyName creato
+ m_CurrProject.SelAssemblyName = Local_AssemblyName
' aggiorno la lista
- CurrProject.NotifyPropertyChanged("AssemblyList")
+ ''CurrProject.NotifyPropertyChanged("AssemblyList")
'------------------------------------------------------------------------------------------------------------------------------------------------
' LETTURA DI UN FILE DI TIPO TEMPLATE
'If String.IsNullOrEmpty(ImportTemplate) Then
@@ -475,96 +400,38 @@ Public Class AssemblyManagerVM
' DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, Local_AssemblyName.Name, True, False)
'End If
'------------------------------------------------------------------------------------------------------------------------------------------------
+ ' Creo nuovo assembly
+ NewCmd(Local_AssemblyName)
' carico il nome come Assemblato selezionato
Dim OrderWindow As New OrderV(Application.Current.MainWindow, New OrderVM())
OrderWindow.ShowDialog()
- NewAssembly = True
- OpenSelectedAssembly(Local_AssemblyName)
End Sub
-#End Region ' AddDoorCommand
+#End Region ' AddDoor
-#Region "RemoveDoorCommand"
+#Region "RemoveAssembly"
- '''
- ''' Returns a command that do New.
- '''
- Public ReadOnly Property RemoveDoorCommand As ICommand
+ Public ReadOnly Property RemoveAssembly_Command As ICommand
Get
- If m_cmdRemoveDoor Is Nothing Then
- m_cmdRemoveDoor = New Command(AddressOf RemoveAssembly)
+ If m_cmdRemoveAssembly Is Nothing Then
+ m_cmdRemoveAssembly = New Command(AddressOf RemoveAssembly)
End If
- Return m_cmdRemoveDoor
+ Return m_cmdRemoveAssembly
End Get
End Property
- '''
- ''' Execute the New. This method is invoked by the NewCommand.
- '''
Public Sub RemoveAssembly()
- Dim DeletingQuestion As Integer = 0
- Dim DeletingResult As MessageBoxResult = MessageBoxResult.No
- If IsNothing(m_SelectedAssembly) Then Return
- ''DeleteNewPart = -1
- '' salvo il nome del file che sta per essere eliminato
- 'Dim RemoveDoorName As String = Path.GetFileNameWithoutExtension(m_SelectedAssembly)
-
- ''If Map.refPartPageVM.CurrPart.NewPart Then
- '' ' se sono arrivato qui signifoca che sto chiudendo il programma con una porta nuova aperta ma non salvata
- '' ' se ho dichiarato che non voglio salvare significa che devo eliminare
- '' DeletingResult = MessageBoxResult.Yes
- 'Else
- ' ' stamp a video il messaggio per chiedere se eliminare
- ' DeletingResult = MessageBox.Show(String.Format(EgtMsg(50116), Path.GetFileNameWithoutExtension(m_SelectedAssembly)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
- 'End if
- DeletingResult = MessageBox.Show(String.Format(EgtMsg(50116), Path.GetFileNameWithoutExtension(m_SelectedAssembly.Name)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
- ' chiedo se devo eliminere il file: se si
- If DeletingResult = MessageBoxResult.Yes Then
- ' ricerco l'indice del file all'interno della lista delle porte
- 'SetNameCurrAssemblyAsSaved(m_SelectedAssembly)
- 'Dim SelIndex As Integer = m_CurrProject.AssemblyList.IndexOf(m_SelectedAssembly)
- ' elimino dall'elenco dei file
- If File.Exists(m_SelectedAssembly.Name) Then
- File.Delete(m_SelectedAssembly.Name)
- End If
- RemoveFromAssemblyList()
- ' elimino dalla lista
- ' m_CurrProject.AssemblyList.Remove(m_SelectedAssembly)
- ' CurrProject.NotifyPropertyChanged("AssemblyList")
- ' '' per quando torno nel m_SelectedDoor...per non chiedere di salvare o eliminare
- ' 'DeleteNewPart = -1
- ' '' se la lista non è rimasta vuota
- ' If m_CurrProject.AssemblyList.Count > 0 Then
- ' ' aggiorno la porta da visualizzare
- ' If SelIndex > m_CurrProject.AssemblyList.Count - 1 Then
- ' SelectedAssembly = m_CurrProject.AssemblyList(SelIndex - 1)
- ' OpenSelectedAssembly(SelectedAssembly)
- ' Else
- ' SelectedAssembly = m_CurrProject.AssemblyList(SelIndex)
- ' OpenSelectedAssembly(SelectedAssembly)
- ' End If
- ' ' se non ci sono altre porte nella lista allora
- ' Else
- ' ' elimino qualsiasi resto di porta
- ' Map.refJambPageVM.CurrAssembly = Nothing
- ' ' aggiorni l'immagine a nulla
- ' EgtNewFile()
- ' EgtZoom(ZM.ALL)
- ' End If
- Else
- 'altrimenti salvo il file
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, m_SelectedAssembly.Name, True)
- End If
+ If IsNothing(CurrProject.SelAssemblyName) Then Return
+ Select Case MessageBox.Show(String.Format(EgtMsg(50116), Path.GetFileNameWithoutExtension(CurrProject.SelAssemblyName.Name)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No)
+ Case MessageBoxResult.Yes
+ Delete(CurrProject.SelAssemblyName)
+ Case MessageBoxResult.No
+ ' non faccio alcunchè
+ End Select
End Sub
-#End Region ' RemoveDoorCommand
+#End Region ' RemoveAssembly
-#End Region ' Commands
-
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Public Sub NotifyPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
+#End Region ' COMMANDS
End Class
diff --git a/AssemblyManager/AssemblyName.vb b/AssemblyManager/AssemblyName.vb
new file mode 100644
index 0000000..33e6cea
--- /dev/null
+++ b/AssemblyManager/AssemblyName.vb
@@ -0,0 +1,55 @@
+Imports System.IO
+Imports EgtWPFLib5
+
+Public Class AssemblyName
+ Inherits VMBase
+
+ Private m_Name As String
+ Public Property Name As String
+ Get
+ Return m_Name
+ End Get
+ Set(value As String)
+ m_Name = value
+ m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
+ End Set
+ End Property
+
+ Private m_IsModified As Boolean
+ Public Property IsModified As Boolean
+ Get
+ Return m_IsModified
+ End Get
+ Set(value As Boolean)
+ m_IsModified = value
+ If m_IsModified Then
+ If Not m_GraphicName.Contains("*") Then m_GraphicName &= "*"
+ Else
+ m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
+ End If
+ NotifyPropertyChanged("GraphicName")
+ End Set
+ End Property
+
+ Private m_GraphicName As String
+ Public Property GraphicName As String
+ Get
+ Return m_GraphicName
+ End Get
+ Set(value As String)
+ m_GraphicName = value
+ End Set
+ End Property
+
+ Private m_SelAssembly As New Assembly
+ Public Property SelAssembly As Assembly
+ Get
+ Return m_SelAssembly
+ End Get
+ Set(value As Assembly)
+ m_SelAssembly = value
+ Map.refAssemblyPageVM.NotifyPropertyChanged("CurrAssembly")
+ End Set
+ End Property
+
+End Class
\ No newline at end of file
diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb
index 062d9ac..94725cc 100644
--- a/CompoPanel/CompoPanelVM.vb
+++ b/CompoPanel/CompoPanelVM.vb
@@ -139,7 +139,6 @@ Public Class CompoPanelVM
Public Sub GoToAssemblyBtn(param As Object)
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
- 'ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
Map.refSceneManagerVM.RefreshBtn()
End Sub
diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb
index dabd22e..c0320ad 100644
--- a/Constants/ConstGen.vb
+++ b/Constants/ConstGen.vb
@@ -41,11 +41,9 @@ Module ConstGen
Public Const HELP_DIR As String = "Help"
' sottodirettorio Template
Public Const TEMPLATE_DIR As String = "Template"
- ' File ddf utilizzato per il disegno corrente
+ ' File ddf utilizzato per il disegno corrente (porta, assemblato, singola parte)
Public Const TEMP_FILE As String = "CurrPart.ddf"
- ' File ddf utilizzato per mostrare tutto l'assemblato corrente
- Public Const TEMP_ASSEMBLY As String = "CurrAssembly.ddf"
- Public Const TEMP_FILE_TXT As String = "CurrDoor.txt"
+ ' File con gli errori della parte di disegno (lua)
Public Const TEMP_PART_TXT As String = "CurrPart.txt"
End Module
diff --git a/DdfFile.vb b/DdfFile.vb
index 8267a24..48739fc 100644
--- a/DdfFile.vb
+++ b/DdfFile.vb
@@ -5,134 +5,16 @@ Imports System.Text.RegularExpressions
Friend Module DdfFile
- ' il vettore che conterrà tutti le linee del file DDF da leggere
- Friend FileContent As String()
' lista ordinata delle componenti da stampare
Friend CompoListOrder As New List(Of String)
Friend UnitMeasure As String
#Region "SCRITTURA DDF"
- ''genero le stringhe che dovranno essere scritte nel DDF
- '' !!! attenzione !!! tutte le volte che stampo sul file di CurrDoor.ddf la variabile booelana DEVE essere settata su True
- 'Friend Sub WriteDDF(Part As Part, sPath As String, bIsDDf As Boolean)
- ' ' pulisco lista prima di iniziare a scrivere
- ' Dim DdfFileContent As New List(Of String)
- ' If String.IsNullOrEmpty(Part.Measure) Then
- ' Part.Measure = OptionModule.m_SelectedMeasureUnit
- ' End If
- ' DdfFileContent.Add("#EGTDOORCREATOR")
- ' 'Genero una lista di stringhe
- ' If Part.Measure = "Inches" Then
- ' Part.Measure = "inches"
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_MEASURES & ": " & Part.Measure)
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
- ' If String.IsNullOrEmpty(Part.Code) Then
- ' Part.Code = "1111"
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_CODE & ": " & Part.Code)
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
- ' DdfFileContent.Add(ConstCompo.S_ORDER & ":")
- ' ' Probablimente da cambiare
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": ")
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_ELEVATION & ": ")
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PROJECT & ": ")
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PO & ": ")
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LINE & ": ")
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
- ' DdfFileContent.Add(ConstCompo.K_DATE & ":" & " " & System.DateTime.Now.ToString("dd/MM/yyyy"))
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
-
- ' '---------------------------------------------------------------------------------------------------------
- ' ' è specificato il tipo significa che abbiamo un assemblato
- ' If Not IsNothing(Part.TypePart) Then
- ' DdfFileContent.Add("piece: " & Part.TypePart)
- ' End If
- ' DdfFileContent.Add("")
- ' '---------------------------------------------------------------------------------------------------------
-
- ' Dim dVal As Double = 0
- ' DdfFileContent.Add(ConstCompo.K_SIZE & ":")
- ' If Not StringToDouble(Part.Width, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_WIDTH, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WIDTH & ": " & DoubleToString(dVal, 5))
- ' If Not StringToDouble(Part.Height, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_HEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HEIGHT & ": " & DoubleToString(dVal, 5))
- ' If Not StringToDouble(Part.Thickness, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_THICKNESS, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5))
- ' ' aggiungo il peso della porta
- ' If Part.IsCheckedWeight = Visibility.Visible Then
- ' If Not StringToDouble(Part.Weight, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_WEIGHT, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_WEIGHT & ": " & Part.Weight)
- ' End If
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
- ' DdfFileContent.Add("" & ConstCompo.K_SWING & ": " & Part.Swing)
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
-
- ' ' aggiungo il secure nullo al DDF
- ' DdfFileContent.Add("" & ConstCompo.K_SECURE & ": " & "0")
- ' ' aggiungo una riga vuota per separare la lista successiva
- ' DdfFileContent.Add("")
- ' DdfFileContent.Add("" & ConstCompo.K_PROFILES & ":")
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LOCKEDGE & ": " & Part.LockEdgeType.Name)
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining))
- ' If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & Part.HingeEdgeType.Name)
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining))
- ' If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & Part.TopType.Name)
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining))
- ' If Not StringToDouble(Part.TopOverMaterial, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
- ' DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & Part.BottomType.Name)
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
- ' If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
- ' MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- ' Return
- ' End If
- ' DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
-
- ' ' Riordino e stampo le compo
- ' SearchCompo(DdfFileContent, Part, bIsDDf)
- ' If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
- ' Directory.CreateDirectory(Path.GetDirectoryName(sPath))
- ' End If
- ' File.WriteAllLines(sPath, DdfFileContent, Text.Encoding.UTF8)
- 'End Sub
-
' Questa funzione dovrà sostituire quella precedente (Scritta sopra)
Private IdIndex As Integer = 0
- Friend Sub WriteDDFPart(Part As Part, sPath As String, bIsDDf As Boolean, bIsForAssembly As Boolean)
+ Friend Sub WriteDDFPart(Part As Part, sPath As String, bIsTemplate As Boolean, bIsForAssembly As Boolean)
' pulisco lista prima di iniziare a scrivere
Dim DdfFileContent As New List(Of String)
' quindi significa che non è mai stato caricato il valore
@@ -168,29 +50,29 @@ Friend Module DdfFile
End If
DdfFileContent.Add(ConstCompo.S_ORDER & ":")
- ' Probablimente da cambiare
- If Not IsNothing(Map.refOrderVM.Customer) Then
- DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": " & Map.refOrderVM.Customer)
+ ' Probabilmente da cambiare
+ If Not IsNothing(Part.Customer) Then
+ DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": " & Part.Customer)
Else
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_CUSTOMER & ": ")
End If
- If Not IsNothing(Map.refOrderVM.Elevation) Then
- DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_ELEVATION & ": " & Map.refOrderVM.Elevation)
+ If Not IsNothing(Part.Elevation) Then
+ DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_ELEVATION & ": " & Part.Elevation)
Else
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_ELEVATION & ": ")
End If
- If Not IsNothing(Map.refOrderVM.Project) Then
- DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PROJECT & ": " & Map.refOrderVM.Project)
+ If Not IsNothing(Part.Project) Then
+ DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PROJECT & ": " & Part.Project)
Else
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PROJECT & ": ")
End If
- If Not IsNothing(Map.refOrderVM.PO) Then
- DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PO & ": " & Map.refOrderVM.PO)
+ If Not IsNothing(Part.PO) Then
+ DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PO & ": " & Part.PO)
Else
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_PO & ": ")
End If
- If Not IsNothing(Map.refOrderVM.Line) Then
- DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LINE & ": " & Map.refOrderVM.Line)
+ If Not IsNothing(Part.Line) Then
+ DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LINE & ": " & Part.Line)
Else
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_LINE & ": ")
End If
@@ -200,14 +82,10 @@ Friend Module DdfFile
' aggiungo una riga vuota per separare la lista successiva
DdfFileContent.Add("")
' è specificato il tipo significa che abbiamo un assemblato
- If Not IsNothing(Part.TypePart) And Not Part.IsNotAssembly Then
- DdfFileContent.Add("piece: " & Part.TypePart)
- Else
- DdfFileContent.Add("piece: " & "DO_1")
- End If
+ DdfFileContent.Add("piece: " & Part.TypePart)
DdfFileContent.Add("")
- If Not Part.IsNotAssembly Then
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
If Not IsNothing(Part.TypePart) Then
' il posizionamento della prima porta sta nell'origine
If Part.TypePart = "DO_1" Then
@@ -321,7 +199,7 @@ Friend Module DdfFile
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
' Riordino e stampo le compo
- SearchCompo(DdfFileContent, Part, bIsDDf)
+ SearchCompo(DdfFileContent, Part, bIsTemplate)
If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
Directory.CreateDirectory(Path.GetDirectoryName(sPath))
End If
@@ -606,8 +484,10 @@ Friend Module DdfFile
#Region "SCRITTURA ASSEMBLATO"
' serve per pulire il file temporaneo la prima volta che viene creato
- Private FirstPart As Boolean = True
- Friend Sub WriteDDFAssembly(ByVal CurrAssembly As Assembly, sPath As String, bIsDDF As Boolean)
+ Friend Function WriteDDFAssembly(ByVal CurrAssembly As Assembly, sPath As String, bIsTemplate As Boolean) As Boolean
+ ' verifico esistenza assemblato
+ If IsNothing(CurrAssembly) Then Return False
+
' serve per capire se almeno una Part è stata inserita e quindi inserire il separatore
Dim bSplit As Boolean = False
Dim SplitPart As New List(Of String)
@@ -621,35 +501,35 @@ Friend Module DdfFile
Dim FirstPart As Boolean = False
Select Case CurrAssembly.DoorNumber
Case "1"
- WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsTemplate, FirstPart)
FirstPart = True
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
Case "2"
If Not CurrAssembly.GetArrayPartDoor(0).Door.Swing.Contains("I") Then
- WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsTemplate, FirstPart)
FirstPart = True
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
- WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
Else
- WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.GetArrayPartDoor(1).Door, sPath, bIsTemplate, FirstPart)
FirstPart = True
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
- WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.GetArrayPartDoor(0).Door, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
End If
End Select
- WriteDDFPart(CurrAssembly.LeftJamb, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.LeftJamb, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
- WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.RightJamb, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
If CurrAssembly.Exterior Then
- WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, SplitPart, Text.Encoding.UTF8)
- WriteDDFPart(CurrAssembly.BottomJamb, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.BottomJamb, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
Else
- WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsDDF, FirstPart)
+ WriteDDFPart(CurrAssembly.TopJamb, sPath, bIsTemplate, FirstPart)
File.AppendAllLines(sPath, EndAssebly, Text.Encoding.UTF8)
End If
'------------------------------------------------------------------------------------------------------------------
@@ -664,13 +544,13 @@ Friend Module DdfFile
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.Width, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "width : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "width", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add("")
GeneralAssembly.Add(" " & "Light : ")
@@ -678,25 +558,25 @@ Friend Module DdfFile
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "up : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(ConstCompo.K_SPACE3 & EgtMsg(50106) & "LightUp", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.LightLock, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "LightLock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.LightHinge, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "LightHinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.LightBottom, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "bottom : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "LightBottom", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add("")
GeneralAssembly.Add(" " & "Overlap : ")
@@ -704,25 +584,25 @@ Friend Module DdfFile
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "thickness : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "ThicknessHead", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.OverlapHinge, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "hinge : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "Overlap Hinge", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.OverlapLock, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "lock : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "Overlap Lock", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
If StringToDouble(CurrAssembly.DeltaThickness, dVal) Then
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "deltaT : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "Delta Thickness", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
' i parametri associatia alla condizione di Exterior sono stampati solo se Exterior è true
If CurrAssembly.Exterior Then
@@ -731,7 +611,7 @@ Friend Module DdfFile
GeneralAssembly.Add(ConstCompo.K_SPACE3 & "top : " & DoubleToString(dVal, 5))
Else
MessageBox.Show(EgtMsg(50106) & "Overlap Top", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
End If
GeneralAssembly.Add("")
@@ -740,28 +620,28 @@ Friend Module DdfFile
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.LockEdgeMachining))
If Not StringToDouble(CurrAssembly.LockEdgeOverMaterial, dVal) Then
MessageBox.Show(EgtMsg(50106) & K_LOCKEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_HINGEEDGE & ": " & CurrAssembly.HingeEdgeType.Name)
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.HingeEdgeMachining))
If Not StringToDouble(CurrAssembly.HingeEdgeOverMaterial, dVal) Then
MessageBox.Show(EgtMsg(50106) & K_HINGEDGEOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_TOP & ": " & CurrAssembly.TopType.Name)
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.TopMachining))
If Not StringToDouble(CurrAssembly.TopOverMaterial, dVal) Then
MessageBox.Show(EgtMsg(50106) & K_TOPOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
GeneralAssembly.Add(ConstCompo.K_SPACE3 & ConstCompo.K_BOTTOM & ": " & CurrAssembly.BottomType.Name)
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(CurrAssembly.BottomMachining))
If Not StringToDouble(CurrAssembly.BottomOverMaterial, dVal) Then
MessageBox.Show(EgtMsg(50106) & K_BOTTOMOVERMATERIAL_INI, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
GeneralAssembly.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERIAL & ": " & DoubleToString(dVal, 5))
@@ -770,196 +650,12 @@ Friend Module DdfFile
GeneralAssembly.Add(" " & "doors : " & CurrAssembly.DoorNumber)
Else
MessageBox.Show(EgtMsg(50106) & "Number of Doors", EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- Return
+ Return False
End If
File.AppendAllLines(sPath, GeneralAssembly, Text.Encoding.UTF8)
- End Sub
+ Return True
+ End Function
#End Region
- 'eseguo il confronto tra il DDF Nuovo e quello in lettura nella finestra grafica: restituisce falso se i due file sono diversi
- Friend Function ComparisonFileDDF(sPathNewDoor As String, sPathTempDoor As String) As Boolean
- ''Dim FileContentNewDoor As String()
- ''Dim FileContentTempDoor As String()
- Dim bComparison As Boolean = False
- ''FileContentNewDoor = File.ReadAllLines(sPathNewDoor)
- ''FileContentTempDoor = File.ReadAllLines(sPathTempDoor)
- ''Dim nComparison As Integer
-
- '' individuo il file più corto tra i due
- ''Dim EndOfFile As Integer
- ''If FileContentNewDoor.Count > FileContentTempDoor.Count Then
- '' EndOfFile = FileContentTempDoor.Count
- '' nComparison = 1
- ''ElseIf FileContentNewDoor.Count < FileContentTempDoor.Count Then
- '' EndOfFile = FileContentNewDoor.Count
- '' nComparison = -1
- ''ElseIf FileContentNewDoor.Count = FileContentTempDoor.Count Then
- '' EndOfFile = FileContentNewDoor.Count
- '' nComparison = 0
- ''End If
-
- ''Dim Line As Integer = 0
- ''Dim LineBis As Integer = 0
- '' confronto riga per riga i due file
- ''For Line = 0 To EndOfFile - 1
-
- '' SkipWhiteSpace(FileContentNewDoor, Line, FileContentNewDoor.Count - 1)
- '' SkipWhiteSpace(FileContentTempDoor, LineBis, FileContentTempDoor.Count - 1)
-
- '' If Trim(FindComments(FileContentNewDoor(Line))) = Trim(FindComments(FileContentTempDoor(LineBis))) Then
- '' bComparison = True
- '' LineBis += 1
- '' Else
- '' se la riga cercata è la data allora non considerare la modifica
- '' If Trim(SearchName(FileContentNewDoor(Line))) = "date" Then
- '' bComparison = True
- '' LineBis += 1
- '' ElseIf IsNumeric(SearchKeyValue(FileContentNewDoor(Line), SearchName(FileContentNewDoor(Line)))) Then
- '' Dim sValNewDoor As Double
- '' StringToDouble(SearchKeyValue(FileContentNewDoor(Line), SearchName(FileContentNewDoor(Line))), sValNewDoor)
- '' Dim sValTempDoor As Double
- '' StringToDouble(SearchKeyValue(FileContentTempDoor(Line), SearchName(FileContentTempDoor(LineBis))), sValTempDoor)
- '' If sValNewDoor = sValTempDoor Then
- '' bComparison = True
- '' LineBis += 1
- '' Else
- '' bComparison = False
- '' Exit For
- '' End If
- '' End If
- '' End If
- ''Next
- ''studio le righe che non sono state analizzate sopra
- ''Select Case nComparison
- '' Case 1
- '' For MissinIndex = EndOfFile To FileContentNewDoor.Count - 1
- '' If Not String.IsNullOrWhiteSpace(FindComments(FileContentNewDoor(MissinIndex))) Then
- '' bComparison = False
- '' Exit Select
- '' Else
- '' bComparison = True
- '' End If
- '' Next
- '' Case -1
- '' For MissinIndex = EndOfFile To FileContentTempDoor.Count - 1
- '' If Not String.IsNullOrWhiteSpace(FindComments(FileContentTempDoor(MissinIndex))) Then
- '' bComparison = False
- '' Exit Select
- '' Else
- '' bComparison = True
- '' End If
- '' Next
- ''End Select
- Return bComparison
-
- End Function
-
-#Region "LETTURA ASSEMBLATO"
- Private m_Assembly As New Assembly
-
- ' controllo che il DDF che voglio leggere esista, e se esiste che non sia vuoto
- Friend Sub DecomposeAssebly(ByVal sPathAssembly As String)
- 'Dim FileContent() As String
- Dim nDDF As Integer = 1
- ' controllo che il file esista
- If Not File.Exists(sPathAssembly) Then Return
- ' acrico tutto il file nel vettore
- FileContent = File.ReadAllLines(sPathAssembly)
- ' se il file esiste ma è vuoto
- If FileContent.Count = 0 Then
- MessageBox.Show(EgtMsg(50107), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- End If
-
- ' riga corrente del file
- Dim LineIndex As Integer = 0
- ' riga associata all'inizio di ogni ddf
- Dim StartIndex As Integer = 0
- ' riga associata alla fine di ogni ddf
- Dim StopIndex As Integer = 0
- ' serve per contare quante sono le righe vuote
- Dim EmptyLine As Integer = 0
-
- ' fino a quando il file non è terminato
- While (LineIndex < FileContent.Count)
- ' controlla se trova 3 lineette
- If Search3Score(FileContent(LineIndex)) Or Search3Dots(FileContent(LineIndex)) Then
- ' assegno come riga terminela del ddf quella che precede i tre trattini
- StopIndex = LineIndex - 1
- ' carica il vettore attraverso un ciclo for
- For i As Integer = 0 To StopIndex - StartIndex
- ' scommentando le righe
- FileContent(StartIndex + i) = Utility.FindComments(FileContent(StartIndex + i))
- ' verifico che la riga appena passata non sia vuota
- If (String.IsNullOrEmpty(FileContent(StartIndex + i)) Or String.IsNullOrWhiteSpace(FileContent(StartIndex + i))) Then
- EmptyLine += 1
- End If
- Next
- ' se il numero di righe bianche è ugule alla dimensione del vettore allora quel ddf non esiste e non deve essere stampato
- If (EmptyLine = StopIndex - StartIndex + 1) Then
- ' decido quindi di passare a stampare il succesivo
- nDDF += 1
- Else
- DDFFromAssembly(nDDF, StartIndex)
- nDDF += 1
- End If
- EmptyLine = 0
- ' assegno come nuovo punto di partenza la riga successiva ai tre trattini
- StartIndex = LineIndex + 1
-
- End If
- LineIndex += 1
- End While
-
- End Sub
- ' il vettore che contiene gli startpoint del file assembly
- Friend ListPartsStartIndex As New ObservableCollection(Of Integer)
- 'la lista dei nomi della pulsantiera
- Friend ListParts As New ObservableCollection(Of String)
- ' stampo nel direttorio dei files temporanei il ddf prelevato dall'assemblato
- Private Sub DDFFromAssembly(ByVal nDDF As Integer, StartPoint As Integer)
- Dim TempDoor As New Part
- ' con il seguente select-case stampo il file ddf temporaneo che si vuole leggere
- Select Case nDDF
- 'Case 1
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- 'Case 2
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- 'Case 3
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- 'Case 4
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- 'Case 5
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- 'Case 6
- ' Part.NewReadDDF(StartPoint, TempDoor)
- ' m_Assembly.DoorListAssembly.Add(TempDoor)
- End Select
- End Sub
-
-#End Region 'Lettura Assemblato
-
- ' se il titolo presenta * allora vuol dire che era stato modificato, altrinenti no .Trim("*"c)
- Friend Function SetModify(rMainWindow As MainWindowVM) As Boolean
- If Trim(rMainWindow.ProjectNameMsg) = Trim(rMainWindow.ProjectNameMsg.Trim("*"c)) Then
- Return True
- Else
- Return False
- End If
- End Function
-
- ''Public Function SkipWhiteSpace(Array() As String, ByRef Index As Integer, LastIndex As Integer) As Integer
- '' Array(Index) = FindComments(Array(Index))
- '' While String.IsNullOrWhiteSpace(Array(Index)) And Index < LastIndex
- '' Index += 1
- '' Array(Index) = FindComments(Array(Index))
- '' End While
- '' Return Index
- ''End Function
-
End Module
diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb
index 1130ee6..2f403c4 100644
--- a/DoorParameters/Compo.vb
+++ b/DoorParameters/Compo.vb
@@ -108,7 +108,7 @@ Public Class Compo
SetTemplateSelItem(value)
'm_IsModifiedTemplateSelItem = True
'm_rfCurrDoor.SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -742,7 +742,7 @@ Public Class Compo
Get
If m_CmdDelete Is Nothing Then
m_CmdDelete = New Command(AddressOf Delete)
- End If
+ End If
Return m_CmdDelete
End Get
End Property
@@ -752,7 +752,7 @@ Public Class Compo
'''
Public Sub Delete()
Map.refPartPageVM.CurrPart.RemoveCompo(Me)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
#End Region ' DeleteCommand
@@ -848,7 +848,7 @@ Public Class TextBoxParam
EgtLuaResetGlobVar("STU")
End If
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetValue(sValue As String)
@@ -973,7 +973,7 @@ Public Class ComboBoxParam
Set(value As String)
m_SelItem = value
m_IsModifyCompoParam = True
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -1000,7 +1000,7 @@ Public Class TextBoxOnOffParam
End Get
Set(value As Boolean)
m_IsActive = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb
index 23fd528..90d1a7f 100644
--- a/DoorParameters/Part.vb
+++ b/DoorParameters/Part.vb
@@ -54,7 +54,7 @@ Public Class Part
End Get
Set(value As Boolean)
m_IsActive = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetIsActive(bIsActive As Boolean)
@@ -62,15 +62,15 @@ Public Class Part
NotifyPropertyChanged("IsActive")
End Sub
- Private m_IsNotAssembly As Boolean = False
- Public Property IsNotAssembly As Boolean
- Get
- Return m_IsNotAssembly
- End Get
- Set(value As Boolean)
- m_IsNotAssembly = value
- End Set
- End Property
+ 'Private m_IsAssembly As Boolean = False
+ 'Public Property IsAssembly As Boolean
+ ' Get
+ ' Return m_IsAssembly
+ ' End Get
+ ' Set(value As Boolean)
+ ' m_IsAssembly = value
+ ' End Set
+ 'End Property
#End Region ' Nuove proprietà delle parti
@@ -114,45 +114,45 @@ Public Class Part
End Set
End Property
- 'Private m_Elevation As String
- 'Public Property Elevation As String
- ' Get
- ' Return m_Elevation
- ' End Get
- ' Set(value As String)
- ' m_Elevation = value
- ' End Set
- 'End Property
+ Private m_Elevation As String
+ Public Property Elevation As String
+ Get
+ Return m_Elevation
+ End Get
+ Set(value As String)
+ m_Elevation = value
+ End Set
+ End Property
- 'Private m_Project As String
- 'Public Property Project As String
- ' Get
- ' Return m_Project
- ' End Get
- ' Set(value As String)
- ' m_Project = value
- ' End Set
- 'End Property
+ Private m_Project As String
+ Public Property Project As String
+ Get
+ Return m_Project
+ End Get
+ Set(value As String)
+ m_Project = value
+ End Set
+ End Property
- 'Private m_PO As String
- 'Public Property PO As String
- ' Get
- ' Return m_PO
- ' End Get
- ' Set(value As String)
- ' m_PO = value
- ' End Set
- 'End Property
+ Private m_PO As String
+ Public Property PO As String
+ Get
+ Return m_PO
+ End Get
+ Set(value As String)
+ m_PO = value
+ End Set
+ End Property
- 'Private m_Line As String
- 'Public Property Line As String
- ' Get
- ' Return m_Line
- ' End Get
- ' Set(value As String)
- ' m_Line = value
- ' End Set
- 'End Property
+ Private m_Line As String
+ Public Property Line As String
+ Get
+ Return m_Line
+ End Get
+ Set(value As String)
+ m_Line = value
+ End Set
+ End Property
Private m_Date As String
Public Property DatePar As String
@@ -185,13 +185,13 @@ Public Class Part
SetVarSize()
UpdateToolTip()
NotifyPropertyChanged("Height")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetHeight(sHeight As String)
m_Height = sHeight
NotifyPropertyChanged("Height")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
Private m_Width As String = String.Empty
@@ -211,13 +211,13 @@ Public Class Part
Map.refAssemblyPageVM.CurrAssembly.UpDateAllCompo()
SetVarSize()
UpdateToolTip()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetWidth(sWidth As String)
m_Width = sWidth
NotifyPropertyChanged("Width")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Sub
Private m_Thickness As String
@@ -234,7 +234,7 @@ Public Class Part
End If
SetVarSize()
UpdateToolTip()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
Public Sub SetThickness(sThickness As String)
@@ -258,7 +258,7 @@ Public Class Part
Else
MessageBox.Show(EgtMsg(50148), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -290,8 +290,8 @@ Public Class Part
Return m_Swing
End Get
Set(value As String)
- m_Swing = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ m_Swing = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
Map.refAssemblyPageVM.CurrAssembly.UpdateSwing(m_Swing)
Map.refAssemblyPageVM.CurrAssembly.TopRabbetJamb()
End Set
@@ -324,7 +324,7 @@ Public Class Part
Set(value As ObservableCollection(Of EdgeType))
m_EdgeTypeList = value
Map.refAssemblyPageVM.CurrAssembly.NotifyPropertyChanged("EdgeTypeList")
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -333,13 +333,13 @@ Public Class Part
Get
If m_LockEdgeType.IsActive = Visibility.Collapsed Then
m_LockEdgeType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_LockEdgeType
End Get
Set(value As EdgeType)
m_LockEdgeType = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -348,13 +348,13 @@ Public Class Part
Get
If m_HingeEdgeType.IsActive = Visibility.Collapsed Then
m_HingeEdgeType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_HingeEdgeType
End Get
Set(value As EdgeType)
m_HingeEdgeType = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -363,13 +363,13 @@ Public Class Part
Get
If m_TopType.IsActive = Visibility.Collapsed Then
m_TopType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_TopType
End Get
Set(value As EdgeType)
m_TopType = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -378,13 +378,13 @@ Public Class Part
Get
If m_BottomType.IsActive = Visibility.Collapsed Then
m_BottomType = EdgeTypeList(0)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End If
Return m_BottomType
End Get
Set(value As EdgeType)
m_BottomType = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -399,7 +399,7 @@ Public Class Part
End Get
Set(value As Boolean)
m_TopMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -410,7 +410,7 @@ Public Class Part
End Get
Set(value As Boolean)
m_LockEdgeMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -421,7 +421,7 @@ Public Class Part
End Get
Set(value As Boolean)
m_HingeEdgeMachining = value
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -434,7 +434,7 @@ Public Class Part
m_BottomMachining = value
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -456,7 +456,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -474,7 +474,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -492,7 +492,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -510,7 +510,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
@@ -577,7 +577,7 @@ Public Class Part
NewCompo.SetTemplateSelItem(NewCompo.TemplateItemList(SelItemindex))
End If
End If
- ' se non c'è il template
+ ' se non c'è il template
Else
' nascondo il template
NewCompo.TemplateVisibility = Visibility.Collapsed
@@ -736,7 +736,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
Return NewCompo
End Function
@@ -814,7 +814,7 @@ Public Class Part
End If
'm_IsModifyDoor = True
'SetTitle()
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
Return NewCompo
End Function
@@ -1071,7 +1071,7 @@ Public Class Part
'End Sub
Shared Sub ReadDDFPartDoor(ArrayFile() As String, ByRef LineIndex As Integer, ByRef ReadDoor As Part)
Dim InvalidValue As String = String.Empty
- ' controllo se esite il file DDF
+ ' controllo se esiste il file DDF
ReadDoor.FileContent = ArrayFile
' se il file esiste ma è vuoto
If ReadDoor.FileContent.Count = 0 Then
@@ -1124,7 +1124,7 @@ Public Class Part
Else
Exit While
End If
- ' Leggo il ordine
+ ' Leggo l'ordine
If LineIndex < ReadDoor.FileContent.Count - 1 Then
If SearchKey(ReadDoor.FileContent(LineIndex), S_ORDER) Then
LineIndex = ReadDoor.GetOrder(LineIndex + 1)
@@ -1391,8 +1391,7 @@ Public Class Part
Index += 1
Else
' carico il valore nella porta corrente
- Map.refOrderVM.Customer = Customer
- 'm_Customer = Customer
+ m_Customer = Customer
' passo alla riga successiva
Index += 1
End If
@@ -1401,8 +1400,7 @@ Public Class Part
If Not SearchKey(FileContent(Index), K_ELEVATION) Then ExitOrder = -1
Index += 1
Else
- Map.refOrderVM.Elevation = Elevation
- 'm_Elevation = Elevation
+ m_Elevation = Elevation
Index += 1
End If
Dim Project As String = SearchKeyValue(FileContent(Index), K_PROJECT)
@@ -1410,8 +1408,7 @@ Public Class Part
If Not SearchKey(FileContent(Index), K_PROJECT) Then ExitOrder = -1
Index += 1
Else
- Map.refOrderVM.Project = Project
- 'm_Project = Project
+ m_Project = Project
Index += 1
End If
Dim PO As String = SearchKeyValue(FileContent(Index), K_PO)
@@ -1419,8 +1416,7 @@ Public Class Part
If Not SearchKey(FileContent(Index), K_PO) Then ExitOrder = -1
Index += 1
Else
- Map.refOrderVM.PO = PO
- 'm_PO = PO
+ m_PO = PO
Index += 1
End If
Dim Line As String = SearchKeyValue(FileContent(Index), K_LINE)
@@ -1428,8 +1424,7 @@ Public Class Part
If Not SearchKey(FileContent(Index), K_LINE) Then ExitOrder = -1
Index += 1
Else
- Map.refOrderVM.Line = Line
- 'm_Line = Line
+ m_Line = Line
Index += 1
End If
diff --git a/Doors.vb b/Doors.vb
index 6a367bc..48add78 100644
--- a/Doors.vb
+++ b/Doors.vb
@@ -13,6 +13,7 @@
Imports Microsoft.VisualBasic
Imports EgtUILib
+Imports EgtWPFLib5
Public Module Doors
@@ -27,6 +28,10 @@ Public Module Doors
Dim bOk As Boolean = CreateDoors(sFile, False, False)
' Scrivo il nome del file aperto in una variabile globale per averlo in caso di errore
IniFile.m_DDFFilePath = sFile
+ ' se attiva modalità assemblato, calcolo posizioni dei Part
+ If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
+ Map.refSceneManagerVM.ComposeAssembly(SceneManagerVM.nComposeAssembly)
+ End If
' Aggiorno la visualizzazione
If bDraw Then EgtZoom(ZM.ALL)
' Cursore standard
@@ -38,7 +43,7 @@ Public Module Doors
' Carico il file
Dim sExecPath As String = String.Empty
Dim sExecName As String = String.Empty
- GetPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecName)
+ GetMainPrivateProfileString(S_DOORS, K_DDFEXEC, "", sExecName)
sExecPath = IniFile.m_sDoorsDirPath & "\" & sExecName
If Not EgtLuaExecFile(sExecPath) Then Return False
' Lancio la creazione
@@ -47,7 +52,7 @@ Public Module Doors
EgtLuaSetGlobBoolVar("DGD.BATCH", bBatch)
EgtLuaSetGlobIntVar("DGD.MachEn", 0)
Dim sFunction As String = String.Empty
- GetPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction)
+ GetMainPrivateProfileString(S_DOORS, K_DDFFUNCTION, "", sFunction)
Dim bOk As Boolean = EgtLuaExecLine(sFunction)
Dim nErr As Integer = 999
If Not EgtLuaGetGlobIntVar("DGD.ERR", nErr) Or nErr <> 0 Then bOk = False
diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj
index b81fd13..daaac3b 100644
--- a/EgtDOORCreator.vbproj
+++ b/EgtDOORCreator.vbproj
@@ -110,6 +110,7 @@
AboutBoxV.xaml
+
@@ -171,10 +172,10 @@
PopUpViewPanelV.xaml
-
+
RefreshPanelV.xaml
-
+
SceneManagerV.xaml
@@ -261,7 +262,7 @@
MSBuild:Compile
Designer
-
+
Designer
MSBuild:Compile
diff --git a/IniFile.vb b/IniFile.vb
index 4a4e116..5bebfbf 100644
--- a/IniFile.vb
+++ b/IniFile.vb
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
+Imports EgtWPFLib5
Friend Module IniFile
@@ -45,47 +46,10 @@ Friend Module IniFile
Friend m_sDoorsDirPath As String = String.Empty
' IniFile
- Public Function GetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer
- Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileDouble(IpAppName As String, IpKeyName As String, nDefault As Integer) As Double
- Return EgtUILib.GetPrivateProfileDouble(IpAppName, IpKeyName, nDefault, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
- Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileColor(IpAppName As String, IpKeyName As String, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
- Return EgtUILib.GetPrivateProfileColor(IpAppName, IpKeyName, Col, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
- Return EgtUILib.GetPrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileZoomWin(IpAppName As String, IpKeyName As String, ByRef bOutline As Boolean, ByRef Col As EgtUILib.EgtInterface.Color3d) As Boolean
- Return EgtUILib.GetPrivateProfileZoomWin(IpAppName, IpKeyName, bOutline, Col, m_sIniFile)
- End Function
-
- Public Function GetPrivateProfileFloatingWinPos(lpAppName As String, lpKeyName As String, ByRef nState As String, ByRef nIndex As Integer, ByRef nLeft As Integer, ByRef nTop As Integer) As Boolean
- Dim sVal As String = String.Empty
- GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
- Dim sItems() As String = sVal.Split(",".ToCharArray)
- If sItems.Count() >= 4 Then
- nState = sItems(0)
- nIndex = CInt(sItems(1))
- nLeft = CInt(sItems(2))
- nTop = CInt(sItems(3))
- Return True
- End If
- Return False
- End Function
Public Function GetPrivateProfileLanguage(ByVal lpAppName As String, ByVal lpKeyName As String) As Language
Dim sVal As String = String.Empty
- GetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
+ GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
Dim sItems() As String = sVal.Split(",".ToCharArray)
If sItems.Count() = 2 Then
Return New Language(sItems(0), sItems(1))
@@ -156,18 +120,10 @@ Friend Module IniFile
Return IpBoolean
End Function
- Public Function WritePrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
- Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sIniFile)
- End Function
-
Public Function DefaultWritePrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
Return EgtUILib.WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_DefaultIniFile)
End Function
- Public Function WritePrivateProfileWinPos(IpAppName As String, IpKeyName As String, ByRef nFlag As Integer, ByRef nLeft As Integer, ByRef nTop As Integer, ByRef nWidth As Integer, ByRef nHeight As Integer) As Boolean
- Return EgtUILib.WritePrivateProfileWinPos(IpAppName, IpKeyName, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
- End Function
-
Friend Sub OpenDirectory(DirectoryPath As String, ByRef ComboList As List(Of String))
RecursiveOpenDirectory(DirectoryPath, ComboList, DirectoryPath)
End Sub
diff --git a/Launcher/LauncherModule.vb b/Launcher/LauncherModule.vb
index a5b46b3..3fced10 100644
--- a/Launcher/LauncherModule.vb
+++ b/Launcher/LauncherModule.vb
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
+Imports EgtWPFLib5
Module LauncherModule
' riferimento
@@ -8,7 +9,7 @@ Module LauncherModule
Friend Sub InitLauncherModule()
' carico il percorso dell'ultimo progetto aperto
- GetPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject)
+ GetMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject)
End Sub
End Module
diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb
index 94f6168..a5198e8 100644
--- a/MainWindow/MainWindowModel.vb
+++ b/MainWindow/MainWindowModel.vb
@@ -1,6 +1,7 @@
Imports System.Threading
Imports System.Math
Imports EgtUILib
+Imports EgtWPFLib5
Friend Class MainWindowModel
@@ -32,6 +33,8 @@ Friend Class MainWindowModel
IniFile.m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
' Impostazione direttorio Ini file
IniFile.m_sIniFile = IniFile.m_sConfigDir & "\" & INI_FILE_NAME
+ ' Impostazione path Ini file
+ EgtWPFLib5.IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
' Impostazione direttorio della cartella Help
IniFile.m_sHelpDir = m_sDataRoot & "\" & HELP_DIR
' Impostazione direttorio della cartella Template
@@ -45,7 +48,7 @@ Friend Class MainWindowModel
EgtSetLockType(KEY_TYPE.HW)
' Leggo e imposto chiave di protezione
Dim sLicFileName As String = String.Empty
- GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
+ GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
Dim sKey As String = String.Empty
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
@@ -54,7 +57,7 @@ Friend Class MainWindowModel
Dim bKey As Boolean = EgtGetKeyLevel(3279, 16, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 16, 1, IniFile.m_nKeyOptions)
'Inizializzazione generale di EgtInterface
- m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
+ m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
Dim sLogMsg As String = "User " & Environment.UserName & "\" & Environment.MachineName & " (" & m_nInstance.ToString() & ")" & vbLf &
My.Application.Info.Description.ToString() & " ver. " &
@@ -64,23 +67,23 @@ Friend Class MainWindowModel
My.Application.Info.Version.Revision.ToString()
EgtInit(m_nDebug, sLogFile, sLogMsg)
' carico direttorio doors
- GetPrivateProfileString(S_DOORS, K_BASEDIR, "", IniFile.m_sDoorsDirPath)
+ GetMainPrivateProfileString(S_DOORS, K_BASEDIR, "", IniFile.m_sDoorsDirPath)
' L'indirizzo del file di Default
IniFile.m_DefaultIniFile = IniFile.m_sDoorsDirPath & "\Compo\Default.ini"
'Inizializzo OptionModule
OptionModule.InitOptionModule()
' imposto dir font Nfe e font default
Dim sNfeDir As String = String.Empty
- GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
+ GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
Dim sDefFont As String = String.Empty
- GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont)
+ GetMainPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont)
EgtSetFont(sNfeDir, sDefFont)
' imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
- GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
+ GetMainPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
EgtSetLuaLibs(sLuaLibsDir)
Dim sLuaBaseLib As String = String.Empty
- GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
+ GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' Imposto path IniFile
EgtSetIniFile(IniFile.m_sIniFile)
@@ -105,13 +108,13 @@ Friend Class MainWindowModel
' Prima istanza
m_nInstance = 1
' Aggiorno stato istanze attive
- WritePrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
+ WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
Else
' Leggo il massimo numero di istanze ammesse
- Dim nMaxInst As Integer = GetPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
+ Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
nMaxInst = Max(1, Min(nMaxInst, 32))
' Cerco il primo indice di istanza libero (max 32)
- Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
+ Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
m_nInstance = 1
Dim nMask As Integer = 1
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
@@ -147,7 +150,7 @@ Friend Class MainWindowModel
End If
' Aggiorno stato istanze attive
nTmp += (1 << (m_nInstance - 1))
- WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
+ WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
End If
End Sub
diff --git a/MainWindow/MainWindowV.xaml b/MainWindow/MainWindowV.xaml
index 67b92d3..af55832 100644
--- a/MainWindow/MainWindowV.xaml
+++ b/MainWindow/MainWindowV.xaml
@@ -6,7 +6,7 @@
DataContext="{StaticResource MainWindowVM}"
Title="{Binding ProjectNameMsg}" Icon="/Resources/EgtDOOR.ico"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
- MinHeight="600" MinWidth="800" Height="768" Width="1366"
+ MinHeight="600" MinWidth="800"
AboutBox="{Binding AboutBox}" WindowStyle="None" ResizeMode="NoResize"
CloseCommand="{Binding CloseApplicationCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
diff --git a/MainWindow/MainWindowV.xaml.vb b/MainWindow/MainWindowV.xaml.vb
index 68110f4..81ab1d3 100644
--- a/MainWindow/MainWindowV.xaml.vb
+++ b/MainWindow/MainWindowV.xaml.vb
@@ -2,19 +2,27 @@
Class MainWindowV
- Public Sub Me_ContentRendered() Handles Me.ContentRendered
+#Region "EVENTS"
+
+ Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ ' Carico e imposto posizione finestra
+ WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
+ End Sub
+
+ Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' se è assente la chiave di protezione non mostro la finestra Launcher
If Map.refSceneManagerVM.bProtectKey Then
Map.refMainWindowVM.SetLauncher()
End If
End Sub
- Private Sub EgtCustomWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
- Dim rfMainWindowVM As MainWindowVM = DirectCast(Me.DataContext, MainWindowVM)
- ' Posizione e dimensioni del Form
- Dim WinPos As New WinPos
- GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
- rfMainWindowVM.WinPosToWindow(Me, WinPos)
+ Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
+ ' Salvo posizione finestra (se non minimizzata)
+ If WindowState <> WindowState.Minimized Then
+ WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
+ End If
End Sub
+#End Region ' EVENTS
+
End Class
diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb
index 054e17b..1e57376 100644
--- a/MainWindow/MainWindowVM.vb
+++ b/MainWindow/MainWindowVM.vb
@@ -97,7 +97,7 @@ Public Class MainWindowVM
Launcher.ShowDialog()
Case 1
' se non trovo salvato nessun ultimo file allora apro vuoto
- If GetPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject) < 0 Then
+ If GetMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject) < 0 Then
Exit Select
Else
' apro l'ultimo progetto
@@ -132,27 +132,6 @@ Public Class MainWindowVM
End If
End Sub
- Friend Sub WinPosToWindow(Window As Window, WinPos As WinPos)
- Window.WindowStartupLocation = WindowStartupLocation.Manual
- Window.Top = WinPos.nTop
- Window.Left = WinPos.nLeft
- Window.Height = WinPos.nHeight
- Window.Width = WinPos.nWidth
- Window.WindowState = If(WinPos.nFlag = 1, WindowState.Maximized, WindowState.Normal)
- End Sub
-
- Friend Sub WindowToWinPos(Window As Window, WinPos As WinPos)
- WinPos.nTop = CInt(Window.Top)
- WinPos.nLeft = CInt(Window.Left)
- WinPos.nHeight = CInt(Window.Height)
- WinPos.nWidth = CInt(Window.Width)
- WinPos.nFlag = If(Window.WindowState = WindowState.Maximized, 1, 0)
- If Window.WindowState = WindowState.Maximized Then
- WinPos.nHeight = CInt(Window.RestoreBounds.Height)
- WinPos.nWidth = CInt(Window.RestoreBounds.Width)
- End If
- End Sub
-
#Region "CloseApplicationCommand"
'''
@@ -171,53 +150,22 @@ Public Class MainWindowVM
''' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
'''
Public Sub CloseApplication(ByVal param As Object)
- '' Gestisco eventuale file corrente modificato
- 'Application.Msn.NotifyColleagues(Application.MANAGEMODIFIED)
- 'If m_allowWindowToClose Then
- ' Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATION)
- ' Salvo posizione Form (se non minimizzato)
- If Application.Current.MainWindow.WindowState <> WindowState.Minimized Then
- Dim WinPos As New WinPos
- WindowToWinPos(Application.Current.MainWindow, WinPos)
- WritePrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
+ ' verifico se selezionato esiste e modificato
+ If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
+ Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
+ Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
+ Case MessageBoxResult.Yes
+ Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
+ Case MessageBoxResult.No
+ ' Non faccio alcunchè
+ Case MessageBoxResult.Cancel
+ Return
+ End Select
End If
- ' ' Terminazione generale di EgtInterface
- ' EgtExit()
- ' ' Rilascio mutex
- ' m_objMutex.Close()
- ' ' Aggiorno istanze usate
- ' Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
- ' nTmp -= (1 << (m_nInstance - 1))
- ' WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
- ' ' Salvo impostazione macchina corrente
- ' Application.Msn.NotifyColleagues(Application.SAVECURRENTMACHINE)
-
- ' aggiorno file DDF grafico (CurrDoor.ddf)
- If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then
- 'DdfFile.WriteDDF(Map.refPartPageVM.CurrPart, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
- 'Dim SelDoor As String = Map.refAssemblyManagerVM.SelectedAssembly.Name
- ' ''If Not DdfFile.ComparisonFileDDF(IniFile.m_sTempDir & "\CurrDoor.ddf", SelDoor) Then
- 'If Not DdfFile.SetModify(Me) Then
- '' se la risposta è di non salavre non faccio nulla
- 'Dim QuestionSave As String = String.Format(EgtMsg(50152), Path.GetFileNameWithoutExtension(SelDoor))
- 'Dim Result As MessageBoxResult
- 'Result = MessageBox.Show(QuestionSave, EgtMsg(50110), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
- 'If Result = MessageBoxResult.Cancel Then
- ' Return
- 'ElseIf (Result = MessageBoxResult.Yes) Then
- ' ' altrimenti sovrascrivo il DDF
- ' DdfFile.WriteDDF(Map.refPartPageVM.CurrPart, SelDoor, True)
- 'ElseIf (Result = MessageBoxResult.No AndAlso Map.refPartPageVM.CurrPart.NewPart = True) Then
- ' Map.refAssemblyManagerVM.RemoveAssembly()
- 'End If
- 'End If
- ' scrivo il nome dell'ultimo file aperto
- If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
- If Not IsNothing(Map.refProjectManagerVM.m_CurrProject) Then
- IniFile.WritePrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refProjectManagerVM.m_CurrProject.Name)
- End If
+ ' scrivo il nome dell'ultimo file aperto
+ If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) Then
+ WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
End If
-
EgtExit()
'' Disabilito gestore Idle
'RemoveHandler Application.Idle, AddressOf Application_Idle
diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index 38ba966..1430347 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
-Imports EgtUILib
Imports System.IO
+Imports EgtUILib
+Imports EgtWPFLib5
Friend Module OptionModule
@@ -106,13 +107,13 @@ Friend Module OptionModule
End While
' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
Dim sMsgDir As String = String.Empty
- If GetPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
+ If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
sMsgDir = IniFile.m_sConfigDir
End If
' Leggo file messaggi
Dim sMsgName As String = String.Empty
- GetPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
+ GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sMsgName)
Dim sMsgFilePath As String = sMsgDir & "\EgalTechEng.txt"
For Each Language In OptionModule.m_LanguageList
If Language.Name = sMsgName Then
@@ -126,11 +127,11 @@ Friend Module OptionModule
End If
'i valori della pagina dell'assemblato
- Dim Config As Integer = GetPrivateProfileInt(S_GENERAL, S_RUNAS, 0)
+ Dim Config As Integer = GetMainPrivateProfileInt(S_GENERAL, S_RUNAS, 0)
m_ConfigurationSoftware = If(Config = 0, ConfigType.Door, ConfigType.Assembly)
' imposto unità di misura per interfaccia utente
- m_bIsMmUnit = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
+ m_bIsMmUnit = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
EgtSetUiUnits(m_bIsMmUnit)
If m_bIsMmUnit Then
m_SelectedMeasureUnit = m_MeasureUnitList(0)
@@ -139,11 +140,11 @@ Friend Module OptionModule
End If
' imposto tipo di avvio
- Dim nOptionLauncher As Integer = GetPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0)
+ Dim nOptionLauncher As Integer = GetMainPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0)
' leggo il direttorio di salvataggio dei progetti
Dim sMyProjectDir As String = String.Empty
- If GetPrivateProfileString(S_DOORS, K_MYPROJECTDIR, "", sMyProjectDir) <> 0 Then
+ If GetMainPrivateProfileString(S_DOORS, K_MYPROJECTDIR, "", sMyProjectDir) <> 0 Then
' se non esiste il direttorio
If Not Directory.Exists(sMyProjectDir) Then
' manntego l'accesso a quello di default
@@ -159,7 +160,7 @@ Friend Module OptionModule
End If
Dim sTemplateDir As String = String.Empty
- If GetPrivateProfileString(S_DOORS, K_TEMPLATEDIR, "", sTemplateDir) <> 0 Then
+ If GetMainPrivateProfileString(S_DOORS, K_TEMPLATEDIR, "", sTemplateDir) <> 0 Then
' se non esiste il direttorio
If Not Directory.Exists(sTemplateDir) Then
' manntego l'accesso a quello di default
diff --git a/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb
index fa2cc3a..12bf76b 100644
--- a/OptionsWindow/OptionsViewModel.vb
+++ b/OptionsWindow/OptionsViewModel.vb
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports EgtUILib
+Imports EgtWPFLib5
Public Class OptionsVM
Implements INotifyPropertyChanged
@@ -23,7 +24,7 @@ Public Class OptionsVM
Set(value As Language)
If value IsNot OptionModule.m_SelectedLanguage Then
OptionModule.m_SelectedLanguage = value
- WritePrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
+ WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
End If
m_Chapter = "language"
End Set
@@ -42,7 +43,7 @@ Public Class OptionsVM
Set(value As String)
If value IsNot OptionModule.m_SelectedMeasureUnit Then
OptionModule.m_SelectedMeasureUnit = value
- ' iniziliazzo il valore dell'unità di misura
+ ' inizializzo il valore dell'unità di misura
DdfFile.UnitMeasure = value
If value = OptionModule.m_MeasureUnitList(0) Then
OptionModule.m_bIsMmUnit = True
@@ -50,7 +51,7 @@ Public Class OptionsVM
OptionModule.m_bIsMmUnit = False
End If
EgtSetUiUnits(OptionModule.m_bIsMmUnit)
- WritePrivateProfileString(S_SCENE, K_MMUNITS, If(OptionModule.m_bIsMmUnit, 1, 0).ToString)
+ WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, If(OptionModule.m_bIsMmUnit, 1, 0).ToString)
End If
m_Chapter = "unit_measure"
End Set
@@ -71,11 +72,11 @@ Public Class OptionsVM
OptionModule.m_SelectedOptionLauncher = Trim(value)
Select Case OptionModule.m_SelectedOptionLauncher
Case "Open Window"
- WritePrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(0))
+ WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(0))
Case "Last Project"
- WritePrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(1))
+ WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(1))
Case "Empty"
- WritePrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(2))
+ WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, CStr(2))
End Select
m_Chapter = "start_up"
End If
@@ -387,7 +388,7 @@ Public Class OptionsVM
If value IsNot IniFile.m_MyProjectDir Then
IniFile.m_MyProjectDir = value
' iniziliazzo il valore dell'unità di misura
- WritePrivateProfileString(S_DOORS, K_MYPROJECTDIR, value)
+ WriteMainPrivateProfileString(S_DOORS, K_MYPROJECTDIR, value)
End If
NotifyPropertyChanged("MyProjectDir")
End Set
diff --git a/Order/OrderV.xaml b/Order/OrderV.xaml
index d19a20e..9d24dbb 100644
--- a/Order/OrderV.xaml
+++ b/Order/OrderV.xaml
@@ -57,7 +57,8 @@
SelectedItem="{Binding Configuration}"/>-->
+ IsDefault="True"
+ IsCancel="True"/>
diff --git a/Order/OrderVM.vb b/Order/OrderVM.vb
index 5c66a09..7b44f79 100644
--- a/Order/OrderVM.vb
+++ b/Order/OrderVM.vb
@@ -1,7 +1,8 @@
-Imports System.ComponentModel
+Imports EgtWPFLib5
Public Class OrderVM
- Implements INotifyPropertyChanged
+ Inherits VMBase
+
#Region "Messages"
Public ReadOnly Property Title As String
@@ -50,103 +51,93 @@ Public Class OrderVM
#End Region ' Messages
- Private m_Customer As String
Public Property Customer As String
Get
- Return m_Customer
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Customer
End Get
Set(value As String)
- m_Customer = value
- 'Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ CurrAssembly.GetArrayPartDoor(0).Door.Customer = value
+ CurrAssembly.GetArrayPartDoor(1).Door.Customer = value
+ CurrAssembly.LeftJamb.Customer = value
+ CurrAssembly.RightJamb.Customer = value
+ CurrAssembly.TopJamb.Customer = value
+ CurrAssembly.BottomJamb.Customer = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
- Private m_Elevation As String
Public Property Elevation As String
Get
- Return m_Elevation
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Elevation
End Get
Set(value As String)
- m_Elevation = value
- 'Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ CurrAssembly.GetArrayPartDoor(0).Door.Elevation = value
+ CurrAssembly.GetArrayPartDoor(1).Door.Elevation = value
+ CurrAssembly.LeftJamb.Elevation = value
+ CurrAssembly.RightJamb.Elevation = value
+ CurrAssembly.TopJamb.Elevation = value
+ CurrAssembly.BottomJamb.Elevation = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
- Private m_Project As String
Public Property Project As String
Get
- Return m_Project
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Project
End Get
Set(value As String)
- m_Project = value
- 'Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ CurrAssembly.GetArrayPartDoor(0).Door.Project = value
+ CurrAssembly.GetArrayPartDoor(1).Door.Project = value
+ CurrAssembly.LeftJamb.Project = value
+ CurrAssembly.RightJamb.Project = value
+ CurrAssembly.TopJamb.Project = value
+ CurrAssembly.BottomJamb.Project = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
- Private m_PO As String
Public Property PO As String
Get
- Return m_PO
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.PO
End Get
Set(value As String)
- m_PO = value
- 'Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ CurrAssembly.GetArrayPartDoor(0).Door.PO = value
+ CurrAssembly.GetArrayPartDoor(1).Door.PO = value
+ CurrAssembly.LeftJamb.PO = value
+ CurrAssembly.RightJamb.PO = value
+ CurrAssembly.TopJamb.PO = value
+ CurrAssembly.BottomJamb.PO = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
- Private m_Line As String
Public Property Line As String
Get
- Return m_Line
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return Nothing
+ Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.GetArrayPartDoor(0).Door.Line
End Get
Set(value As String)
- m_Line = value
- 'Map.refAssemblyManagerVM.SelectedAssembly.IsModify = True
+ Dim CurrAssembly As Assembly = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly
+ CurrAssembly.GetArrayPartDoor(0).Door.Line = value
+ CurrAssembly.GetArrayPartDoor(1).Door.Line = value
+ CurrAssembly.LeftJamb.Line = value
+ CurrAssembly.RightJamb.Line = value
+ CurrAssembly.TopJamb.Line = value
+ CurrAssembly.BottomJamb.Line = value
+ Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
End Set
End Property
- Private m_cmdCloseOrder As ICommand
-
Sub New()
Map.SetRefOrderVM(Me)
End Sub
- '''
- ''' Returns a command that remove the current selected machining.
- '''
- Public ReadOnly Property CloseOrderCommand() As ICommand
- Get
- If m_cmdCloseOrder Is Nothing Then
- m_cmdCloseOrder = New Command(AddressOf CloseOrder)
- End If
- Return m_cmdCloseOrder
- End Get
- End Property
-
- '''
- ''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
- '''
- Public Sub CloseOrder()
- ' Chiusura finestra
- For Each Window In Application.Current.Windows
- If TypeOf Window Is OrderV Then
- Dim OptionsWindow As OrderV = DirectCast(Window, OrderV)
- ' se chiudo la pagina dal pulsante salva allora stampo il file corrente
- If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso
- Not IsNothing(Map.refAssemblyManagerVM.SelectedAssembly) AndAlso
- Not IsNothing(Map.refAssemblyManagerVM.SelectedAssembly.Name) Then
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, Map.refAssemblyManagerVM.SelectedAssembly.Name, True)
- End If
- OptionsWindow.Close()
- Map.refAssemblyManagerVM.bSaveCurrent = True
- End If
- Next
- End Sub
-
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Public Sub NotifyPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
-
End Class
diff --git a/ProjectManager/Project.vb b/ProjectManager/Project.vb
index cb38009..7d627b9 100644
--- a/ProjectManager/Project.vb
+++ b/ProjectManager/Project.vb
@@ -1,9 +1,10 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.IO
+Imports EgtWPFLib5
Public Class Project
- Implements INotifyPropertyChanged
+ Inherits VMBase
Private m_Name As String
Public Property Name As String
@@ -26,57 +27,15 @@ Public Class Project
End Set
End Property
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Public Sub NotifyPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
-
-End Class
-
-Public Class AssemblyName
- Implements INotifyPropertyChanged
-
- Private m_Name As String
- Public Property Name As String
+ Private m_SelAssemblyName As AssemblyName
+ Public Property SelAssemblyName As AssemblyName
Get
- Return m_Name
+ Return m_SelAssemblyName
End Get
- Set(value As String)
- m_Name = value
- m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
+ Set(value As AssemblyName)
+ m_SelAssemblyName = value
+ NotifyPropertyChanged("SelAssemblyName")
End Set
End Property
- Private m_IsModify As Boolean
- Public Property IsModify As Boolean
- Get
- Return m_IsModify
- End Get
- Set(value As Boolean)
- m_IsModify = value
- If m_IsModify Then
- If Not m_GraphicName.Contains("*") Then m_GraphicName &= "*"
- Else
- m_GraphicName = Path.GetFileNameWithoutExtension(m_Name)
- End If
- NotifyPropertyChanged("GraphicName")
- End Set
- End Property
-
- Private m_GraphicName As String
- Public Property GraphicName As String
- Get
- Return m_GraphicName
- End Get
- Set(value As String)
- m_GraphicName = value
- End Set
- End Property
-
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Public Sub NotifyPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
End Class
\ No newline at end of file
diff --git a/ProjectManager/ProjectManagerVM.vb b/ProjectManager/ProjectManagerVM.vb
index b67dd13..65c27cd 100644
--- a/ProjectManager/ProjectManagerVM.vb
+++ b/ProjectManager/ProjectManagerVM.vb
@@ -2,6 +2,7 @@
Imports System.ComponentModel
Imports System.IO
Imports EgtUILib
+Imports EgtWPFLib5
Imports Ionic.zip
Public Class ProjectManagerVM
@@ -11,16 +12,9 @@ Public Class ProjectManagerVM
Friend m_CurrProject As Project
- 'Public ReadOnly Property MruFileNames As ObservableCollection(Of String)
- ' Get
- ' Return IniFile.m_MruFiles.m_FileNames
- ' End Get
- 'End Property
-
' Definizione comandi
Private m_cmdNew As ICommand
Private m_cmdOpen As ICommand
- 'Private Shared m_cmdOpenMruFile As ICommand
Private m_cmdSave As ICommand
Private m_cmdSaveAs As ICommand
Private m_cmdInsert As ICommand
@@ -125,7 +119,18 @@ Public Class ProjectManagerVM
''' Execute the New. This method is invoked by the NewCommand.
'''
Public Sub NewCmd()
- If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
+ ' verifico se selezionato esiste e modificato
+ If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
+ Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
+ Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
+ Case MessageBoxResult.Yes
+ Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
+ Case MessageBoxResult.No
+ ' Non faccio nulla
+ Case MessageBoxResult.Cancel
+ Return
+ End Select
+ End If
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
' visualizzo la text per inserire il nome del progetto (cioè la directory da creare)
Dim SaveFileDialog As New EgtWPFLib5.EgtSaveFileDialog
@@ -143,21 +148,12 @@ Public Class ProjectManagerVM
CurrProject.Name = SaveFileDialog.FileName
' Ripulisco lista porte
CurrProject.AssemblyList.Clear()
-
- '' se una porta è già aperta
- 'Map.refDoorParametersVM.CurrPart = Nothing
-
- Map.refAssemblyPageVM.CurrAssembly = Nothing
- Map.refPartPageVM.CurrPart = Nothing
-
EgtNewFile()
EgtZoom(ZM.ALL)
- ' Notifico aggiornamento DoorList e Name per aggiornare la grafica
- CurrProject.NotifyPropertyChanged("Name")
- CurrProject.NotifyPropertyChanged("PartList")
Map.refMainWindowVM.ProjectNameMsg = Map.refMainWindowVM.SetTitle(m_CurrProject.Name)
Map.refMainWindowVM.ModifyTitle(True)
- 'm_rfMainWindowVM.ProjectNameMsg = m_CurrProject.Name
+ ' Creo nuova porta
+ Map.refAssemblyManagerVM.AddAssembly()
End Sub
#End Region ' NewCommand
@@ -180,7 +176,18 @@ Public Class ProjectManagerVM
''' Execute the Open. This method is invoked by the OpenCommand.
'''
Public Sub Open()
- If Not Map.refAssemblyManagerVM.SaveCurrentAssembly() Then Return
+ ' verifico se selezionato esiste e modificato
+ If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
+ Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
+ Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
+ Case MessageBoxResult.Yes
+ Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
+ Case MessageBoxResult.No
+ Map.refAssemblyManagerVM.Delete(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
+ Case MessageBoxResult.Cancel
+ Return
+ End Select
+ End If
Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
FolderBrowserDialog.SelectedPath = IniFile.m_MyProjectDir
' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
@@ -203,7 +210,7 @@ Public Class ProjectManagerVM
' lo aggiungo alla lista delle porte
Dim Local_Assembly As New AssemblyName
Local_Assembly.Name = DDFFileArray(DDFIndex)
- Local_Assembly.IsModify = False
+ Local_Assembly.IsModified = False
CurrProject.AssemblyList.Add(Local_Assembly)
End If
Next
@@ -212,8 +219,7 @@ Public Class ProjectManagerVM
CurrProject.NotifyPropertyChanged("AssemblyList")
' Se c'è almeno una porta la visualizzo
If CurrProject.AssemblyList.Count > 0 Then
- Map.refAssemblyManagerVM.OpenSelectedAssembly(CurrProject.AssemblyList(0))
- 'DoorManagerVM.SelectedDoor = CurrProject.DoorList(0)
+ Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(0))
Else
Map.refPartPageVM.CurrPart = Nothing
EgtNewFile()
@@ -266,61 +272,18 @@ Public Class ProjectManagerVM
''' Execute the Save. This method is invoked by the SaveCommand.
'''
Public Sub Save()
- Dim SetTitle As String
- Dim CurrAssembly As Assembly = Map.refAssemblyPageVM.CurrAssembly
- If Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.SelectedAssembly.Name) Then
- 'Map.refDoorManagerVM.DeleteNewPart = 1
- If Not IsNothing(CurrAssembly) Then
- SetTitle = Map.refAssemblyManagerVM.CurrProject.Name
- 'DdfFile.WriteDDFAssembly(CurrAssembly, Map.refDoorManagerVM.SelectedAssembly, True)
- Map.refAssemblyManagerVM.SelectedAssembly.IsModify = False
- Part.FirstReadingEdge = False
- Map.refAssemblyManagerVM.SelectedAssembly.NotifyPropertyChanged("IsModify")
- If Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door.IsNotAssembly Then
- DdfFile.WriteDDFPart(Map.refAssemblyPageVM.CurrAssembly.GetArrayPartDoor(0).Door, Map.refAssemblyManagerVM.SelectedAssembly.Name, True, False)
- 'DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
- ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_FILE)
- Else
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, Map.refAssemblyManagerVM.SelectedAssembly.Name, True)
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
- ExecDoors(Map.refSceneManagerVM.ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
- Map.refAssemblyManagerVM.CurrProject.NotifyPropertyChanged("AssemblyList")
- End If
-
- Else
- MessageBox.Show(EgtMsg(50128), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
- End If
-
- Else
+ ' Verifico esista elemento selezionato
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
+ ' Impossibile savare un file se non esiste una porta! Errore
MessageBox.Show(EgtMsg(50128), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
+ Return
End If
+ ' Eseguo salvataggio
+ Map.refAssemblyManagerVM.Save(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName)
End Sub
#End Region ' SaveCommand
- '#Region "SaveAsCommand"
-
- ' '''
- ' ''' Returns a command that do SaveAs.
- ' '''
- ' Public ReadOnly Property SaveAsCommand As ICommand
- ' Get
- ' If m_cmdSaveAs Is Nothing Then
- ' m_cmdSaveAs = New RelayCommand(AddressOf SaveAs)
- ' End If
- ' Return m_cmdSaveAs
- ' End Get
- ' End Property
-
- ' '''
- ' ''' Execute the SaveAs. This method is invoked by the SaveAsCommand.
- ' '''
- ' Public Sub SaveAs(ByVal param As Object)
- ' Application.Msn.NotifyColleagues(Application.SAVEASPROJECT)
- ' End Sub
-
- '#End Region ' SaveAsCommand
-
#Region "OptionsCommand"
'''
@@ -377,7 +340,7 @@ Public Class ProjectManagerVM
' lo aggiungo alla lista delle porte
Dim Local_Assembly As New AssemblyName
Local_Assembly.Name = DDFFileArray(DDFIndex)
- Local_Assembly.IsModify = False
+ Local_Assembly.IsModified = False
CurrProject.AssemblyList.Add(Local_Assembly)
End If
Next
@@ -388,8 +351,7 @@ Public Class ProjectManagerVM
Map.refMainWindowVM.ModifyTitle(False)
' Se c'è almeno una porta la visualizzo
If CurrProject.AssemblyList.Count > 0 Then
- 'Map.refAssemblyManagerVM.SelectedAssembly = CurrProject.AssemblyList(0)
- Map.refAssemblyManagerVM.OpenSelectedAssembly(CurrProject.AssemblyList(0))
+ Map.refAssemblyManagerVM.Open(CurrProject.AssemblyList(0))
End If
End If
End Sub
@@ -416,7 +378,7 @@ Public Class ProjectManagerVM
Public Sub SendFeedback()
' Recupero indirizzo a cui spedire la mail
Dim sSupportAddress As String = String.Empty
- GetPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
+ GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
' se vuoto do messaggio di errore ed esco
If String.IsNullOrWhiteSpace(sSupportAddress) Then
MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
diff --git a/SceneManager/Refresh/RefreshPanelV.xaml b/SceneManager/Refresh/RefreshPanelV.xaml
deleted file mode 100644
index b836a3d..0000000
--- a/SceneManager/Refresh/RefreshPanelV.xaml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SceneManager/Refresh/RefreshPanelVM.vb b/SceneManager/Refresh/RefreshPanelVM.vb
deleted file mode 100644
index 92e8a01..0000000
--- a/SceneManager/Refresh/RefreshPanelVM.vb
+++ /dev/null
@@ -1,214 +0,0 @@
-Imports System.ComponentModel
-Imports EgtUILib
-
-
-Public Class RefreshPanelVM
- Implements INotifyPropertyChanged
-
- Private m_MsgError As String
- Public Property MsgError As String
- Get
- Return m_MsgError
- End Get
- Set(value As String)
- m_MsgError = value
- NotifyPropertyChanged("MsgError")
- End Set
- End Property
-
- Private m_ErrorVisibility As Visibility = Visibility.Collapsed
- Public Property ErrorVisibility As Visibility
- Get
- Return m_ErrorVisibility
- End Get
- Set(value As Visibility)
- m_ErrorVisibility = value
- NotifyPropertyChanged("ErrorVisibility")
- End Set
- End Property
-
- Private m_ButtonVisibility As Visibility = Visibility.Collapsed
- Public Property ButtonVisibility As Visibility
- Get
- Return m_ButtonVisibility
- End Get
- Set(value As Visibility)
- m_ButtonVisibility = value
- NotifyPropertyChanged("ButtonVisibility")
- End Set
- End Property
-
- Private m_AssemblyIsChecked As Boolean = True
- Public Property AssemblyIsChecked As Boolean
- Get
- Return m_AssemblyIsChecked
- End Get
- Set(value As Boolean)
- If SceneManagerVM.nComposeAssembly <> 1 Then
- m_AssemblyIsChecked = True
- m_ExplodedIsChecked = False
- m_DisposedIsChecked = False
- NotifyPropertyChanged("ExplodedIsChecked")
- NotifyPropertyChanged("DisposedIsChecked")
- End If
- End Set
- End Property
-
- Private m_ExplodedIsChecked As Boolean = False
- Public Property ExplodedIsChecked As Boolean
- Get
- Return m_ExplodedIsChecked
- End Get
- Set(value As Boolean)
- If SceneManagerVM.nComposeAssembly <> 2 Then
- m_ExplodedIsChecked = True
- m_AssemblyIsChecked = False
- m_DisposedIsChecked = False
- NotifyPropertyChanged("AssemblyIsChecked")
- NotifyPropertyChanged("DisposedIsChecked")
- End If
- End Set
- End Property
-
- Private m_DisposedIsChecked As Boolean = False
- Public Property DisposedIsChecked As Boolean
- Get
- Return m_DisposedIsChecked
- End Get
- Set(value As Boolean)
- If SceneManagerVM.nComposeAssembly <> 0 Then
- m_DisposedIsChecked = True
- m_AssemblyIsChecked = False
- m_ExplodedIsChecked = False
- NotifyPropertyChanged("AssemblyIsChecked")
- NotifyPropertyChanged("ExplodedIsChecked")
- End If
- End Set
- End Property
-
-#Region "Messages"
- Public ReadOnly Property RefreshMsg As String
- Get
- Return EgtMsg(50301)
- End Get
- End Property
-
- Public ReadOnly Property AssemblyMsg As String
- Get
- Return "Assembly"
- End Get
- End Property
-
- Public ReadOnly Property ExplodedMsg As String
- Get
- Return "Exploded"
- End Get
- End Property
-
- Public ReadOnly Property DispositionMsg As String
- Get
- Return "Disposed"
- End Get
- End Property
-
-#End Region
-
-#Region "ToolTip"
- Public ReadOnly Property RefreshToolTip As String
- Get
- Return EgtMsg(50301)
- End Get
- End Property
-
-#End Region
- Private m_CmdRefreshBtn As ICommand
- Private m_CmdAssemblyBtn As ICommand
- Private m_CmdExplodedBtn As ICommand
- Private m_CmdDisposedBtn As ICommand
- Private m_CmdShowErrorBtn As ICommand
-
- Sub New()
- Map.SetRefRefreshPanelVM(Me)
- ButtonVisibility = If(OptionModule.m_ConfigurationSoftware = ConfigType.Door, Visibility.Collapsed, Visibility.Visible)
- End Sub
-
-#Region "COMMAND"
-
-#Region "RefreshBtnCommand"
-
- '''
- ''' Returns a command that do Exec.
- '''
- Public ReadOnly Property RefreshBtnCommand As ICommand
- Get
- If m_CmdRefreshBtn Is Nothing Then
- ' Richiamo il comando che già esiste
- m_CmdRefreshBtn = New Command(AddressOf Map.refSceneManagerVM.RefreshBtn)
- End If
- Return m_CmdRefreshBtn
- End Get
- End Property
-
-
-#End Region ' RefreshBtnCommand
-
-#Region "AssemblyBtnCommand"
-
- '''
- ''' Returns a command that do Exec.
- '''
- Public ReadOnly Property AssemblyBtnCommand As ICommand
- Get
- If m_CmdAssemblyBtn Is Nothing Then
- ' Richiamo il comando che già esiste
- m_CmdAssemblyBtn = New Command(AddressOf Map.refSceneManagerVM.AssemblyBtn)
- End If
- Return m_CmdAssemblyBtn
- End Get
- End Property
-
- Public ReadOnly Property ExplodedBtnCommand As ICommand
- Get
- If m_CmdExplodedBtn Is Nothing Then
- ' Richiamo il comando che già esiste
- m_CmdExplodedBtn = New Command(AddressOf Map.refSceneManagerVM.ExlpodedBtn)
- End If
- Return m_CmdExplodedBtn
- End Get
- End Property
-
- Public ReadOnly Property DisposedBtnCommand As ICommand
- Get
- If m_CmdDisposedBtn Is Nothing Then
- ' Richiamo il comando che già esiste
- m_CmdDisposedBtn = New Command(AddressOf Map.refSceneManagerVM.DisposedBtn)
- End If
- Return m_CmdDisposedBtn
- End Get
- End Property
-
-#End Region ' AssemblyBtnCommand
-
- Friend m_MsgGraphic As String
- Public ReadOnly Property ShowErrorBtnCommand As ICommand
- Get
- If m_CmdShowErrorBtn Is Nothing Then
- m_CmdShowErrorBtn = New Command(AddressOf ShowErrorBtn)
- End If
- Return m_CmdShowErrorBtn
- End Get
- End Property
-
- Public Sub ShowErrorBtn()
- MessageBox.Show(m_MsgGraphic, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
- End Sub
-
-#End Region ' Command
-
- Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
-
- Public Sub NotifyPropertyChanged(propName As String)
- RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
- End Sub
-
-End Class
diff --git a/SceneManager/RefreshPanel/RefreshPanelV.xaml b/SceneManager/RefreshPanel/RefreshPanelV.xaml
new file mode 100644
index 0000000..7245245
--- /dev/null
+++ b/SceneManager/RefreshPanel/RefreshPanelV.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SceneManager/Refresh/RefreshPanelV.xaml.vb b/SceneManager/RefreshPanel/RefreshPanelV.xaml.vb
similarity index 100%
rename from SceneManager/Refresh/RefreshPanelV.xaml.vb
rename to SceneManager/RefreshPanel/RefreshPanelV.xaml.vb
diff --git a/SceneManager/RefreshPanel/RefreshPanelVM.vb b/SceneManager/RefreshPanel/RefreshPanelVM.vb
new file mode 100644
index 0000000..2591bd6
--- /dev/null
+++ b/SceneManager/RefreshPanel/RefreshPanelVM.vb
@@ -0,0 +1,156 @@
+Imports System.ComponentModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class RefreshPanelVM
+ Inherits VMBase
+
+ Private m_ErrorVisibility As Visibility = Visibility.Collapsed
+ Public Property ErrorVisibility As Visibility
+ Get
+ Return m_ErrorVisibility
+ End Get
+ Set(value As Visibility)
+ m_ErrorVisibility = value
+ NotifyPropertyChanged("ErrorVisibility")
+ End Set
+ End Property
+
+ Private m_ButtonVisibility As Visibility = Visibility.Collapsed
+ Public Property ButtonVisibility As Visibility
+ Get
+ Return m_ButtonVisibility
+ End Get
+ Set(value As Visibility)
+ m_ButtonVisibility = value
+ NotifyPropertyChanged("ButtonVisibility")
+ End Set
+ End Property
+
+ Private m_AssemblyIsChecked As Boolean = True
+ Public Property AssemblyIsChecked As Boolean
+ Get
+ Return m_AssemblyIsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_AssemblyIsChecked Then
+ m_AssemblyIsChecked = value
+ If value Then
+ Map.refSceneManagerVM.AssemblyBtn()
+ End If
+ End If
+ End Set
+ End Property
+
+ Private m_ExplodedIsChecked As Boolean = False
+ Public Property ExplodedIsChecked As Boolean
+ Get
+ Return m_ExplodedIsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_ExplodedIsChecked Then
+ m_ExplodedIsChecked = value
+ If value Then
+ Map.refSceneManagerVM.ExlpodedBtn()
+ End If
+ End If
+ End Set
+ End Property
+
+ Private m_DisposedIsChecked As Boolean = False
+ Public Property DisposedIsChecked As Boolean
+ Get
+ Return m_DisposedIsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_DisposedIsChecked Then
+ m_DisposedIsChecked = value
+ If value Then
+ Map.refSceneManagerVM.DisposedBtn()
+ End If
+ End If
+ End Set
+ End Property
+
+#Region "Messages"
+
+ Public ReadOnly Property RefreshMsg As String
+ Get
+ Return EgtMsg(50301)
+ End Get
+ End Property
+
+ Public ReadOnly Property AssemblyMsg As String
+ Get
+ Return "Assembly"
+ End Get
+ End Property
+
+ Public ReadOnly Property ExplodedMsg As String
+ Get
+ Return "Exploded"
+ End Get
+ End Property
+
+ Public ReadOnly Property DispositionMsg As String
+ Get
+ Return "Disposed"
+ End Get
+ End Property
+
+#End Region
+
+#Region "ToolTip"
+
+ Public ReadOnly Property RefreshToolTip As String
+ Get
+ Return EgtMsg(50301)
+ End Get
+ End Property
+
+#End Region
+
+ Private m_CmdRefresh As ICommand
+ Private m_CmdShowError As ICommand
+
+ Sub New()
+ Map.SetRefRefreshPanelVM(Me)
+ ButtonVisibility = If(OptionModule.m_ConfigurationSoftware = ConfigType.Door, Visibility.Collapsed, Visibility.Visible)
+ End Sub
+
+#Region "COMMAND"
+
+#Region "Refresh"
+
+ Public ReadOnly Property Refresh_Command As ICommand
+ Get
+ If m_CmdRefresh Is Nothing Then
+ ' Richiamo il comando che già esiste
+ m_CmdRefresh = New Command(AddressOf Map.refSceneManagerVM.RefreshBtn)
+ End If
+ Return m_CmdRefresh
+ End Get
+ End Property
+
+#End Region ' Refresh
+
+#Region "ShowError"
+
+ Public ReadOnly Property ShowError_Command As ICommand
+ Get
+ If m_CmdShowError Is Nothing Then
+ m_CmdShowError = New Command(AddressOf ShowErrorBtn)
+ End If
+ Return m_CmdShowError
+ End Get
+ End Property
+
+ Public Sub ShowErrorBtn()
+ MessageBox.Show(Map.refSceneManagerVM.GraphicError, Map.refSceneManagerVM.GraphicErrorType, MessageBoxButton.OK, MessageBoxImage.Error)
+ End Sub
+
+#End Region ' ShowError
+
+#End Region ' COMMAND
+
+End Class
diff --git a/SceneManager/SceneManagerVM.vb b/SceneManager/SceneManagerVM.vb
index c129dfc..f56cd83 100644
--- a/SceneManager/SceneManagerVM.vb
+++ b/SceneManager/SceneManagerVM.vb
@@ -2,7 +2,7 @@
Imports System.IO
Imports System.Windows.Forms.Integration
Imports EgtUILib
-'Imports System.Text.RegularExpressions
+Imports EgtWPFLib5
Public Class SceneManagerVM
Implements INotifyPropertyChanged
@@ -74,6 +74,20 @@ Public Class SceneManagerVM
End Get
End Property
+ Private m_GraphicError As String = String.Empty
+ Friend ReadOnly Property GraphicError As String
+ Get
+ Return m_GraphicError
+ End Get
+ End Property
+
+ Private m_GraphicErrorType As String = String.Empty
+ Friend ReadOnly Property GraphicErrorType As String
+ Get
+ Return m_GraphicErrorType
+ End Get
+ End Property
+
'PROJECT PAGE'S SCENE FIELDS AND PROPERTIES
' Reference to the ProjectScene
Private WithEvents m_ProjectScene As New Scene
@@ -127,7 +141,7 @@ Public Class SceneManagerVM
Dim sDestFile As String = IniFile.m_sConfigDir & "\" & LicDlg.SafeFileName
My.Computer.FileSystem.CopyFile(LicDlg.FileName, sDestFile, True)
' Imposto il nuovo file di licenza nell'Ini
- WritePrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
+ WriteMainPrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
End If
End If
End If
@@ -152,44 +166,44 @@ Public Class SceneManagerVM
Private Sub PreInitializeScene()
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
- GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_ProjectScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
- GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
- GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
- GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
+ GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
m_ProjectScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
- GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
+ GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
m_ProjectScene.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
- GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
+ GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
m_ProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
- GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
+ GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
m_ProjectScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
- Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
- Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
- Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
- Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
+ Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
+ Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
+ Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
+ Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
m_ProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
End Sub
Private Sub PostInitializeScene()
' Impostazioni Controller
m_Controller.SetScene(m_ProjectScene)
- Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
- Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
+ Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
+ Dim nShowCurveDir As Integer = GetMainPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
End Sub
'questo metodo restituisce l'errore letto nel file CurrDoor.txt
@@ -214,20 +228,20 @@ Public Class SceneManagerVM
While String.IsNullOrEmpty(FileContent(IndexLine)) AndAlso IndexLine < FileContent.Count
IndexLine += 1
End While
- DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).m_MsgGraphic = FileContent(IndexLine)
+ m_GraphicError = FileContent(IndexLine)
' se compare un errore disattivo il righello
DirectCast(Me.InstrumentPanel.DataContext, InstrumentPanelVM).GetDistIsChecked = False
' rendo visibile il bottone dell'errore
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ErrorVisibility = Visibility.Visible
- DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).MsgError = EgtMsg(50101) & nMsgErr
+ m_GraphicErrorType = EgtMsg(50101) & nMsgErr
' altrimenti un avvertimento
ElseIf nMsgErr < 0 Then
While String.IsNullOrEmpty(FileContent(IndexLine)) AndAlso IndexLine < FileContent.Count
IndexLine += 1
End While
- DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).m_MsgGraphic = FileContent(IndexLine)
+ m_GraphicError = FileContent(IndexLine)
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ErrorVisibility = Visibility.Visible
- DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).MsgError = EgtMsg(50144) & nMsgErr
+ m_GraphicErrorType = EgtMsg(50144) & nMsgErr
Else
DirectCast(Me.RefreshPanel.DataContext, RefreshPanelVM).ErrorVisibility = Visibility.Collapsed
End If
@@ -256,18 +270,21 @@ Public Class SceneManagerVM
'''
Friend Shared nComposeAssembly As Integer = 1
Public Sub RefreshBtn()
- Dim rfDoorParametersVM As PartPageVM = Map.refPartPageVM
- Dim CurrDoorPath As String = IniFile.m_sTempDir & "\" & TEMP_FILE
+ ' Verifico esista elemento selezionato
+ If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then Return
+ ' definisco e rimuovo file temporaneo di assemblato
+ Dim sTempFile As String = IniFile.m_sTempDir & "\" & TEMP_FILE
+ Try
+ File.Delete(sTempFile)
+ Catch ex As Exception
+ End Try
+ ' eseguo
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Then
- DdfFile.WriteDDFPart(Map.refPartPageVM.CurrPart, CurrDoorPath, True, False)
- ' Viene scritto per usi successivi, non usato in questa esecuzione
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
- ExecDoors(m_ProjectScene, CurrDoorPath)
- ComposeAssembly(nComposeAssembly)
+ DdfFile.WriteDDFPart(Map.refPartPageVM.CurrPart, sTempFile, True, False)
+ ExecDoors(m_ProjectScene, sTempFile)
Else
- DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY, True)
- ExecDoors(m_ProjectScene, IniFile.m_sTempDir & "\" & TEMP_ASSEMBLY)
- ComposeAssembly(nComposeAssembly)
+ DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True)
+ ExecDoors(m_ProjectScene, sTempFile)
End If
ShowGraphicError()
End Sub