Compare commits

...

4 Commits

Author SHA1 Message Date
Nicola Pievani 5f71f7dfa3 Gestione chiave di rete 2024-05-10 16:13:46 +02:00
Nicola Pievani b16d860805 Migliorata gestione unità di misura 2024-05-07 15:59:12 +02:00
Nicola Pievani 34472efbc2 Gestione errore 'Rabbet.frame' non trovato 2024-04-08 10:14:31 +02:00
Nicola Pievani 9edda7ead3 Migliorata gestione unità di misura mm 2024-02-21 16:19:05 +01:00
8 changed files with 150 additions and 42 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
+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"
+37 -13
View File
@@ -1876,7 +1876,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 +2013,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 +2052,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 +2105,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 +2157,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, 2605, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2605, 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.5.1")>
<Assembly: AssemblyFileVersion("2.6.5.1")>
+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)
+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"
+51 -13
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
@@ -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