|
|
|
@@ -214,6 +214,16 @@ Public Class OptionWindowVM
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public Property UseSimplifiedSection As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return OptionModule.m_bUseSimplifiedSection
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
OptionModule.m_bUseSimplifiedSection = value
|
|
|
|
|
WriteMainPrivateProfileString(S_SOLIDS, K_SIMPLIFIEDSECTION, If(value, "1", "0"))
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
'Public Property SelectedTextFont As String
|
|
|
|
|
' Get
|
|
|
|
|
' Return m_FontList(m_FontList.IndexOf(OptionModule.m_sFontText))
|
|
|
|
@@ -563,17 +573,23 @@ Public Class OptionWindowVM
|
|
|
|
|
End Property
|
|
|
|
|
Public ReadOnly Property ThickLineMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return EgtMsg( 6536) ' Linee spesse
|
|
|
|
|
Return EgtMsg(6536) ' Linee spesse
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
Public ReadOnly Property SmoothTriMeshMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return EgtMsg( 6518) ' Superfici smussate
|
|
|
|
|
Return EgtMsg(6518) ' Superfici smussate
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
Public ReadOnly Property UseSimplifiedSectionMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return "Use simplified strand section"
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property UpdateLicenceMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return EgtMsg( 6553) ' Aggiorna licenza
|
|
|
|
|
Return EgtMsg(6553) ' Aggiorna licenza
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
@@ -953,31 +969,31 @@ Public Class OptionWindowVM
|
|
|
|
|
Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName)
|
|
|
|
|
' Preparo direttorio temporaneo
|
|
|
|
|
Dim sTempDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, "Temp")
|
|
|
|
|
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
End If
|
|
|
|
|
My.Computer.FileSystem.CreateDirectory( sTempDir)
|
|
|
|
|
My.Computer.FileSystem.CreateDirectory(sTempDir)
|
|
|
|
|
' Unzip nel direttorio temporaneo
|
|
|
|
|
Using zip As New Ionic.Zip.ZipFile(sMachZip)
|
|
|
|
|
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
|
|
|
|
|
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
|
|
|
|
|
End Using
|
|
|
|
|
' Se non è una macchina segnalo il problema ed esco
|
|
|
|
|
If Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".ini")) Or
|
|
|
|
|
Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".mlde")) Then
|
|
|
|
|
If Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".ini")) Or
|
|
|
|
|
Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then
|
|
|
|
|
' Il file {0} non contiene una macchina - Avviso
|
|
|
|
|
Dim sOut As String = String.Format(EgtMsg(6529), sMachZip)
|
|
|
|
|
MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
|
|
|
|
|
' Rimuovo il direttorio temporaneo ed esco
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
' Imposto data e ora correnti al file mlde della macchina
|
|
|
|
|
Try
|
|
|
|
|
File.SetLastWriteTime( Path.Combine( sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
|
|
|
|
|
File.SetLastWriteTime(Path.Combine(sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
End Try
|
|
|
|
|
' Verifico esistenza di una macchina con lo stesso nome
|
|
|
|
|
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists( sMachDir)
|
|
|
|
|
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists(sMachDir)
|
|
|
|
|
Dim bUpdate As Boolean = True
|
|
|
|
|
If bOldExists Then
|
|
|
|
|
Dim MachBox As New UpdateMachineV(Application.Current.MainWindow, New UpdateMachineVM(sMachName))
|
|
|
|
@@ -994,23 +1010,23 @@ Public Class OptionWindowVM
|
|
|
|
|
End Select
|
|
|
|
|
' Faccio una copia di backup della macchina corrente
|
|
|
|
|
Dim sBackupDir As String = sMachDir & ".old"
|
|
|
|
|
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
End If
|
|
|
|
|
Try
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory( sMachDir, sBackupDir, True)
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory(sMachDir, sBackupDir, True)
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
' Ripristino lo stato originale ed esco
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory( sBackupDir, sMachDir, True)
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory(sBackupDir, sMachDir, True)
|
|
|
|
|
' L'aggiornamento della macchina "{0}" non è riuscito.
|
|
|
|
|
Dim sKo As String = String.Format(EgtMsg(6535), sMachName)
|
|
|
|
|
EgtOutLog( sKo)
|
|
|
|
|
EgtOutLog(sKo)
|
|
|
|
|
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
|
|
|
|
|
Return
|
|
|
|
|
End Try
|
|
|
|
|
End If
|
|
|
|
|
' Installo la macchina
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory( Path.Combine( sTempDir, sMachName), sMachDir, True)
|
|
|
|
|
My.Computer.FileSystem.MoveDirectory(Path.Combine(sTempDir, sMachName), sMachDir, True)
|
|
|
|
|
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
|
|
|
|
|
If bOldExists And bUpdate Then
|
|
|
|
|
Dim sBackupDir As String = sMachDir & ".old"
|
|
|
|
@@ -1047,10 +1063,10 @@ Public Class OptionWindowVM
|
|
|
|
|
End If
|
|
|
|
|
'La macchina "{0}" è stata aggiornata con successo.
|
|
|
|
|
Dim sOk As String = String.Format(EgtMsg(6530), sMachName)
|
|
|
|
|
EgtOutLog( sOk)
|
|
|
|
|
EgtOutLog(sOk)
|
|
|
|
|
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
|
|
|
|
|
' Rimuovo il direttorio temporaneo
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
|
|
|
|
|
' Aggiorno la lista delle macchina
|
|
|
|
|
MyMachine.InsertMachine(sMachDir, Map.refMachinePanelVM.MachineList)
|
|
|
|
|
End Sub
|
|
|
|
@@ -1098,7 +1114,7 @@ Public Class OptionWindowVM
|
|
|
|
|
' aggiungo i file della Macchina
|
|
|
|
|
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName
|
|
|
|
|
If Directory.Exists(sMachineDir) Then
|
|
|
|
|
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
|
|
|
|
|
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
|
|
|
|
|
End If
|
|
|
|
|
' salvo lo zip
|
|
|
|
|
zip.Save()
|
|
|
|
|