Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1aa30cb695 | |||
| 30497d3ee6 | |||
| 0f8a2634bd | |||
| ef0dc65d9d | |||
| f968341f72 | |||
| beea154999 | |||
| eaf753646a | |||
| d73000bdd7 | |||
| 5aa4d596d8 | |||
| ba2ce76713 | |||
| c66589b38d | |||
| 74b72e774e | |||
| 9e07561399 | |||
| 42ba2f7015 |
@@ -2045,7 +2045,7 @@ Public Class Assembly
|
||||
|
||||
' cerco il nome della componente da associare FrameFile
|
||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
||||
If Path.GetExtension(CurrDoorHArdwareFile) <> NGE_EXTENSION Then
|
||||
If Path.GetExtension(CurrDoorHArdwareFile).ToLower <> NGE_EXTENSION Then
|
||||
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||
End If
|
||||
' cerco il campo [Match file] nel file lua della componente
|
||||
@@ -2197,7 +2197,7 @@ Public Class Assembly
|
||||
|
||||
' cerco il nome della componente da associare FrameFile
|
||||
Dim CurrDoorHArdwareFile As String = CurrCompo.CompoType.Path & "\" & CurrCompo.TemplateSelItem
|
||||
If Path.GetExtension(CurrDoorHArdwareFile) <> NGE_EXTENSION Then
|
||||
If Path.GetExtension(CurrDoorHArdwareFile).ToLower <> NGE_EXTENSION Then
|
||||
CurrDoorHArdwareFile &= LUA_EXTENSION
|
||||
End If
|
||||
' cerco il campo [Match file] nel file lua della componente
|
||||
|
||||
@@ -367,13 +367,12 @@ Public Class AssemblyManagerVM
|
||||
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
|
||||
Continue For
|
||||
If Path.GetExtension(DDFArray(IndexFile)).ToLower = DDF_EXTENSION Then
|
||||
Dim NewAssembly As New AssemblyName
|
||||
NewAssembly.Name = DDFArray(IndexFile)
|
||||
NewAssembly.IsModified = False
|
||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
||||
End If
|
||||
Dim NewAssembly As New AssemblyName
|
||||
NewAssembly.Name = DDFArray(IndexFile)
|
||||
NewAssembly.IsModified = False
|
||||
Map.refAssemblyManagerVM.CurrProject.AssemblyList.Add(NewAssembly)
|
||||
Next
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
Try
|
||||
@@ -1019,6 +1018,7 @@ Public Class AssemblyManagerVM
|
||||
' TERMINO TUTTO SUBITO
|
||||
EgtOutLog("Scrittura file '.ddf' terminata")
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.Shutdown(0)
|
||||
Return True
|
||||
End If
|
||||
@@ -1655,8 +1655,8 @@ Public Class AssemblyManagerVM
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(FilePath, Trim(FilePath))
|
||||
' Controllo se il nome della porta ha estensione
|
||||
If Path.HasExtension(SaveFileDialog.FileName) Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName)
|
||||
If Not sExtension.ToLower = DDF_EXTENSION Then
|
||||
Dim sExtension As String = Path.GetExtension(SaveFileDialog.FileName).ToLower
|
||||
If Not sExtension = DDF_EXTENSION Then
|
||||
SaveFileDialog.FileName = SaveFileDialog.FileName.Replace(sExtension, DDF_EXTENSION)
|
||||
End If
|
||||
Else
|
||||
|
||||
@@ -133,10 +133,9 @@ Public Class CompoType
|
||||
End Sub
|
||||
|
||||
Public Function LoadListTemplate() As Boolean
|
||||
FolderList.Clear()
|
||||
m_HardwareFolderList.Clear()
|
||||
m_FrameFolderList.Clear()
|
||||
m_FolderList.Clear()
|
||||
m_FrameFolderList.Clear()
|
||||
m_HardwareFolderList.Clear()
|
||||
GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -43,6 +43,7 @@ Module ConstIni
|
||||
Public Const K_REFRESHTIME As String = "RefreshTime"
|
||||
Public Const K_DDFVERSION As String = "DDFVersion"
|
||||
Public Const K_SAVEASSINGLEDOOR As String = "SaveAsSingleDoor"
|
||||
Public Const K_READONLY As String = "ReadOnly"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
+2
-1
@@ -63,7 +63,8 @@ Friend Module DdfFile
|
||||
DdfFileContent.Add("#EGTDOORCREATOR")
|
||||
Dim Config As String = IniFile.m_sDoorsDirPath
|
||||
Config = Path.GetFileName(Config)
|
||||
DdfFileContent.Add("#Config: " & Config)
|
||||
' versione 2.7d1: non esiste un sottodirettorio di Doors allora non stampo il nome della configurazione
|
||||
If Config <> "Doors" Then 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)
|
||||
|
||||
+20
-35
@@ -1917,6 +1917,22 @@ Public Class Compo
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' Conversione da meta espressione in file lua ad espressione valida in interfaccia
|
||||
Private Function ConvertFromLua( sValue As String) As String
|
||||
' sistemo variabili
|
||||
sValue = sValue.Replace( "(DGD.dW)", "W")
|
||||
sValue = sValue.Replace( "(DGD.dW/25.4)", "W")
|
||||
sValue = sValue.Replace( "(DGD.dT)", "T")
|
||||
sValue = sValue.Replace( "(DGD.dT/25.4)", "T")
|
||||
sValue = sValue.Replace( "(DGD.dH)", "H")
|
||||
sValue = sValue.Replace( "(DGD.dH/25.4)", "H")
|
||||
' elimino inch(...) o mm(...)
|
||||
sValue = RegexFunction.Brackets(sValue)
|
||||
' sistemo per unità in interfaccia
|
||||
Utility.ConvertCurrentUnitMeasure(sValue)
|
||||
return sValue
|
||||
End Function
|
||||
|
||||
' carico il parametro letto
|
||||
Private Function LoadParamFromLua(sValue As String, ByRef CurrCompoParam As CompoParam) As Boolean
|
||||
If TypeOf CurrCompoParam Is TextBoxOnOffParam Then
|
||||
@@ -1926,29 +1942,11 @@ Public Class Compo
|
||||
End If
|
||||
Dim sItems() As String = sValue.Split(";"c)
|
||||
' estraggo il primo valore: -- NomeParamOnOff = inch(0.6); 0
|
||||
sValue = sItems(0)
|
||||
Dim ReadValue = RegexFunction.Brackets(sValue)
|
||||
If ReadValue.Contains("DGD.dW") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "W")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dT") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "T")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dH") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "H")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
Utility.ConvertCurrentUnitMeasure(ReadValue)
|
||||
Dim ReadValue As String = ConvertFromLua( sItems(0))
|
||||
TempParam.SetValue(ReadValue)
|
||||
' verifico se deve essere attivata
|
||||
If sItems.Count > 1 Then
|
||||
If sItems(1).Trim <> "0" Then
|
||||
TempParam.SetIsActive(True)
|
||||
Else
|
||||
TempParam.SetIsActive(False)
|
||||
End If
|
||||
If sItems.Count > 1 AndAlso sItems(1).Trim = "0" Then
|
||||
TempParam.SetIsActive(False)
|
||||
Else
|
||||
TempParam.SetIsActive(True)
|
||||
End If
|
||||
@@ -1959,20 +1957,7 @@ Public Class Compo
|
||||
If Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage Then
|
||||
If Not TempParam.EnableCopy Then Return False
|
||||
End If
|
||||
Dim ReadValue = RegexFunction.Brackets(sValue)
|
||||
If ReadValue.Contains("DGD.dW") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "W")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dT") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "T")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
If ReadValue.Contains("DGD.dH") Then
|
||||
ReadValue = sValue.Replace(ReadValue & ")", "H")
|
||||
ReadValue = RegexFunction.Brackets(ReadValue)
|
||||
End If
|
||||
Utility.ConvertCurrentUnitMeasure(ReadValue)
|
||||
Dim ReadValue As String = ConvertFromLua( sValue)
|
||||
TempParam.SetValue(ReadValue)
|
||||
Return True
|
||||
ElseIf TypeOf CurrCompoParam Is ComboBoxOnOffParam Then
|
||||
|
||||
+20
-5
@@ -1197,9 +1197,13 @@ Public Class Part
|
||||
End Get
|
||||
Set(value As Compo)
|
||||
m_SelCompo = value
|
||||
MarkCompoInScena()
|
||||
' La selezione della componente è demandata all'evento click (PartPageV)
|
||||
'MarkCompoInScena()
|
||||
End Set
|
||||
End Property
|
||||
Public Sub SetSelCompo()
|
||||
MarkCompoInScena()
|
||||
End Sub
|
||||
|
||||
#Region "AddCompo"
|
||||
|
||||
@@ -1421,7 +1425,7 @@ Public Class Part
|
||||
NewCompo.SetSelBrand(NewCompo.BrandListPart(0))
|
||||
' Carico il primo modello della lista
|
||||
Dim SelItemIndex As Integer = 0
|
||||
While SelItemIndex < NewCompo.FileList.Count - 1 AndAlso Path.HasExtension(NewCompo.FileList(SelItemIndex)) AndAlso Path.GetExtension(NewCompo.FileList(SelItemIndex)) = NGE_EXTENSION
|
||||
While SelItemIndex < NewCompo.FileList.Count - 1 AndAlso Path.HasExtension(NewCompo.FileList(SelItemIndex)) AndAlso Path.GetExtension(NewCompo.FileList(SelItemIndex)).ToLower = NGE_EXTENSION
|
||||
SelItemIndex += 1
|
||||
End While
|
||||
If SelItemIndex < NewCompo.FileList.Count Then
|
||||
@@ -1533,6 +1537,8 @@ Public Class Part
|
||||
DdfFile.GetOrderedListSameCompo(TempList)
|
||||
' ontengo la posizione prevista nella grafica
|
||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo)
|
||||
' recupero il direttorio della componente
|
||||
Dim sDirCompo As String = Path.GetFileName(m_SelCompo.CompoType.Path)
|
||||
' recupero la lista ordinata
|
||||
Dim sCompoName As String = m_SelCompo.TemplateSelItem
|
||||
' recupero il primo part disponibile
|
||||
@@ -1541,13 +1547,22 @@ Public Class Part
|
||||
Dim IndexLay As Integer = 0
|
||||
While nIdLay <> GDB_ID.NULL
|
||||
Dim sInfoPath As String = String.Empty
|
||||
If EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
||||
Dim sFileName As String = String.Empty
|
||||
Dim sFileDir As String = String.Empty
|
||||
If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso
|
||||
EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then
|
||||
sInfoPath = sFileDir & sFileName
|
||||
End If
|
||||
End If
|
||||
If Not String.IsNullOrWhiteSpace( sInfoPath) Then
|
||||
Dim sNamePath As String = sInfoPath
|
||||
If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then
|
||||
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso
|
||||
sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||
EgtSetMark(nIdLay)
|
||||
m_SelCompo.SetMark()
|
||||
Exit While
|
||||
ElseIf sNamePath.Contains(sCompoName) And IndexLay < IndexInList Then
|
||||
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay < IndexInList Then
|
||||
IndexLay = IndexLay + 1
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -31,4 +31,12 @@
|
||||
|
||||
End Sub
|
||||
|
||||
' Forzo la selzione della compo corrente
|
||||
Private Sub DoorParamsItemsControl_Click() Handles DoorParamsItemsControl.MouseLeftButtonUp
|
||||
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Map.refPartPageVM.CurrPart.SetSelCompo()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -481,11 +481,12 @@ Public Class Hardware
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' elimina il file temporaneo CurrHardware.lua
|
||||
' elimina il file temporaneo CurrHardware.lua (se esiste anche CurrHardware.luae)
|
||||
Public Function DeleteTempFile() As Boolean
|
||||
If String.IsNullOrWhiteSpace(CurrHardwareFilePath) Then Return False
|
||||
Try
|
||||
File.Delete(CurrHardwareFilePath)
|
||||
if File.Exists(CurrHardwareFilePath & "e") Then File.Delete(CurrHardwareFilePath & "e")
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
Return True
|
||||
@@ -1600,7 +1601,7 @@ Public Class Hardware
|
||||
bNewHardware = False
|
||||
Dim ErrorMsg As String = String.Empty
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
|
||||
' scrivo tutto sul file corrente
|
||||
Try
|
||||
@@ -1790,19 +1791,20 @@ Public Class Hardware
|
||||
Map.refHardwarePageVM.GenericPart.CompoList.Clear()
|
||||
If String.IsNullOrWhiteSpace(Map.refHardwarePageVM.CurrHardware.SelTemplate) Then Return False
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
' costruisco il nome del percorso del file corrente
|
||||
Dim ModelDir As String = String.Empty
|
||||
' costruisco il percorso del file temporaneo nella cartella corrente:
|
||||
Dim CurrDirectoryInModelDir As String = Path.GetDirectoryName(Map.refHardwarePageVM.CurrHardware.SelTemplate)
|
||||
CurrDirectoryInModelDir = Trim(CurrDirectoryInModelDir.Replace(m_HardwareGeneral.Path, ""))
|
||||
'If m_SelBrand.ModelDir <> RegexFunction.ModelTemplate(m_HardwareGeneral.Path) Then ModelDir = m_SelBrand.ModelDirGraphic & "\"
|
||||
If m_SelBrand.ModelDir <> m_HardwareGeneral.Path Then ModelDir = m_SelBrand.ModelDirGraphic & "\"
|
||||
If Not String.IsNullOrWhiteSpace(CurrDirectoryInModelDir) Then ModelDir = ModelDir & CurrDirectoryInModelDir & "\"
|
||||
Dim sTempFileHardw As String = m_HardwareGeneral.Path & "\" & ModelDir & TEMP_FILE_HARDWARE
|
||||
' salvo il file
|
||||
File.WriteAllLines(sTempFileHardw, NewFileContent)
|
||||
'LoadSwingFromTemplate()
|
||||
' salvo eventuale file associato luae
|
||||
Dim sLuaeFile As String = m_HardwareGeneral.Path & "\" & ModelDir & Map.refHardwarePageVM.CurrHardware.SelTemplate & ".luae"
|
||||
If File.Exists(sLuaeFile) Then File.Copy(sLuaeFile, sTempFileHardw & "e")
|
||||
' aggiungo la componente
|
||||
Map.refHardwarePageVM.GenericPart.AddNewHardware(m_HardwareGeneral, ModelDir & Path.GetFileNameWithoutExtension(TEMP_FILE_HARDWARE))
|
||||
CurrHardwareFilePath = sTempFileHardw
|
||||
@@ -1819,7 +1821,7 @@ Public Class Hardware
|
||||
If Not File.Exists(TemplFile) Then Return False
|
||||
Dim FileContent() As String = File.ReadAllLines(TemplFile)
|
||||
Dim NewFileContent As New ObservableCollection(Of String)
|
||||
If Not WriteFile(NewFileContent) Then Return False
|
||||
If Not ReadFile(NewFileContent) Then Return False
|
||||
' costruisco il nome del percorso del file corrente
|
||||
Dim CurrConfig As String = m_HardwareGeneral.Path & "\" & CONFIGINI_FILE_NAME
|
||||
Dim CurrItemPath As String = CurrPath()
|
||||
@@ -1831,7 +1833,7 @@ Public Class Hardware
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function WriteFile(ByRef NewFileContent As ObservableCollection(Of String)) As Boolean
|
||||
Private Function ReadFile(ByRef NewFileContent As ObservableCollection(Of String)) As Boolean
|
||||
For IndexName As Integer = 0 To m_GroupChapterName.Count - 1
|
||||
CascadedChapter(m_GroupChapters, m_GroupChapterName(IndexName))
|
||||
Next
|
||||
|
||||
@@ -71,8 +71,8 @@ Friend Class MainWindowModel
|
||||
EgtSetLockId(sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2703, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2703, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2712, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2712, 1, IniFile.m_nKeyOptions)
|
||||
' Leggo e imposto livello utilizzatore
|
||||
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
|
||||
'Inizializzazione generale di EgtInterface
|
||||
@@ -118,8 +118,6 @@ Friend Class MainWindowModel
|
||||
EgtLuaRequire(sLuaBaseLib)
|
||||
' Imposto path IniFile
|
||||
EgtSetIniFile(IniFile.m_sIniFile)
|
||||
' Imposto la modalità di lettura dei file ddf
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -132,7 +130,7 @@ Friend Class MainWindowModel
|
||||
Private Sub ManageIstance()
|
||||
Dim bCreated As Boolean
|
||||
Try
|
||||
m_objMutex = New Mutex(False, "Global\EgtDOORCreator", bCreated)
|
||||
m_objMutex = New Mutex(True, "Global\EgtDOORCreator", bCreated)
|
||||
Catch
|
||||
bCreated = False
|
||||
End Try
|
||||
@@ -141,20 +139,36 @@ Friend Class MainWindowModel
|
||||
m_nInstance = 1
|
||||
' Aggiorno stato istanze attive
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString)
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
Else
|
||||
' Leggo il massimo numero di istanze ammesse
|
||||
Const MAX_INST As Integer = 32
|
||||
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
|
||||
nMaxInst = Max(1, Min(nMaxInst, 32))
|
||||
' Cerco il primo indice di istanza libero (max 32)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se l'indice supera il massimo
|
||||
If m_nInstance > nMaxInst Then
|
||||
nMaxInst = Max(1, Min(nMaxInst, MAX_INST))
|
||||
' Richiedo il possesso del mutex
|
||||
Dim bOk As Boolean = False
|
||||
If m_objMutex.WaitOne(500) Then
|
||||
' Cerco il primo indice di istanza libero (max 32)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
m_nInstance = 1
|
||||
Dim nMask As Integer = 1
|
||||
While (nTmp And nMask) <> 0 And m_nInstance <= m_nInstance
|
||||
m_nInstance += 1
|
||||
nMask *= 2
|
||||
End While
|
||||
' Se nuova istanza nei limiti
|
||||
If m_nInstance <= nMaxInst Then
|
||||
bOk = True
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
' Rilascio il possesso del mutex
|
||||
m_objMutex.ReleaseMutex()
|
||||
End If
|
||||
' Se non è possibile continuare
|
||||
If Not bOk Then
|
||||
' porto in primo piano la prima istanza
|
||||
Dim bFound As Boolean = False
|
||||
' processi del programma a 32 bit
|
||||
@@ -178,13 +192,21 @@ Friend Class MainWindowModel
|
||||
Next
|
||||
End If
|
||||
' esco dal programma
|
||||
End
|
||||
Environment.Exit(1)
|
||||
End If
|
||||
' Aggiorno stato istanze attive
|
||||
nTmp += (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ReleaseInstance()
|
||||
' Aggiorno istanze usate
|
||||
Dim bOk As Boolean = m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (m_nInstance - 1))
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
If bOk Then m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che cancella tutti i file in un direttorio o lo crea se non esiste
|
||||
|
||||
@@ -8,7 +8,11 @@ Public Class MainWindowVM
|
||||
|
||||
' Modello del MainWindow (classe vera e propria)
|
||||
Private m_MainWindowModel As New MainWindowModel
|
||||
|
||||
Friend ReadOnly Property MainWindowModel As MainWindowModel
|
||||
Get
|
||||
Return m_MainWindowModel
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Instance As Integer
|
||||
Get
|
||||
Return m_MainWindowModel.m_nInstance
|
||||
@@ -435,7 +439,6 @@ Public Class MainWindowVM
|
||||
End If
|
||||
Map.refHardwarePageVM.CurrHardware.DeleteTempFile()
|
||||
End If
|
||||
Utility.UnLockDir()
|
||||
Case Else
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified Then
|
||||
Dim sText As String = String.Format(EgtMsg(50109), Path.GetFileNameWithoutExtension(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name))
|
||||
@@ -467,9 +470,15 @@ Public Class MainWindowVM
|
||||
Not String.IsNullOrWhiteSpace(Map.refAssemblyManagerVM.CurrProject.Name) Then
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.Name)
|
||||
End If
|
||||
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
Application.Current.MainWindow.Close()
|
||||
' Libero eventuale porta bloccata
|
||||
Utility.UnLockDir()
|
||||
' Aggiorno istanze usate
|
||||
m_MainWindowModel.ReleaseInstance()
|
||||
' Chiudo la finestra principale del programma
|
||||
Application.Current.MainWindow.Close()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Imports System.Windows
|
||||
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtDOORCreator")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2026 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
|
||||
@@ -72,5 +72,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.3.3")>
|
||||
<Assembly: AssemblyFileVersion("2.7.3.3")>
|
||||
<Assembly: AssemblyVersion("3.1.1.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.1.1")>
|
||||
|
||||
@@ -246,7 +246,7 @@ Friend Module OptionModule
|
||||
' verifico se il programma è in modalità di sola lettura DDF
|
||||
If (IniFile.m_nKeyOptions And KEY_OPT.READ_ONLY) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, "ReadOnly", 0) <> 0 Then
|
||||
ElseIf GetMainPrivateProfileInt(S_GENERAL, K_READONLY, 0) <> 0 Then
|
||||
OptionModule.ReadOnlyDDF = True
|
||||
Else
|
||||
OptionModule.ReadOnlyDDF = False
|
||||
|
||||
@@ -2079,6 +2079,7 @@ Public Class OptionsVM
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
' chiudo il programma e lo riavvio
|
||||
Map.refMainWindowVM.CloseApplication()
|
||||
@@ -2095,6 +2096,7 @@ Public Class OptionsVM
|
||||
Dim sVal As String = ""
|
||||
EgtLuaGetGlobStringVar("CCD.NewMachineName", sVal)
|
||||
OptionModule.m_CurrentMachine = sVal
|
||||
WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
|
||||
EgtLuaResetGlobVar("CCD")
|
||||
End If
|
||||
End If
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ Public Class OrderVM
|
||||
Private Function VerifyNotIsNothing() As Boolean
|
||||
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse
|
||||
IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly) OrElse
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then
|
||||
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count < 1 Then
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
|
||||
@@ -704,7 +704,7 @@ Public Class ProjectManagerVM
|
||||
' salvo il nome completo del file
|
||||
sFilePathComplete = fd.FileName
|
||||
' salvo l'estensione dell'ultimo progetto aperto
|
||||
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName))
|
||||
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName).ToLower)
|
||||
' se esiste un file in lettura con questo nome allora blocco tutto
|
||||
If Utility.IsFileLocked(sFilePath, Path.GetFileNameWithoutExtension(sFilePathComplete)) Then
|
||||
If Not IsNothing(Map.refAssemblyManagerVM.CurrProject) AndAlso Not IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) Then
|
||||
@@ -1008,6 +1008,7 @@ Public Class ProjectManagerVM
|
||||
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
|
||||
If OptionModule.AdjustDDT Then
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.Shutdown(3)
|
||||
End If
|
||||
Return
|
||||
@@ -1334,7 +1335,7 @@ Public Class ProjectManagerVM
|
||||
Case MessageBoxResult.Yes
|
||||
For IndexFile As Integer = 0 To Map.refAssemblyManagerVM.CurrProject.AssemblyList.Count - 1
|
||||
' controllo che abbia estensione ddf
|
||||
If Path.GetExtension(Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name) = ".ddf" Then
|
||||
If Path.GetExtension(Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name).ToLower = ".ddf" Then
|
||||
Dim SouFile As String = Map.refAssemblyManagerVM.CurrProject.AssemblyList(IndexFile).Name
|
||||
Dim DestFile As String = Path.Combine(MachinProject, Path.GetFileName(SouFile))
|
||||
Try
|
||||
@@ -1469,9 +1470,6 @@ Public Class ProjectManagerVM
|
||||
' ripulisco il nome della porta (cancello tutto il percorso del file lasciando solo il nome del file)
|
||||
For DDFIndex = 0 To DDFFileArray.Count - 1
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)).ToLower = ".ddf" Then
|
||||
If Path.GetExtension(DDFFileArray(DDFIndex)) <> DDF_EXTENSION Then
|
||||
Continue For
|
||||
End If
|
||||
' lo aggiungo alla lista delle porte
|
||||
Dim Local_Assembly As New AssemblyName
|
||||
Local_Assembly.Name = DDFFileArray(DDFIndex)
|
||||
|
||||
+2
-1
@@ -39,7 +39,7 @@ Module RegexFunction
|
||||
' Restituisce il valore scritto tra le parentesi tonde ()
|
||||
Friend Function Brackets(sLine As String) As String
|
||||
If Not sLine.Contains("("c) AndAlso Not sLine.Contains(")"c) Then Return sLine
|
||||
Return Regex.Match(sLine, "\s*\(\s*(.*?\b)\s*\).*").Groups(1).Value
|
||||
Return Regex.Match(sLine, "\s*\(\s*(.*\b)\s*\).*").Groups(1).Value
|
||||
End Function
|
||||
|
||||
' restituisce quello che segue l'uguale assegnata una parola chiave tra i due trattini e 'uguale
|
||||
@@ -111,6 +111,7 @@ Module RegexFunction
|
||||
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LAUNCHER, (OptionModule.m_SelectedOptionLauncher + LoOpenOnce).ToString())
|
||||
' esco dall'applicazione
|
||||
EgtExit()
|
||||
Map.refMainWindowVM.MainWindowModel.ReleaseInstance()
|
||||
Application.Current.MainWindow.Close()
|
||||
End
|
||||
Else
|
||||
|
||||
@@ -442,36 +442,34 @@ Public Class SceneManagerVM
|
||||
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
|
||||
' Se misurazione attiva
|
||||
If Map.refInstrumentPanelVM.ActualDistanceState Then Return
|
||||
' se non esiste una porta corrente allora esco
|
||||
If IsNothing(Map.refPartPageVM) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then
|
||||
Return
|
||||
End If
|
||||
Dim LocalCompoList As ObservableCollection(Of Compo) = Map.refPartPageVM.CurrPart.CompoList
|
||||
' Ripulisco la scena da i Mark
|
||||
' Se non esiste una porta corrente allora esco
|
||||
If IsNothing(Map.refPartPageVM) OrElse IsNothing(Map.refPartPageVM.CurrPart) Then Return
|
||||
' Ripulisco la scena dai Mark
|
||||
Map.refPartPageVM.CurrPart.ResetAllMark()
|
||||
' Se la lista dei componenti è vuota allora esco
|
||||
If Map.refPartPageVM.CurrPart.CompoList.Count < 1 Then
|
||||
Dim LocalCompoList As ObservableCollection(Of Compo) = Map.refPartPageVM.CurrPart.CompoList
|
||||
If LocalCompoList.Count < 1 Then
|
||||
EgtDraw()
|
||||
Return
|
||||
End If
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr)
|
||||
'If Not Map.refInstrumentPanelVM.ActualDistanceState Then
|
||||
' Verifico se selezionato curva
|
||||
' Recupero gli oggetti nel mirino di selezione
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
' Ciclo su questi oggetti
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
If EgtGetType(nId) = GDB_TY.CRV_COMPO Or EgtGetType(nId) = GDB_TY.CRV_ARC Or EgtGetType(nId) = GDB_TY.CRV_LINE Then
|
||||
Dim nIdParent As Integer = EgtGetParent(nId)
|
||||
Dim sNameLayer As String = String.Empty
|
||||
EgtGetName(nIdParent, sNameLayer)
|
||||
If Not sNameLayer.StartsWith("AUX") Or Not sNameLayer.StartsWith("SOLID") Or Not sNameLayer.StartsWith("DIM") Then
|
||||
If Not ( sNameLayer.StartsWith("AUX") OrElse sNameLayer.StartsWith("SOLID") OrElse sNameLayer.StartsWith("DIM")) Then
|
||||
' scorro l'elenco dei componenti fino a trovare un riscontro tra i nomi e i parametri
|
||||
For Each ItemCompo As Compo In LocalCompoList
|
||||
If MatchCompoFromScena(nIdParent, ItemCompo, LocalCompoList) Then Exit While
|
||||
If MatchCompoFromScene(nIdParent, ItemCompo, LocalCompoList) Then Exit While
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
@@ -482,59 +480,74 @@ Public Class SceneManagerVM
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Function MatchCompoFromScena(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean
|
||||
If IsNothing(CurrCompo) Then Return True
|
||||
Private Function MatchCompoFromScene(nIdLay As Integer, CurrCompo As Compo, CompoList As ObservableCollection(Of Compo)) As Boolean
|
||||
|
||||
If IsNothing(CurrCompo) Then Return False
|
||||
|
||||
' recupero il direttorio del componente
|
||||
Dim sDirCompo As String = Path.GetFileName(CurrCompo.CompoType.Path)
|
||||
' recupero il nome del componente
|
||||
Dim sCompoName As String = CurrCompo.TemplateSelItem
|
||||
' recupero il nome della componente selezionata con MouseOver
|
||||
Dim sInfoPath As String = String.Empty
|
||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then
|
||||
Dim sFileName As String = String.Empty
|
||||
Dim sFileDir As String = String.Empty
|
||||
If EgtGetInfo(nIdLay, "CustGeomFile", sFileName) AndAlso
|
||||
EgtGetInfo(nIdLay, "CustGeomPath", sFileDir) Then
|
||||
sInfoPath = sFileDir & sFileName
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
' verifico validità
|
||||
If Not ( sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 AndAlso
|
||||
sInfoPath.IndexOf( sDirCompo, StringComparison.InvariantCultureIgnoreCase) >= 0) Then
|
||||
Return False
|
||||
End If
|
||||
' recupero la lista dei compo dello stesso tipo
|
||||
Dim TempList As ObservableCollection(Of Compo) = DdfFile.GetCurrentListSameCompoType(CompoList, CurrCompo.CompoType.DDFName)
|
||||
' recupero la lista dei compo con lo stesso nome
|
||||
TempList = DdfFile.GetCurrentListSameCompoDDFName(TempList, CurrCompo.SelFile, CurrCompo.SelBrandPart)
|
||||
' riordino la lista appena trovata secondo le regole di stampa DDF
|
||||
DdfFile.GetOrderedListSameCompo(TempList)
|
||||
|
||||
' cerco ordine layer
|
||||
Dim nCounter As Integer = 1
|
||||
Dim nCurrLayId As Integer = nIdLay
|
||||
While nCurrLayId <> GDB_ID.NULL
|
||||
nCurrLayId = EgtGetNext(nCurrLayId)
|
||||
Dim LocalsPath As String = String.Empty
|
||||
Dim LocalsName As String = String.Empty
|
||||
Dim LocalsDir As String = String.Empty
|
||||
If ( EgtGetInfo(nCurrLayId, "Path", LocalsPath) AndAlso
|
||||
sInfoPath.Trim = LocalsPath.Trim) OrElse
|
||||
( EgtGetInfo(nCurrLayId, "CustGeomFile", LocalsName) AndAlso
|
||||
EgtGetInfo(nCurrLayId, "CustGeomPath", LocalsDir) AndAlso
|
||||
sInfoPath.Trim = LocalsDir.Trim & LocalsName.Trim) Then
|
||||
nCounter += 1
|
||||
End If
|
||||
End While
|
||||
Dim IndexLay As Integer = Math.Max( TempList.Count - nCounter, 0)
|
||||
|
||||
' ottengo la posizione prevista nella grafica
|
||||
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, CurrCompo)
|
||||
' recupero la lista ordinata
|
||||
Dim sCompoName As String = CurrCompo.TemplateSelItem
|
||||
' oridnamento del layer
|
||||
Dim IndexLay As Integer = -1
|
||||
' recupero il nome della comaponente selezionata con MouseOver
|
||||
Dim sInfoPath As String = String.Empty
|
||||
If Not EgtGetInfo(nIdLay, "Path", sInfoPath) Then Return True
|
||||
' Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath)
|
||||
Dim sNamePath As String = sInfoPath
|
||||
'If sNamePath = sCompoName Then
|
||||
If sNamePath.Contains(sCompoName) Then
|
||||
Dim nCurrLayId As Integer = nIdLay
|
||||
Dim nCounter As Integer = 1
|
||||
While nCurrLayId <> GDB_ID.NULL
|
||||
nCurrLayId = EgtGetNext(nCurrLayId)
|
||||
Dim LocalsPath As String = String.Empty
|
||||
If EgtGetInfo(nCurrLayId, "Path", LocalsPath) Then
|
||||
If sNamePath.Trim = LocalsPath.Trim Then
|
||||
nCounter += 1
|
||||
End If
|
||||
End If
|
||||
End While
|
||||
IndexLay = TempList.Count - nCounter
|
||||
End If
|
||||
' la compo passata non ha lo stesso nome, quindi mi aspetto un'altra compo
|
||||
If IndexLay = -1 Then Return False
|
||||
|
||||
While IndexInList < TempList.Count And nIdLay <> GDB_ID.NULL
|
||||
' recupero l'ordinamento del layer
|
||||
If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then
|
||||
If sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexLay = IndexInList Then
|
||||
EgtSetMark(nIdLay)
|
||||
' evidenzio la compo corrente
|
||||
TempList(IndexInList).SetMark()
|
||||
' ricerca terminata correttamente
|
||||
Return True
|
||||
Exit While
|
||||
ElseIf sNamePath.Contains(sCompoName) And IndexInList < IndexLay Then
|
||||
ElseIf sInfoPath.IndexOf( sCompoName, StringComparison.InvariantCultureIgnoreCase) >= 0 And IndexInList < IndexLay Then
|
||||
IndexInList += 1
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End While
|
||||
' prova con un'altra compo
|
||||
|
||||
'non trovata
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
+36
-34
@@ -626,83 +626,85 @@ Public Module Utility
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub GetDirectoryCompoFiles(DirectoryPath As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
RecursiveGetDirectoryCompoFiles(DirectoryPath, DirectoryPath, FileList, bRemoveNge)
|
||||
End Sub
|
||||
|
||||
' csotruisco le liste dei file
|
||||
Friend Sub GetDirectoryCompoModel(HardwareDirPath As String, FolderList As ObservableCollection(Of CompoBrandDir), Optional FrameFolderList As ObservableCollection(Of CompoBrandDir) = Nothing, Optional HardwareFolderList As ObservableCollection(Of CompoBrandDir) = Nothing)
|
||||
'FrameFolderList = New ObservableCollection(Of CompoBrandDir)
|
||||
' costruisco le liste dei file
|
||||
Friend Sub GetDirectoryCompoModel(HardwareDirPath As String, FolderList As ObservableCollection(Of CompoBrandDir),
|
||||
Optional FrameFolderList As ObservableCollection(Of CompoBrandDir) = Nothing,
|
||||
Optional HardwareFolderList As ObservableCollection(Of CompoBrandDir) = Nothing)
|
||||
' Nome del direttorio dei componenti
|
||||
Dim BaseDirName As String = Path.GetFileName(HardwareDirPath)
|
||||
' Carico l'elenco dei file contenuti nei sottodirettori
|
||||
Dim FolderArray() As String = Directory.GetDirectories(HardwareDirPath)
|
||||
Dim CurrFolder As CompoBrandDir = Nothing
|
||||
For Each Folder In FolderArray
|
||||
Folder = Folder.Replace("/", "\")
|
||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, False)
|
||||
Dim CurrGenFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrGenFolder.ModelFileList, False)
|
||||
' genero le liste per il DoorCreator
|
||||
If CurrFolder.ModelFileList.Count > 0 Then
|
||||
If CurrGenFolder.ModelFileList.Count > 0 Then
|
||||
If Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
FrameFolderList.Add(CurrFolder)
|
||||
'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then HardwareFolderList.Add(CurrFolder)
|
||||
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrGenFolder)
|
||||
Else
|
||||
FolderList.Add(CurrFolder)
|
||||
FolderList.Add(CurrGenFolder)
|
||||
End If
|
||||
End If
|
||||
' genero le liste per l'HardwareManager
|
||||
CurrFolder = New CompoBrandDir(Folder, BaseDirName)
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
HardwareFolderList.Add(CurrFolder)
|
||||
Else
|
||||
' solo se non sono in modlità assemblato non carcico gli elenchi ".frame"
|
||||
If Not Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
HardwareFolderList.Add(CurrFolder)
|
||||
If Not IsNothing(HardwareFolderList) Then
|
||||
Dim CurrHardFolder As CompoBrandDir = New CompoBrandDir(Folder, BaseDirName)
|
||||
GetDirectoryCompoFiles(Folder, CurrHardFolder.ModelFileList, True)
|
||||
If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then
|
||||
HardwareFolderList.Add(CurrHardFolder)
|
||||
Else
|
||||
' solo se non sono in modalità assemblato non carico gli elenchi ".frame"
|
||||
If Not Folder.ToLower.Contains(FRAME_FOLDER) Then
|
||||
HardwareFolderList.Add(CurrHardFolder)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
GetDirectoryCompoFiles(Folder, CurrFolder.ModelFileList, True)
|
||||
Next
|
||||
' Carico l'elenco dei file contenuti nella radice del direttorio
|
||||
' Carico l'elenco dei file contenuti nel direttorio
|
||||
Dim FileArray() As String = Directory.GetFiles(HardwareDirPath)
|
||||
CurrFolder = Nothing
|
||||
Dim CurrFolder As CompoBrandDir = Nothing
|
||||
Dim CurrFrameFolder As CompoBrandDir = Nothing
|
||||
Dim CurrHardwareFolder As CompoBrandDir = Nothing
|
||||
For Each File In FileArray
|
||||
File = File.Replace("/", "\")
|
||||
If Not Path.GetExtension(File) = INI_EXTENSION And Not Path.GetExtension(File) = TEMPL_EXTENSION And
|
||||
(Path.GetExtension(File) = LUA_EXTENSION Or Path.GetExtension(File) = NGE_EXTENSION) And
|
||||
Dim sExt As String = Path.GetExtension(File).ToLower
|
||||
If (sExt = LUA_EXTENSION Or sExt = NGE_EXTENSION) And
|
||||
Not File.Contains(MATCHING_FILE_NAME) And Not File.ToLower().Contains("currhardware") Then
|
||||
If File.Contains(FRAME_FOLDER) Then
|
||||
If IsNothing(CurrFrameFolder) Then
|
||||
' CurrFrameFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName & FRAME_FOLDER)
|
||||
CurrFrameFolder = New CompoBrandDir(HardwareDirPath, BaseDirName & FRAME_FOLDER)
|
||||
FrameFolderList.Add(CurrFrameFolder)
|
||||
If Not IsNothing(FrameFolderList) Then FrameFolderList.Add(CurrFrameFolder)
|
||||
End If
|
||||
CurrFrameFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrFrameFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
Else
|
||||
If IsNothing(CurrFolder) Then
|
||||
' CurrFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
||||
CurrFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||
FolderList.Add(CurrFolder)
|
||||
End If
|
||||
CurrFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
If Not File.Contains(NGE_EXTENSION) Then
|
||||
If IsNothing(CurrHardwareFolder) Then
|
||||
' CurrHardwareFolder = New CompoBrandDir(Path.GetFileName(HardwareDirPath), BaseDirName)
|
||||
CurrHardwareFolder = New CompoBrandDir(HardwareDirPath, BaseDirName)
|
||||
HardwareFolderList.Add(CurrHardwareFolder)
|
||||
If Not IsNothing(HardwareFolderList) Then HardwareFolderList.Add(CurrHardwareFolder)
|
||||
End If
|
||||
CurrHardwareFolder.ModelFileList.Add(If(Path.GetExtension(File) = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
CurrHardwareFolder.ModelFileList.Add(If(Path.GetExtension(File).ToLower = NGE_EXTENSION, Path.GetFileName(File), Path.GetFileNameWithoutExtension(File)))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub GetDirectoryCompoFiles(DirectoryPath As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
RecursiveGetDirectoryCompoFiles(DirectoryPath, DirectoryPath, FileList, bRemoveNge)
|
||||
End Sub
|
||||
|
||||
Private Sub RecursiveGetDirectoryCompoFiles(DirectoryPath As String, BaseDirectory As String, ByRef FileList As ObservableCollection(Of String), bRemoveNge As Boolean)
|
||||
' File nei sottodirettori
|
||||
Dim SubDir() As String = Directory.GetDirectories(DirectoryPath)
|
||||
For Index = 0 To SubDir.Count - 1
|
||||
RecursiveGetDirectoryCompoFiles(SubDir(Index), BaseDirectory, FileList, bRemoveNge)
|
||||
Next
|
||||
' File nel direttorio
|
||||
Dim Files() As String = Directory.GetFiles(DirectoryPath)
|
||||
For Index = 0 To Files.Count - 1
|
||||
Dim FileExt As String = Path.GetExtension(Files(Index).ToLower())
|
||||
|
||||
Reference in New Issue
Block a user