EgtCAM5 :

- sulla status bar in modalità Disegna aggiunta indicazione numero di entità selezionate (Sel : NNN)
- migliorie e correzioni a ExecuteWindow per caso di passaggio a Lavorazioni.
This commit is contained in:
Dario Sassi
2025-12-03 18:45:00 +01:00
parent 2648b704cc
commit 4d610cea8b
7 changed files with 45 additions and 221 deletions
+1
View File
@@ -2219,6 +2219,7 @@ Public Class DrawPanelVM
If Not IniFile.m_ProjectSceneContext = 0 Then
bSelOk = EgtGetFirstSelectedObj() <> GDB_ID.NULL
bLayerOkAndSelOk = m_bLayerOk And m_bSelOk
Map.refStatusBarVM.UpdateSelectedCount()
End If
If Application.m_UpdateLayerTree Then
+4 -7
View File
@@ -10,7 +10,7 @@ Public Class ExecuteWindowVM
' Evento per chiusura finestra
Friend Event OnCloseWindow(bDialogResult As Boolean)
Private ReadOnly sScriptFilePath As String = Path.Combine(IniFile.m_sTempDir, "ImmExec" & IniFile.m_nInstance.ToString() & ".tua")
Private ReadOnly sScriptFilePath As String = Path.Combine(IniFile.m_sTempDir, "ImmExec" & IniFile.m_nInstance.ToString() & ".lua")
Private m_sScriptText As String
Public Property sScriptText As String
@@ -96,12 +96,9 @@ Public Class ExecuteWindowVM
' Salva il file script
SaveScript(sScriptFilePath, m_sScriptText)
' Esegue il file script
EgtLuaExecFile(sScriptFilePath)
' Aggiorna visualizzazione
EgtDraw()
' Aggiorna interfaccia
If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.LoadObjTree()
UpdateUI()
Map.refProjectVM.ExecScript(sScriptFilePath)
' Se non passato a lavorazione, aggiornamento visualizzazione
If IniFile.m_ProjectMode <> ProjectModeOpt.MACHINING Then EgtDraw()
' Chiudo finestra
RaiseEvent OnCloseWindow(True)
End Sub
+2 -2
View File
@@ -169,9 +169,9 @@ Public Class ButtonItem
End If
If Not File.Exists(m_sLuaCmdPath) Then Return
If Not Path.GetExtension(m_sLuaCmdPath).ToLower = ".lua" Then Return
' Abilito eventi se comando lua termina con Beam\Process.lua
' Abilito eventi se comando lua lanciato da Beam o Wall
m_sCurrBarName = m_sBarName
Dim bRaiseEvent As Boolean = ( m_sBarName = "Beam" OrElse m_sBarName = "Wall")
Dim bRaiseEvent As Boolean = ( m_sBarName = "Beam" OrElse m_sBarName = "Wall")
' eseguo file Lua
Map.refProjectVM.PreExecScript(False)
Map.refProjectVM.ExecScript(m_sLuaCmdPath, bRaiseEvent)
+25 -210
View File
@@ -14,51 +14,6 @@ Public Class MyStatusBarVM
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
' GRAPHICAL ELEMENTS
'Private m_StatusOutput As String
'Public Property StatusOutput As String
' Get
' Return m_StatusOutput
' End Get
' Set(value As String)
' m_StatusOutput = value
' NotifyPropertyChanged("StatusOutput")
' End Set
'End Property
'Private m_StatusCurrPos As String
'Public Property StatusCurrPos As String
' Get
' Return m_StatusCurrPos
' End Get
' Set(value As String)
' m_StatusCurrPos = value
' NotifyPropertyChanged("StatusCurrPos")
' End Set
'End Property
'Private m_StatusProgress As Integer
'Public Property StatusProgress As Integer
' Get
' Return m_StatusProgress
' End Get
' Set(value As Integer)
' m_StatusProgress = value
' NotifyPropertyChanged("StatusProgress")
' End Set
'End Property
'Private m_StatusStopIsEnabled As Boolean
'Public Property StatusStopIsEnabled As Boolean
' Get
' Return m_StatusStopIsEnabled
' End Get
' Set(value As Boolean)
' m_StatusStopIsEnabled = value
' NotifyPropertyChanged("StatusStopIsEnabled")
' End Set
'End Property
Private m_GridDimensionText As String
Public Property GridDimensionText As String
Get
@@ -92,84 +47,32 @@ Public Class MyStatusBarVM
End Set
End Property
'Private m_StatusUnitsText As String
'Public Property StatusUnitsText As String
' Get
' Return m_StatusUnitsText
' End Get
' Set(value As String)
' m_StatusUnitsText = value
' NotifyPropertyChanged("StatusUnitsText")
' End Set
'End Property
Private m_nSelCount As Integer = 0
Public ReadOnly Property SelCount As String
Get
Return "Sel : " & m_nSelCount.ToString()
End Get
End Property
Public Sub UpdateSelectedCount()
Dim nSelCnt As Integer = EgtGetSelectedObjCount()
If nSelCnt <> m_nSelCount Then
m_nSelCount = nSelCnt
NotifyPropertyChanged("SelCount")
End If
End Sub
'Private m_SnapPointTypeText As String
'Public Property SnapPointTypeText As String
' Get
' Return m_SnapPointTypeText
' End Get
' Set(value As String)
' m_SnapPointTypeText = value
' NotifyPropertyChanged("SnapPointTypeText")
' End Set
'End Property
'Private m_SnapPointTypeBackground As SolidColorBrush
'Public Property SnapPointTypeBackground As SolidColorBrush
' Get
' Return m_SnapPointTypeBackground
' End Get
' Set(value As SolidColorBrush)
' m_SnapPointTypeBackground = value
' NotifyPropertyChanged("SnapPointTypeBackground")
' End Set
'End Property
'' Lista delle macchine disponibili nel programma
'Private m_MachinesList As New ObservableCollection(Of Machine)
'Public Property MachinesList As ObservableCollection(Of Machine)
' Get
' Return m_MachinesList
' End Get
' Set(value As ObservableCollection(Of Machine))
' m_MachinesList = value
' End Set
'End Property
'' Macchina correntemente selezionata e quindi attiva
'Private m_SelectedMachine As Machine
'Public Property SelectedMachine As Machine
' Get
' Return m_SelectedMachine
' End Get
' Set(value As Machine)
' If IsNothing(value) Then
' m_SelectedMachine = Nothing
' ElseIf value IsNot m_SelectedMachine Then
' EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
' If EgtSetCurrMachine(value.Name) Then
' m_SelectedMachine = value
' IniFile.m_sMachineName = m_SelectedMachine.Name
' IniFile.m_sCurrMachIniFilePath = m_SelectedMachine.MachineDirPath & "\" & m_SelectedMachine.Name & ".ini"
' IniFile.m_sCurrMachToolsDirPath = m_SelectedMachine.MachineDirPath & "\Tools"
' IniFile.m_sCurrMachSetUpDirPath = m_SelectedMachine.MachineDirPath & "\SetUp"
' IniFile.m_sCurrMachScriptsDirPath = m_SelectedMachine.MachineDirPath & "\Scripts"
' UpdateToolAndMachDbParamVisibility()
' NotifyPropertyChanged("SelectedMachine")
' End If
' End If
' End Set
'End Property
'Private m_MachineListIsEnabled As Boolean
'Public Property MachineListIsEnabled As Boolean
' Get
' Return m_MachineListIsEnabled
' End Get
' Set(value As Boolean)
' m_MachineListIsEnabled = value
' NotifyPropertyChanged("MachineListIsEnabled")
' End Set
'End Property
Public ReadOnly Property SelCountVisibility As Visibility
Get
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
Return Visibility.Visible
Else
Return Visibility.Hidden
End If
End Get
End Property
Friend Sub UpdateSelCountVisibility()
NotifyPropertyChanged("SelCountVisibility")
End Sub
' Commands definition
Private m_cmdGridDimension As ICommand
@@ -434,94 +337,6 @@ Public Class MyStatusBarVM
EgtSetGridShow(bShowGrid, bShowGrid And bShowGridFrame)
End Sub
'''' <summary>
'''' Method that search the machines in the correct folder and add to the MachinesList those valid.
'''' </summary>
'Private Sub SearchMachines()
' ' Svuoto la lista delle macchine
' m_MachinesList.Clear()
' ' Se direttorio base macchine non definito o non esiste, ritorno
' If String.IsNullOrWhiteSpace(IniFile.m_sMachinesRoot) OrElse
' Not Directory.Exists(IniFile.m_sMachinesRoot) OrElse Directory.GetDirectories(IniFile.m_sMachinesRoot).Count = 0 Then
' IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
' EgtOutLog(EgtMsg(MSG_STATUSBAR + 1))
' Return
' End If
' ' Cerco le macchine
' Dim TempArray As String() = Directory.GetDirectories(IniFile.m_sMachinesRoot)
' For i As Integer = 0 To TempArray.Count - 1
' AddMachine(TempArray(i))
' Next
' If m_MachinesList.Count = 0 Then
' IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW
' EgtOutLog(EgtMsg(MSG_STATUSBAR + 1))
' Return
' End If
'End Sub
'Private Function AddMachine(sPath As String) As Boolean
' ' Verifico presenza file caratteristici
' Dim sName As String = Path.GetFileName(sPath)
' Dim MachineIniPath As String = sPath & "\" & sName & ".ini"
' Dim MachineMldePath As String = sPath & "\" & sName & ".mlde"
' If Not File.Exists(MachineIniPath) Or Not File.Exists(MachineMldePath) Then Return False
' ' Aggiungo alla lista
' m_MachinesList.Add(New Machine With {.Name = sName, .MachineDirPath = sPath})
' Return True
'End Function
'Friend Function InsertMachine(sPath As String) As Boolean
' ' Verifico presenza file caratteristici
' Dim sName As String = Path.GetFileName(sPath)
' Dim MachineIniPath As String = sPath & "\" & sName & ".ini"
' Dim MachineMldePath As String = sPath & "\" & sName & ".mlde"
' If Not File.Exists(MachineIniPath) Or Not File.Exists(MachineMldePath) Then Return False
' ' Cerco la posizione di inserimento
' Dim nPos As Integer = 0
' For nI As Integer = 0 To m_MachinesList.Count() - 1
' Dim nRes As Integer = String.Compare(sName, m_MachinesList(nI).Name, True)
' If nRes = 0 Then
' Return True
' ElseIf nRes < 0 Then
' Exit For
' Else
' nPos += 1
' End If
' Next
' ' Inserisco nella lista
' m_MachinesList.Insert(nPos, New Machine With {.Name = sName, .MachineDirPath = sPath})
' Return True
'End Function
'''' <summary>
'''' Class that create the association Name/IniPath for the machine's
'''' </summary>
'Class Machine
' Private m_sName As String
' Public Property Name As String
' Get
' Return m_sName
' End Get
' Set(value As String)
' m_sName = value
' End Set
' End Property
' Friend MachineDirPath As String
'End Class
'Private Sub UpdateToolAndMachDbParamVisibility()
' If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWINGONARCS, 0, IniFile.m_sCurrMachIniFilePath) <> 0 Then
' Sawing(39) = Visibility.Visible ' StepExtArc
' Sawing(40) = Visibility.Visible ' StepIntArc
' Else
' Sawing(39) = Visibility.Collapsed ' StepExtArc
' Sawing(40) = Visibility.Collapsed ' StepIntArc
' End If
'End Sub
Public Function OutText(ByRef psText As IntPtr) As Boolean
' Assegno stringa
OutputMessage = (Marshal.PtrToStringUni(psText))
+5
View File
@@ -67,6 +67,11 @@
<TextBlock Text="{Binding CurrPos}" Foreground="{StaticResource EgaltechWhite}"/>
</StatusBarItem>
<StatusBarItem Grid.Column="8">
<!-- Indica il numero di entità selezionate -->
<TextBlock Text="{Binding SelCount}" Foreground="{StaticResource EgaltechWhite}"
Visibility="{Binding SelCountVisibility}" Margin="5,0,5,0" />
</StatusBarItem>
<StatusBarItem Grid.Column="9">
<Button Command="{Binding StatusUnitsCommand}" Content="{Binding MeasureUnit}" Width="35"/>
</StatusBarItem>
</StatusBar>
+1 -1
View File
@@ -99,7 +99,7 @@ Public Class MyToolDbWindowVM
End Sub
Public Overrides Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) 'Handles m_ToolScene.OnCursorPos
Public Overrides Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String)
Map.refStatusBarVM.NotifyCurrPos(sCursorPos)
End Sub
+7 -1
View File
@@ -210,6 +210,10 @@ Public Class TopCommandBarVM
If Not IsNothing(Map.refSpecialPanelVM) Then
Map.refSpecialPanelVM.SpecialPanelIsEnabled(value)
End If
' aggiorno visibilità indicatore numero di entità selezionate
If Not IsNothing(Map.refStatusBarVM) Then
Map.refStatusBarVM.UpdateSelCountVisibility()
End If
End If
End Sub
@@ -236,7 +240,7 @@ Public Class TopCommandBarVM
If EgtGetCurrMachGroup() = GDB_ID.NULL Then
ExecExitMachScript()
EgtDraw()
' altrimenti, aggiusto...
' altrimenti, aggiusto...
Else
' se parametri di una lavorazione aperti, disattivo database utensili, lavorazioni e setup
Dim bIsEnabled As Boolean = Not IsNothing(Map.refOperationParametersExpanderVM) AndAlso Not Map.refOperationParametersExpanderVM.ParametersIsExpanded
@@ -244,6 +248,8 @@ Public Class TopCommandBarVM
' se parametri di una lavorazione aperti, disattivo MTable e SpecialPanel
If Not IsNothing(Map.refDoorPanelVM) Then Map.refDoorPanelVM.MTableIsEnabled(bIsEnabled)
If Not IsNothing(Map.refSpecialPanelVM) Then Map.refSpecialPanelVM.SpecialPanelIsEnabled(bIsEnabled)
' aggiorno visibilità indicatore numero di entità selezionate
If Not IsNothing(Map.refStatusBarVM) Then Map.refStatusBarVM.UpdateSelCountVisibility()
End If
Else
' Deseleziono tutto