Compare commits

...

3 Commits

Author SHA1 Message Date
Nicola Pievani 0a59263410 Correzione scrittura file TestHardware versione 2 2023-05-11 15:55:21 +02:00
Nicola Pievani f507d0be44 Gestione Options nel ddf (manca la visualizzazione) 2023-05-11 15:02:31 +02:00
Nicola Pievani d2c87c76b5 Merge branch 'Features/New_DDF_Version' into NicolaP 2023-05-11 11:48:35 +02:00
3 changed files with 73 additions and 5 deletions
+1
View File
@@ -62,6 +62,7 @@ Module ConstCompo
Public Const K_DEPTH_BOTTOM As String = "depth bottom"
Public Const K_DELTA_BOTTOM As String = "delta bottom"
Public Const K_HARDWARE As String = "hardware"
Public Const K_OPTIONS As String = "options"
' Nome, sezioni e chiavi del file Config.ini
Public Const CONFIGINI_FILE_NAME As String = "Config.ini"
+33 -5
View File
@@ -526,6 +526,12 @@ Friend Module DdfFile
If Not Directory.Exists(Path.GetDirectoryName(sPath)) Then
Directory.CreateDirectory(Path.GetDirectoryName(sPath))
End If
If OptionModule.m_sVersionDDF = "2" Then
DdfFileContent.Add(ConstCompo.K_OPTIONS & ": ")
DdfFileContent.Add(Part.sOptions)
End If
DdfFileContent.Add(" ")
DdfFileContent.Add("# End Part")
' se sono arrivato fin qui significa che tutto è andato a buon fine (posso quindisalvare il file corrente)
@@ -564,6 +570,7 @@ Friend Module DdfFile
End If
' dal 20/04/2023 inserita gestione della versione (da configurare nel programma)
If OptionModule.m_sVersionDDF <> "1" Then
DdfFileContent.Add("")
DdfFileContent.Add("version: " & OptionModule.m_sVersionDDF)
End If
DdfFileContent.Add("")
@@ -698,7 +705,12 @@ Friend Module DdfFile
End If
'----------------------------------------------------------------------------------------------------------------------------------------------------
DdfFileContent.Add("" & ConstCompo.S_PROFILES & ":")
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": ")
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
Else
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_LOCKEDGE & ": " & SetBevel(Part.TypePart, Part.LockEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name, Part.InvertBevel))
End If
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.LockEdgeMachining))
If Not StringToDouble(Part.LockEdgeOverMaterial, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_LOCKEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
@@ -714,7 +726,12 @@ Friend Module DdfFile
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
End If
End If
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": ")
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
Else
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_HINGEEDGE & ": " & SetBevel(Part.TypePart, Part.HingeEdgeType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
End If
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.HingeEdgeMachining))
If Not StringToDouble(Part.HingeEdgeOverMaterial, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_HINGEDGEOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
@@ -730,7 +747,12 @@ Friend Module DdfFile
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
End If
End If
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": ")
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
Else
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_TOP & ": " & SetBevel(Part.TypePart, Part.TopType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
End If
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.TopMachining))
If Not StringToDouble(Part.TopOverMaterial, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_TOPOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
@@ -746,7 +768,12 @@ Friend Module DdfFile
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_OVERMATERIAL & ": " & sVal)
End If
End If
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
If OptionModule.m_sVersionDDF = "2" Then ' K_TYPE
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": ")
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_TYPEEDGE & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
Else
DdfFileContent.Add(m_sSpace1Tab & ConstCompo.K_BOTTOM & ": " & SetBevel(Part.TypePart, Part.BottomType.Name, Part.DispositionItem.Name, Part.SwingAlias.Name))
End If
DdfFileContent.Add(m_sSpace2Tab & ConstCompo.K_MACHINING & ": " & ConvertBooleanToOnOff(Part.BottomMachining))
If Not StringToDouble(Part.BottomOverMaterial, dVal) Then
MessageBox.Show(String.Format(EgtMsg(50141), K_BOTTOMOVERMATERIAL_INI), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
@@ -763,8 +790,9 @@ Friend Module DdfFile
End If
End If
DdfFileContent.Add(" ")
If OptionModule.m_sVersionDDF = "2" Then
DdfFileContent.Add(ConstCompo.K_HARDWARE & "hardware: ")
DdfFileContent.Add(ConstCompo.K_HARDWARE & ": ")
End If
' Riordino e stampo le compo
SearchCompo(DdfFileContent, Part, bIsDDF)
+39
View File
@@ -1161,6 +1161,21 @@ Public Class Part
#End Region ' Top Angle
#Region "OPTIONS"
Private m_sOptions As String = String.Empty
Public Property sOptions As String
Get
Return m_sOptions
End Get
Set(value As String)
m_sOptions = value
End Set
End Property
#End Region ' Options
#End Region ' General
' lista delle componenti
@@ -1702,6 +1717,8 @@ Public Class Part
ReadDoorCompleted = True
Case ConstCompo.K_HARDWARE
LineIndex = LineIndex + 1
Case ConstCompo.K_OPTIONS
LineIndex = ReadDoor.GetOptions(ReadDoor.NextIndex(LineIndex))
Case Else 'COMPONENTS
' Se sezione senza nome o altro errore
If String.IsNullOrWhiteSpace(sSection) Then
@@ -2205,6 +2222,28 @@ Public Class Part
Return NextIndex(Index)
End Function
Private Function GetOptions(Index As Integer) As Integer
If Index > FileContent.Count() - 1 Then Return Index
Dim sLine As String = RemoveComment(FileContent(Index))
' se stringa vuota passo alla riga successiva
If String.IsNullOrEmpty(sLine) Then
Return Index
End If
' procedo a leggere le options
Dim nCount As Integer = 0
m_sOptions = String.Empty
' sLine.StartsWith(OptionModule.m_sSpace1Tab)
While Not (Search3Hyphens(sLine) OrElse Search3Dots(sLine))
m_sOptions &= If(nCount > 0, vbCrLf, "") & sLine
Index = NextIndex(Index)
' se il file è terminatpo esco
If Index > FileContent.Count() - 1 Then Return Index
sLine = RemoveComment(FileContent(Index))
nCount = nCount + 1
End While
Return Index
End Function
' calcola la congruenza del posizionamento e del secure
Private Sub CalcBevelFromSecure()
' se sono nella configurazione assemblato e sto leggendo un frame