EgtDOORCreator 1.8e2 :

- aggiunto il campo "Weight" al general del door,
- aggiunta di una variabile booleana alla funzione ReadDDF nella classe Door per permettere di stampare le funzioni scritte nelle textbox, attualmente no è in uso (settata True)
This commit is contained in:
Nicola Pievani
2017-05-09 16:04:50 +00:00
parent f43bf27dd9
commit efb250b4a4
16 changed files with 296 additions and 32 deletions
+1
View File
@@ -44,6 +44,7 @@ Module ConstCompo
Public Const K_HEIGHT As String = "height"
Public Const K_THICKNESS As String = "thickness"
Public Const K_SWING As String = "swing"
Public Const K_WEIGHT As String = "weight"
Public Const K_SECURE As String = "secure"
Public Const K_PROFILES As String = "profiles"
Public Const K_LOCKEDGE As String = "lockedge"
+2
View File
@@ -41,6 +41,8 @@ Module ConstIni
Public Const K_WIDTH_INI As String = "Width"
Public Const K_HEIGHT_INI As String = "Height"
Public Const K_THICKNESS_INI As String = "Thickness"
Public Const K_WEIGHT_INI As String = "Weight"
Public Const K_WEIGHTISCHECKED_INI As String = "WeightIsChecked"
Public Const K_SWING_LIST_INI As String = "SwingList"
Public Const K_SWING_INI As String = "Swing"
+27 -7
View File
@@ -14,7 +14,8 @@ Friend Module DdfFile
#Region "SCRITTURA DDF"
'genero le stringhe che dovranno essere scritte nel DDF
Friend Sub WriteDDF(Door As Door, sPath As String)
' !!! attenzione !!! tutte le volte che stampo sul file di CurrDoor.ddf la variabile booelana DEVE essere settata su True
Friend Sub WriteDDF(Door As Door, sPath As String, bIsDDf As Boolean)
' Door = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor
' pulisco lista prima di iniziare a scrivere
Dim DdfFileContent As New List(Of String)
@@ -64,11 +65,20 @@ Friend Module DdfFile
Return
End If
DdfFileContent.Add(ConstCompo.K_SPACE3 & ConstCompo.K_THICKNESS & ": " & DoubleToString(dVal, 5))
' aggiungo il peso della porta
If Door.IsCheckedWeight = Visibility.Visible Then
If Not StringToDouble(Door.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 & ": " & Door.Weight)
End If
' aggiungo una riga vuota per separare la lista successiva
DdfFileContent.Add("")
DdfFileContent.Add("" & ConstCompo.K_SWING & ": " & Door.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
@@ -104,7 +114,7 @@ Friend Module DdfFile
DdfFileContent.Add(ConstCompo.K_SPACE5 & ConstCompo.K_OVERMATERAL & ": " & DoubleToString(dVal, 5))
' Riordino e stampo le compo
SearchCompo(DdfFileContent, Door)
SearchCompo(DdfFileContent, Door, bIsDDf)
If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
Directory.CreateDirectory(Path.GetDirectoryName(sPath))
End If
@@ -112,7 +122,7 @@ Friend Module DdfFile
End Sub
' stampa le compo seguedo l'ordine della lista delle componenti del ddf
Public Sub SearchCompo(DdfFileContent As List(Of String), ByRef Door As Door)
Public Sub SearchCompo(DdfFileContent As List(Of String), ByRef Door As Door, bIsDDf As Boolean)
Dim NewCompoNameDDF = False
Dim WritingError As String = String.Empty
' cerco la prima componente da aggiungere alla lista delle componenti
@@ -128,7 +138,7 @@ Friend Module DdfFile
DdfFileContent.Add("")
End If
' Carico nella lista dei componenti la lista di stringhe da stampare
DdfFileContent.AddRange(GenerateCompolistDDF(Door.CompoList(Index2), WritingError, NewCompoNameDDF))
DdfFileContent.AddRange(GenerateCompolistDDF(Door.CompoList(Index2), WritingError, NewCompoNameDDF, bIsDDF))
End If
NewCompoNameDDF = False
Next
@@ -140,7 +150,7 @@ Friend Module DdfFile
End Sub
'Genero la lista di parametri di ogni compo che vedo a video
Public Function GenerateCompolistDDF(Compo As Compo, ByRef sErrorList As String, bNewCompoNameDDF As Boolean) As List(Of String)
Public Function GenerateCompolistDDF(Compo As Compo, ByRef sErrorList As String, bNewCompoNameDDF As Boolean, bIsDDF As Boolean) As List(Of String)
Dim CompoListDDF As New List(Of String)
' se il nome non esiste ancora nella lista lo aggiungo
If Not bNewCompoNameDDF Then
@@ -182,8 +192,13 @@ Friend Module DdfFile
If DirectCast(CurrCompoParam, TextBoxOnOffParam).ToolTipValue = EgtMsg(50143) Then
If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine
sErrorList &= String.Format(EgtMsg(50141), DirectCast(CurrCompoParam, TextBoxOnOffParam).Name, CurrCompoParam.DDFName)
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxOnOffParam).DDFName & ": ")
Else
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxOnOffParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxOnOffParam).ToolTipValue)
If bIsDDF Then
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxOnOffParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxOnOffParam).ToolTipValue)
Else
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxOnOffParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxOnOffParam).Value)
End If
End If
ElseIf Not String.IsNullOrWhiteSpace(DirectCast(CurrCompoParam, TextBoxOnOffParam).ToolTipValue) AndAlso Not DirectCast(CurrCompoParam, TextBoxOnOffParam).IsActive Then
' non restituire nessun tipo di errore
@@ -195,8 +210,13 @@ Friend Module DdfFile
If DirectCast(CurrCompoParam, TextBoxParam).ToolTipValue = EgtMsg(50143) Then
If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine
sErrorList &= String.Format(EgtMsg(50141), DirectCast(CurrCompoParam, TextBoxParam).Name, CurrCompoParam.DDFName)
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxParam).DDFName & ": ")
Else
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxParam).ToolTipValue)
If bIsDDF Then
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxParam).ToolTipValue)
Else
CompoListDDF.Add(K_SPACE5 & DirectCast(CurrCompoParam, TextBoxParam).DDFName & ": " & DirectCast(CurrCompoParam, TextBoxParam).Value)
End If
End If
Else
If Not String.IsNullOrEmpty(sErrorList) Then sErrorList &= Environment.NewLine
+8 -6
View File
@@ -38,7 +38,8 @@ Public Class DoorManagerViewModel
' prima di cambiare porta selezionata chiedo il salvataggio il quella precedente
' se esiste una porta corrente associata al nome allora scrivo il file ddf per il disegno
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf")
' è necessario che il file passato alla grafica non presenti espressioni numeriche
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
Select Case DeleteNewDoor
' se è una porta appena creata
@@ -55,7 +56,7 @@ Public Class DoorManagerViewModel
Else
' altrimenti chiedo di salvare il file di disegno
If MessageBox.Show(String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_SelectedDoor)), EgtMsg(50110), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.Yes Then
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor)
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor, True)
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).bSetChange = False
End If
End If
@@ -76,6 +77,7 @@ Public Class DoorManagerViewModel
SelDoor.Width = OptionModule.m_Width
SelDoor.Height = OptionModule.m_Height
SelDoor.Thickness = OptionModule.m_Thickness
SelDoor.Weight = OptionModule.m_Weight
SelDoor.Swing = OptionModule.m_Swing
SelDoor.LockEdgeType = OptionModule.m_LockEdgeType
@@ -94,9 +96,9 @@ Public Class DoorManagerViewModel
' assegno la porta creata alla Programma come porta corrente
DoorParametersViewModel.CurrDoor = SelDoor
' scrivo il ddf della nuova porta come file temp
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf")
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
' e stampo il nuovo ddf
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor)
DdfFile.WriteDDF(DoorParametersViewModel.CurrDoor, m_SelectedDoor, True)
' quindi da ora la nuova porta ha un suo DDF che possiamo trattare come tutti gli altri
' assegno il valore falso cosi da non ripetere questa operazione nel caso in cui si arrivi dalla funzione AddDoor
SelDoor.NewDoor = False
@@ -111,7 +113,7 @@ Public Class DoorManagerViewModel
DoorParametersViewModel.CurrDoor = SelDoor
' copio il file DDF come file DDF temporaneo
If Not IsNothing(DoorParametersViewModel.CurrDoor) Then
DdfFile.WriteDDF(SelDoor, IniFile.m_sTempDir & "\CurrDoor.ddf")
DdfFile.WriteDDF(SelDoor, IniFile.m_sTempDir & "\CurrDoor.ddf", True)
ExecDoors(DirectCast(m_rfMainWindowViewModel.SceneManager.DataContext, SceneManagerViewModel).ProjectScene, IniFile.m_sTempDir & "\CurrDoor.ddf")
' dal MainWindowViewModel accediamo alla ScenaManagerViewModel (primo DirectCast)
' dalla StatusBar accediamo alla proprietà pubblica UnitMeasure
@@ -302,7 +304,7 @@ Public Class DoorManagerViewModel
MessageBox.Show(String.Format(EgtMsg(50117), RemoveDoorName), EgtMsg(50118), MessageBoxButton.OK, MessageBoxImage.Information)
Else
' altrimenti salvo il file
DdfFile.WriteDDF(DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, m_SelectedDoor)
DdfFile.WriteDDF(DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, m_SelectedDoor, True)
End If
End If
End Sub
+1 -1
View File
@@ -1076,7 +1076,7 @@ Public Class TextBoxParam
If StringToDouble(Value, dValue) Then
Return DoubleToString(dValue, 4)
Else
Return "Invalid Expression"
Return EgtMsg(50143)
End If
End Get
+140 -9
View File
@@ -124,7 +124,7 @@ Public Class Door
#Region "Size"
Public m_Height As String
Private m_Height As String
Public Property Height As String
Get
Return m_Height
@@ -182,6 +182,49 @@ Public Class Door
End Set
End Property
Private m_Weight As String
Public Property Weight As String
Get
If String.IsNullOrEmpty(m_Weight) Then
m_Weight = OptionModule.m_Weight
m_IsModifyDoor = True
End If
Return m_Weight
End Get
Set(value As String)
Dim dVal As Double
If StringToDouble(value, dVal) Then
m_Weight = value
Else
MessageBox.Show("Invalid Value", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
m_IsModifyDoor = True
SetTitle()
End Set
End Property
Private Shared m_IsCheckedWeight As Visibility
Public Shared Property IsCheckedWeight As Visibility
Get
Return m_IsCheckedWeight
End Get
Set(value As Visibility)
m_IsCheckedWeight = value
End Set
End Property
Public Property VisibilityWeight As Visibility
Get
Return m_IsCheckedWeight
End Get
Set(value As Visibility)
m_IsCheckedWeight = value
m_IsModifyDoor = True
SetTitle()
NotifyPropertyChanged("VisibilityWeight")
End Set
End Property
Private m_Swing As String = Nothing
Public Property Swing As String
Get
@@ -296,9 +339,6 @@ Public Class Door
End Get
Set(value As Boolean)
m_TopMachining = value
'If SetChange <> 0 Then
' SetChange += 1
'End If
m_IsModifyDoor = True
End Set
End Property
@@ -401,9 +441,6 @@ Public Class Door
Else
MessageBox.Show("Invalid Value", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk)
End If
'If SetChange <> 0 Then
' SetChange += 1
'End If
m_IsModifyDoor = True
SetTitle()
End Set
@@ -679,6 +716,22 @@ Public Class Door
Else
Exit For
End If
' leggo il peso della porta
If LineIndex < ReadDoor.FileContent.Count - 1 Then
If ReadDoor.SearchKey(ReadDoor.FileContent(LineIndex), K_WEIGHT) Then
LineIndex = ReadDoor.GetWeight(LineIndex)
If LineIndex = -1 Then
InvalidValue += String.Format(EgtMsg(50102), K_WEIGHT + vbCrLf)
' assegno una porta vuota ed esco dal ciclo
ReadDoor = Nothing
Exit For
End If
End If
Else
Exit For
End If
' swing
If LineIndex < ReadDoor.FileContent.Count - 1 Then
If ReadDoor.SearchKey(ReadDoor.FileContent(LineIndex), K_SWING) Then
@@ -739,9 +792,23 @@ Public Class Door
MessageBox.Show(InvalidValue, EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
Else
If Not bSecure Then
DdfFile.WriteDDF(ReadDoor, sPathDDF)
DdfFile.WriteDDF(ReadDoor, sPathDDF, True)
End If
If String.IsNullOrEmpty(ReadDoor.m_Weight) Then
If m_IsCheckedWeight = Visibility.Visible Then
' se il valore è acceso ma non è presente nel ddf chiedo se spegnere
If MessageBox.Show("Caution: Weight is setted in OptionPage. Do you want to remove?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' decido di spegnere
OptionsViewModel.IsCheckedWeight = False
Else
' decido di accendere
OptionsViewModel.IsCheckedWeight = True
ReadDoor.m_Weight = OptionModule.m_Weight
ReadDoor.VisibilityWeight = Visibility.Visible
End If
End If
End If
End If
End Sub
' restituice la riga scommentata
@@ -797,6 +864,7 @@ Public Class Door
End Function
#Region "Carica il General della porta"
' Leggo l'unità di misura
Public Function GetMeasure(Index As Integer) As Integer
Dim Measure As String = SearchKeyValue(FileContent(Index), K_MEASURES)
@@ -956,6 +1024,70 @@ Public Class Door
Return Index
End Function
' carico il valore del peso
Public Function GetWeight(Index As Integer) As Integer
' se sono arrivato fino a qui significa che è stato scritto nel ddf
Dim Weight As String = SearchKeyValue(FileContent(Index), K_WEIGHT)
' se il valore restituito è nullo o vuoto
If String.IsNullOrWhiteSpace(Weight) Then
' se non c'è la parola chiave significa che il valore è spento
If Not SearchKey(FileContent(Index), K_WEIGHT) Then
' confronto con il dato che è stato salvato nell'option page, se il valore è acceso
If m_IsCheckedWeight = Visibility.Visible Then
' se il valore è acceso ma non è presente nel ddf chiedo se spegnere
If MessageBox.Show("Caution: Weight is setted in OptionPage. Do you want to remove?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' decido di spegnere
OptionsViewModel.IsCheckedWeight = False
Else
' decido di accendere
OptionsViewModel.IsCheckedWeight = True
m_Weight = OptionModule.m_Weight
' questo richiamo serve per avvisare che il ddf sta cambiando forma
VisibilityWeight = Visibility.Visible
End If
End If
' se la parola chiave esiste ma non è associato nessun valore
Else
If m_IsCheckedWeight = Visibility.Collapsed Then
If MessageBox.Show("Caution: Weight is setted in DDF. Do you want to add?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' decido di accendere
OptionsViewModel.IsCheckedWeight = True
m_Weight = OptionModule.m_Weight
Else
' decido di spegnere
OptionsViewModel.IsCheckedWeight = False
' questo richiamo serve ad avvisare che sta avvenendo un cambiamento nel ddf
VisibilityWeight = Visibility.Collapsed
End If
Else
' valore è acceso quindi posso salvarlo direttamente
m_Weight = OptionModule.m_Weight
End If
End If
' se il valore esiste Weight
Else
If m_IsCheckedWeight = Visibility.Collapsed Then
If MessageBox.Show("Caution: Weight is setted in DDF. Do you want to add?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) = MessageBoxResult.Yes Then
' decido di accendere
m_IsCheckedWeight = Visibility.Visible
OptionsViewModel.IsCheckedWeight = True
m_Weight = Weight
Else
' decido di spegnere
m_IsCheckedWeight = Visibility.Collapsed
End If
Else
' valore è acceso quindi posso salvarlo direttamente
m_Weight = Weight
End If
End If
Index += 1
' restituisco la riga successiva all'ultimo valore letto
Return Index
End Function
' carico valori swing
Public Function GetSwing(Index As Integer) As Integer
Dim Swing As String = SearchKeyValue(FileContent(Index), K_SWING)
@@ -1197,7 +1329,6 @@ Public Class Door
If SearchScore(FileContent(Index)) Then
' leggo il valore del template e lo assegno alla componente che sto generando
' attenzione: devo passare anche il nome del parametro da cercare; per ora posso avere "template" o "shape" come parola chiave
'm_CurrCompo.TemplateSelItem = SearchKeyValue(FileContent(Index), SearchTemplate(FileContent(Index)))
m_CurrCompo.SetTemplateSelItem(SearchKeyValue(FileContent(Index), SearchTemplate(FileContent(Index))))
' se il template non ha nessun nome
If String.IsNullOrWhiteSpace(m_CurrCompo.TemplateSelItem) Then
+16 -3
View File
@@ -60,22 +60,35 @@
Margin="2,0,0,2"/>
<TextBox Grid.Column="1" Grid.Row="1" Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrDoor.Height, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,0.4,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
<TextBlock Grid.Row="2" Text="{Binding ThicknessMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,2"/>
<TextBox Grid.Column="1" Grid.Row="2" Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrDoor.Thickness, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,0.4,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"/>
<TextBlock Grid.Row="3" Text="{Binding SwingMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,2"/>
<ComboBox Grid.Column="1" Grid.Row="3" Margin="0.4,0.2,39.6,3.2"
<ComboBox Grid.Column="1" Grid.Row="3" Margin="0.4,2,39.6,3.2"
ItemsSource="{Binding CurrDoor.SwingTypeList}"
SelectedItem="{Binding CurrDoor.Swing}"
Style="{StaticResource DoorParamsCmBx}" Height="Auto"/>
<TextBlock Grid.Row="4" Text="{Binding WeightMsg}"
Style="{StaticResource DoorParamsTxBl}"
Margin="2,0,0,2" Visibility="{Binding CurrDoor.VisibilityWeight}"/>
<TextBox Grid.Row="4" Grid.Column="1"
Style="{StaticResource DoorParamsTxBx}"
Text="{Binding CurrDoor.Weight, UpdateSourceTrigger=PropertyChanged}"
Margin="0.4,2,39.6,3.2" VerticalAlignment="Stretch" Height="Auto"
Visibility="{Binding CurrDoor.VisibilityWeight}"/>
<!--Seconda colonna -->
<!-- Profiles-->
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding LockedgeMsg}"
@@ -109,6 +109,11 @@ Public Class DoorParametersViewModel
Return EgtMsg(50126)
End Get
End Property
Public ReadOnly Property WeightMsg As String
Get
Return EgtMsg(50047)
End Get
End Property
#End Region
Public ReadOnly Property DeleteCompoToolTip As String
+11
View File
@@ -129,6 +129,17 @@ Friend Module IniFile
Return IpBoolean
End Function
Public Function DefaultGetPrivateProfilesVisibility(ByVal lpAppName As String, ByVal lpKeyName As String, ByRef IpVisibility As Visibility) As Visibility
Dim sVal As String = String.Empty
DefaultGetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
If String.Equals(Trim(sVal), "1") Then
IpVisibility = Visibility.Visible
Else
IpVisibility = Visibility.Collapsed
End If
Return IpVisibility
End Function
Public Function DefaultGetPrivateProfilesBevel(ByVal lpAppName As String, ByVal lpKeyName As String, ByRef IpBoolean As Visibility) As Visibility
Dim sVal As String = String.Empty
DefaultGetPrivateProfileString(lpAppName, lpKeyName, "", sVal)
+2 -2
View File
@@ -210,7 +210,7 @@ Public Class MainWindowViewModel
' aggiorno file DDF grafico (CurrDoor.ddf)
If Not IsNothing(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor) Then
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, IniFile.m_sTempDir & "\CurrDoor.ddf")
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, IniFile.m_sTempDir & "\" & TEMP_FILE, True)
Dim SelDoor As String = DirectCast(Me.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor
''If Not DdfFile.ComparisonFileDDF(IniFile.m_sTempDir & "\CurrDoor.ddf", SelDoor) Then
If Not DdfFile.SetModify(Me) Then
@@ -218,7 +218,7 @@ Public Class MainWindowViewModel
If MessageBox.Show("Do you want to save this file (" & Path.GetFileNameWithoutExtension(SelDoor) & ")?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
Else
' altrimenti sovrascrivo il DDF
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, SelDoor)
DdfFile.WriteDDF(DirectCast(Me.DoorParameters.DataContext, DoorParametersViewModel).CurrDoor, SelDoor, True)
End If
End If
' scrivo il nome dell'ultimo file aperto
+2 -2
View File
@@ -72,5 +72,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.8.5.1")>
<Assembly: AssemblyFileVersion("1.8.5.1")>
<Assembly: AssemblyVersion("1.8.5.2")>
<Assembly: AssemblyFileVersion("1.8.5.2")>
+8
View File
@@ -29,6 +29,7 @@ Friend Module OptionModule
Friend m_Width As String
Friend m_Height As String
Friend m_Thickness As String
Friend m_Weight As String
Friend m_SwingTypeList As New List(Of String)
Friend m_Swing As String
Friend m_StaticEdgeTypeList As New ObservableCollection(Of String)
@@ -122,6 +123,12 @@ Friend Module OptionModule
Dim Swing As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE, K_SWING_INI, "", Swing)
m_Swing = Swing
Dim Weight As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE, K_WEIGHT_INI, "", Weight)
m_Weight = Weight
Dim WeightVisibility As Visibility = Visibility.Collapsed
DefaultGetPrivateProfilesVisibility(S_SIZE, K_WEIGHTISCHECKED_INI, WeightVisibility)
Door.IsCheckedWeight = WeightVisibility
' carico il valori associati al tipo di spigolo
Dim EdgeTypeList As New ObservableCollection(Of String)
@@ -132,6 +139,7 @@ Friend Module OptionModule
m_StaticEdgeTypeList = EdgeTypeList
OptionsViewModel.CreateEdgeTypeList()
' carico i valori associati agli spigoli
Dim LockEdgeType As String = String.Empty
DefaultGetPrivateProfileString(S_EDGE, K_LOCKEDGE, "", LockEdgeType)
For Index = 0 To OptionsViewModel.EdgeTypeList.Count - 1
+23
View File
@@ -85,6 +85,29 @@
Style="{StaticResource DoorParamsCmBx}"
Margin="5,0,30,5"/>
<TextBlock Grid.Row="4" Text="{Binding WeightMsg}"
Style="{StaticResource DoorParamsTxBl}"
VerticalAlignment="Center"/>
<Grid Grid.Row="4" Grid.Column="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height=" 1*"/>
</Grid.RowDefinitions>
<CheckBox Grid.Column="1"
IsChecked="{Binding IsCheckedWeight}"
Name="Weight"
Margin="0,0,5,5"
Style="{StaticResource DoorParamsChBx}" />
<TextBox Style="{StaticResource DoorParamsTxBx}"
Text="{Binding WeightValue, UpdateSourceTrigger=PropertyChanged}"
Margin="5,0,10,5"
IsEnabled="{Binding IsChecked, ElementName=Weight}"/>
</Grid>
<TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding LockEdgeMsg}" VerticalAlignment="Center"
Style="{StaticResource DoorParamsTxBl}" Margin="20,0,5,0"/>
<ComboBox Grid.Column="3" Grid.Row="1"
+48
View File
@@ -168,6 +168,41 @@ Public Class OptionsViewModel
End Set
End Property
Public Property WeightValue As String
Get
Return OptionModule.m_Weight
End Get
Set(value As String)
OptionModule.m_Weight = value
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHT_INI, OptionModule.m_Weight)
End Set
End Property
Public Shared Property IsCheckedWeight As Boolean
Get
If Door.IsCheckedWeight = Visibility.Visible Then
Return True
Else
Return False
End If
End Get
Set(value As Boolean)
If value Then
Door.IsCheckedWeight = Visibility.Visible
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "1")
Else
If Door.IsCheckedWeight = Visibility.Visible Then
If MessageBox.Show("Caution. Weight is setted in the current door. Do you want to remove?", "Questyion", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) = MessageBoxResult.Yes Then
Door.IsCheckedWeight = Visibility.Collapsed
DefaultWritePrivateProfileString(S_SIZE, K_WEIGHTISCHECKED_INI, "0")
Else
Return
End If
End If
End If
End Set
End Property
Public ReadOnly Property SwingTypeList As List(Of String)
Get
Return OptionModule.m_SwingTypeList
@@ -495,6 +530,13 @@ Public Class OptionsViewModel
End Get
End Property
Public ReadOnly Property WeightMsg As String
Get
Return EgtMsg(MSG_MAINWINDOW + 47)
End Get
End Property
Public ReadOnly Property BottomMsg As String
Get
Return EgtMsg(MSG_MAINWINDOW + 8)
@@ -689,6 +731,12 @@ Public Class OptionsViewModel
For Each Window In Application.Current.Windows
If TypeOf Window Is OptionsView Then
Dim OptionsWindow As OptionsView = DirectCast(Window, OptionsView)
' se eseguo una modifica prima di avere una porta...controllo bene!!
If Not IsNothing(m_rfCurrDoor) Then
m_rfCurrDoor.VisibilityWeight = Door.IsCheckedWeight
m_rfCurrDoor.NotifyPropertyChanged("Weight")
m_rfCurrDoor.NotifyPropertyChanged("VisibilityWeight")
End If
OptionsWindow.Close()
End If
Next
+1 -1
View File
@@ -280,7 +280,7 @@ Public Class ProjectManagerViewModel
DoorManagerViewModel.DeleteNewDoor = 1
If Not IsNothing(CurrDoor) Then
SetTitle = DoorManagerViewModel.CurrProject.Name
DdfFile.WriteDDF(CurrDoor, DoorManagerViewModel.SelectedDoor)
DdfFile.WriteDDF(CurrDoor, DoorManagerViewModel.SelectedDoor, True)
CurrDoor.m_IsModifyDoor = False
DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel).bSetChange = False
m_rfMainWindowViewModel.ProjectNameMsg = SetTitle
+1 -1
View File
@@ -258,7 +258,7 @@ Public Class SceneManagerViewModel
Dim rfDoorParametersViewModel As DoorParametersViewModel = DirectCast(m_rfMainWindowViewModel.DoorParameters.DataContext, DoorParametersViewModel)
Dim CurrDoorPath As String = IniFile.m_sTempDir & "\" & TEMP_FILE
If Not IsNothing(rfDoorParametersViewModel.CurrDoor) AndAlso Not String.IsNullOrWhiteSpace(DirectCast(m_rfMainWindowViewModel.DoorManager.DataContext, DoorManagerViewModel).SelectedDoor) Then
DdfFile.WriteDDF(rfDoorParametersViewModel.CurrDoor, CurrDoorPath)
DdfFile.WriteDDF(rfDoorParametersViewModel.CurrDoor, CurrDoorPath, True)
ExecDoors(m_ProjectScene, CurrDoorPath)
End If
ShowGraphicError()