EgtDOORCreator :

- migliorie nella gestione cambio configurazione per ddf con riavvio.
This commit is contained in:
Dario Sassi
2018-08-09 11:31:50 +00:00
parent 7799f02953
commit aa258f639b
6 changed files with 74 additions and 112 deletions
+45 -89
View File
@@ -10,7 +10,8 @@ Friend Module OptionModule
Friend m_SelectedLanguage As Language
Friend m_OptionLauncherList As New List(Of String)
Friend m_SelectedOptionLauncher As String
Friend m_SelectedOptionLauncher As Integer = 0
Friend m_bLauncherOpenOnce As Boolean = False
Friend m_sLastProject As String = String.Empty
' Parametri che contengono lista delle unità di misura disponibili e quella selezionata
@@ -26,11 +27,12 @@ Friend Module OptionModule
Friend m_PropertList As New ObservableCollection(Of PropertyItem)
Friend m_PropertListJamb As New ObservableCollection(Of PropertyItem)
Friend Enum LauncherWindow As Integer
Friend Enum LauncherOpt As Integer
Open_window = 0
Open_last_project = 1
Empty = 2
End Enum
Friend Const LoOpenOnce As Integer = 10
Friend Enum ConfigType As Integer
Door = 0
@@ -150,8 +152,8 @@ Friend Module OptionModule
' inizializzazione lettura variabili ad inizio programma
Friend Sub InitOptionModule()
' la lettura dei file dei messaggi è stata separata (vedere la calssse MainWindowModel)
'i valori della pagina dell'assemblato
' la lettura dei file dei messaggi è stata separata (vedere la classe MainWindowModel)
' i valori della pagina dell'assemblato
If (IniFile.m_nKeyOptions And KEY_OPT.JAMBS) <> 0 Then
Dim Config As Integer = GetMainPrivateProfileInt(S_GENERAL, K_RUNAS, 0)
m_ConfigurationSoftware = If(Config = 0, ConfigType.Door, ConfigType.Assembly)
@@ -160,109 +162,65 @@ Friend Module OptionModule
m_ConfigurationSoftware = ConfigType.Door
End If
Dim DisableOrder As Integer = GetMainPrivateProfileInt(S_GENERAL, "DisableOrder", 0)
m_DisableWindowOrder = If(DisableOrder = 0, False, True)
m_DisableWindowOrder = (GetMainPrivateProfileInt(S_GENERAL, "DisableOrder", 0) <> 0)
Dim DisableTemplate As Integer = GetMainPrivateProfileInt(S_GENERAL, "DisableTemplate", 0)
m_DisableTemplate = If(DisableTemplate = 0, False, True)
m_DisableTemplate = (GetMainPrivateProfileInt(S_GENERAL, "DisableTemplate", 0) <> 0)
' imposto unità di misura per interfaccia utente
m_bIsMmUnit = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
EgtSetUiUnits(m_bIsMmUnit)
If m_bIsMmUnit Then
m_SelectedMeasureUnit = m_MeasureUnitList(0)
Else
m_SelectedMeasureUnit = m_MeasureUnitList(1)
End If
m_SelectedMeasureUnit = m_MeasureUnitList(If(m_bIsMmUnit, 0, 1))
' imposto tipo di avvio
Dim nOptionLauncher As Integer = GetMainPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0)
Dim nLauncher As Integer = GetMainPrivateProfileInt(S_LAUNCHERWINDOW, K_LAUNCHER, 0)
m_SelectedOptionLauncher = (nLauncher Mod LoOpenOnce)
If nLauncher >= LoOpenOnce Then
m_bLauncherOpenOnce = True
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, m_SelectedOptionLauncher.ToString())
End If
' leggo il direttorio di salvataggio dei progetti
Dim sMyProjectDir As String = String.Empty
If GetMainPrivateProfileString(S_DOORS, K_MYPROJECTDIR, "", sMyProjectDir) <> 0 Then
' se non esiste il direttorio
If Not Directory.Exists(sMyProjectDir) Then
' mantengo l'accesso a quello di default
EgtOutLog("Warning : " & sMyProjectDir & " does not exist")
' controllo che il direttorio che era stato passato di default esista
If Not Directory.Exists(IniFile.m_MyProjectDir) Then
' creo il direttorio
Directory.CreateDirectory(IniFile.m_MyProjectDir)
End If
Else
IniFile.m_MyProjectDir = sMyProjectDir
End If
If GetMainPrivateProfileString(S_DOORS, K_MYPROJECTDIR, "", sMyProjectDir) > 0 AndAlso Directory.Exists(sMyProjectDir) Then
IniFile.m_MyProjectDir = sMyProjectDir
Else
' mantengo l'accesso a quello di default
EgtOutLog("Warning : " & sMyProjectDir & " does not exist")
' se il direttorio di default non esiste, lo creo
If Not Directory.Exists(IniFile.m_MyProjectDir) Then Directory.CreateDirectory(IniFile.m_MyProjectDir)
End If
Dim sTemplateDir As String = String.Empty
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
EgtOutLog(String.Format(EgtMsg(50180), sTemplateDir))
' controllo che il direttorio che era stato passato di default esista
If Not Directory.Exists(IniFile.m_TemplateDir) Then
' creo il direttorio
Directory.CreateDirectory(IniFile.m_TemplateDir)
End If
Else
IniFile.m_TemplateDir = sTemplateDir
End If
If GetMainPrivateProfileString(S_DOORS, K_TEMPLATEDIR, "", sTemplateDir) > 0 AndAlso Directory.Exists(sTemplateDir) Then
IniFile.m_TemplateDir = sTemplateDir
Else
' mantego l'accesso a quello di default
EgtOutLog(String.Format(EgtMsg(50180), sTemplateDir))
' se il direttorio di default non esiste, lo creo
If Not Directory.Exists(IniFile.m_TemplateDir) Then Directory.CreateDirectory(IniFile.m_TemplateDir)
End If
Dim sMachinDir As String = String.Empty
If GetMainPrivateProfileString(S_DOORS, K_MACHINDIR, "", sMachinDir) <> 0 Then
If Not Directory.Exists(sMachinDir) Then
' mantengo l'accesso a quello di default
EgtOutLog(String.Format(EgtMsg(50180), sMachinDir))
' controllo che il direttorio che era stato passato di default esista
Else
IniFile.m_MachinProject = sMachinDir
End If
If GetMainPrivateProfileString(S_DOORS, K_MACHINDIR, "", sMachinDir) > 0 AndAlso Directory.Exists(sMachinDir) Then
IniFile.m_MachinProject = sMachinDir
Else
' mantengo l'accesso a quello di default
EgtOutLog(String.Format(EgtMsg(50180), sMachinDir))
End If
Dim nSmartHelp As Integer = 1
nSmartHelp = GetMainPrivateProfileInt(S_GENERAL, K_SMARTHELP, 1)
If nSmartHelp = 0 Then
m_SmartHelp = True
Else
m_SmartHelp = False
End If
m_SmartHelp = (GetMainPrivateProfileInt(S_GENERAL, K_SMARTHELP, 1) = 0)
Dim nDisableHM As Integer = 1
nDisableHM = GetMainPrivateProfileInt(S_GENERAL, K_DISABLEHM, 1)
If nDisableHM = 0 Then
m_DisableHM = True
Else
m_DisableHM = False
End If
m_DisableHM = (GetMainPrivateProfileInt(S_GENERAL, K_DISABLEHM, 1) = 0)
Dim nDisableDeleteCommandHM As Integer = 1
nDisableDeleteCommandHM = GetMainPrivateProfileInt(S_GENERAL, K_DISABLEDELETECOMMANDHM, 1)
If nDisableDeleteCommandHM = 0 Then
m_DisableDeleteCommandHM = True
Else
m_DisableDeleteCommandHM = False
End If
m_DisableDeleteCommandHM = (GetMainPrivateProfileInt(S_GENERAL, K_DISABLEDELETECOMMANDHM, 1) = 0)
Dim nDisableProperties As Integer = 1
nDisableProperties = GetMainPrivateProfileInt(S_GENERAL, "DisableProperties", 1)
If nDisableProperties = 0 Then
m_DisableProperties = Visibility.Visible
Else
m_DisableProperties = Visibility.Collapsed
End If
m_DisableProperties = If(GetMainPrivateProfileInt(S_GENERAL, K_DISABLEPROPERTIES, 1) = 0, Visibility.Visible, Visibility.Collapsed)
' leggo il tipo di Bevel selezionato
Dim BevelUp As Visibility
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELU_INI, BevelUp)
m_bBevelUp = BevelUp
Dim BevelDown As Visibility
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELD_INI, BevelDown)
m_bBevelDown = BevelDown
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELU_INI, m_bBevelUp)
DefaultGetPrivateProfilesBevel(S_EDGE, K_BEVELD_INI, m_bBevelDown)
'disposizione in macchina delle porte (variabile globale)
' disposizione in macchina delle porte (variabile globale)
Select Case GetMainPrivateProfileInt(S_GENERAL, K_DISPOSITION, 0)
Case 0
m_Disposition.Name = ConstGen.BEVEL_BYSWING
@@ -311,7 +269,6 @@ Friend Module OptionModule
Dim SwingTypeList As New List(Of String)
DefaultGetPrivateProfileList(S_SIZE_INI, K_SWING_LIST_INI, SwingTypeList)
LoadSwingTypeList(SwingTypeList)
'm_SwingTypeList = SwingTypeList
Dim Swing As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE_INI, K_SWING_INI, ConstGen.RIGHTHAND, Swing)
@@ -516,11 +473,10 @@ Friend Module OptionModule
DefaultGetPrivateProfileString(S_OVERMATERIALASSEMBLY, K_BOTTOMOVERMATERIAL_INI, "", BottomOverMaterialAss)
m_BottomOverMaterialAssembly = BottomOverMaterialAss
m_OptionLauncherList.Add(EgtMsg(50206))
m_OptionLauncherList.Add(EgtMsg(50207))
m_OptionLauncherList.Add(EgtMsg(50208))
' assegno il valore selezioato dalla lista
m_SelectedOptionLauncher = m_OptionLauncherList(nOptionLauncher)
' Lista messaggi per launcher
m_OptionLauncherList.Add(EgtMsg(50206)) 'Open Window
m_OptionLauncherList.Add(EgtMsg(50207)) 'Last Project
m_OptionLauncherList.Add(EgtMsg(50208)) 'Empty
End Sub