Compare commits

...

35 Commits

Author SHA1 Message Date
Nicola Pievani 1a6a4ff228 Aggiornamento versione 2.7c1 2025-03-03 12:51:16 +01:00
Demetrio Cassarino aeba705637 -cambiato colore su toggle 2025-03-03 12:39:45 +01:00
Nicola Pievani 70737f3ad1 Aggiornamento versione 2025-02-06 09:20:42 +01:00
Nicola Pievani 28ac231cba Correzione caricamento istanze classi all'avvio 2025-01-30 12:04:23 +01:00
Nicola Pievani 201792b9cc Migliorata gestione avvio programma in cieco 2025-01-27 12:02:39 +01:00
Nicola Pievani f7ccde68f4 Correzione salvataggio Porta singola 2024-12-20 17:12:58 +01:00
Nicola Pievani d9f56bccf3 Lettura modalità di salvataggio da INI 2024-12-18 16:17:50 +01:00
Nicola Pievani 328d333e16 Migliorata gestione Assemblato e porta singola 2024-12-18 15:15:32 +01:00
Nicola Pievani 306798a7d5 Merge commit '52461712a85184583d4fdaa5caf68a73d2fd5664' 2024-12-09 15:32:49 +01:00
Demetrio Cassarino 52461712a8 -modificato webbrouse da navigate a source 2024-12-09 15:31:38 +01:00
Nicola Pievani d4d4e3a9d7 Merge branch 'master' of https://gitlab.steamware.net/egaltech/EgtDOORCreator 2024-12-09 15:30:38 +01:00
Nicola Pievani 4525c6d780 Selezione anta in HardwareManager 2024-12-09 15:30:30 +01:00
Demetrio Cassarino a814b83e87 -migliorata gestion customer 2024-12-09 11:32:29 +01:00
Nicola Pievani 316374761d Gestione Swing e miglioramenti avvio in cieco 2024-12-02 12:00:26 +01:00
Nicola Pievani a53f9ff352 Correzione stringa costanti 2024-11-25 17:58:35 +01:00
Nicola Pievani 5d32bb9ddf Migliorata gestione evidenziazione compo 2024-11-25 15:39:26 +01:00
Nicola Pievani 8006b66a01 Merge commit 'a97f84f49b32e3e9e2153ad583bfe2bd2814bb31' 2024-11-20 13:05:31 +01:00
Nicola Pievani a97f84f49b Cambio versione 2024-11-20 13:04:58 +01:00
Nicola Pievani 98a16e0828 Aggiunto messaggio di log 2024-11-20 12:48:56 +01:00
Nicola Pievani e4390636fe Creazione Log per programma avviato in cieco 2024-11-20 12:38:10 +01:00
Nicola Pievani faa6bd2b8c Migliorata gestione seleziona da scena 2024-11-19 16:37:46 +01:00
Nicola Pievani dd8be77fb5 Merge commit '301ec52bf3225311f9098b0083c7f24e3f3330e7' 2024-11-19 11:53:44 +01:00
Nicola Pievani 301ec52bf3 Cambio colore bordo in evidenza 2024-11-19 11:53:00 +01:00
Nicola Pievani ee5a14a8f8 Salvataggio ultima estensione aperta, evidenzio da scena 2024-11-19 11:52:15 +01:00
Nicola Pievani dbc2b88e51 Merge branch 'master' of https://gitlab.steamware.net/egaltech/EgtDOORCreator 2024-11-18 18:11:20 +01:00
Nicola Pievani 11a270febf Merge commit '03f8312a3ddf9dd052fedcf091590d304af2b180' 2024-11-18 18:10:59 +01:00
Nicola Pievani 03f8312a3d Merge commit '22941facd28769d1f963eb15f5887f92a9d633bd' into NicolaP 2024-11-18 18:10:29 +01:00
Dario Sassi 61310b1579 Merge commit 'ac9f8354cc14656222fc701c1f1b91f80761ca46' 2024-10-10 19:17:58 +02:00
Nicola Pievani ac9f8354cc Geastione avvio programma in cieco 2024-10-07 19:48:54 +02:00
Nicola Pievani 1d65a311f3 Correzione salvataggio dati da Args 2024-10-04 15:21:33 +02:00
Nicola Pievani 3fb5e636bf Se fallisce lettura Args termino tutto subito 2024-10-04 13:40:13 +02:00
Nicola Pievani 621bd11b3d Avvio programma con Args esterno 2024-10-04 13:32:08 +02:00
Nicola Pievani 22941facd2 Merge commit '90a898f25aedc4232808a9ae5b3221c9e4d12961' 2024-09-16 12:57:19 +02:00
Nicola Pievani 90a898f25a Aggiornamento versione 2.6i1 2024-09-16 12:57:04 +02:00
Nicola Pievani 062c19ff6f Migliorata/Corretta lettura parametri DGD.T/.H/.W in millimetri Hardware template 2024-09-16 12:55:10 +02:00
24 changed files with 492 additions and 118 deletions
+8 -3
View File
@@ -9,10 +9,15 @@ Class Application
MyBase.OnStartup(e)
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
' Creo la View principale
Me.MainWindow = New MainWindowV
Me.MainWindow = New MainWindowV(e.Args)
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(Me.MainWindow)
' Mostro la View principale
Me.MainWindow.Show()
If OptionModule.AdjustDDT Then
Me.MainWindow.Hide()
Else
Me.MainWindow.Show()
End If
'' Mostro la View principale
'Me.MainWindow.Show()
End Sub
End Class
+29 -7
View File
@@ -1045,7 +1045,15 @@ Public Class Assembly
End Enum
' carico il valore finale restituito dalla lettura dell'assembalto (di default errore)
Public bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.ErrorInAssembInfo
Private m_bOk As ResultReadingAssembInfo = ResultReadingAssembInfo.ErrorInAssembInfo
Public Property bOk As ResultReadingAssembInfo
Get
Return m_bOk
End Get
Set(value As ResultReadingAssembInfo)
m_bOk = value
End Set
End Property
' vettore di righe del file ddf in lettura
Private FileContent() As String
@@ -1058,6 +1066,8 @@ Public Class Assembly
If Not File.Exists(sPathDDF) Then
Return
End If
' verifico se il file è un template
Dim bIsTemplate As Boolean = (Path.GetExtension(sPathDDF).ToLower = ".ddt")
ReadAssembly.FileContent = File.ReadAllLines(sPathDDF)
' se il file esiste ma è vuoto
If ReadAssembly.FileContent.Count = 0 Then
@@ -1080,7 +1090,7 @@ Public Class Assembly
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
Else
Map.refSceneManagerVM.EnableRefresh = False
If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo) = -1 Then
If ReadAssembly.GetDDFDoor(IndexLine, sErrorInfo, bIsTemplate) = -1 Then
' errore nella lettura di un part: blocco tutto
ReadAssembly = Nothing
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = False
@@ -1468,10 +1478,11 @@ Public Class Assembly
End Function
' dopo la lettura delle informazioni dell'assemblato
Private Function GetDDFDoor(IndexLine As Integer, ByRef sErrorInfo As String) As Integer
Private Function GetDDFDoor(IndexLine As Integer, ByRef sErrorInfo As String, Optional ByVal bIsTemplate As Boolean = False) As Integer
Dim Line As Integer = IndexLine
While Line < FileContent.Count - 1 AndAlso Not Search3Dots(FileContent(Line))
Dim Local_PartDoor As New PartDoor
Local_PartDoor.IsTemplate = bIsTemplate
Dim Local_Door As New Part(Local_PartDoor)
' carcio la liste delle propiretà
'CreateNewPropertiesList(Local_Door.PropertiesList, Local_Door.SelectedMaterial)
@@ -1494,7 +1505,13 @@ Public Class Assembly
sDoorPiece = sDoorPiece.Remove(sDoorPiece.LastIndexOf("_"c) + 1)
End If
Map.refCompoPanelVM.GoBackVisibility = Visibility.Visible
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
' verifico che la lettura dell'assemblato sia andato a buon fine
If Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo Then
' forzo l'apertura della pagina DOOR
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage
Else
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
End If
Else
' significa che stiamo per leggere una porta singola, cerco una porta
If Not Local_Door.TypePart.Contains("DO_") Then
@@ -1723,7 +1740,7 @@ Public Class Assembly
' controllo degli oggetti caricati nell'assemblato
Private Function ControlAssemblyInformation() As Boolean
Dim ErrorMessages As String = String.Empty
Select Case bOk
Select Case m_bOk
Case ResultReadingAssembInfo.CorrectAssembInfo
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
' 50520=The current ddf is an assembly
@@ -1777,9 +1794,9 @@ Public Class Assembly
Public Function ControlAssembly(Optional ByVal bSaving As Boolean = False) As String
' se è una porta singola oppure le info generali non sono state caricate correttamente non controllo l'assemblato
If bSaving Then
If bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
If m_bOk <> ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
Else
If bOk = ResultReadingAssembInfo.ErrorInAssembInfo OrElse bOk = ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
If m_bOk = ResultReadingAssembInfo.ErrorInAssembInfo OrElse m_bOk = ResultReadingAssembInfo.MissingAssembInfo Then Return String.Empty
End If
Dim WritingError As String = String.Empty
Dim DoorTypeList As String = String.Empty
@@ -2495,6 +2512,7 @@ Public Class Assembly
Map.refSceneManagerVM.RefreshBtn()
Case "Height"
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
HeightJamb()
HeightDoor()
TopRabbetJamb()
@@ -2504,6 +2522,7 @@ Public Class Assembly
UpDateAllCompo()
Case "Width"
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
TopBottomWidth()
TopRabbetJamb()
BottomRabbetJamb()
@@ -2512,10 +2531,12 @@ Public Class Assembly
UpDateAllCompo()
Case "Thickness"
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
TopRabbetJamb()
UpDateAllCompo()
Case "Swing"
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
UpDateCompolistOnJamb()
SwingJamb()
SetPartDoorCurrAssembly()
@@ -2523,6 +2544,7 @@ Public Class Assembly
'UpDateAllCompo()
Case "DoorNumber"
If m_bOk <> ResultReadingAssembInfo.CorrectAssembInfo Then Return
ClearRefOnAssembly()
SetPartDoorCurrAssembly()
ReverseDoor()
+10
View File
@@ -7,6 +7,16 @@ Imports EgtWPFLib5
Public Class PartDoor
Inherits VMBase
Private m_IsTemplate As Boolean = False
Public Property IsTemplate As Boolean
Get
Return m_IsTemplate
End Get
Set(value As Boolean)
m_IsTemplate = value
End Set
End Property
Private m_Door As Part
Public Property Door As Part
Get
+60 -10
View File
@@ -131,32 +131,65 @@ Public Class AssemblyManagerVM
' 50540 = The current ddf is a part of a frame, do you want to save?
If MessageBox.Show(EgtMsg(50540), EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, True, False)
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
DdfFile.SaveErrorCompo = False
Else
Return False
End If
Else
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, True, False)
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
DdfFile.SaveErrorCompo = False
End If
Else
' se il ddf che sto leggendo è composto dal al massimo due parti significa che c'è un errore
' Se il ddf che sto leggendo è composto dal al massimo due parti significa che c'è un errore
If SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.CorrectAssembInfo AndAlso
SavedAssName.SelAssembly.ListPartDoor.Count < 3 Then
' se sto salvando meno di tre componenti significa che mancano qualche pezzo per essere un assemblato
' Se sto salvando meno di tre componenti significa che mancano qualche pezzo per essere un assemblato
SavedAssName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo
End If
Dim ErrorMessage As String = SavedAssName.SelAssembly.ControlAssembly(True)
Dim m_MessageBoxResult As MessageBoxResult = MessageBoxResult.Cancel
If Not String.IsNullOrEmpty(ErrorMessage) Then
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
Return False
' Richiedo di scegliere se salvare come porta singola oppure come assemblato (altrimenti annullo il salvataggio)
If GetMainPrivateProfileInt(S_GENERAL, K_SAVEASSINGLEDOOR, 0) <> 0 Then
' 50732=Save as Assembly (YES), Single door (NO).
m_MessageBoxResult = MessageBox.Show(EgtMsg(50732), EgtMsg(50144), MessageBoxButton.YesNoCancel, MessageBoxImage.Warning, MessageBoxResult.No)
If m_MessageBoxResult = MessageBoxResult.Cancel Then
' interrompo il salvataggio
Return False
End If
If m_MessageBoxResult = MessageBoxResult.Yes Then
' Procedo a sovrascrivere il file come ASSEMBALTO
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
DdfFile.SaveErrorCompo = False
ElseIf m_MessageBoxResult = MessageBoxResult.No Then
' Procedo a sovrascrivere il file come SINGLE DOOR
DdfFile.SaveErrorCompo = True
Dim _IsDDF As Boolean = IsCurrentFileDDF(SavedAssName.Name)
DdfFile.WriteDDFPart(SavedAssName.SelAssembly.ListPartDoor(0).Door, SavedAssName.Name, _IsDDF, False)
DdfFile.SaveErrorCompo = False
End If
Else
' Avviso che sto per salvare una porta singola come assemblato (altrimenti annullo il salvataggio)
If Not MessageBox.Show(ErrorMessage, EgtMsg(50144), MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No) = MessageBoxResult.Yes Then
Return False
End If
' Procedo a sovrascrivere il file
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
DdfFile.SaveErrorCompo = False
End If
Else
' Non ci sono errori: procedo a sovrascrivere il file
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
DdfFile.SaveErrorCompo = False
End If
DdfFile.SaveErrorCompo = True
DdfFile.WriteDDFAssembly(SavedAssName.SelAssembly, SavedAssName.Name, True)
DdfFile.SaveErrorCompo = False
End If
' controllo che il salvataggio sia andato a buon fine
@@ -981,6 +1014,14 @@ Public Class AssemblyManagerVM
OpenedAssName.IsModified = Part.FirstReadingEdge
If OptionModule.m_ConfigurationSoftware = ConfigType.Door Then
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, sTempFile, True, False)
If OptionModule.AdjustDDT Then
DdfFile.WriteDDFPart(OpenedAssName.SelAssembly.ListPartDoor(0).Door, OptionModule.SaveFileNameFromArgs, True, False)
' TERMINO TUTTO SUBITO
EgtOutLog("Scrittura file '.ddf' terminata")
EgtExit()
Application.Current.Shutdown(0)
Return True
End If
' aggiorno elenco quotature
Map.refDimensioningPanelVM.LoadHardwareDimList()
ExecDoors(Map.refSceneManagerVM.ProjectScene, sTempFile, False)
@@ -1006,7 +1047,16 @@ Public Class AssemblyManagerVM
If Assembly.Refreshing Then EgtZoom(ZM.ALL)
m_CurrProject.SelAssemblyName.SelAssembly.MatchCompo()
m_CurrProject.SelAssemblyName.SelAssembly.UpDateAllOrigValue()
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
' Se mancano le info per generare l'assemblato accedo direttamente alla prima porta
If m_CurrProject.SelAssemblyName.SelAssembly.bOk = Assembly.ResultReadingAssembInfo.MissingAssembInfo Then
If m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor.Count > 0 Then
Map.refAssemblyPageVM.JambBtn(m_CurrProject.SelAssemblyName.SelAssembly.ListPartDoorOfDoor(0).Type)
Else
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
End If
Else
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage
End If
End If
' ogni progetto salvato è l'ultimo da aprire, anche se il programma è chiuso dall'HardwareManager
' controllo che esiste almeno un file aperto
+2
View File
@@ -225,6 +225,8 @@ Public Class CompoPanelVM
Map.refAssemblyPageVM.CurrAssembly.CreateCompoOnJamb(NewCompo, "")
End If
Map.refSceneManagerVM.RefreshBtn()
' evidenzio componente
Map.refPartPageVM.CurrPart.MarkCompoInScena()
Else
MessageBox.Show(EgtMsg(50108), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Exclamation)
End If
+3 -1
View File
@@ -42,6 +42,7 @@ Module ConstIni
Public Const K_EGTCAMEXE As String = "EgtCam5Exe"
Public Const K_REFRESHTIME As String = "RefreshTime"
Public Const K_DDFVERSION As String = "DDFVersion"
Public Const K_SAVEASSINGLEDOOR As String = "SaveAsSingleDoor"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
@@ -90,7 +91,8 @@ Module ConstIni
Public Const K_DDFFUNCTION As String = "DdfFun"
Public Const K_MYPROJECTDIR As String = "ProjectDirectory"
Public Const K_TEMPLATEDIR As String = "TemplateDirectory"
Public Const K_MACHINDIR As String = "MachinDirectory"
' Correzione nome Chiave valore ver 2.6k2 "MachineDirectory"
Public Const K_MACHINDIR As String = "MachineDirectory"
Public Const K_MTABLE As String = "MTable"
Public Const S_REPORT As String = "Report"
+27 -5
View File
@@ -10,11 +10,7 @@ Module Modified
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) Then
For Each Compo In Map.refPartPageVM.CurrPart.CompoList
Compo.BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush)
Compo.BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush)
Compo.Foreground = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush)
Compo.BorderThickness = 1
Compo.FontBold = FontWeights.Normal
Compo.ResetMark()
Next
End If
Else
@@ -111,6 +107,32 @@ Public Class Compo
End Set
End Property
Public Sub ResetMark()
m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush)
m_BackGroundColor = Brushes.White
m_Foreground = Brushes.Black
m_BorderThickness = 1
m_FontBold = FontWeights.Normal
NotifyPropertyChanged("BorderColor")
NotifyPropertyChanged("BackGroundColor")
NotifyPropertyChanged("Foreground")
NotifyPropertyChanged("BorderThickness")
NotifyPropertyChanged("FontBold")
End Sub
Public Sub SetMark()
m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
m_BackGroundColor = DirectCast(New BrushConverter().ConvertFrom("#FFFFFFFF"), SolidColorBrush)
m_Foreground = DirectCast(New BrushConverter().ConvertFrom("#FF4D84C4"), SolidColorBrush)
m_BorderThickness = 2
m_FontBold = FontWeights.Bold
NotifyPropertyChanged("BorderColor")
NotifyPropertyChanged("BackGroundColor")
NotifyPropertyChanged("Foreground")
NotifyPropertyChanged("BorderThickness")
NotifyPropertyChanged("FontBold")
End Sub
#End Region ' Colori GroupBox
#Region "CompoRef"
+27 -9
View File
@@ -1509,17 +1509,19 @@ Public Class Part
#Region "Selection compo"
Private Sub ResetAllMark()
Public Sub ResetAllMark()
Dim nIdFirstPart As Integer = EgtGetFirstPart()
Dim nIdLay As Integer = EgtGetFirstLayer(nIdFirstPart)
While nIdLay <> GDB_ID.NULL
EgtResetMark(nIdLay)
nIdLay = EgtGetNextLayer(nIdLay)
End While
EgtDraw()
For Each ItemCompo As Compo In CompoList
ItemCompo.ResetMark()
Next
End Sub
Private Sub MarkCompoInScena()
Public Sub MarkCompoInScena()
If IsNothing(m_SelCompo) Then Return
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
ResetAllMark()
@@ -1532,7 +1534,7 @@ Public Class Part
' ontengo la posizione prevista nella grafica
Dim IndexInList As Integer = DdfFile.GetIndexInList(TempList, m_SelCompo)
' recupero la lista ordinata
Dim sCompoName As String = m_SelCompo.SelFile
Dim sCompoName As String = m_SelCompo.TemplateSelItem
' recupero il primo part disponibile
Dim nIdFirstPart As Integer = EgtGetFirstPart()
Dim nIdLay As Integer = EgtGetFirstLayer(nIdFirstPart)
@@ -1540,11 +1542,12 @@ Public Class Part
While nIdLay <> GDB_ID.NULL
Dim sInfoPath As String = String.Empty
If EgtGetInfo(nIdLay, "Path", sInfoPath) Then
Dim sNamePath As String = Path.GetFileNameWithoutExtension(sInfoPath)
If sNamePath = sCompoName And IndexLay = IndexInList Then
Dim sNamePath As String = sInfoPath
If sNamePath.Contains(sCompoName) And IndexLay = IndexInList Then
EgtSetMark(nIdLay)
m_SelCompo.SetMark()
Exit While
ElseIf sNamePath = sCompoName And IndexLay < IndexInList Then
ElseIf sNamePath.Contains(sCompoName) And IndexLay < IndexInList Then
IndexLay = IndexLay + 1
End If
End If
@@ -1869,6 +1872,7 @@ Public Class Part
' Messaggi di errore generici, se la stringa dei messaggi contiene delle informazioni allora visualizzo
If Not String.IsNullOrWhiteSpace(sErrorInfo) Then
Dim sTitle As String = EgtMsg(50101)
If Not IsNothing(ReadDoor) AndAlso Not IsNothing(ReadDoor.TypePart) Then sTitle &= ReadDoor.TypePart.ToString
' 50541 = {0} in reading {1}.
If Not IsNothing(ReadDoor) Then String.Format(EgtMsg(50541), sTitle, ReadDoor.TypePart)
MessageBox.Show(sErrorInfo, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
@@ -2034,6 +2038,9 @@ Public Class Part
If Index > FileContent.Count() - 1 Then Return -1
Dim sLine As String = RemoveComment(FileContent(Index))
Dim Width As String = GetValueWithKey(sLine, K_WIDTH)
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
Width = OptionModule.m_Width
End If
If String.IsNullOrWhiteSpace(Width) Then
If Not SearchKey(sLine, K_WIDTH) Then Return -1
' altrimenti
@@ -2051,6 +2058,9 @@ Public Class Part
If Index > FileContent.Count() - 1 Then Return -1
sLine = RemoveComment(FileContent(Index))
Dim Height As String = GetValueWithKey(sLine, K_HEIGHT)
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
Height = OptionModule.m_Height
End If
If String.IsNullOrWhiteSpace(Height) Then
If Not SearchKey(sLine, K_HEIGHT) Then Return -1
' altrimenti
@@ -2068,6 +2078,9 @@ Public Class Part
If Index > FileContent.Count() - 1 Then Return -1
sLine = RemoveComment(FileContent(Index))
Dim Thickness As String = GetValueWithKey(sLine, K_THICKNESS)
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT Then
Thickness = OptionModule.m_Thickness
End If
If String.IsNullOrWhiteSpace(Thickness) Then
If Not SearchKey(sLine, K_THICKNESS) Then Return -1
' altrimenti
@@ -2159,6 +2172,10 @@ Public Class Part
MessageBox.Show(String.Format(EgtMsg(50141), ConstIni.K_SWING_INI) & EgtMsg(50159), EgtMsg(50101), MessageBoxButton.OK, MessageBoxImage.Error)
Else
' carico il valore nella porta corrente
If m_refPartDoor.IsTemplate And OptionModule.AdjustDDT AndAlso Not String.IsNullOrEmpty(OptionModule.ForcesSideSwing) Then
Swing = Swing.Remove(0, 1)
Swing = OptionModule.ForcesSideSwing & Swing
End If
m_Swing = Swing
OptionModule.SetCurrSwing(m_SwingAlias, m_Swing)
If IsNothing(m_SwingAlias) Then Return -1
@@ -3480,10 +3497,11 @@ Public Class Part
ElseIf nPartDoor > 1 Then
' Assemblati
Dim WdSelPartV As New SelectPartV()
Dim WdSelPartVM As New SelectPartVM("Selezione della porta", "Selezione anta", nPartDoor, 1)
' 50233=Selezione della porta, 50234=Selezione anta
Dim WdSelPartVM As New SelectPartVM(EgtMsg(50233), EgtMsg(50234), nPartDoor, 1)
WdSelPartV.DataContext = WdSelPartVM
WdSelPartV.ShowDialog()
Dim nSelection As Integer = CInt(WdSelPartVM.Selection.Split(" "c)(1)) - 1
Dim nSelection As Integer = WdSelPartVM.nSelectedIndex
' 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
+1 -1
View File
@@ -162,7 +162,7 @@
<SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
<SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
<SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
<SolidColorBrush x:Key="Button.Pressed.Background" Color="#FF90CFEE"/>
<SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
<SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
<SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
+10 -12
View File
@@ -1,19 +1,17 @@
<EgtWPFLib5:EgtCustomWindow x:Class="GuideV"
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}" Icon="/Resources/EgtDOOR.ico"
TitleBarBrush="{StaticResource EgaltechBlue1}"
BorderBrush="{StaticResource EgaltechBlue1}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
IsMinimizable="True" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Height="800" Width="1500">
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}" Icon="/Resources/EgtDOOR.ico"
TitleBarBrush="{StaticResource EgaltechBlue1}"
BorderBrush="{StaticResource EgaltechBlue1}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
IsMinimizable="True" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Height="800" Width="1500">
<DockPanel Margin="5">
<WebBrowser x:Name="DoorBrowser"/>
</DockPanel>
</EgtWPFLib5:EgtCustomWindow>
+2 -2
View File
@@ -20,10 +20,10 @@ Public Class GuideV
Dim sHelpDir As String = String.Empty
If OptionModule.m_SmartHelp = HelpPage.LocalHost Then
sHelpDir = IniFile.m_sHelpDir.Replace("C:", "file://127.0.0.1/c$")
DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html"))
DoorBrowser.Source = New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")
ElseIf OptionModule.m_SmartHelp = HelpPage.WebBrowserVB Then
sHelpDir = IniFile.m_sHelpDir
DoorBrowser.Navigate(New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html"))
DoorBrowser.Source = New Uri(sHelpDir & "\" & m_Language & "\" & GuideVM.m_AddressGuide & ".html")
Else
sHelpDir = IniFile.m_sHelpDir
Try
+2 -2
View File
@@ -76,8 +76,8 @@ Friend Class MainWindowModel
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2608, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2608, 1, IniFile.m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2703, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2703, 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())
+67 -5
View File
@@ -1,9 +1,27 @@
Imports EgtWPFLib5
Imports EgtUILib
Class MainWindowV
Private m_args() As String = Nothing
#Region "EVENTS"
Public Sub New(args As String())
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Per leggere più argomenti devono essere scritti ognuno tra doppi apici e separati da spazio
' Esempio:"Argomento 1 di prova" "Argomento 2 di prova"
EgtOutLog(" 1 Numero argomenti: " & args.Length.ToString)
If args.Length > 0 Then
m_args = args
RunBlindCode()
End If
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
End Sub
Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Carico e imposto posizione finestra
WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
@@ -11,19 +29,63 @@ Class MainWindowV
Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' se è assente la chiave di protezione non mostro la finestra Launcher
If Map.refSceneManagerVM.bProtectKey Then
Map.refMainWindowVM.SetLauncher()
Map.refMainWindowVM.ShowErrorCompoLoad()
End If
RunBlindCode()
End Sub
Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing
' Salvo posizione finestra (se non minimizzata)
If WindowState <> WindowState.Minimized Then
If WindowState <> WindowState.Minimized And Not OptionModule.AdjustDDT Then
WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
End If
End Sub
#End Region ' EVENTS
Private Sub RunBlindCode()
If Map.refSceneManagerVM.bProtectKey Then
ReadArgs()
Map.refMainWindowVM.SetLauncher()
Map.refMainWindowVM.ShowErrorCompoLoad()
End If
End Sub
' Lettura degli argomenti e scrittura di un file di Log con i parametri caricati
Private Sub ReadArgs()
If Not IsNothing(m_args) Then
' leggo gli argomenti: Il programma si chiude appena termina la scrittura del file DDF
Dim Items() As String = m_args(0).Split(";"c)
EgtOutLog(" Argomenti: " & m_args.ToString)
If Items.Length >= 5 Then
' Avvio progetto - LauncherOpt.Open_last_project (1)
OptionModule.m_bLauncherOpenOnce = True
' Indico il percorso del file
OptionModule.FileNameFromArgs = Items(0)
EgtOutLog(" File '.ddt' input : " & OptionModule.FileNameFromArgs)
' Assegno i valore Width, Height, Thickness
OptionModule.m_Width = Items(1)
EgtOutLog(" width : " & OptionModule.m_Width)
OptionModule.m_Height = Items(2)
EgtOutLog(" height : " & OptionModule.m_Height)
OptionModule.m_Thickness = Items(3)
EgtOutLog(" thickness : " & OptionModule.m_Thickness)
' Indico il percoso di salvataggio file DDF
OptionModule.SaveFileNameFromArgs = Items(4)
EgtOutLog(" File '.ddf' output : " & OptionModule.SaveFileNameFromArgs)
' Nuovo parametro da laggere per gestione Swing
If Items.Length = 6 Then
OptionModule.ForcesSideSwing = Items(5)
EgtOutLog(" swing : " & OptionModule.ForcesSideSwing)
End If
' abilito lettura dati
OptionModule.AdjustDDT = True
Else
EgtOutLog(" Argomenti non conformi")
' blocco lettura dati
OptionModule.AdjustDDT = False
' TERMINO TUTTO SUBITO!
End
End If
End If
End Sub
End Class
+23 -14
View File
@@ -65,9 +65,14 @@ Public Class MainWindowVM
Return m_SelectedPage
End Get
Set(value As ListPageEnum)
m_SelectedPage = value
NotifyPropertyChanged("PageControl")
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
' Verifico che sia una vera modifica
If m_SelectedPage <> value Then
m_SelectedPage = value
NotifyPropertyChanged("PageControl")
If Not IsNothing(Map.refInstrumentPanelVM) Then
Map.refInstrumentPanelVM.NotifyPropertyChanged("DimensionVisibility")
End If
End If
End Set
End Property
@@ -84,20 +89,20 @@ Public Class MainWindowVM
Public ReadOnly Property PageControl As ContentControl
Get
If m_SelectedPage = ListPageEnum.nDDFPage Then
If OptionModule.m_SingleDoor then
If OptionModule.m_SingleDoor Then
VisibilityAssemblyManager = Visibility.Hidden
Else
VisibilityAssemblyManager = Visibility.Visible
End If
End If
NotifyPropertyChanged("AssemblyManagerControl")
NotifyPropertyChanged("ProjectManagerControl")
Return m_PartPage
ElseIf m_SelectedPage = ListPageEnum.nAssemblyPage Then
If OptionModule.m_SingleDoor then
If OptionModule.m_SingleDoor Then
VisibilityAssemblyManager = Visibility.Hidden
Else
VisibilityAssemblyManager = Visibility.Visible
End If
End If
NotifyPropertyChanged("AssemblyManagerControl")
NotifyPropertyChanged("ProjectManagerControl")
Return m_AssemblyPage
@@ -107,11 +112,11 @@ Public Class MainWindowVM
NotifyPropertyChanged("ProjectManagerControl")
Return m_HardwarePage
Else
If OptionModule.m_SingleDoor then
If OptionModule.m_SingleDoor Then
VisibilityAssemblyManager = Visibility.Hidden
Else
VisibilityAssemblyManager = Visibility.Visible
End If
End If
NotifyPropertyChanged("AssemblyManagerControl")
NotifyPropertyChanged("ProjectManagerControl")
Return Nothing
@@ -137,7 +142,7 @@ Public Class MainWindowVM
Public ReadOnly Property ProjectManagerControl As ContentControl
Get
If m_SelectedPage <> ListPageEnum.nHardwarePage then
If m_SelectedPage <> ListPageEnum.nHardwarePage Then
Return m_ProjectManager
Else
ProjectNameMsg = "HardwareManager"
@@ -153,6 +158,7 @@ Public Class MainWindowVM
End Property
Sub New()
EgtOutLog(" Creazione e inizializzazone MainWondowVM ")
Map.SetRefMainWindowVM(Me)
m_AssemblyPage = New AssemblyPageV
m_AssemblyPage.DataContext = New AssemblyPageVM
@@ -166,7 +172,6 @@ Public Class MainWindowVM
m_HardwarePage.DataContext = New HardwarePageVM
m_AssemblyManager = New AssemblyManagerV
m_AssemblyManager.DataContext = New AssemblyManagerVM
' inserisco la scena
m_SceneManager = New SceneManagerV
m_SceneManager.DataContext = New SceneManagerVM
Dim OptionsPage As OptionsVM = OptionPage
@@ -311,7 +316,7 @@ Public Class MainWindowVM
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
If StartReload Then Return
' 50545 = It has been deleted file: {0}, {1}.
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
Dim Message As String = String.Format(EgtMsg(50545), e.FullPath, e.ChangeType)
selectedWatcher = WatcherCalling.OnDeleted
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
RaiseEvent Er(Message, e.FullPath)
@@ -324,7 +329,7 @@ Public Class MainWindowVM
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
If StartReload Then Return
' 50543 = It has been renamed file: {0}, {1}.
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
Dim Message As String = String.Format(EgtMsg(50543), e.FullPath, e.ChangeType)
selectedWatcher = WatcherCalling.OnRenamed
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
RaiseEvent Er(Message, e.FullPath)
@@ -337,7 +342,7 @@ Public Class MainWindowVM
If m_SelectedPage = ListPageEnum.nHardwarePage Then Return
If StartReload Then Return
' 50544 = It has been created new file: {0}, {1}.
Dim Message As String =String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
Dim Message As String = String.Format(EgtMsg(50544), e.FullPath, e.ChangeType)
selectedWatcher = WatcherCalling.OnCreated
Application.Current.Dispatcher.BeginInvoke(New Action(Sub()
RaiseEvent Er(Message, e.FullPath)
@@ -366,6 +371,10 @@ Public Class MainWindowVM
Case LauncherOpt.Open_last_project
' se definito ultimo progetto, lo apro
If GetMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, "", m_sLastProject) > 0 Then
' se caricato il nome in avvio del programma allora sovrascrivo
If OptionModule.AdjustDDT Then
m_sLastProject = OptionModule.FileNameFromArgs
End If
Map.refProjectManagerVM.OpenLastProject()
End If
Case Else
+3 -3
View File
@@ -32,7 +32,7 @@ Imports System.Windows
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtDOORCreator")>
<Assembly: AssemblyCopyright("Copyright © 2016-2024 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2016-2025 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.6.8.2")>
<Assembly: AssemblyFileVersion("2.6.8.2")>
<Assembly: AssemblyVersion("2.7.3.1")>
<Assembly: AssemblyFileVersion("2.7.3.1")>
+7
View File
@@ -7,6 +7,13 @@ Friend Module OptionModule
' flag per modalità di visualizzazione file (solo lettura)
Friend ReadOnlyDDF As Boolean = False
' flag per forzare l'aggiornamento delle dimensioni anta dei file DDT
Friend AdjustDDT As Boolean = False
Friend FileNameFromArgs As String = String.Empty
Friend SaveFileNameFromArgs As String = String.Empty
' Forza la scrittura dello swing Left(L..) oppure Right(R..)
Friend ForcesSideSwing As String = String.Empty
' Parametri che contengono lista delle lingue disponibili e lingua selezionata
Friend m_LanguageList As New ObservableCollection(Of Language)
Friend m_SelectedLanguage As Language
+14 -10
View File
@@ -66,10 +66,18 @@ Public Class OrderVM
End Get
End Property
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
Return False
End If
Return True
End Function
Public Property Customer As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
If Not VerifyNotIsNothing() Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Customer
End Get
Set(value As String)
@@ -83,8 +91,7 @@ Public Class OrderVM
Public Property Elevation As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
If Not VerifyNotIsNothing() Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Elevation
End Get
Set(value As String)
@@ -98,8 +105,7 @@ Public Class OrderVM
Public Property Project As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
If Not VerifyNotIsNothing() Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Project
End Get
Set(value As String)
@@ -113,8 +119,7 @@ Public Class OrderVM
Public Property PO As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
If Not VerifyNotIsNothing() Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.PO
End Get
Set(value As String)
@@ -128,8 +133,7 @@ Public Class OrderVM
Public Property Line As String
Get
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) AndAlso
Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor.Count > 0 Then Return Nothing
If Not VerifyNotIsNothing() Then Return Nothing
Return Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor(0).Door.Line
End Get
Set(value As String)
+23 -2
View File
@@ -687,8 +687,8 @@ Public Class ProjectManagerVM
fd.InitialDirectory = IniFile.m_MyProjectDir
End If
' seleziono il filtro di apertura
fd.Filter = "(*.ddt) |*.ddt|(*.ddf) |*.ddf"
fd.FilterIndex = 2
fd.Filter = "(*.ddf) |*.ddf|(*.ddt) |*.ddt"
fd.FilterIndex = GetCurrentFilter()
fd.RestoreDirectory = True
' apro la finestra di dialogo
If fd.ShowDialog() <> System.Windows.Forms.DialogResult.OK Then
@@ -703,6 +703,8 @@ Public Class ProjectManagerVM
sFilePath = Path.GetDirectoryName(fd.FileName)
' salvo il nome completo del file
sFilePathComplete = fd.FileName
' salvo l'estensione dell'ultimo progetto aperto
WriteMainPrivateProfileString("General", "LastExtensionOpened", Path.GetExtension(fd.FileName))
' 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
@@ -846,6 +848,21 @@ Public Class ProjectManagerVM
End If
End Sub
Private Function GetCurrentFilter() As Integer
Dim nFilter As Integer = 1
Dim sExt As String = String.Empty
GetMainPrivateProfileString("General", "LastExtensionOpened", "ddf", sExt)
sExt = sExt.Replace("."c, "")
sExt = sExt.Trim
Select Case sExt
Case = "ddf"
nFilter = 1
Case = "ddt"
nFilter = 2
End Select
Return nFilter
End Function
#End Region ' OpenCommand
#Region "OpenMruFileCommand"
@@ -989,6 +1006,10 @@ Public Class ProjectManagerVM
Else
EgtOutLog("LastProject '" & OptionModule.m_sLastProject & "' is not a file or does not exist!")
Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nNothingSelected
If OptionModule.AdjustDDT Then
EgtExit()
Application.Current.Shutdown(3)
End If
Return
End If
Else
+3 -2
View File
@@ -6,7 +6,7 @@
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"
Height="110" Width="300" Topmost="True"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
@@ -30,7 +30,8 @@
</UniformGrid>
<Button IsDefault="True" Name="OkBtn" Grid.Row="2" Grid.ColumnSpan="2"
<Button IsDefault="True" Name="OkBtn" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right"
Margin="0,0,5,0"
Content="{Binding SaveMsg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
</Grid>
+25 -3
View File
@@ -7,6 +7,13 @@
End Get
End Property
Private m_SaveMsg As String = "Ok"
Public ReadOnly Property SaveMsg As String
Get
Return m_SaveMsg
End Get
End Property
Private m_PartDoorMsg As String = "Select part"
Public ReadOnly Property PartDoorMsg As String
Get
@@ -31,16 +38,31 @@
End Get
Set(value As String)
m_Selection = value
m_nSelectedIndex = m_PartDoorList.IndexOf(m_Selection)
End Set
End Property
Private m_nSelectedIndex As Integer = 0
Public ReadOnly Property nSelectedIndex As Integer
Get
Return m_nSelectedIndex
End Get
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)
For Each ItemDoor As PartDoor In Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.SelAssembly.ListPartDoor
m_PartDoorList.Add(ItemDoor.Type)
Next
m_Selection = "Door " & nIndex.ToString
If Not IsNothing(Map.refPartPageVM) AndAlso Not IsNothing(Map.refPartPageVM.CurrPart) AndAlso
Not IsNothing(Map.refPartPageVM.CurrPart.TypePart) Then
m_nSelectedIndex = m_PartDoorList.IndexOf(Map.refPartPageVM.CurrPart.TypePart)
Else
m_nSelectedIndex = 0
End If
m_Selection = m_PartDoorList(m_nSelectedIndex)
End Sub
End Class
@@ -1,35 +1,35 @@
<UserControl x:Class="InstrumentPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator">
<StackPanel Background="Transparent" Orientation="Horizontal" >
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
<StackPanel Background="Transparent" Orientation="Horizontal" >
<ToggleButton ToolTip="{Binding GetDistToolTip}" IsEnabled ="{Binding EnableCmdDist}"
Style="{StaticResource GridViewPanelToggleButton}" IsChecked="{Binding GetDistIsChecked}">
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform" Width="25" />
</ToggleButton>
<Button ToolTip="{Binding LinearDimensionToolTip}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
Visibility="{Binding DimensionVisibility}">
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
ToolTipService.ShowOnDisabled="True"
Command="{Binding LinearDimensionCommand}" IsEnabled="{Binding EnableCmdDimension}"
Visibility="{Binding DimensionVisibility}">
<Image Source="/Resources/InstrumentPanel/LinearDimension.png" Stretch="Uniform" Width="25"/>
</Button>
<TextBox Style="{StaticResource DimensioParameter}"
Name ="TextBox1"
Visibility="{Binding TextDimensionVisibility}" Margin="5"
Width="100" Height="25"
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
</TextBox.InputBindings>
</TextBox>
<TextBox Style="{StaticResource DimensioParameter}"
Name ="TextBox1"
Visibility="{Binding TextDimensionVisibility}" Margin="5"
Width="100" Height="25"
Text="{Binding TextDimension, UpdateSourceTrigger=PropertyChanged}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding OkTextDimension}"/>
</TextBox.InputBindings>
</TextBox>
<Button Command="{Binding PrintHardwareCommand}" ToolTip="{Binding PrintHardwareToolTip}" Focusable="False"
<Button Command="{Binding PrintHardwareCommand}" ToolTip="{Binding PrintHardwareToolTip}" Focusable="False"
IsEnabled ="{Binding EnableCmdSaveImg}" Visibility="{Binding SaveImgHardware}">
<ContentControl>
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
<Image Source="/Resources/TopCommandBar/SaveAs.png" Stretch="Uniform" Width="25"/>
</ContentControl>
</Button>
</StackPanel>
</StackPanel>
</UserControl>
@@ -29,7 +29,7 @@ Public Class InstrumentPanelVM
#Region "FIELDS & PROPERTIES"
Private m_GetDistIsChecked As Boolean = True
Private m_GetDistIsChecked As Boolean = False
Public Property GetDistIsChecked As Boolean
Get
GetDistance(m_GetDistIsChecked)
+105 -2
View File
@@ -172,7 +172,7 @@ Public Class SceneManagerVM
' Chiudo il programma
End
End If
Return m_ProjectSceneHost
Return m_ProjectSceneHost
End Get
End Property
@@ -346,7 +346,7 @@ Public Class SceneManagerVM
ElseIf Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nAssemblyPage Then
If Not EnableRefresh Then Return
' Verifico esista elemento selezionato
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) orelse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return
If IsNothing(Map.refAssemblyManagerVM.CurrProject.SelAssemblyName) OrElse IsNothing(Map.refAssemblyPageVM.CurrAssembly) Then Return
DdfFile.WriteDDFAssembly(Map.refAssemblyPageVM.CurrAssembly, sTempFile, True)
ExecDoors(m_ProjectScene, sTempFile, False)
' mantengo i layer accesi
@@ -435,6 +435,109 @@ Public Class SceneManagerVM
#End Region ' Command
#Region "EVENT Scene"
Private Sub MouseMoveOverScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_ProjectScene.OnMouseMoveScene
' Se non abilitata l'evidenziazione dei compo allora esco
If GetMainPrivateProfileInt(S_GENERAL, "MarkCompo", 0) = 0 Then Return
' Se misurazione attiva
If Map.refInstrumentPanelVM.GetDistIsChecked 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
Map.refPartPageVM.CurrPart.ResetAllMark()
' Se la lista dei componenti è vuota allora esco
If Map.refPartPageVM.CurrPart.CompoList.Count < 1 Then
EgtDraw()
Return
End If
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Verifico se selezionato curva
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSel As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
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
' 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
Next
End If
End If
' Passo al successivo
nId = EgtGetNextObjInSelWin()
End While
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
' 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)
' 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
EgtSetMark(nIdLay)
' evidenzio la compo corrente
TempList(IndexInList).SetMark()
' ricerca terminata correttamente
Return True
Exit While
ElseIf sNamePath.Contains(sCompoName) And IndexInList < IndexLay Then
IndexInList += 1
Else
Return False
End If
End While
' prova con un'altra compo
Return False
End Function
#End Region ' Event scene
Public Sub ComposeAssembly(nAssembl As Integer)
If Not File.Exists(IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua") Then
EgtOutLog("SetUp error: SetUp configuration file (" & IniFile.m_sDoorsDirPath & "\" & "Main_Assemb.lua)" & " doesn't exist ")
+19 -3
View File
@@ -22,6 +22,10 @@ Public Module Utility
' CurrFile deve arrivare già senza estensione!
Private Function GenerateLockFileName(ByVal CurrDirectory As String, Optional ByVal CurrFile As String = "") As String
' Se in modalità Modifica file DDT allora non bloccare il file
If OptionModule.AdjustDDT Then
Return String.Empty
End If
If OptionModule.ReadOnlyDDF Then
Return String.Empty
End If
@@ -266,6 +270,18 @@ Public Module Utility
Return Index
End Function
' Verifica se il file/path indicato è ddf (true)
Friend Function IsCurrentFileDDF(sFileName As String) As Boolean
Dim IsDDF As Boolean = True
If Not String.IsNullOrEmpty(sFileName) AndAlso Path.HasExtension(sFileName) Then
Dim sExtension As String = Path.GetExtension(sFileName)
If sExtension.ToLower = DDT_EXTENSION Then
IsDDF = False
End If
End If
Return IsDDF
End Function
#Region "PARAM LUA"
' elimina i commenti nel file lua
@@ -585,9 +601,9 @@ Public Module Utility
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")
sMyVal = sMyVal.Replace("(DGD.dW)", "W")
sMyVal = sMyVal.Replace("(DGD.dH)", "H")
sMyVal = sMyVal.Replace("(DGD.dT)", "T")
End If
Return sMyVal
End Function