Compare commits

..

11 Commits

Author SHA1 Message Date
Nicola Pievani a4202d0be1 Aggiornamento versione 2.6g5 2024-07-24 15:05:16 +02:00
Nicola Pievani 2730d1ad32 Miglioramenti gestione TmplateDoor 2024-07-10 18:39:05 +02:00
Nicola Pievani a6492ac6e1 Correzione scrittura parametri DGD 2024-06-26 18:24:19 +02:00
Nicola Pievani 1fb0c4bd09 Merge commit '5f71f7dfa33b55063c9e09469e744f7b800766b2' 2024-05-10 16:14:25 +02:00
Nicola Pievani 5f71f7dfa3 Gestione chiave di rete 2024-05-10 16:13:46 +02:00
Nicola Pievani 86b2e011e0 Merge commit 'b16d860805fee93995139704af452d3c9a0a45e4' 2024-05-07 15:59:32 +02:00
Nicola Pievani b16d860805 Migliorata gestione unità di misura 2024-05-07 15:59:12 +02:00
Nicola Pievani 774c64678f Merge commit '34472efbc2b8b675468e6f9482f181a81d41f82b' 2024-04-08 10:15:14 +02:00
Nicola Pievani 34472efbc2 Gestione errore 'Rabbet.frame' non trovato 2024-04-08 10:14:31 +02:00
Nicola Pievani 6ddc0f305b Merge branch 'NicolaP' 2024-02-21 16:19:42 +01:00
Nicola Pievani 9edda7ead3 Migliorata gestione unità di misura mm 2024-02-21 16:19:05 +01:00
18 changed files with 455 additions and 107 deletions
+14 -4
View File
@@ -3588,9 +3588,14 @@ Public Class Assembly
If Not bRabbet Then
'Map.refPartPageVM.CurrPart = Jamb
CurrCompo = Jamb.AddNewCompo(Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel), True)
DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).SelItem = DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).ItemList(0)
If Not IsNothing(CurrCompo) Then
DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).SelItem = DirectCast(CurrCompo.CompoParamList(0), ComboBoxParam).ItemList(0)
Else
' 50180=Warning : {0} does not exist.
MessageBox.Show(String.Format(EgtMsg(50180), Map.refCompoPanelVM.CompoTypeList(IndexCompoPanel).Name & ".frame"), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
CurrCompo = Jamb.CompoList(IndexCompo)
CurrCompo = Jamb.CompoList(IndexCompo)
End If
' mofico la componete rabbet
If Not IsNothing(CurrCompo) Then
@@ -3729,9 +3734,14 @@ Public Class Assembly
If Not bRabbet Then
' lo aggiungo
Local_Compo = Jamb.AddNewCompo(Map.refCompoPanelVM.CompoTypeList(CompoListIndex), True)
DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).SetSelItem(DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).ItemList(nIndexSide))
If Not IsNothing(Local_Compo) Then
DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).SetSelItem(DirectCast(Local_Compo.CompoParamList(0), ComboBoxParam).ItemList(nIndexSide))
Else
' 50180=Warning : {0} does not exist.
MessageBox.Show(String.Format(EgtMsg(50180), Map.refCompoPanelVM.CompoTypeList(CompoListIndex).Name & ".frame"), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
Local_Compo = Jamb.CompoList(IndexCompo)
Local_Compo = Jamb.CompoList(IndexCompo)
End If
If Not IsNothing(Local_Compo) Then
Dim dVal1 As Double = 0
+24 -21
View File
@@ -21,7 +21,7 @@ Public Class AssemblyManagerVM
Private m_VisibilityDoorList As Visibility = Visibility.Collapsed
Public Property VisibilityDoorList As Visibility
Get
Return m_VisibilityDoorList
Return m_VisibilityDoorList
End Get
Set(value As Visibility)
m_VisibilityDoorList = value
@@ -81,7 +81,9 @@ Public Class AssemblyManagerVM
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
' ricarico la lista completa degli swing
NewAssName.SelAssembly.ListPartDoor(0).Door.SwingTypeList = OptionModule.m_SwingTypeList
NewAssName.SelAssembly.ListPartDoor(0).Door.SetSwing(OptionModule.m_Swing)
If String.IsNullOrEmpty(NewAssName.SelAssembly.ListPartDoor(0).Door.Swing) Then
NewAssName.SelAssembly.ListPartDoor(0).Door.SetSwing(OptionModule.m_Swing)
End If
DdfFile.WriteDDFPart(NewAssName.SelAssembly.ListPartDoor(0).Door, sTempFile, False, False)
' assegno la porte salvata nel CurrPart.ddf come porta corrente del progetto
Map.refPartPageVM.CurrPart = NewAssName.SelAssembly.ListPartDoor(0).Door
@@ -157,7 +159,7 @@ Public Class AssemblyManagerVM
DdfFile.SaveErrorCompo = False
End If
' controllo che il salvataggio sia andato a buon fine
If bConfirmSavin Then
SavedAssName.IsModified = False
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
@@ -321,18 +323,18 @@ Public Class AssemblyManagerVM
End Select
Map.refMainWindowVM.selectedWatcher = MainWindowVM.WatcherCalling.NoEvents
' se sono in modalità hardware allora esco senza caricare l'elenco delle porte
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage then Return true
'-------------------------------------------------------------------------------------------------------------------------------------------------
If Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then Return True
'-------------------------------------------------------------------------------------------------------------------------------------------------
' devo ricalcolare l'elenco delle porte nel progetto corrente:
If OptionModule.m_SingleDoor then Return True
If OptionModule.m_SingleDoor Then Return True
' calcolo l'elenco delle porte solo dopo il salvataggio della porta corrente
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified then Return true
If Not IsNothing( Map.refAssemblyManagerVM.CurrProject) andAlso Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.Name) then
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then Return True
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.Name) Then
Dim CurrAssemblyName As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
Map.refAssemblyManagerVM.CurrProject.AssemblyList = New ObservableCollection(Of AssemblyName)
Dim DDFArray()as String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
For IndexFile As Integer = 0 to DDFArray.Count - 1
If Path.GetExtension(DDFArray(IndexFile)) <> DDF_EXTENSION then
Dim DDFArray() As String = Directory.GetFiles(Map.refAssemblyManagerVM.CurrProject.Name)
For IndexFile As Integer = 0 To DDFArray.Count - 1
If Path.GetExtension(DDFArray(IndexFile)) <> DDF_EXTENSION Then
Continue For
End If
Dim NewAssembly As New AssemblyName
@@ -340,12 +342,12 @@ Public Class AssemblyManagerVM
NewAssembly.IsModified = False
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
Next
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) then
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
Try
'Map.refAssemblyManagerVM.CurrProject = LocalCurrProject
'LocalCurrProject.SelAssemblyName = LocalCurrProject.AssemblyList.First(Function(x) x.Name = Local_AssemblyName.Name)
Map.refAssemblyManagerVM.CurrProject = Map.refAssemblyManagerVM.CurrProject
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.AssemblyList.First(Function(x) x.Name = CurrAssemblyName)
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName = Map.refAssemblyManagerVM.CurrProject.AssemblyList.First(Function(x) x.Name = CurrAssemblyName)
Catch ex As Exception
EgtOutLog("Aggiornamento Progetto Corrente: impossibile caricare ultima porta")
End Try
@@ -372,8 +374,8 @@ Public Class AssemblyManagerVM
Next
Next
End If
End If
Return True
End If
Return True
End Function
' ricerca il tipo di compoente chiamato
@@ -446,7 +448,7 @@ Public Class AssemblyManagerVM
If Not bBrandExists OrElse Not bFileExists Then
'' se la compoenente che sto caricando era corretta
'ErrCompo.LoadByDefault = True
' se il brand non esiste, ma è selezionato
' se il brand non esiste, ma è selezionato
If Not bBrandExists Then
ErrCompo.MissingDirectory = True
ErrCompo.MissingFile = True
@@ -1072,7 +1074,7 @@ Public Class AssemblyManagerVM
Public Function ManageModified() As Boolean
' verifico se selezionato esiste e modificato
If Not IsNothing (m_CurrProject) AndAlso Not IsNothing(m_CurrProject.SelAssemblyName) AndAlso m_CurrProject.SelAssemblyName.IsModified Then
If Not IsNothing(m_CurrProject) AndAlso Not IsNothing(m_CurrProject.SelAssemblyName) AndAlso m_CurrProject.SelAssemblyName.IsModified Then
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(m_CurrProject.SelAssemblyName.Name))
Select Case MessageBox.Show(sText, "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
@@ -1303,7 +1305,8 @@ Public Class AssemblyManagerVM
' creo le Ante
For IndexDoor As Integer = 0 To nDoorNumber - 1
Dim Type As String = ConstGen.PART_DO_ & IndexDoor + 1
If IsNothing(ReserchPartDoor(Type)) Then
Dim _PartDoor As PartDoor = ReserchPartDoor(Type)
If IsNothing(_PartDoor) Then
Dim Local_PartDoor As New PartDoor
Local_PartDoor.Door = New Part(Local_PartDoor)
Local_PartDoor.Door.TypePart = Type
@@ -1313,7 +1316,7 @@ Public Class AssemblyManagerVM
'CreateNewPropertiesList(Local_PartDoor.Door.PropertiesList, Local_PartDoor.Door.SelectedMaterial)
CurrAssembly.ListPartDoor.Add(Local_PartDoor)
Else
'CurrAssembly.ListPartDoor.Add(ReserchPartDoor(Type))
CurrAssembly.ListPartDoor.Add(_PartDoor)
End If
Next
@@ -1610,7 +1613,7 @@ Public Class AssemblyManagerVM
SaveFileDialog.FileName &= DDF_EXTENSION
End If
' verifico che non sia bloccato (in fase di creazione di una nuova porta posso avere il file .lck senza il ddf)
If Utility.IsFileLocked(Path.GetDirectoryName(SaveFileDialog.FileName), Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)) then
If Utility.IsFileLocked(Path.GetDirectoryName(SaveFileDialog.FileName), Path.GetFileNameWithoutExtension(SaveFileDialog.FileName)) Then
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
Utility.OutLog("Apertura progetto : " & Map.refAssemblyManagerVM.CurrProject.Name)
Utility.LockDir(Map.refAssemblyManagerVM.CurrProject.Name, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.GraphicName)
@@ -1654,7 +1657,7 @@ Public Class AssemblyManagerVM
' aggiorno la lista
'------------------------------------------------------------------------------------------------------------------------------------------------
' LETTURA DI UN FILE DI TIPO TEMPLATE
If ImportTemplate(sImportTemplate) Then
If ImportTemplate(sImportTemplate) Then
Utility.OutLog("Apertura progetto : " & Local_AssemblyName.Name)
Utility.LockDir(Path.GetDirectoryName(Local_AssemblyName.Name), Path.GetFileNameWithoutExtension(Local_AssemblyName.Name))
' carico il nome come Assemblato selezionato
+10
View File
@@ -17,6 +17,16 @@ Public Class AssemblyName
End Set
End Property
Private m_OrigTemplate As String = String.Empty
Public Property OrigTemplate As String
Get
Return m_OrigTemplate
End Get
Set(value As String)
m_OrigTemplate = value
End Set
End Property
Private m_IsModified As Boolean
Public Property IsModified As Boolean
Get
+3
View File
@@ -23,6 +23,9 @@ Module ConstGen
Public Const LIC_FILE_NAME As String = "EgtDOORCreator.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_KEY As String = "Key"
Public Const K_NETKEY As String = "NetKey"
Public Const K_LOCKID As String = "LockId"
Public Const K_NESTKEY As String = "NestKey"
' File di log generale
Public Const GENLOG_FILE_NAME As String = "EgtDOORCreatorLog#.txt"
+4
View File
@@ -64,6 +64,10 @@ Friend Module DdfFile
Dim Config As String = IniFile.m_sDoorsDirPath
Config = Path.GetFileName(Config)
DdfFileContent.Add("#Config: " & Config)
' versione 2.6g1: salvo il nome del template da cui è genetato il file corrente
If Not String.IsNullOrEmpty(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate) Then
DdfFileContent.Add("#OrigTemplate: " & Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.OrigTemplate)
End If
If Not IsNothing(Part.TypePart) Then
DdfFileContent.Add("#" & PrintTitleDDFPart(Part.TypePart))
End If
+73 -8
View File
@@ -2,6 +2,7 @@
Imports System.ComponentModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports System.Text.RegularExpressions
Public Class Part
@@ -3360,6 +3361,7 @@ Public Class Part
' utilizzata per generare la porta/jamb dell'Hardware
Sub New(Hardware As String)
If Not String.IsNullOrEmpty(Hardware) Then
Me.m_Width = OptionModule.m_WidthJamb
Me.m_Height = OptionModule.m_Height
@@ -3393,10 +3395,77 @@ Public Class Part
Me.TypePart = ConstGen.PART_FRAME_LEFT
Return
End If
Me.m_Width = OptionModule.m_Width
Me.m_Height = OptionModule.m_Height
Me.m_Thickness = OptionModule.m_Thickness
Me.SetSwing(OptionModule.m_Swing)
Dim bCLoneDoor As Boolean = (GetMainPrivateProfileInt(S_GENERAL, "CloneDoor", 0) = 1)
' Se abilitato in file Ini "DoorClone" allora verifico se esiste una porta corrente
If bCLoneDoor And Not IsNothing(Map.refAssemblyManagerVM) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) AndAlso
Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor) Then
' Se presente una sola anta
Dim nPartDoor As Integer = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count
If nPartDoor = 1 Then
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0)
If Not IsNothing(LocalPartDoor.Door) Then
Me.m_Width = LocalPartDoor.Door.m_Width
Me.m_Height = LocalPartDoor.Door.m_Height
Me.m_Thickness = LocalPartDoor.Door.m_Thickness
Me.SetSwing(LocalPartDoor.Door.m_Swing)
Me.SetLockEdgeType(New EdgeType(LocalPartDoor.Door.LockEdgeType.Name, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(LocalPartDoor.Door.HingeEdgeType.Name, Visibility.Visible))
Me.SetTopType(New EdgeType(LocalPartDoor.Door.TopType.Name, Visibility.Visible))
Me.SetBottomType(New EdgeType(LocalPartDoor.Door.BottomType.Name, Visibility.Visible))
Else
' Devo usare i parametri di default
Me.m_Width = OptionModule.m_Width
Me.m_Height = OptionModule.m_Height
Me.m_Thickness = OptionModule.m_Thickness
Me.SetSwing(OptionModule.m_Swing)
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
End If
ElseIf nPartDoor > 1 Then
' Assemblati
Dim WdSelPartV As New SelectPartV()
Dim WdSelPartVM As New SelectPartVM("Selezione della porta", "Selezione anta", nPartDoor, 1)
WdSelPartV.DataContext = WdSelPartVM
WdSelPartV.ShowDialog()
Dim nSelection As Integer = CInt(WdSelPartVM.Selection.Split(" "c)(1)) - 1
' Apro una finestra per chiedere quale anta usare come riferimento
Dim LocalPartDoor As PartDoor = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(nSelection)
Me.m_Width = LocalPartDoor.Door.m_Width
Me.m_Height = LocalPartDoor.Door.m_Height
Me.m_Thickness = LocalPartDoor.Door.m_Thickness
Me.SetSwing(LocalPartDoor.Door.m_Swing)
Me.SetLockEdgeType(New EdgeType(LocalPartDoor.Door.LockEdgeType.Name, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(LocalPartDoor.Door.HingeEdgeType.Name, Visibility.Visible))
Me.SetTopType(New EdgeType(LocalPartDoor.Door.TopType.Name, Visibility.Visible))
Me.SetBottomType(New EdgeType(LocalPartDoor.Door.BottomType.Name, Visibility.Visible))
Else
' Devo usare i parametri di default
Me.m_Width = OptionModule.m_Width
Me.m_Height = OptionModule.m_Height
Me.m_Thickness = OptionModule.m_Thickness
Me.SetSwing(OptionModule.m_Swing)
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
End If
Else
Me.m_Width = OptionModule.m_Width
Me.m_Height = OptionModule.m_Height
Me.m_Thickness = OptionModule.m_Thickness
Me.SetSwing(OptionModule.m_Swing)
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
End If
If Not IsNothing(OptionModule.m_CurrMaterial) Then
Try
Me.SetMaterial(m_MaterialList.First(Function(x) x.Name = Trim(OptionModule.m_CurrMaterial.Name)))
@@ -3409,10 +3478,6 @@ Public Class Part
Me.m_IsActive = True
Me.m_Measure = ConvertMmUnitsToString(OptionModule.m_bIsMmUnit)
Me.m_Weight = OptionModule.m_Weight
Me.SetLockEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetHingeEdgeType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetTopType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.SetBottomType(New EdgeType(ConstGen.BEVEL_SQUARED, Visibility.Visible))
Me.m_LockEdgeMachining = OptionModule.m_LockEdgeMachining
Me.m_HingeEdgeMachining = OptionModule.m_HingeEdgeMachining
Me.m_TopMachining = OptionModule.m_TopMachining
+8
View File
@@ -223,6 +223,10 @@
</Compile>
<Compile Include="ProjectManager\ProjectManagerVM.vb" />
<Compile Include="ProjectManager\MySaveFileDialogVM.vb" />
<Compile Include="ProjectManager\SelectPartV.xaml.vb">
<DependentUpon>SelectPartV.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectManager\SelectPartVM.vb" />
<Compile Include="RegexFunction.vb" />
<Compile Include="ReportInfo\ReportCompo.vb" />
<Compile Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml.vb">
@@ -363,6 +367,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ProjectManager\SelectPartV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SceneManager\DimensioningPanel\DimensioningPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
+58 -32
View File
@@ -83,8 +83,8 @@ Public Class Hardware
If Not IsNothing(value) Then
m_SelBrand = value
ElseIf Not IsNothing(value) AndAlso Not Directory.Exists(value.ModelDir) Then
' 50542 = {0}: Directory does not exist!
ErrorReading = String.Format(EgtMsg(50542),value.ModelDir)
' 50542 = {0}: Directory does not exist!
ErrorReading = String.Format(EgtMsg(50542), value.ModelDir)
RefreshTemplateListEgtDOORCreator()
Else
Return
@@ -130,8 +130,8 @@ Public Class Hardware
SelTemplate = String.Empty
'Map.refSceneManagerVM.RefreshBtn()
End If
Else
SelTemplate = String.Empty
Else
SelTemplate = String.Empty
'Map.refSceneManagerVM.RefreshBtn()
End If
' termine della selezione
@@ -530,7 +530,9 @@ Public Class Hardware
Else
SwingTemplate = "RH"
End If
IniFile.StdTemplateGetPrivateProfileString("Hardware", "Swing", SwingTemplate, SwingTemplate)
If String.IsNullOrEmpty(SwingTemplate) Or Not (GetMainPrivateProfileInt(S_GENERAL, "CloneDoor", 0) = 1) Then
IniFile.StdTemplateGetPrivateProfileString("Hardware", "Swing", SwingTemplate, SwingTemplate)
End If
Map.refHardwarePageVM.GenericPart.SetSwing(SwingTemplate)
If bIsFrame Then
IniFile.StdTemplateGetPrivateProfileString("Hardware", "SwingFrame", "RH", SwingTemplate)
@@ -555,17 +557,17 @@ Public Class Hardware
If Map.refHardwarePageVM.GenericPart.CompoList.Count < 1 Then Return
'If String.IsNullOrEmpty(HardwareGeneral.JambSide) Then
For Each Item In Map.refHardwarePageVM.GenericPart.CompoList(0).CompoParamList
If TypeOf Item Is ComboBoxParam AndAlso
Item.DDFName = "side" Then
Dim CBoxPar As ComboBoxParam = DirectCast(Item, ComboBoxParam)
Dim IndexItem As Integer = CBoxPar.ItemList.IndexOf(CBoxPar.SelItem)
If IndexItem > -1 Then
HardwareGeneral.SetJambSide(CBoxPar.ItemListDDF(IndexItem))
End If
'HardwareGeneral.SetJambSide(CBoxPar.SelItem)
Exit For
If TypeOf Item Is ComboBoxParam AndAlso
Item.DDFName = "side" Then
Dim CBoxPar As ComboBoxParam = DirectCast(Item, ComboBoxParam)
Dim IndexItem As Integer = CBoxPar.ItemList.IndexOf(CBoxPar.SelItem)
If IndexItem > -1 Then
HardwareGeneral.SetJambSide(CBoxPar.ItemListDDF(IndexItem))
End If
Next
'HardwareGeneral.SetJambSide(CBoxPar.SelItem)
Exit For
End If
Next
'End If
If HardwareGeneral.JambSide.ToLower.Contains("hinge") Then
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_LEFT & HINGE
@@ -581,21 +583,21 @@ Public Class Hardware
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_Height)
End If
Return
ElseIf HardwareGeneral.JambSide.ToLower.Contains("top") Then
ElseIf HardwareGeneral.JambSide.ToLower.Contains("top") Then
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_TOP & TOP
If Not HardwarePartVM.bIsSettingDoor Then
Map.refHardwarePageVM.GenericPart.SetWidth(OptionModule.m_Width)
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_ThicknessHead)
End If
Return
ElseIf HardwareGeneral.JambSide.ToLower.Contains("bottom") Then
ElseIf HardwareGeneral.JambSide.ToLower.Contains("bottom") Then
Map.refHardwarePageVM.GenericPart.TypePart = PART_FRAME_BOTTOM & BOTTOM
If Not HardwarePartVM.bIsSettingDoor Then
Map.refHardwarePageVM.GenericPart.SetWidth(OptionModule.m_Width)
Map.refHardwarePageVM.GenericPart.SetHeight(OptionModule.m_ThicknessBottom)
End If
Return
End If
End If
End Sub
@@ -826,7 +828,7 @@ Public Class Hardware
End If
End If
ParamIndex += 1
ParamIndex += 1
End While ' termina lettura del capitolo
GroupChapters.Add(Chapter)
@@ -1876,7 +1878,7 @@ Public Class Hardware
' cerco un numero finito di parametri
For IndexParam As Integer = 0 To IndexParamDDF - 1
If LineIndex + ParamIndex > sFile.Count - 1 Then Return False
' recuro il nome del parametro
' recupero il nome del parametro
KeyParam = Trim(RegexFunction.KeyParamLine(sFile(LineIndex + ParamIndex)))
While String.IsNullOrEmpty(KeyParam) And LineIndex + ParamIndex < sFile(LineIndex + ParamIndex).Count
ParamIndex += 1
@@ -2013,21 +2015,27 @@ Public Class Hardware
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.TypeVar & "( " & Text.Value & ")"
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "inch( " & Text.Value & ")"
End If
Else
sValue = Text.Value
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "mm( " & sValue & ")"
End If
Case ConstGen.MM
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
sValue = Text.Value
InchesToMm(sValue)
'sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "inch( " & sValue & ")"
Else
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.Value
'sValue = Text.Value
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "mm( " & Text.Value & ")"
End If
End If
End Select
@@ -2046,21 +2054,27 @@ Public Class Hardware
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.TypeVar & "( " & Text.Value & ")"
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "inch( " & Text.Value & ")"
End If
Else
sValue = Text.Value
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "mm( " & sValue & ")"
End If
Case ConstGen.MM
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
sValue = Text.Value
InchesToMm(sValue)
'sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "inch( " & sValue & ")"
Else
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.Value
'sValue = Text.Value
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "mm( " & Text.Value & ")"
End If
End If
End Select
@@ -2093,22 +2107,28 @@ Public Class Hardware
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.TypeVar & "( " & Text.Value & ")"
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "inch( " & Text.Value & ")"
End If
'sValue = Text.TypeVar & "( " & Text.ToolTipValue & ")"
Else
sValue = Text.Value
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "mm( " & sValue & ")"
End If
Case ConstGen.MM
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
sValue = Text.Value
InchesToMm(sValue)
'sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "inch( " & sValue & ")"
Else
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.Value
'sValue = Text.Value
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "mm( " & Text.Value & ")"
End If
'sValue = Text.ToolTipValue
End If
@@ -2139,22 +2159,28 @@ Public Class Hardware
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.TypeVar & "( " & Text.Value & ")"
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "inch( " & Text.Value & ")"
End If
'sValue = Text.TypeVar & "( " & Text.ToolTipValue & ")"
Else
sValue = Text.Value
If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
'If MmToInches(sValue) Then sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "mm( " & Text.Value & ")"
End If
Case ConstGen.MM
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
sValue = Text.Value
InchesToMm(sValue)
'sValue = Text.TypeVar & "( " & sValue & ")"
sValue = "inch( " & Text.Value & ")"
Else
If Text.ToolTipValue.Contains("Invalid") Then
sValue = "0.0000"
Else
sValue = Text.Value
'sValue = Text.Value
'sValue = Text.TypeVar & "( " & Text.Value & ")"
sValue = "mm( " & Text.Value & ")"
End If
'sValue = Text.ToolTipValue
End If
+21 -2
View File
@@ -56,9 +56,28 @@ Friend Class MainWindowModel
Dim sKey As String = String.Empty
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey(sNestKey)
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey(bNetHwKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey(bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty(sLockId) Then
EgtSetLockId(sLockId)
End If
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2512, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2512, 1, IniFile.m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2607, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2607, 1, IniFile.m_nKeyOptions)
'Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+2 -2
View File
@@ -72,5 +72,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.12.2")>
<Assembly: AssemblyFileVersion("2.5.12.2")>
<Assembly: AssemblyVersion("2.6.7.1")>
<Assembly: AssemblyFileVersion("2.6.7.5")>
+3 -3
View File
@@ -434,19 +434,19 @@ Friend Module OptionModule
Dim Width As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE_INI, K_WIDTH_INI, "32", Width)
Utility.ConvertCompoConfig(Width, 500)
Utility.ConvertCompoConfig(Width, 9999)
m_Width = Width
Dim dWidth As Double
If StringToDouble(m_Width, dWidth) Then EgtLuaSetGlobNumVar("W", dWidth)
Dim Height As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE_INI, K_HEIGHT_INI, "80", Height)
Utility.ConvertCompoConfig(Height, 500)
Utility.ConvertCompoConfig(Height, 9999)
m_Height = Height
Dim dHeight As Double
If StringToDouble(m_Height, dHeight) Then EgtLuaSetGlobNumVar("H", dHeight)
Dim Thickness As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE_INI, K_THICKNESS_INI, "1.75", Thickness)
Utility.ConvertCompoConfig(Thickness, 100)
Utility.ConvertCompoConfig(Thickness, 9999)
m_Thickness = Thickness
Dim dThickness As Double
If StringToDouble(m_Thickness, dThickness) Then EgtLuaSetGlobNumVar("T", dThickness)
+50 -14
View File
@@ -6,7 +6,7 @@ Imports System.ComponentModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports Ionic.zip
Imports Ionic.Zip
Public Class ProjectManagerVM
Implements INotifyPropertyChanged
@@ -411,10 +411,10 @@ Public Class ProjectManagerVM
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Visible
Return
End If
'-------------------------------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------------------------------
'Prima di tutto chiedo se vuole aprire un template
Dim sImportTemplate As String = Map.refAssemblyManagerVM.ShowDialogImportTemplate
'Prima di tutto chiedo se vuole aprire un template
Dim sImportTemplate As String = Map.refAssemblyManagerVM.ShowDialogImportTemplate
' dichiaro la finestra di dialogo
Dim saveFileDialog1 As New System.Windows.Forms.SaveFileDialog()
@@ -476,6 +476,7 @@ Public Class ProjectManagerVM
' creo un nuovo assemblato
Dim Local_AssemblyName As New AssemblyName
Local_AssemblyName.Name = FilePathComplete
Local_AssemblyName.OrigTemplate = sImportTemplate
Local_AssemblyName.GraphicName = Path.GetFileNameWithoutExtension(FilePathComplete)
m_CurrProject.AssemblyList.Add(Local_AssemblyName)
' Seleziono AssembyName creato
@@ -487,13 +488,17 @@ Public Class ProjectManagerVM
End If
' tolgo la visualizzazione della lista dei nomi
Map.refAssemblyManagerVM.CurrProject = CurrProject
Map.refAssemblyManagerVM.ImportTemplate(sImportTemplate)
Dim bImportedTemplate As Boolean = Map.refAssemblyManagerVM.ImportTemplate(sImportTemplate)
' Creo nuovo assembly
Map.refAssemblyManagerVM.NewCmd(Local_AssemblyName)
Utility.OutLog("Creazione nuovo progetto : " & saveFileDialog1.FileName)
Utility.LockDir(Path.GetDirectoryName(saveFileDialog1.FileName), Path.GetFileNameWithoutExtension(saveFileDialog1.FileName))
Map.refAssemblyManagerVM.VisibilityDoorList = Visibility.Collapsed
CurrProject.NotifyPropertyChanged("Name")
' Se l'importazione del template è andata a buon fine allora salvo
If bImportedTemplate Then
Save()
End If
End If
End Sub
@@ -1188,17 +1193,48 @@ Public Class ProjectManagerVM
End If
' se esite una porta, allora rendo possibile la creazione di un template della porta corrente
If Not IsNothing(Map.refPartPageVM.CurrPart) Then
' Stampo il file correte nella cartella Template
Dim SaveFileDialog As New MySaveFileDialogVM
Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
SaveFileDialog.Title = EgtMsg(50417)
SaveFileDialog.Directory = IniFile.m_TemplateDir
SaveFileDialog.Extension = DDT_EXTENSION
'SaveFileDialog.FileName = m_CurrProject.Name & "\"
' se decido di chiuedere la finestra
If Not SaveFileDialogWnd.ShowDialog Then
' ' Stampo il file correte nella cartella Template
' Dim SaveFileDialog As New MySaveFileDialogVM
' Dim SaveFileDialogWnd As New EgtWPFLib5.SaveFileDialogV(Application.Current.MainWindow, SaveFileDialog)
' SaveFileDialog.Title = EgtMsg(50417)
' SaveFileDialog.Directory = IniFile.m_TemplateDir
' SaveFileDialog.Extension = DDT_EXTENSION
' 'SaveFileDialog.FileName = m_CurrProject.Name & "\"
' ' se decido di chiuedere la finestra
' If Not SaveFileDialogWnd.ShowDialog Then
' Return
' End If
' Apro la finestra di salvataggio generica
Dim SaveFileDialog As New System.Windows.Forms.SaveFileDialog()
' controllo se esiste il file DDF
Dim sFilePath As String = Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name
If File.Exists(sFilePath) Then
' recupero il nome del template che ha generato il DDF corrente
Dim DDTOrig As String = String.Empty
Dim fStream As String() = File.ReadAllLines(sFilePath)
DDTOrig = ReadOrigTemplate(fStream)
SaveFileDialog.Filter = "(*.ddt) |*.ddt"
SaveFileDialog.FilterIndex = 2
If String.IsNullOrEmpty(DDTOrig) Then
If OptionModule.m_SingleDoor Then
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
Else
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.Name)
End If
Else
SaveFileDialog.FileName = Path.GetFileNameWithoutExtension(DDTOrig)
End If
End If
' avvio la ricerca nell'ultimo direttorio aperto
SaveFileDialog.InitialDirectory = IniFile.m_TemplateDir
If SaveFileDialog.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
' Interrompo la creazione del template
Return
End If
' Controllo se ha estensione il nome della porta
If Path.HasExtension(SaveFileDialog.FileName) Then
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
+37
View File
@@ -0,0 +1,37 @@
<EgtWPFLib5:EgtCustomWindow x:Class="SelectPartV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
Height="100" Width="300" Topmost="True"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<UniformGrid Columns="2" Grid.Row="0" Grid.ColumnSpan="2">
<TextBlock Margin="5" Height="24" Text="{Binding PartDoorMsg}" VerticalAlignment="Center"/>
<ComboBox Margin="5,0,5,0" Height="24" VerticalAlignment="Center"
ItemsSource="{Binding PartDoorList}" SelectedItem="{Binding Selection}"/>
</UniformGrid>
<Button IsDefault="True" Name="OkBtn" Grid.Row="2" Grid.ColumnSpan="2"
Content="{Binding SaveMsg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+15
View File
@@ -0,0 +1,15 @@
Public Class SelectPartV
Sub New()
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
Me.Close()
End Sub
End Class
+46
View File
@@ -0,0 +1,46 @@
Public Class SelectPartVM
Private m_Title As String = "Selection of door"
Public ReadOnly Property Title As String
Get
Return m_Title
End Get
End Property
Private m_PartDoorMsg As String = "Select part"
Public ReadOnly Property PartDoorMsg As String
Get
Return m_PartDoorMsg
End Get
End Property
Private m_PartDoorList As New List(Of String)
Public Property PartDoorList As List(Of String)
Get
Return m_PartDoorList
End Get
Set(value As List(Of String))
m_ListPartDoor = value
End Set
End Property
Private m_Selection As String = ""
Public Property Selection As String
Get
Return m_Selection
End Get
Set(value As String)
m_Selection = value
End Set
End Property
Sub New(TitleWd As String, MsgWd As String, nParts As Integer, nIndex As Integer)
m_Title = TitleWd
m_PartDoorMsg = MsgWd
For Index As Integer = 0 To nParts - 1
m_PartDoorList.Add("Door " & nParts.ToString)
Next
m_Selection = "Door " & nIndex.ToString
End Sub
End Class
+14
View File
@@ -121,6 +121,20 @@ Module RegexFunction
Return True
End Function
' leggo dal vettore per cercare la stringa OrigTemplate
Friend Function ReadOrigTemplate(fStream As String()) As String
Dim sOrigTemplate As String = String.Empty
For Each Line As String In fStream
If Line.Contains("#OrigTemplate") Then
sOrigTemplate = Regex.Match(Line, "\s*:\s*(.*?)\s*$").Groups(1).Value
Return sOrigTemplate
Exit For
End If
Next
' Processo il tipo di configurazione
Return sOrigTemplate
End Function
' restituisce quello che segue l'uguale assegnata la parola chiave Err
Friend Function ErrDraw(sLine As String) As Integer
Dim sErrMsg As String = Regex.Match(sLine, "\s*(Err)\s*=\s*(.*?\b)\s*$").Groups(2).Value
+19 -5
View File
@@ -121,12 +121,26 @@ Public Class SceneManagerVM
m_ProjectSceneHost.Child = Nothing
' Se manca la chiave
If IniFile.m_nKeyLevel = -1 Or IniFile.m_nKeyLevel = -2 Then
EgtOutLog("Missing Dongle")
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
If Not EgtGetNetHwKey() Then
EgtOutLog("Missing Dongle")
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
Else
EgtOutLog("NetDongle is full")
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
End If
ElseIf IniFile.m_nKeyLevel = -9 Then
EgtOutLog("Missing Link with Net Dongle")
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
' Altrimenti manca la licenza
' Altrimenti manca la licenza
Else
EgtOutLog("Problems with Licence")
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
+54 -16
View File
@@ -304,7 +304,32 @@ Public Module Utility
Return "0.0000"
End If
End Select
ElseIf sValue.Contains("(") And sValue.Contains(")") And Not sValue.Contains("inch") Then
ElseIf sValue.Contains("(") And sValue.Contains(")") And sValue.Contains("mm") Then
sValue = Trim(sValue.Replace("mm", ""))
If sValue.StartsWith("(") And sValue.EndsWith(")") Then
Dim ArrayString() As Char = StringToChar(sValue)
ArrayString(0) = CChar("§")
ArrayString(ArrayString.Count - 1) = CChar("§")
sValue = CharToString(ArrayString, sValue)
sValue = Trim(sValue.Replace("§", ""))
End If
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
' ricevo un valore in inches
Select Case OptionModule.m_SelectedMeasureUnit
Case ConstGen.MM ' se la configurazione è inches non faccio conversioni
If StringToDouble(sValue, dVal) Then
Return sValue
Else
Return "0.0000"
End If
Case ConstGen.VAL_INCHES ' se la configurazione è in mm faccio la conevrsione
If MmToInches(sValue) Then
Return sValue
Else
Return "0.0000"
End If
End Select
ElseIf sValue.Contains("(") And sValue.Contains(")") And (Not sValue.Contains("inch") Or Not sValue.Contains("mm")) Then
'sValue = Regex.Match(sValue, "\s*\((.*?)\s*\)\s*\.*").Groups(1).Value
If String.IsNullOrEmpty(sValue) Then Return "0.0000"
' ricevo un valore in mm
@@ -353,7 +378,7 @@ Public Module Utility
Friend Function MmToInches(ByRef sMeasure As String) As Boolean
Dim dVal As Double = 0.0
If Not StringToDouble(sMeasure, dVal) Then Return False
dVal = dVal / ONEINCH
'dVal = dVal / ONEINCH
sMeasure = LenToString(dVal, 4)
Return True
End Function
@@ -379,6 +404,10 @@ Public Module Utility
' non eseguo nessun tipo di conversione
Return True
Else
' la configurazione è già in mm quindi non devo convertire
If OptionModule.m_IsMM Then
Return True
End If
Return InchesToMm(sMeasure)
End If
Return False
@@ -417,7 +446,7 @@ Public Module Utility
End If
ElseIf OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES And OptionModule.m_IsMM Then
' Discordi
If StringToLen(sItems, dDefaultValue) AndAlso dDefaultValue < dControlValue Then
If StringToDouble(sItems, dDefaultValue) AndAlso dDefaultValue < dControlValue Then
MmToInches(sItems)
Return True
End If
@@ -525,9 +554,9 @@ Public Module Utility
sMyVal = sMyVal.Replace("H", "(DGD.dH/25.4)")
sMyVal = sMyVal.Replace("T", "(DGD.dT/25.4)")
Else
sMyVal = sMyVal.Replace("W", "DGD.dW")
sMyVal = sMyVal.Replace("H", "DGD.dH")
sMyVal = sMyVal.Replace("T", "DGD.dT")
sMyVal = sMyVal.Replace("W", "(DGD.dW)")
sMyVal = sMyVal.Replace("H", "(DGD.dH)")
sMyVal = sMyVal.Replace("T", "(DGD.dT)")
End If
End If
Return sMyVal
@@ -536,16 +565,25 @@ Public Module Utility
Friend Function ConvertToDGD(sTypeVar As String, sValue As String) As String
Dim sMyVal As String = sValue
' se testo numerico, eseguo opportunbe conversioni per H,W e T
If sTypeVar = ConstGen.INCHES Or sTypeVar = ConstGen.MM Then
If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
Else
sMyVal = sMyVal.Replace("DGD.dW", "W")
sMyVal = sMyVal.Replace("DGD.dH", "H")
sMyVal = sMyVal.Replace("DGD.dT", "T")
End If
'If sTypeVar = ConstGen.INCHES Or sTypeVar = ConstGen.MM Then
' If OptionModule.m_SelectedMeasureUnit = ConstGen.VAL_INCHES Then
' sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
' sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
' sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
' Else
' sMyVal = sMyVal.Replace("DGD.dW", "W")
' sMyVal = sMyVal.Replace("DGD.dH", "H")
' sMyVal = sMyVal.Replace("DGD.dT", "T")
' End If
'End If
If sMyVal.Contains("25.4") Then
sMyVal = sMyVal.Replace("(DGD.dW/25.4)", "W")
sMyVal = sMyVal.Replace("(DGD.dH/25.4)", "H")
sMyVal = sMyVal.Replace("(DGD.dT/25.4)", "T")
Else
sMyVal = sMyVal.Replace("DGD.dW", "W")
sMyVal = sMyVal.Replace("DGD.dH", "H")
sMyVal = sMyVal.Replace("DGD.dT", "T")
End If
Return sMyVal
End Function