From 4d610cea8b0cc6a6c3a6a8ef684e9fc2fd1f6f03 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 3 Dec 2025 18:45:00 +0100 Subject: [PATCH] =?UTF-8?q?EgtCAM5=20:=20-=20sulla=20status=20bar=20in=20m?= =?UTF-8?q?odalit=C3=A0=20Disegna=20aggiunta=20indicazione=20numero=20di?= =?UTF-8?q?=20entit=C3=A0=20selezionate=20(Sel=20:=20NNN)=20-=20migliorie?= =?UTF-8?q?=20e=20correzioni=20a=20ExecuteWindow=20per=20caso=20di=20passa?= =?UTF-8?q?ggio=20a=20Lavorazioni.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrawPanel/DrawPanelVM.vb | 1 + ExecuteWindow/ExecuteWindowVM.vb | 11 +- SpecialPanel/SpecialPanelVM.vb | 4 +- StatusBar/MyStatusBarVM.vb | 235 ++++-------------------------- StatusBar/StatusBarV.xaml | 5 + ToolsDbWindow/MyToolDbWindowVM.vb | 2 +- TopCommandBar/TopCommandBarVM.vb | 8 +- 7 files changed, 45 insertions(+), 221 deletions(-) diff --git a/DrawPanel/DrawPanelVM.vb b/DrawPanel/DrawPanelVM.vb index df0c1bd..8bb8930 100644 --- a/DrawPanel/DrawPanelVM.vb +++ b/DrawPanel/DrawPanelVM.vb @@ -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 diff --git a/ExecuteWindow/ExecuteWindowVM.vb b/ExecuteWindow/ExecuteWindowVM.vb index 27eb94e..3a00c6e 100644 --- a/ExecuteWindow/ExecuteWindowVM.vb +++ b/ExecuteWindow/ExecuteWindowVM.vb @@ -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 diff --git a/SpecialPanel/SpecialPanelVM.vb b/SpecialPanel/SpecialPanelVM.vb index 80f91ca..97db945 100644 --- a/SpecialPanel/SpecialPanelVM.vb +++ b/SpecialPanel/SpecialPanelVM.vb @@ -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) diff --git a/StatusBar/MyStatusBarVM.vb b/StatusBar/MyStatusBarVM.vb index fb302ea..e4f8423 100644 --- a/StatusBar/MyStatusBarVM.vb +++ b/StatusBar/MyStatusBarVM.vb @@ -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 - '''' - '''' Method that search the machines in the correct folder and add to the MachinesList those valid. - '''' - '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 - - '''' - '''' Class that create the association Name/IniPath for the machine's - '''' - '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)) diff --git a/StatusBar/StatusBarV.xaml b/StatusBar/StatusBarV.xaml index 6c32863..bdbf0f8 100644 --- a/StatusBar/StatusBarV.xaml +++ b/StatusBar/StatusBarV.xaml @@ -67,6 +67,11 @@ + + + +