Salvataggio Info progetto nei MachGroup
This commit is contained in:
@@ -719,6 +719,8 @@ Public Class MySceneHostVM
|
||||
End Sub
|
||||
|
||||
Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
|
||||
' Salvo le info del progetto
|
||||
TopCommandBarVM.SetInfoProj(sFile)
|
||||
' Recupero tutti i file di texture associabili ai gruppi di lavoro del progetto
|
||||
Dim sDirToSearch As String = Path.GetDirectoryName(sFile)
|
||||
Dim sFileToSearch As String = Path.GetFileNameWithoutExtension(sFile) & "." & PHOTO_NAME & "*"
|
||||
|
||||
@@ -74,12 +74,12 @@ Public Class TopCommandBarVM
|
||||
End Property
|
||||
Public ReadOnly Property ExportToolTip As String
|
||||
Get
|
||||
Return EgtMsg( 91505) 'Esporta in macchina
|
||||
Return EgtMsg(91505) 'Esporta in macchina
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DxfOutToolTip As String
|
||||
Get
|
||||
Return EgtMsg( 91506) 'Esporta DXF
|
||||
Return EgtMsg(91506) 'Esporta DXF
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property OptionsToolTip As String
|
||||
@@ -226,8 +226,20 @@ Public Class TopCommandBarVM
|
||||
''' Execute the SaveAs. This method is invoked by the SaveAsCommand.
|
||||
''' </summary>
|
||||
Public Sub SaveAs(ByVal param As Object)
|
||||
'Dim SaveFileDialog As New System.Windows.Forms.SaveFileDialog()
|
||||
'SaveFileDialog.Filter = "(*.nge) |*.nge"
|
||||
'SaveFileDialog.FilterIndex = 2
|
||||
'' avvio la ricerca nell'ultimo direttorio aperto
|
||||
'Dim sFilePath As String = String.Empty
|
||||
'EgtGetCurrFilePath(sFilePath)
|
||||
'SaveFileDialog.InitialDirectory = Path.GetExtension(sFilePath)
|
||||
'SaveFileDialog.FileName = Path.GetFileName(sFilePath)
|
||||
'' apro la finestra di dialogo
|
||||
'Dim bChangeProject As Boolean = True
|
||||
'If SaveFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then Return
|
||||
'Dim sNewFilePath As String = SaveFileDialog.FileName
|
||||
' non posso avere la stessa lastra in due progetti -> gestita da DataBase
|
||||
OmagOFFICEMap.refSceneHostVM.SaveAsProject()
|
||||
OmagOFFICEMap.refSceneHostVM.SaveAsProject_1()
|
||||
End Sub
|
||||
|
||||
#End Region ' SaveAsCommand
|
||||
@@ -238,12 +250,12 @@ Public Class TopCommandBarVM
|
||||
''' Returns a command that do Export.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ExportCommand As ICommand
|
||||
Get
|
||||
If m_cmdExport Is Nothing Then
|
||||
m_cmdExport = New Command(AddressOf Export)
|
||||
End If
|
||||
Return m_cmdExport
|
||||
End Get
|
||||
Get
|
||||
If m_cmdExport Is Nothing Then
|
||||
m_cmdExport = New Command(AddressOf Export)
|
||||
End If
|
||||
Return m_cmdExport
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
@@ -436,4 +448,42 @@ Public Class TopCommandBarVM
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Public Shared Sub SetInfoProj(Optional sFilePath As String = "")
|
||||
EgtOutLog(" *** SAVE PROJECT ***")
|
||||
' Recupero l'ID della macchinata corrente
|
||||
Dim CurrGrpId As Integer = EgtGetCurrMachGroup()
|
||||
' Path completa del progetto corrente
|
||||
If String.IsNullOrEmpty(sFilePath) Then EgtGetCurrFilePath(sFilePath)
|
||||
Dim nPartInRawsProj As Integer = 0
|
||||
Dim nGrpId = EgtGetFirstMachGroup()
|
||||
|
||||
While nGrpId <> GDB_ID.NULL
|
||||
' Imposto la macchinata corrente
|
||||
EgtSetCurrMachGroup(nGrpId)
|
||||
' recupero il primo grezzo della macchinata corrente
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
nPartInRawsProj += EgtGetPartInRawPartCount(nRawId)
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
nGrpId = EgtGetNextMachGroup(nGrpId)
|
||||
End While
|
||||
|
||||
nGrpId = EgtGetFirstMachGroup()
|
||||
While nGrpId <> GDB_ID.NULL
|
||||
' percorso progetto
|
||||
EgtSetInfo(nGrpId, "ProjPath", sFilePath)
|
||||
' Anno/Mese/Giorno/Ora/min di salvataggio
|
||||
EgtSetInfo(nGrpId, "Released", DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))
|
||||
' numero di pezzi presenti nel progetto
|
||||
EgtSetInfo(nGrpId, "NbrProjParts", nPartInRawsProj.ToString)
|
||||
nGrpId = EgtGetNextMachGroup(nGrpId)
|
||||
End While
|
||||
EgtOutLog(" ProjPath:" & sFilePath)
|
||||
EgtOutLog(" Released:" & DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))
|
||||
EgtOutLog(" NbrProjParts:" & nPartInRawsProj.ToString)
|
||||
' Reimposto la macchina corrente
|
||||
EgtSetCurrMachGroup(CurrGrpId)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user