From 0dfbcd86a06b158def0cfdc31e9c23229c2cef51 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 24 Feb 2018 11:40:43 +0000 Subject: [PATCH] EgtCAM5 1.9c1 : - in config. macchina aggiunta tolleranza fori - corretto avvio finestra config. macchina quando manca direttorio per attrezzaggio. --- MachOptionsWindow/MachOptionsView.xaml | 20 ++++--- MachOptionsWindow/MachOptionsViewModel.vb | 69 ++++++++++++++++------- My Project/AssemblyInfo.vb | 4 +- 3 files changed, 64 insertions(+), 29 deletions(-) diff --git a/MachOptionsWindow/MachOptionsView.xaml b/MachOptionsWindow/MachOptionsView.xaml index 9de4631..986cdd6 100644 --- a/MachOptionsWindow/MachOptionsView.xaml +++ b/MachOptionsWindow/MachOptionsView.xaml @@ -7,14 +7,14 @@ TitleBarBrush="{StaticResource EgaltechBlue1}" BorderBrush="{StaticResource EgaltechBlue1}" WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False" - IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" + IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" CloseCommand="{Binding CloseMachOptionsCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" SizeToContent="WidthAndHeight"> - + @@ -26,21 +26,27 @@ + - + - + + + + + + - @@ -50,9 +56,9 @@ - + - diff --git a/MachOptionsWindow/MachOptionsViewModel.vb b/MachOptionsWindow/MachOptionsViewModel.vb index 5093081..b6046af 100644 --- a/MachOptionsWindow/MachOptionsViewModel.vb +++ b/MachOptionsWindow/MachOptionsViewModel.vb @@ -5,31 +5,48 @@ Namespace EgtCAM5 Public Class MachOptionsViewModel - Private m_dSafeZ As String + Private m_sSafeZ As String Public Property SafeZ As String Get - Return m_dSafeZ + Return m_sSafeZ End Get Set(value As String) Dim dSafeZ As Double = 0 - StringToLen(value, dSafeZ) - EgtMdbSetGeneralParam(MCH_GP.SAFEZ, dSafeZ) - EgtMdbSave() - m_dSafeZ = value + If StringToLen(value, dSafeZ) Then + EgtMdbSetGeneralParam(MCH_GP.SAFEZ, dSafeZ) + EgtMdbSave() + m_sSafeZ = value + End If End Set End Property - Private m_dSafeAggrBottZ As String + Private m_sSafeAggrBottZ As String Public Property SafeAggrBottZ As String Get - Return m_dSafeAggrBottZ + Return m_sSafeAggrBottZ End Get Set(value As String) Dim dSafeAggrBottZ As Double = 0 - StringToLen(value, dSafeAggrBottZ) - EgtMdbSetGeneralParam(MCH_GP.SAFEAGGRBOTTZ, dSafeAggrBottZ) - EgtMdbSave() - m_dSafeAggrBottZ = value + If StringToLen(value, dSafeAggrBottZ) Then + EgtMdbSetGeneralParam(MCH_GP.SAFEAGGRBOTTZ, dSafeAggrBottZ) + EgtMdbSave() + m_sSafeAggrBottZ = value + End If + End Set + End Property + + Private m_sHolesTolerance As String + Public Property HolesTolerance As String + Get + Return m_sHolesTolerance + End Get + Set(value As String) + Dim dHolesTolerance As Double = 0 + If StringToLen(value, dHolesTolerance) Then + EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, dHolesTolerance) + EgtMdbSave() + m_sHolesTolerance = value + End If End Set End Property @@ -86,6 +103,12 @@ Namespace EgtCAM5 End Get End Property + Public ReadOnly Property HolesToleranceMsg As String + Get + Return EgtMsg(MSG_MACHININGOPTIONPAGE + 9) + End Get + End Property + Public ReadOnly Property SplitArcsMsg As String Get Return EgtMsg(MSG_MACHININGOPTIONPAGE + 2) @@ -107,23 +130,29 @@ Namespace EgtCAM5 ' Leggo distanza di sicurezza Dim dVal As Double = 0 EgtMdbGetGeneralParam(MCH_GP.SAFEZ, dVal) - m_dSafeZ = LenToString(dVal, 2) + m_sSafeZ = LenToString(dVal, 2) ' Leggo distanza di sicurezza per rinvii da sotto dVal = 0 EgtMdbGetGeneralParam(MCH_GP.SAFEAGGRBOTTZ, dVal) - m_dSafeAggrBottZ = LenToString(dVal, 2) + m_sSafeAggrBottZ = LenToString(dVal, 2) + ' Leggo tolleranza tra diametro punta e diametro foro + dVal = 0 + EgtMdbGetGeneralParam(MCH_GP.HOLEDIAMTOLER, dVal) + m_sHolesTolerance = LenToString(dVal, 2) ' Leggo tipo di spezzatura archi Dim nVal As Integer = 0 EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal) m_SelectedSplitArcs = DirectCast(nVal, MCH_SA) ' Riempio lista attrezzaggi salvati m_ArchivedSetUpList.Add(String.Empty) - Dim SetUpFileNames() As String = Directory.GetFiles(IniFile.m_sCurrMachSetUpDirPath) - For FileIndex = 0 To SetUpFileNames.Count - 1 - If Path.GetExtension(SetUpFileNames(FileIndex)).ToLower = ".stu" Then - m_ArchivedSetUpList.Add(Path.GetFileNameWithoutExtension(SetUpFileNames(FileIndex))) - End If - Next + If Directory.Exists(IniFile.m_sCurrMachSetUpDirPath) Then + Dim SetUpFileNames() As String = Directory.GetFiles(IniFile.m_sCurrMachSetUpDirPath) + For FileIndex = 0 To SetUpFileNames.Count - 1 + If Path.GetExtension(SetUpFileNames(FileIndex)).ToLower = ".stu" Then + m_ArchivedSetUpList.Add(Path.GetFileNameWithoutExtension(SetUpFileNames(FileIndex))) + End If + Next + End If ' Leggo attrezzaggio predefinito If EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", MachOptionModule.m_sSelectedDefaultSetUp, IniFile.m_sCurrMachIniFilePath) <= 0 Then SelectedDefaultSetUp = Nothing diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 7a11060..32dfd63 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + +