diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index c37620d..b99cc85 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -1,5 +1,8 @@ Module ConstMachIni + Public Const S_MCH_GENERAL As String = "General" + Public Const K_MATERIAL As String = "Material" + Public Const S_PARTPROGRAM As String = "PartProgram" Public Const K_EXTENSION As String = "Extension" @@ -67,4 +70,10 @@ Public Const S_ESTIMATIONS As String = "Estimations" Public Const K_EST_ENABLE As String = "Enable" + ' Tipi di materiali previsti attualmente per le macchine + Public Const MCH_MAT_STONE As String = "Stone" + Public Const MCH_MAT_WOOD As String = "Wood" + Public Const MCH_MAT_BEAM As String = "Beam" + Public Const MCH_MAT_ADDITIVE As String = "Additive" + End Module diff --git a/MachGroupPanel/MyMachGroupPanelVM.vb b/MachGroupPanel/MyMachGroupPanelVM.vb index c6eb60b..f887d59 100644 --- a/MachGroupPanel/MyMachGroupPanelVM.vb +++ b/MachGroupPanel/MyMachGroupPanelVM.vb @@ -311,19 +311,19 @@ Public Class MyMachGroupPanelVM End Sub Private Sub LoadMaterialType() - Dim sMatType As String = "Wood" + Dim sMatType As String = MCH_MAT_WOOD ' IniFile.m_sMachineName = Map.refStatusBarVM.SelectedMachine.Name ' IniFile.m_sCurrMachIniFilePath = Map.refStatusBarVM.SelectedMachine.MachineDirPath & "\" & Map.refStatusBarVM.SelectedMachine.Name & ".ini" Dim sMachineIniPath = IniFile.m_sCurrMachIniFilePath - EgtUILib.GetPrivateProfileString(S_GENERAL, EgtWPFLib5.EstConstMachIni.K_MATERIAL, sMatType, sMatType, sMachineIniPath) + EgtUILib.GetPrivateProfileString(S_MCH_GENERAL, K_MATERIAL, sMatType, sMatType, sMachineIniPath) Select Case sMatType - Case "Stone" + Case MCH_MAT_STONE EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE - Case "Wood" + Case MCH_MAT_WOOD EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD - Case "Beam" + Case MCH_MAT_BEAM EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM - Case "Additive" + Case MCH_MAT_ADDITIVE EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD Case Else ' Se il materiale specificato nel file INI della macchina non corrisponde ai 4 sopracitati viene emesso un messaggio di errore diff --git a/MachOptionsWindow/MachOptionV.xaml b/MachOptionsWindow/MachOptionV.xaml index 07039ed..3e298f2 100644 --- a/MachOptionsWindow/MachOptionV.xaml +++ b/MachOptionsWindow/MachOptionV.xaml @@ -16,10 +16,8 @@ - - - - + + @@ -28,6 +26,8 @@ + + @@ -57,12 +57,24 @@ - + + + + + + + + + + + - + diff --git a/MachOptionsWindow/MachOptionVM.vb b/MachOptionsWindow/MachOptionVM.vb index 67afd8a..f4e4653 100644 --- a/MachOptionsWindow/MachOptionVM.vb +++ b/MachOptionsWindow/MachOptionVM.vb @@ -1,5 +1,6 @@ Imports System.IO Imports EgtUILib +Imports EgtWPFLib5 Public Class MachOptionVM @@ -48,21 +49,6 @@ Public Class MachOptionVM End Set End Property - Private m_sApproxLinTol As String - Public Property ApproxLinTol As String - Get - Return m_sApproxLinTol - End Get - Set(value As String) - Dim dApproxLinTol As Double = 0 - If StringToLen(value, dApproxLinTol) Then - EgtMdbSetGeneralParam(MCH_GP.APPROXLINTOL, dApproxLinTol) - EgtMdbSave() - m_sApproxLinTol = value - End If - End Set - End Property - Private m_SplitArcsList As New List(Of MCH_SA)({MCH_SA.NEVER, MCH_SA.GEN_PLANE, MCH_SA.NO_XY_PLANE, MCH_SA.ALWAYS}) Public ReadOnly Property SplitArcsList As List(Of MCH_SA) Get @@ -82,6 +68,51 @@ Public Class MachOptionVM End Set End Property + Private m_sExtSawArcMinRad As String + Public Property ExtSawArcMinRad As String + Get + Return m_sExtSawArcMinRad + End Get + Set(value As String) + Dim dExtSawArcMinRad As Double = 0 + If StringToLen(value, dExtSawArcMinRad) Then + EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dExtSawArcMinRad) + EgtMdbSave() + m_sExtSawArcMinRad = value + End If + End Set + End Property + + Private m_sIntSawArcMaxSideAng As String + Public Property IntSawArcMaxSideAng As String + Get + Return m_sIntSawArcMaxSideAng + End Get + Set(value As String) + Dim dIntSawArcMaxSideAng As Double = 0 + If StringToLen(value, dIntSawArcMaxSideAng) Then + EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dIntSawArcMaxSideAng) + EgtMdbSave() + m_sIntSawArcMaxSideAng = value + End If + End Set + End Property + + Private m_sApproxLinTol As String + Public Property ApproxLinTol As String + Get + Return m_sApproxLinTol + End Get + Set(value As String) + Dim dApproxLinTol As Double = 0 + If StringToLen(value, dApproxLinTol) Then + EgtMdbSetGeneralParam(MCH_GP.APPROXLINTOL, dApproxLinTol) + EgtMdbSave() + m_sApproxLinTol = value + End If + End Set + End Property + Private m_ArchivedSetUpList As New List(Of String) Public Property ArchivedSetUpList As List(Of String) Get @@ -121,11 +152,6 @@ Public Class MachOptionVM Return EgtMsg(MSG_MACHININGOPTIONPAGE + 9) End Get End Property - Public ReadOnly Property ApproxLinTolMsg As String - Get - Return EgtMsg(6410) ' Tolleranza di approssimazione - End Get - End Property Public ReadOnly Property SplitArcsMsg As String Get @@ -133,6 +159,24 @@ Public Class MachOptionVM End Get End Property + Public ReadOnly Property ExtSawArcMinRadMsg As String + Get + Return EgtMsg(6411) ' Minimo raggio arco esterno con lama + End Get + End Property + + Public ReadOnly Property IntSawArcMaxSideAngMsg As String + Get + Return EgtMsg(6412) ' Massima inclinazione arco interno con lama + End Get + End Property + + Public ReadOnly Property ApproxLinTolMsg As String + Get + Return EgtMsg(6410) ' Tolleranza di approssimazione + End Get + End Property + Public ReadOnly Property DefaultSetUpMsg As String Get Return EgtMsg(MSG_MACHININGOPTIONPAGE + 7) @@ -161,6 +205,14 @@ Public Class MachOptionVM Dim nVal As Integer = 0 EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal) m_SelectedSplitArcs = DirectCast(nVal, MCH_SA) + ' Leggo minimo raggio arco esterno lavorabile con lama + dVal = 0 + EgtMdbGetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal) + m_sExtSawArcMinRad = LenToString(dVal, 4) + ' Leggo massima inclinazione lama per lavorare archi interni + dVal = 0 + EgtMdbGetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal) + m_sIntSawArcMaxSideAng = LenToString(dVal, 4) ' Leggo tolleranza lineare di approssimazione dVal = 0 EgtMdbGetGeneralParam(MCH_GP.APPROXLINTOL, dVal) @@ -185,6 +237,17 @@ Public Class MachOptionVM End If End Sub +#Region "Visibility" + Public ReadOnly Property StoneVisibility As Visibility + Get + Dim sGenMat As String = "" + EgtUILib.GetPrivateProfileString(S_MCH_GENERAL, K_MATERIAL, MCH_MAT_WOOD, sGenMat, IniFile.m_sCurrMachIniFilePath) + Return If( sGenMat = MCH_MAT_STONE, Visibility.Visible, Visibility.Collapsed) + End Get + End Property + +#End Region + #Region "COMMANDS" #Region "CloseMachOptionsCommand" diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 2300864..b3f38b2 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,6 +70,6 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb index 82312b8..557b15f 100644 --- a/My Project/Resources.Designer.vb +++ b/My Project/Resources.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -22,7 +22,7 @@ Namespace My.Resources ''' ''' A strongly-typed resource class, for looking up localized strings, etc. ''' - _ diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb index ff32405..fd3b531 100644 --- a/My Project/Settings.Designer.vb +++ b/My Project/Settings.Designer.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -12,15 +12,16 @@ Option Strict On Option Explicit On - - _ -Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) +Namespace My + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean @@ -28,17 +29,17 @@ Partial Friend NotInheritable Class MySettings Private Shared addedHandlerLockObject As New Object _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - + + Public Shared ReadOnly Property [Default]() As MySettings + Get + #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject @@ -49,10 +50,11 @@ Partial Friend NotInheritable Class MySettings End SyncLock End If #End If - Return defaultInstance - End Get - End Property -End Class + Return defaultInstance + End Get + End Property + End Class +End Namespace Namespace My @@ -62,9 +64,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.EgtCAM5.MySettings + Friend ReadOnly Property Settings() As Global.EgtCAM5.My.MySettings Get - Return Global.EgtCAM5.MySettings.Default + Return Global.EgtCAM5.My.MySettings.Default End Get End Property End Module