- aggiunto flag per uso sezione strand semplificata

This commit is contained in:
Emmanuele Sassi
2024-05-10 11:55:00 +02:00
parent a0d7687214
commit ca32de50f0
4 changed files with 49 additions and 21 deletions
+3
View File
@@ -118,6 +118,9 @@ Public Module ConstIni
Public Const K_VIEWSLIDER As String = "ViewSlider"
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
Public Const S_SOLIDS As String = "Solids"
Public Const K_SIMPLIFIEDSECTION As String = "SimplifiedSection"
Public Const S_COLORS As String = "Colors"
Public Const K_CLR_PRINTPART As String = "PrintPart"
Public Const K_CLR_RIBS As String = "Ribs"
+4
View File
@@ -15,6 +15,8 @@ Friend Module OptionModule
Friend m_bThickLine As Boolean
' Flag per visualizzazione smussata delle superfici
Friend m_bSmoothTriMesh As Boolean
' Flag per visualizzazione semplificate sezione strand
Friend m_bUseSimplifiedSection As Boolean
' Colore di default in disegno
Friend m_DefMaterialColor As Color3d
@@ -107,6 +109,8 @@ Friend Module OptionModule
m_bThickLine = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
' Inizializzo flag visualizzazione smussata delle superfici
m_bSmoothTriMesh = GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
' Inizializzo flag visualizzazione sezione strand semplificata
m_bUseSimplifiedSection = GetMainPrivateProfileInt(S_SOLIDS, K_SIMPLIFIEDSECTION, 0) <> 0
' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0)
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+5
View File
@@ -61,6 +61,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
@@ -70,6 +71,10 @@
Grid.Row="1" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SmoothTriMesh}"
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseSimplifiedSectionMsg}" VerticalAlignment="Center"
Grid.Row="2" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding UseSimplifiedSection}"
Grid.Column="1" Grid.Row="2" Margin="22,5,0,5" VerticalAlignment="Center"/>
</Grid>
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
+37 -21
View File
@@ -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()