From 6d5af149aeab6eb0ff945ed7babb20c66067f603 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 14 Mar 2018 11:05:44 +0000 Subject: [PATCH] EgtCAM5 1.9c3 : - corretto controllo uscita da simulazione in corso (non in Home o Stop) - per MTable lettura da GeometryNameList.ini elimina tutto quanto dopo ";". --- AboutBoxWindow/AboutBoxView.xaml.vb | 1 + Application.xaml.vb | 2 +- IniFile.vb | 2 +- MTableDb/MTableListBox.vb | 13 ++++++++++--- My Project/AssemblyInfo.vb | 4 ++-- .../OperationExpanderView.xaml | 4 ++-- .../OperationExpanderViewModel.vb | 15 +++++++++++++++ .../SimulationExpanderViewModel.vb | 17 ++++++++--------- 8 files changed, 40 insertions(+), 18 deletions(-) diff --git a/AboutBoxWindow/AboutBoxView.xaml.vb b/AboutBoxWindow/AboutBoxView.xaml.vb index 335c790..0d2301f 100644 --- a/AboutBoxWindow/AboutBoxView.xaml.vb +++ b/AboutBoxWindow/AboutBoxView.xaml.vb @@ -19,6 +19,7 @@ Public Class AboutBoxView " (" & IniFile.m_nInstance.ToString() & ")" & Environment.NewLine sInfo &= "DataRoot " & IniFile.m_sDataRoot & Environment.NewLine sInfo &= "MachinesRoot " & IniFile.m_sMachinesRoot & Environment.NewLine + If IniFile.IsActiveDoors() Then sInfo &= "Doors " & IniFile.m_sDoorsDirPath & Environment.NewLine Dim sScene As String = String.Empty EgtGetSceneInfo(sScene) sInfo &= sScene diff --git a/Application.xaml.vb b/Application.xaml.vb index 210ce4a..a8268cd 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -163,7 +163,7 @@ Class Application Friend Const MACHGROUPSRESULT As String = "MachGroupsResult" ' MachiningOptionPanel - ' MachiningTreeViewExpander + Friend Const OPERATIONVIEWEXPANDERISENABLED As String = "OperationViewExpanderIsEnabled" Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled" Friend Const NEWMACHININGMODEISACTIVE As String = "NewMachiningModeIsActive" Friend Const SIMULATIONEXPANDER_GET_ISEXPANDED As String = "Get_SimulationExpander_IsExpanded" diff --git a/IniFile.vb b/IniFile.vb index f70a68d..132dcca 100644 --- a/IniFile.vb +++ b/IniFile.vb @@ -240,7 +240,7 @@ Public Module IniFile End Function Friend Function IsActiveSpecialPanel() As Boolean - Return If(GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0, True, False) + Return GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 End Function End Module diff --git a/MTableDb/MTableListBox.vb b/MTableDb/MTableListBox.vb index 3d05c65..5dbf7d6 100644 --- a/MTableDb/MTableListBox.vb +++ b/MTableDb/MTableListBox.vb @@ -1127,9 +1127,16 @@ Public Class MTableAssociationGridBoxItem Dim NameFilePath As String = IniFile.m_sTablesRoot & "/" & GEONAMELIST_FILE Dim TempNameList As New List(Of String) Dim Index As Integer = 1 - Dim sRaedName As String = String.Empty - While EgtUILib.GetPrivateProfileString(S_GEOMETRYNAMES, Index.ToString, "", sRaedName, NameFilePath) > 0 - TempNameList.Add(sRaedName) + Dim sReadName As String = String.Empty + While EgtUILib.GetPrivateProfileString(S_GEOMETRYNAMES, Index.ToString(), "", sReadName, NameFilePath) > 0 + ' elimino tutto quello che viene dopo il primo ";" + Dim nCut As Integer = sReadName.IndexOf(";"c) + If nCut > 0 Then sReadName = sReadName.Remove(nCut) + ' elimino eventuali spazi iniziali e finali + sReadName = sReadName.Trim() + ' se stringa non vuota la inserisco nell'elenco + If Not String.IsNullOrEmpty(sReadName) Then TempNameList.Add(sReadName) + ' passo alla successiva Index += 1 End While TempNameList.Sort() diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index c6b3453..177b38f 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml index 773944e..7131dbd 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderView.xaml @@ -6,10 +6,10 @@ xmlns:EgtCAM5="clr-namespace:EgtCAM5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"> - + + Style="{StaticResource ExpanderStyle}"> diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb index 8fa0703..748e4d1 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb @@ -64,6 +64,17 @@ Namespace EgtCAM5 SIMULATION End Enum + Private m_OperViewIsEnabled As Boolean = True + Public Property OperViewIsEnabled As Boolean + Get + Return m_OperViewIsEnabled + End Get + Set(value As Boolean) + m_OperViewIsEnabled = value + OnPropertyChanged("OperViewIsEnabled") + End Set + End Property + Private m_ListIsExpanded As Boolean Public Property ListIsExpanded As Boolean Get @@ -397,6 +408,10 @@ Namespace EgtCAM5 EndNewMachining(Params.SelMachOpId) End If End Sub) + Application.Msn.Register(Application.OPERATIONVIEWEXPANDERISENABLED, Sub(bEnable As Boolean) + OperViewIsEnabled = bEnable + End Sub) + Application.Msn.Register(Application.SIMULATIONEXPANDER_GET_ISEXPANDED, Sub(bValue As Boolean) If m_CurrExpandedExpander = MachiningOptionPanelExpander.SIMULATION Then ListIsExpanded = True diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb index 1b729f1..f1e72c2 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb @@ -28,7 +28,7 @@ Namespace EgtCAM5 End Get Set(value As SIM_ST) m_nStatus = value - If IniFile.m_nUserLevel >= 10 AndAlso (value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP) Then + If IniFile.m_nUserLevel >= 5 AndAlso (value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP) Then For Index = 0 To m_MachineAxisList.Count - 1 m_MachineAxisList(Index).IsReadOnlyAxesValue = False Next @@ -37,11 +37,6 @@ Namespace EgtCAM5 m_MachineAxisList(Index).IsReadOnlyAxesValue = True Next End If - If value = SIM_ST.ST_PAUSE OrElse value = SIM_ST.ST_STOP Then - Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, True) - Else - Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, False) - End If EgtSimSetUiStatus(m_nStatus) End Set End Property @@ -75,6 +70,7 @@ Namespace EgtCAM5 InitializeSimulation() EgtDraw() Else + If m_bSimExecuting Then Return CloseSimulation() If IniFile.m_bShowOnlyTable Then EgtShowOnlyTable(True) @@ -605,6 +601,8 @@ Namespace EgtCAM5 Private Sub ExecSim() m_bSimExecuting = True + Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, False) + Application.Msn.NotifyColleagues(Application.OPERATIONVIEWEXPANDERISENABLED, False) EgtSimStart(False) EgtSimSetStep(SliderValue * m_SliderX) Dim nShowDataCounter As Integer = 0 @@ -650,8 +648,7 @@ Namespace EgtCAM5 ' Aggiorno visualizzazione EgtDraw() ' Aggiorno dati CNC - If nShowDataCounter = 5 Or - SimulationStatus = SIM_ST.ST_PAUSE Or SimulationStatus = SIM_ST.ST_STOP Then + If nShowDataCounter = 5 Or SimulationStatus = SIM_ST.ST_PAUSE Or SimulationStatus = SIM_ST.ST_STOP Then ShowCncData() nShowDataCounter = 0 ElseIf nShowDataCounter > 5 Then @@ -661,12 +658,14 @@ Namespace EgtCAM5 End If Else ' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU - System.Threading.Thread.Sleep(1) + System.Threading.Thread.Sleep(4) End If ' Costringo ad aggiornare UI UpdateUI() End While m_bSimExecuting = False + Application.Msn.NotifyColleagues(Application.SETDRAWISENABLED, True) + Application.Msn.NotifyColleagues(Application.OPERATIONVIEWEXPANDERISENABLED, True) End Sub Private Sub ShowCncData()