Compare commits

..

1 Commits

Author SHA1 Message Date
Demetrio Cassarino eec592c782 -aggiunto gestione lampadina su operazione selezionta
-aggiunto info note
2025-04-03 14:26:07 +02:00
73 changed files with 676 additions and 1774 deletions
+2
View File
@@ -1,5 +1,7 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.ComponentModel Imports System.ComponentModel
Imports EgtUILib
Imports EgtUILib.EgtInterface
' Classe che definisce un elemento di base del TreeView ' Classe che definisce un elemento di base del TreeView
Public Class TreeViewItemBase Public Class TreeViewItemBase
+2 -4
View File
@@ -73,7 +73,7 @@ Module ConstIni
Public Const K_SELSURF As String = "SelSurf" Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode" Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_CURVEDIR As String = "CurveDir" Public Const K_CURVEDIR As String = "CurveDir"
Public Const K_SHOWSURFQUALITY As String = "ShowSurfQuality" Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
Public Const K_SHOWZMAP As String = "ShowZmap" Public Const K_SHOWZMAP As String = "ShowZmap"
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels" Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
Public Const K_ZOOMWIN As String = "ZoomWin" Public Const K_ZOOMWIN As String = "ZoomWin"
@@ -189,8 +189,7 @@ Module ConstIni
Public Const K_SELGEOMSURFFINISHING As String = "SelGeomSurfFinishing" Public Const K_SELGEOMSURFFINISHING As String = "SelGeomSurfFinishing"
Public Const K_SELGEOMSURFROUGHING As String = "SelGeomSurfRoughing" Public Const K_SELGEOMSURFROUGHING As String = "SelGeomSurfRoughing"
Public Const K_SELGEOMFIVEAXMILLING As String = "SelGeomFiveAxMilling" Public Const K_SELGEOMFIVEAXMILLING As String = "SelGeomFiveAxMilling"
Public Const K_SELGEOMPROBING As String = "SelGeomProbing" Public Const K_SELVMILLQUALITY As String = "VMillQuality"
Public Const K_VMILLQUALITY As String = "VMillQuality"
Public Const K_MACHININGGROUP As String = "MachiningGroup" Public Const K_MACHININGGROUP As String = "MachiningGroup"
Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable" Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable"
Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps" Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps"
@@ -199,7 +198,6 @@ Module ConstIni
Public Const S_SIMUL As String = "Simul" Public Const S_SIMUL As String = "Simul"
Public Const K_SLIDERX As String = "SliderX" Public Const K_SLIDERX As String = "SliderX"
Public Const K_SLIDERVAL As String = "SliderVal" Public Const K_SLIDERVAL As String = "SliderVal"
Public Const K_TRACEENABLE As String = "TraceEnable"
Public Const S_OPTIONS As String = "Options" Public Const S_OPTIONS As String = "Options"
Public Const K_NEWMACHININGISLASTONE As String = "NewMachiningIsLastOne" Public Const K_NEWMACHININGISLASTONE As String = "NewMachiningIsLastOne"
+14 -19
View File
@@ -1,13 +1,6 @@
Module ConstMachIni 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"
Public Const S_TOOLS As String = "Tools" Public Const S_TOOLS As String = "Tools"
Public Const K_PROBE As String = "Probe"
Public Const K_DRILLBIT As String = "Drillbit" Public Const K_DRILLBIT As String = "Drillbit"
Public Const K_SAWBLADE As String = "Sawblade" Public Const K_SAWBLADE As String = "Sawblade"
Public Const K_MILL As String = "Mill" Public Const K_MILL As String = "Mill"
@@ -15,17 +8,22 @@
Public Const K_CHISEL As String = "Chisel" Public Const K_CHISEL As String = "Chisel"
Public Const K_WATERJET As String = "WaterJet" Public Const K_WATERJET As String = "WaterJet"
Public Const K_COMPO As String = "Compo" Public Const K_COMPO As String = "Compo"
Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger"
Public Const K_SHOWHEADEXIT As String = "ShowHeadExit"
Public Const K_DRILLHOLDER As String = "DrillHolder"
Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder"
Public Const K_MILLHOLDER As String = "MillHolder"
Public Const K_DRILLMAKER As String = "DrillMaker" Public Const K_DRILLMAKER As String = "DrillMaker"
Public Const K_SAWBLADEMAKER As String = "SawbladeMaker" Public Const K_SAWBLADEMAKER As String = "SawbladeMaker"
Public Const K_MILLMAKER As String = "MillMaker" Public Const K_MILLMAKER As String = "MillMaker"
Public Const K_MORTISEMAKER As String = "MortiseMaker" Public Const K_MORTISEMAKER As String = "MortiseMaker"
Public Const K_CHISELMAKER As String = "ChiselMaker" Public Const K_CHISELMAKER As String = "ChiselMaker"
Public Const K_MOUNTEDTOOLCONFIG As String = "MountedToolConfig"
Public Const K_ACTIVE As String = "Active" Public Const K_ACTIVE As String = "Active"
Public Const S_TOOLHOLDER As String = "ToolHolder" Public Const S_TOOLHOLDER As String = "ToolHolder"
Public Const S_MACHININGS As String = "Machinings" Public Const S_MACHININGS As String = "Machinings"
Public Const K_PROBING As String = "Probing"
Public Const K_SAWING As String = "Sawing" Public Const K_SAWING As String = "Sawing"
Public Const K_DRILLING As String = "Drilling" Public Const K_DRILLING As String = "Drilling"
Public Const K_MILLING As String = "Milling" Public Const K_MILLING As String = "Milling"
@@ -39,12 +37,18 @@
Public Const K_SURFFINISHING As String = "SurfFinishing" Public Const K_SURFFINISHING As String = "SurfFinishing"
Public Const K_5AXMILLING As String = "5AxMilling" Public Const K_5AXMILLING As String = "5AxMilling"
Public Const K_WATERJETTING As String = "WaterJetting" Public Const K_WATERJETTING As String = "WaterJetting"
Public Const K_SAWINGONARCS As String = "SawingOnArcs"
Public Const S_GENMACHINING As String = "GenMachining" Public Const S_GENMACHINING As String = "GenMachining"
Public Const K_GENSCRIPT As String = "GenScript" Public Const K_GENSCRIPT As String = "GenScript"
Public Const S_5AXMILLING As String = "5AxMilling" Public Const S_TOOLCHANGER As String = "ToolChanger"
Public Const K_5AXSCRIPT As String = "5AxScript" Public Const K_NUMBER As String = "Number"
Public Const K_POS As String = "Pos"
Public Const K_NAME As String = "Name"
Public Const K_MANUALNUMBER As String = "ManualNumber"
Public Const K_MANUALPOS As String = "ManualPos"
Public Const K_MANUALNAME As String = "ManualName"
Public Const S_DISPOSITION As String = "Disposition" Public Const S_DISPOSITION As String = "Disposition"
Public Const K_DISP_INITSCRIPT As String = "InitScript" Public Const K_DISP_INITSCRIPT As String = "InitScript"
@@ -64,16 +68,7 @@
Public Const S_VMILL As String = "VMill" Public Const S_VMILL As String = "VMill"
Public Const K_VM_ENABLE As String = "Enable" Public Const K_VM_ENABLE As String = "Enable"
Public Const S_TOOLTRACE As String = "ToolTrace"
Public Const K_TT_ENABLE As String = "Enable"
Public Const S_ESTIMATIONS As String = "Estimations" Public Const S_ESTIMATIONS As String = "Estimations"
Public Const K_EST_ENABLE As String = "Enable" 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 End Module
+6 -18
View File
@@ -34,11 +34,6 @@
Command="{Binding ArcCSECommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding ArcCSECommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/ArcCSE.png" Stretch="Uniform"/> <Image Source="/Resources/DrawPanel/ArcCSE.png" Stretch="Uniform"/>
</Button> </Button>
<Button ToolTip="{Binding Arc2PRToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding Arc2PRCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/Arc2PR.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Arc3PToolTip}" Style="{StaticResource DrawPanelButton}" <Button ToolTip="{Binding Arc3PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True" ToolTipService.ShowOnDisabled="True"
Command="{Binding Arc3PCommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding Arc3PCommand}" IsEnabled="{Binding bLayerOk}">
@@ -49,28 +44,21 @@
Command="{Binding ArcPDPCommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding ArcPDPCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/ArcPDP.png" Stretch="Uniform"/> <Image Source="/Resources/DrawPanel/ArcPDP.png" Stretch="Uniform"/>
</Button> </Button>
<Button ToolTip="{Binding BiArcToolTip}" Style="{StaticResource DrawPanelButton}" <Button ToolTip="{Binding CirclePDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding BiArcCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/BiArc.png" Stretch="Uniform"/>
</Button>
<Button Style="{StaticResource DrawPanelButton}"
Visibility="Hidden"/>
<Button ToolTip="{Binding CircleCPToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True" ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCPCommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding CircleCPCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCP.png" Stretch="Uniform"/> <Image Source="/Resources/DrawPanel/CircleCP.png" Stretch="Uniform"/>
</Button> </Button>
<Button ToolTip="{Binding CircleCDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCDCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCD.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Circle3PToolTip}" Style="{StaticResource DrawPanelButton}" <Button ToolTip="{Binding Circle3PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True" ToolTipService.ShowOnDisabled="True"
Command="{Binding Circle3PCommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding Circle3PCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/Circle3P.png" Stretch="Uniform"/> <Image Source="/Resources/DrawPanel/Circle3P.png" Stretch="Uniform"/>
</Button> </Button>
<Button ToolTip="{Binding CircleCDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCDCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCD.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Rectangle2PToolTip}" Style="{StaticResource DrawPanelButton}" <Button ToolTip="{Binding Rectangle2PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True" ToolTipService.ShowOnDisabled="True"
Command="{Binding Rectangle2PCommand}" IsEnabled="{Binding bLayerOk}"> Command="{Binding Rectangle2PCommand}" IsEnabled="{Binding bLayerOk}">
+2 -65
View File
@@ -50,7 +50,7 @@ Public Class DrawPanelVM
Return EgtMsg(MSG_DRAWPANEL + 3) Return EgtMsg(MSG_DRAWPANEL + 3)
End Get End Get
End Property End Property
Public ReadOnly Property CircleCPToolTip As String Public ReadOnly Property CirclePDToolTip As String
Get Get
Return EgtMsg(MSG_DRAWPANEL + 4) Return EgtMsg(MSG_DRAWPANEL + 4)
End Get End Get
@@ -72,12 +72,7 @@ Public Class DrawPanelVM
End Property End Property
Public ReadOnly Property Arc3PToolTip As String Public ReadOnly Property Arc3PToolTip As String
Get Get
Return EgtMsg(5207) Return EgtMsg(MSG_DRAWPANEL + 7)
End Get
End Property
Public ReadOnly Property Arc2PRToolTip As String
Get
Return EgtMsg(5169)
End Get End Get
End Property End Property
Public ReadOnly Property ArcPDPToolTip As String Public ReadOnly Property ArcPDPToolTip As String
@@ -85,12 +80,6 @@ Public Class DrawPanelVM
Return EgtMsg(MSG_DRAWPANEL + 8) Return EgtMsg(MSG_DRAWPANEL + 8)
End Get End Get
End Property End Property
Public ReadOnly Property BiArcToolTip As String
Get
Return EgtMsg(5170)
End Get
End Property
Public ReadOnly Property Rectangle2PToolTip As String Public ReadOnly Property Rectangle2PToolTip As String
Get Get
Return EgtMsg(MSG_DRAWPANEL + 11) Return EgtMsg(MSG_DRAWPANEL + 11)
@@ -481,9 +470,7 @@ Public Class DrawPanelVM
Private m_cmdCircle3P As ICommand Private m_cmdCircle3P As ICommand
Private m_cmdArcCSE As ICommand Private m_cmdArcCSE As ICommand
Private m_cmdArc3P As ICommand Private m_cmdArc3P As ICommand
Private m_cmdArc2PR As ICommand
Private m_cmdArcPDP As ICommand Private m_cmdArcPDP As ICommand
Private m_cmdBiArc As ICommand
Private m_cmdRectangle2P As ICommand Private m_cmdRectangle2P As ICommand
Private m_cmdPolygon As ICommand Private m_cmdPolygon As ICommand
Private m_cmdPolygonSide As ICommand Private m_cmdPolygonSide As ICommand
@@ -761,29 +748,6 @@ Public Class DrawPanelVM
#End Region ' Arc3PCommand #End Region ' Arc3PCommand
#Region "Arc2PRCommand"
''' <summary>
''' Returns a command that do Arc2PR.
''' </summary>
Public ReadOnly Property Arc2PRCommand As ICommand
Get
If m_cmdArc2PR Is Nothing Then
m_cmdArc2PR = New RelayCommand(AddressOf Arc2PR)
End If
Return m_cmdArc2PR
End Get
End Property
''' <summary>
''' Execute the Arc2PR. This method is invoked by the Arc2PRCommand.
''' </summary>
Public Sub Arc2PR(ByVal param As Object)
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARC2PR)
End Sub
#End Region ' Arc2PRCommand
#Region "ArcPDPCommand" #Region "ArcPDPCommand"
''' <summary> ''' <summary>
@@ -814,33 +778,6 @@ Public Class DrawPanelVM
#End Region ' ArcPDPCommand #End Region ' ArcPDPCommand
#Region "BiArcCommand"
''' <summary>
''' Returns a command that do BiArc.
''' </summary>
Public ReadOnly Property BiArcCommand As ICommand
Get
If m_cmdBiArc Is Nothing Then
m_cmdBiArc = New RelayCommand(AddressOf BiArc)
End If
Return m_cmdBiArc
End Get
End Property
''' <summary>
''' Execute the BiArc. This method is invoked by the BiArcCommand.
''' </summary>
Public Sub BiArc(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.BIARC)
Else
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CURVEBEZIER)
End If
End Sub
#End Region ' BiArcCommand
#Region "Rectangle2PCommand" #Region "Rectangle2PCommand"
''' <summary> ''' <summary>
+1 -22
View File
@@ -164,10 +164,6 @@
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" /> <Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" /> <Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" /> <Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
<Compile Include="ExecuteWindow\ExecuteWindowV.xaml.vb">
<DependentUpon>ExecuteWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="ExecuteWindow\ExecuteWindowVM.vb" />
<Compile Include="LeftTray\LeftTrayV.xaml.vb"> <Compile Include="LeftTray\LeftTrayV.xaml.vb">
<DependentUpon>LeftTrayV.xaml</DependentUpon> <DependentUpon>LeftTrayV.xaml</DependentUpon>
</Compile> </Compile>
@@ -177,9 +173,6 @@
<DependentUpon>EstimationsExpanderV.xaml</DependentUpon> <DependentUpon>EstimationsExpanderV.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="OptionPanel\MachiningOptionPanel\EstimationsExpander\EstimationsExpander.vb" /> <Compile Include="OptionPanel\MachiningOptionPanel\EstimationsExpander\EstimationsExpander.vb" />
<Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\ProbingParameterExpanderV.xaml.vb">
<DependentUpon>ProbingParameterExpanderV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml.vb"> <Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml.vb">
<DependentUpon>FiveAxisMachinigParameterExpanderV.xaml</DependentUpon> <DependentUpon>FiveAxisMachinigParameterExpanderV.xaml</DependentUpon>
</Compile> </Compile>
@@ -470,10 +463,6 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="ExecuteWindow\ExecuteWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LeftTray\LeftTrayV.xaml"> <Page Include="LeftTray\LeftTrayV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -486,10 +475,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\ProbingParameterExpanderV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml"> <Page Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -1054,13 +1039,7 @@
<Resource Include="Resources\DrawPanel\StmMoveVertex.png" /> <Resource Include="Resources\DrawPanel\StmMoveVertex.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\DrawPanel\Arc2PR.png" /> <Resource Include="Resources\TreeView\LampSel.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\BiArc.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ExecuteWindow\reload.png" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
-5
View File
@@ -65,13 +65,8 @@ Public Class ExecutePanelVM
''' Execute the Exec. This method is invoked by the ExecCommand. ''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary> ''' </summary>
Public Sub Exec(ByVal param As Object) Public Sub Exec(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Dim ExecuteWindow As New ExecuteWindowV(Application.Current.MainWindow, New ExecuteWindowVM)
ExecuteWindow.ShowDialog()
Else
Map.refProjectVM.PreExecScript(True) Map.refProjectVM.PreExecScript(True)
Map.refProjectVM.ExecScript(String.Empty) Map.refProjectVM.ExecScript(String.Empty)
End If
End Sub End Sub
#End Region ' ExecCommand #End Region ' ExecCommand
-39
View File
@@ -1,39 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ExecuteWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="Execute Window"
Height="500" Width="400"
IsResizable="True"
IsMinimizable="True"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False"
TitleBarHeight="32"
PreviewKeyDown="EgtCustomWindow_PreviewKeyDown"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding sScriptText}"
Style="{StaticResource ExecuteWindow_TextBox}"/>
<Button Grid.Row="1"
Grid.ColumnSpan="2"
Content="{Binding OkMsg}"
Command="{Binding Ok_Command}"
Style="{StaticResource EgtCAM5_InputButton}"/>
<Button Grid.Column="1"
Command="{Binding Reload_Command}"
IsEnabled="{Binding bReload_IsEnable}"
Style="{StaticResource ExecuteWindow_Button}">
<Image Source="/Resources/ExecuteWindow/reload.png" Stretch="Uniform"/>
</Button>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
-32
View File
@@ -1,32 +0,0 @@
Public Class ExecuteWindowV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_ExecuteWindowVM As ExecuteWindowVM
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(Owner As Window, ExecuteWindowVM As ExecuteWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ExecuteWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ExecuteWindowVM = ExecuteWindowVM
End Sub
#End Region ' Constructor
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ExecuteWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
Private Sub EgtCustomWindow_PreviewKeyDown(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
Me.Close()
End If
End Sub
End Class
-125
View File
@@ -1,125 +0,0 @@
Imports System.Text
Imports EgtUILib
Imports System.IO
Public Class ExecuteWindowVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
' Evento per chiusura finestra
Public Event m_CloseWindow(bDialogResult As Boolean)
Private ReadOnly scriptFilePath As String = IO.Path.Combine(IniFile.m_sTempDir, $"tmpLua.lua")
Private m_sScriptText As String
Public Property sScriptText As String
Get
Return m_sScriptText
End Get
Set(value As String)
m_sScriptText = value
NotifyPropertyChanged(NameOf(sScriptText))
End Set
End Property
Private Sub SetScriptFile(value As String)
m_sScriptText = value
NotifyPropertyChanged(NameOf(sScriptText))
End Sub
Private m_bReload_IsEnable As Boolean = File.Exists(scriptFilePath)
Public ReadOnly Property bReload_IsEnable As Boolean
Get
Return m_bReload_IsEnable
End Get
End Property
#Region "Messages"
Public ReadOnly Property OkMsg As String
Get
Return EgtMsg(20041)
End Get
End Property
Public ReadOnly Property SaveMsg As String
Get
Return EgtMsg(6453)
End Get
End Property
#End Region ' Messages
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdReload As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub SaveScript(sPathFileScript As String, sScriptText As String)
If String.IsNullOrWhiteSpace(sPathFileScript) OrElse String.IsNullOrWhiteSpace(sScriptText) Then Return
File.WriteAllText(sPathFileScript, sScriptText, Encoding.UTF8)
End Sub
Private Function ReadScript(sPathFileScript As String) As String
If String.IsNullOrWhiteSpace(sPathFileScript) Then Return String.Empty
Return File.ReadAllText(sPathFileScript)
End Function
#End Region ' Methods
#Region "COMMANDS"
#Region "Ok_Command"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
' Salva il file script
SaveScript(scriptFilePath, m_sScriptText)
' Esegue il file script
EgtLuaExecFile(scriptFilePath)
' Chiudo finestra
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Ok_Command
#Region "Reload_Command"
Public ReadOnly Property Reload_Command As ICommand
Get
If m_cmdReload Is Nothing Then
m_cmdReload = New Command(AddressOf Reload)
End If
Return m_cmdReload
End Get
End Property
Public Sub Reload()
If File.Exists(scriptFilePath) Then
SetScriptFile(ReadScript(scriptFilePath))
End If
End Sub
#End Region ' Reload_Command
#End Region ' Commands
End Class
+6 -6
View File
@@ -311,19 +311,19 @@ Public Class MyMachGroupPanelVM
End Sub End Sub
Private Sub LoadMaterialType() Private Sub LoadMaterialType()
Dim sMatType As String = MCH_MAT_WOOD Dim sMatType As String = "Wood"
' IniFile.m_sMachineName = Map.refStatusBarVM.SelectedMachine.Name ' IniFile.m_sMachineName = Map.refStatusBarVM.SelectedMachine.Name
' IniFile.m_sCurrMachIniFilePath = Map.refStatusBarVM.SelectedMachine.MachineDirPath & "\" & Map.refStatusBarVM.SelectedMachine.Name & ".ini" ' IniFile.m_sCurrMachIniFilePath = Map.refStatusBarVM.SelectedMachine.MachineDirPath & "\" & Map.refStatusBarVM.SelectedMachine.Name & ".ini"
Dim sMachineIniPath = IniFile.m_sCurrMachIniFilePath Dim sMachineIniPath = IniFile.m_sCurrMachIniFilePath
EgtUILib.GetPrivateProfileString(S_MCH_GENERAL, K_MATERIAL, sMatType, sMatType, sMachineIniPath) EgtUILib.GetPrivateProfileString(S_GENERAL, EgtWPFLib5.EstConstMachIni.K_MATERIAL, sMatType, sMatType, sMachineIniPath)
Select Case sMatType Select Case sMatType
Case MCH_MAT_STONE Case "Stone"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE
Case MCH_MAT_WOOD Case "Wood"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case MCH_MAT_BEAM Case "Beam"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM
Case MCH_MAT_ADDITIVE Case "Additive"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case Else Case Else
' Se il materiale specificato nel file INI della macchina non corrisponde ai 4 sopracitati viene emesso un messaggio di errore ' Se il materiale specificato nel file INI della macchina non corrisponde ai 4 sopracitati viene emesso un messaggio di errore
+6 -18
View File
@@ -16,8 +16,10 @@
<Grid Margin="10"> <Grid Margin="10">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="20*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
@@ -26,8 +28,6 @@
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<UniformGrid Grid.Row="0" Columns="2" Margin="0,0,0,5"> <UniformGrid Grid.Row="0" Columns="2" Margin="0,0,0,5">
@@ -57,24 +57,12 @@
</ComboBox> </ComboBox>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Row="4" Columns="2" Margin="0,0,0,5" <UniformGrid Grid.Row="4" Columns="2" Margin="0,0,0,5">
Visibility="{Binding StoneVisibility}">
<TextBlock Text="{Binding ExtSawArcMinRadMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ExtSawArcMinRad}" Height="25" Margin="10,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Row="5" Columns="2" Margin="0,0,0,5"
Visibility="{Binding StoneVisibility}">
<TextBlock Text="{Binding IntSawArcMaxSideAngMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding IntSawArcMaxSideAng}" Height="25" Margin="10,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Row="6" Columns="2" Margin="0,0,0,5">
<TextBlock Text="{Binding ApproxLinTolMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding ApproxLinTolMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ApproxLinTol}" Height="25" Margin="10,0,0,0"/> <TextBox Text="{Binding ApproxLinTol}" Height="25" Margin="10,0,0,0"/>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Row="7" Columns="2"> <UniformGrid Grid.Row="5" Columns="2">
<TextBlock Text="{Binding DefaultSetUpMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding DefaultSetUpMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ArchivedSetUpList}" Height="25" Margin="10,0,0,0" <ComboBox ItemsSource="{Binding ArchivedSetUpList}" Height="25" Margin="10,0,0,0"
SelectedItem="{Binding SelectedDefaultSetUp}" IsEnabled="{Binding IsActiveDefaultSetUp}"/> SelectedItem="{Binding SelectedDefaultSetUp}" IsEnabled="{Binding IsActiveDefaultSetUp}"/>
+20 -83
View File
@@ -1,6 +1,5 @@
Imports System.IO Imports System.IO
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib5
Public Class MachOptionVM Public Class MachOptionVM
@@ -49,6 +48,21 @@ Public Class MachOptionVM
End Set End Set
End Property 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}) 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) Public ReadOnly Property SplitArcsList As List(Of MCH_SA)
Get Get
@@ -68,51 +82,6 @@ Public Class MachOptionVM
End Set End Set
End Property 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) Private m_ArchivedSetUpList As New List(Of String)
Public Property ArchivedSetUpList As List(Of String) Public Property ArchivedSetUpList As List(Of String)
Get Get
@@ -152,6 +121,11 @@ Public Class MachOptionVM
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 9) Return EgtMsg(MSG_MACHININGOPTIONPAGE + 9)
End Get End Get
End Property 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 Public ReadOnly Property SplitArcsMsg As String
Get Get
@@ -159,24 +133,6 @@ Public Class MachOptionVM
End Get End Get
End Property 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 Public ReadOnly Property DefaultSetUpMsg As String
Get Get
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 7) Return EgtMsg(MSG_MACHININGOPTIONPAGE + 7)
@@ -205,14 +161,6 @@ Public Class MachOptionVM
Dim nVal As Integer = 0 Dim nVal As Integer = 0
EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal) EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal)
m_SelectedSplitArcs = DirectCast(nVal, MCH_SA) 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 ' Leggo tolleranza lineare di approssimazione
dVal = 0 dVal = 0
EgtMdbGetGeneralParam(MCH_GP.APPROXLINTOL, dVal) EgtMdbGetGeneralParam(MCH_GP.APPROXLINTOL, dVal)
@@ -237,17 +185,6 @@ Public Class MachOptionVM
End If End If
End Sub 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 "COMMANDS"
#Region "CloseMachOptionsCommand" #Region "CloseMachOptionsCommand"
+2 -2
View File
@@ -385,8 +385,8 @@ Public Class MainWindowVM
EgtSetLockId(sLockId) EgtSetLockId(sLockId)
End If End If
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2711, 1, IniFile.m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(3279, 2703, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2711, 1, IniFile.m_nKeyOptions) EgtGetKeyOptions(3279, 2703, 1, IniFile.m_nKeyOptions)
' Leggo e imposto livello utilizzatore ' Leggo e imposto livello utilizzatore
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1)) IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Imposto abilitazione lavorazioni avanzate ' Imposto abilitazione lavorazioni avanzate
+2 -2
View File
@@ -70,6 +70,6 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.11.3")> <Assembly: AssemblyVersion("2.7.3.2")>
<Assembly: AssemblyFileVersion("2.7.11.3")> <Assembly: AssemblyFileVersion("2.7.3.2")>
+2 -2
View File
@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------ '------------------------------------------------------------------------------
' <auto-generated> ' <auto-generated>
' This code was generated by a tool. ' This code was generated by a tool.
' Runtime Version:4.0.30319.42000 ' Runtime Version:4.0.30319.34209
' '
' Changes to this file may cause incorrect behavior and will be lost if ' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated. ' the code is regenerated.
@@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary> '''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc. ''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary> '''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+8 -10
View File
@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------ '------------------------------------------------------------------------------
' <auto-generated> ' <auto-generated>
' This code was generated by a tool. ' This code was generated by a tool.
' Runtime Version:4.0.30319.42000 ' Runtime Version:4.0.30319.34209
' '
' Changes to this file may cause incorrect behavior and will be lost if ' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated. ' the code is regenerated.
@@ -12,12 +12,11 @@ Option Strict On
Option Explicit On Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0"), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
@@ -29,7 +28,7 @@ Namespace My
Private Shared addedHandlerLockObject As New Object Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs) Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then If My.Application.SaveMySettingsOnExit Then
My.Settings.Save() My.Settings.Save()
End If End If
@@ -53,8 +52,7 @@ Namespace My
Return defaultInstance Return defaultInstance
End Get End Get
End Property End Property
End Class End Class
End Namespace
Namespace My Namespace My
@@ -64,9 +62,9 @@ Namespace My
Friend Module MySettingsProperty Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.EgtCAM5.My.MySettings Friend ReadOnly Property Settings() As Global.EgtCAM5.MySettings
Get Get
Return Global.EgtCAM5.My.MySettings.Default Return Global.EgtCAM5.MySettings.Default
End Get End Get
End Property End Property
End Module End Module
@@ -24,8 +24,8 @@
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBox x:Name="Txt" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}" <TextBox x:Name="Txt" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
PreviewKeyDown="TextBox_PreviewKeyDown" IsVisibleChanged="Txt_IsVisibleChanged" PreviewKeyDown="TextBox_PreviewKeyDown" Height="Auto"
Visibility="{Binding TextVisibility}" Height="Auto" Margin="5,0,5,5" > Visibility="{Binding TextVisibility}" Margin="5,0,5,5">
<TextBox.InputBindings> <TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/> <KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/> <KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
@@ -45,6 +45,44 @@
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}" <ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding ComboVisibility}" Margin="5,5,5,5"/> Visibility="{Binding ComboVisibility}" Margin="5,5,5,5"/>
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
MaxHeight="190"
Margin="2,5,0,10">
<ItemsControl ItemsSource="{Binding InfoList}"
Visibility="{Binding InfoVisibility}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Key}"
ToolTip="{Binding Key}"
Width="70"
HorizontalAlignment="Left"
Margin="0,6,0,0"/>
<TextBox Grid.Column="1"
Text="{Binding Valour, UpdateSourceTrigger=PropertyChanged}"
Margin="8,5,2,10">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneInfoCommand}"/>
</TextBox.InputBindings>
</TextBox>
<Button Grid.Column="2"
Content="-"
Command="{Binding RemoveInfoItemCommand}"
Width="20"
Height="20"
Margin="2,-2,4,5"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Grid Margin="5,0,5,5"> <Grid Margin="5,0,5,5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -1,17 +1,11 @@
Public Class InputExpanderV Public Class InputExpanderV
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs) Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
If (e.Key = Key.Enter And (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Or If (e.Key = Key.Enter And (Keyboard.Modifiers And ModifierKeys.Shift)= ModifierKeys.Shift) Or
(e.Key = Key.V And (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control) Then (e.Key = Key.V And (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control) Then
Txt.AcceptsReturn = True Txt.AcceptsReturn = True
Txt.TextWrapping = TextWrapping.Wrap Txt.TextWrapping = TextWrapping.Wrap
End If End If
End Sub End Sub
Private Sub Txt_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
If Txt.IsVisible Then
Txt.Focus()
End If
End Sub
End Class End Class
@@ -1,6 +1,5 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports EgtUILib Imports EgtUILib
Imports MS.Internal
Public Class InputExpanderVM Public Class InputExpanderVM
Inherits ViewModelBase Inherits ViewModelBase
@@ -8,7 +7,7 @@ Public Class InputExpanderVM
#Region "FIELDS & PROPERTIES" #Region "FIELDS & PROPERTIES"
' Variabile temporanea per salvare bShow ' Variabile temporanea per salvare bShow
Private m_bTempShow As Boolean Private m_tmpbShow As Boolean
Private m_tmpInfoList As New ObservableCollection(Of InfoItem) Private m_tmpInfoList As New ObservableCollection(Of InfoItem)
''' <summary> ''' <summary>
@@ -20,7 +19,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As ObservableCollection(Of InfoItem)) Set(value As ObservableCollection(Of InfoItem))
m_tmpInfoList = value m_tmpInfoList = value
OnPropertyChanged("tmpInfoList") OnPropertyChanged(NameOf(tmpInfoList))
End Set End Set
End Property End Property
@@ -32,7 +31,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As Boolean) Set(value As Boolean)
m_IsExpanded = value m_IsExpanded = value
OnPropertyChanged("IsExpanded") OnPropertyChanged(NameOf(IsExpanded))
End Set End Set
End Property End Property
@@ -43,7 +42,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As Boolean) Set(value As Boolean)
m_IsEnabled = value m_IsEnabled = value
OnPropertyChanged("IsEnabled") OnPropertyChanged(NameOf(IsEnabled))
End Set End Set
End Property End Property
@@ -54,7 +53,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As String) Set(value As String)
m_Title = value m_Title = value
OnPropertyChanged("Title") OnPropertyChanged(NameOf(Title))
End Set End Set
End Property End Property
@@ -66,7 +65,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As String) Set(value As String)
m_TextBlock = value m_TextBlock = value
OnPropertyChanged("TextBlock") OnPropertyChanged(NameOf(TextBlock))
End Set End Set
End Property End Property
@@ -79,7 +78,7 @@ Public Class InputExpanderVM
Set(value As String) Set(value As String)
m_TextBox = value m_TextBox = value
Map.refProjectVM.NotifyInputText(value) Map.refProjectVM.NotifyInputText(value)
OnPropertyChanged("TextBox") OnPropertyChanged(NameOf(TextBox))
End Set End Set
End Property End Property
@@ -91,7 +90,7 @@ Public Class InputExpanderVM
Set(value As Visibility) Set(value As Visibility)
If value <> m_TextVisibility Then If value <> m_TextVisibility Then
m_TextVisibility = value m_TextVisibility = value
OnPropertyChanged("TextVisibility") OnPropertyChanged(NameOf(TextVisibility))
End If End If
End Set End Set
End Property End Property
@@ -103,7 +102,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As Boolean) Set(value As Boolean)
m_FocusTextBox = value m_FocusTextBox = value
OnPropertyChanged("FocusTextBox") OnPropertyChanged(NameOf(FocusTextBox))
End Set End Set
End Property End Property
@@ -115,7 +114,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As String) Set(value As String)
m_CheckBoxText = value m_CheckBoxText = value
OnPropertyChanged("CheckBoxText") OnPropertyChanged(NameOf(CheckBoxText))
End Set End Set
End Property End Property
@@ -128,7 +127,7 @@ Public Class InputExpanderVM
If value <> m_IsChecked Then If value <> m_IsChecked Then
Map.refProjectVM.SetLastBoolean(value) Map.refProjectVM.SetLastBoolean(value)
m_IsChecked = value m_IsChecked = value
OnPropertyChanged("IsChecked") OnPropertyChanged(NameOf(IsChecked))
End If End If
End Set End Set
End Property End Property
@@ -141,7 +140,7 @@ Public Class InputExpanderVM
Set(value As Visibility) Set(value As Visibility)
If value <> m_CheckVisibility Then If value <> m_CheckVisibility Then
m_CheckVisibility = value m_CheckVisibility = value
OnPropertyChanged("CheckVisibility") OnPropertyChanged(NameOf(CheckVisibility))
End If End If
End Set End Set
End Property End Property
@@ -154,36 +153,54 @@ Public Class InputExpanderVM
End Get End Get
Set(value As ObservableCollection(Of String)) Set(value As ObservableCollection(Of String))
m_ComboItemsList = value m_ComboItemsList = value
OnPropertyChanged("ComboItemsList") OnPropertyChanged(NameOf(ComboItemsList))
End Set End Set
End Property End Property
Private m_ComboSelectedIndex As Integer Private m_InfoList As New ObservableCollection(Of InfoItem)
''' <summary>
''' Lista delle info modificate
''' </summary>
Public Property InfoList As ObservableCollection(Of InfoItem)
Get
Return m_InfoList
End Get
Set(value As ObservableCollection(Of InfoItem))
m_InfoList = value
OnPropertyChanged(NameOf(InfoList))
End Set
End Property
Private m_ComboSelectedIndex As Integer = GDB_ID.NULL
Public Property ComboSelectedIndex As Integer Public Property ComboSelectedIndex As Integer
Get Get
Return m_ComboSelectedIndex Return m_ComboSelectedIndex
End Get End Get
Set(value As Integer) Set(value As Integer)
If m_bTempShow Then Map.refProjectVM.SetLastInteger(value) If m_tmpbShow Then Map.refProjectVM.SetLastInteger(value)
m_ComboSelectedIndex = value m_ComboSelectedIndex = value
' Assegno l'indice selezionato ad una variabile temporanea per utilizzarlo quando rimuovo l'info dalla lista
Dim tmpComboSelectedIndex As Integer = ComboSelectedIndex Dim tmpComboSelectedIndex As Integer = ComboSelectedIndex
' Controllo se l'indice è maggiore o uguale a zero e la lista tmp contiene valori
If m_ComboSelectedIndex >= 0 AndAlso tmpInfoList.Count > 0 Then If m_ComboSelectedIndex >= 0 AndAlso tmpInfoList.Count > 0 Then
' se la info è presente la aggiungo alla textbox per modificarla ' Controllo se la info è contenuta nella lista ComboItemsList
If m_TextBox IsNot String.Empty Then If ComboItemsList.Contains(tmpInfoList(m_ComboSelectedIndex).sKey) Then
If Not m_TextBox.EndsWith(vbCrLf) Then m_TextBox &= vbCrLf ' Aggiungo la info alla lista per visualizzarla
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim() InfoList.Add(New InfoItem(tmpInfoList(m_ComboSelectedIndex).nId, tmpInfoList(m_ComboSelectedIndex).sKey, tmpInfoList(m_ComboSelectedIndex).sValour))
ElseIf m_TextBox Is String.Empty Then ' Nascondo la combobox
m_TextBox &= (tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim() & vbCrLf
End If
ComboVisibility = Visibility.Collapsed ComboVisibility = Visibility.Collapsed
ComboItemsList.Remove((tmpInfoList(m_ComboSelectedIndex).sKey & "=" & m_tmpInfoList(m_ComboSelectedIndex).sValour).Trim()) ' Rimuovo la info dalla ComboItemsList
ComboItemsList.Remove(tmpInfoList(m_ComboSelectedIndex).sKey)
End If
' Rimuovo la info dalla tmpInfoList
tmpInfoList.Remove(tmpInfoList(tmpComboSelectedIndex)) tmpInfoList.Remove(tmpInfoList(tmpComboSelectedIndex))
End If End If
m_ComboSelectedIndex = -1 ' Rendo invisibile il pulsante per attivare la combo
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
OnPropertyChanged("ComboSelectedIndex") m_ComboSelectedIndex = GDB_ID.NULL
OnPropertyChanged("ComboItemsList") OnPropertyChanged(NameOf(ComboSelectedIndex))
OnPropertyChanged("TextBox") OnPropertyChanged(NameOf(ComboItemsList))
OnPropertyChanged(NameOf(InfoList))
End Set End Set
End Property End Property
@@ -195,7 +212,7 @@ Public Class InputExpanderVM
Set(value As Visibility) Set(value As Visibility)
If value <> m_ComboVisibility Then If value <> m_ComboVisibility Then
m_ComboVisibility = value m_ComboVisibility = value
OnPropertyChanged("ComboVisibility") OnPropertyChanged(NameOf(ComboVisibility))
End If End If
End Set End Set
End Property End Property
@@ -208,7 +225,7 @@ Public Class InputExpanderVM
End Get End Get
Set(value As Visibility) Set(value As Visibility)
m_ShowBtnVisibility = value m_ShowBtnVisibility = value
OnPropertyChanged("ShowBtnVisibility") OnPropertyChanged(NameOf(ShowBtnVisibility))
End Set End Set
End Property End Property
@@ -223,7 +240,23 @@ Public Class InputExpanderVM
Set(value As Visibility) Set(value As Visibility)
If value <> m_ShowInfoItemVisibility Then If value <> m_ShowInfoItemVisibility Then
m_ShowInfoItemVisibility = value m_ShowInfoItemVisibility = value
OnPropertyChanged("ShowInfoItemVisibility") OnPropertyChanged(NameOf(ShowInfoItemVisibility))
End If
End Set
End Property
Private m_InfoVisibility As Visibility
''' <summary>
''' Propietà visibilità lista info modificate
''' </summary>
Public Property InfoVisibility As Visibility
Get
Return m_InfoVisibility
End Get
Set(value As Visibility)
If value <> m_InfoVisibility Then
m_InfoVisibility = value
OnPropertyChanged(NameOf(InfoVisibility))
End If End If
End Set End Set
End Property End Property
@@ -232,6 +265,7 @@ Public Class InputExpanderVM
Private m_cmdShow As ICommand Private m_cmdShow As ICommand
Private m_cmdDone As ICommand Private m_cmdDone As ICommand
Private m_cmdShowInfoItem As ICommand Private m_cmdShowInfoItem As ICommand
Private m_cmdRemoveInfoItem As ICommand
#Region "Messages" #Region "Messages"
@@ -255,7 +289,6 @@ Public Class InputExpanderVM
Sub New() Sub New()
' Creo riferimento a questa classe in EgtCAM5Map ' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefInputExpanderVM(Me) Map.SetRefInputExpanderVM(Me)
ComboSelectedIndex = -1
End Sub End Sub
#End Region ' Constructor #End Region ' Constructor
@@ -310,7 +343,18 @@ Public Class InputExpanderVM
''' Execute the Point. This method is invoked by the PointCommand. ''' Execute the Point. This method is invoked by the PointCommand.
''' </summary> ''' </summary>
Public Sub Done(ByVal param As Object) Public Sub Done(ByVal param As Object)
Map.refProjectVM.Done(m_TextBox) ' Controllo se la lista contenente la info modificata sia presente
If InfoList.Count > 0 Then
' Ciclo sulla lista
For Each Item As InfoItem In InfoList
Map.refProjectVM.NotifyInputText((Item.Key & "=" & Item.Valour).Trim())
' Assegno a m_TextBox la info modificata
m_TextBox &= vbCrLf & (Item.Key & "=" & Item.Valour).Trim() & vbCrLf
Next
End If
' Rimuovo eventuali spazi
Dim tmpTextBox As String = m_TextBox.Replace(" ", "")
Map.refProjectVM.Done(tmpTextBox)
End Sub End Sub
''' <summary> ''' <summary>
@@ -341,15 +385,6 @@ Public Class InputExpanderVM
''' </summary> ''' </summary>
''' <param name="param"></param> ''' <param name="param"></param>
Public Sub ShowInfoItem(ByVal param As Object) Public Sub ShowInfoItem(ByVal param As Object)
' Se presente info inserita in textbox
If m_TextBox IsNot String.Empty Then
Dim sSplitItem As String() = m_TextBox.Split("="c)
Dim ItemCombo As InfoItem = tmpInfoList.FirstOrDefault(Function(x) x.sKey = sSplitItem(0))
If Not IsNothing(ItemCombo) Then
ComboItemsList.Remove((ItemCombo.sKey & "=" & ItemCombo.sValour).Trim())
tmpInfoList.Remove(ItemCombo)
End If
End If
ComboVisibility = Visibility.Visible ComboVisibility = Visibility.Visible
End Sub End Sub
@@ -360,18 +395,27 @@ Public Class InputExpanderVM
#Region "METHODS" #Region "METHODS"
Friend Sub PrepareInputBox(PrepareInputBoxParam As PrepareInputBoxParam) Friend Sub PrepareInputBox(PrepareInputBoxParam As PrepareInputBoxParam)
' Divido il titolo che può contenere comandi dopo il ';' Title = PrepareInputBoxParam.sTitle
Dim vsSplitTitle As String() = PrepareInputBoxParam.sTitle.Split(";"c)
Title = vsSplitTitle(0)
If PrepareInputBoxParam.sLabel <> "" Then If PrepareInputBoxParam.sLabel <> "" Then
TextBlock = PrepareInputBoxParam.sLabel TextBlock = PrepareInputBoxParam.sLabel
TextBox = "" TextBox = ""
TextVisibility = Visibility.Visible TextVisibility = Visibility.Visible
' Se presente il comando "Sic=1" ' Controllo se il titolo è uguale a INFO se si
If vsSplitTitle.Count() > 1 AndAlso vsSplitTitle(1) = "Sic=1" Then If Title = EgtMsg(5359).ToUpper() Then
m_bTempShow = False ' Metto tmpbShow a false
ComboInfo() m_tmpbShow = False
If ComboItemsList.Count > 0 Then ShowInfoItemVisibility = Visibility.Visible ' Rendo visibile la lista delle info selezionate
InfoVisibility = Visibility.Visible
' Pulisco la lista tmpInfoList
tmpInfoList.Clear()
' Pulisco la lista InfoList
InfoList.Clear()
' Pulisco la lista ComboItemsList
ComboItemsList.Clear()
' Popolo la lista InfoList
GetInfoList()
' Rendo visibile il pulsante che mostra la lista delle info
ShowInfoItemVisibility = If(m_ComboItemsList.Count > 0, Visibility.Visible, Visibility.Collapsed)
End If End If
End If End If
If PrepareInputBoxParam.sCheckLabel <> "" Then If PrepareInputBoxParam.sCheckLabel <> "" Then
@@ -379,9 +423,14 @@ Public Class InputExpanderVM
CheckVisibility = Visibility.Visible CheckVisibility = Visibility.Visible
End If End If
If PrepareInputBoxParam.bShowCombo Then If PrepareInputBoxParam.bShowCombo Then
m_bTempShow = PrepareInputBoxParam.bShowCombo ' Assegno a tmpbShow PrepareInputBoxParam.bShowCombo
m_tmpbShow = PrepareInputBoxParam.bShowCombo
' Pulisco la lista ComboItemsList
ComboItemsList.Clear() ComboItemsList.Clear()
' Pulisco la lista tmpInfoList
tmpInfoList.Clear() tmpInfoList.Clear()
' Pulisco la lista InfoList
InfoList.Clear()
ComboVisibility = Visibility.Visible ComboVisibility = Visibility.Visible
End If End If
If PrepareInputBoxParam.bShowBtn Then If PrepareInputBoxParam.bShowBtn Then
@@ -399,6 +448,7 @@ Public Class InputExpanderVM
ComboVisibility = Visibility.Collapsed ComboVisibility = Visibility.Collapsed
ShowBtnVisibility = Visibility.Collapsed ShowBtnVisibility = Visibility.Collapsed
ShowInfoItemVisibility = Visibility.Collapsed ShowInfoItemVisibility = Visibility.Collapsed
InfoVisibility = Visibility.Collapsed
IsExpanded = False IsExpanded = False
IsEnabled = False IsEnabled = False
End Sub End Sub
@@ -434,25 +484,30 @@ Public Class InputExpanderVM
End Function End Function
''' <summary> ''' <summary>
''' Funzione che popola la lista ComboItemsList ''' Rimovi nota da info lista
''' </summary> ''' </summary>
Private Sub ComboInfo() ''' <param name="InfoItem">Informazione da eliminare</param>
tmpInfoList.Clear() Friend Sub RemoveItemInfo(InfoItem As InfoItem)
ComboItemsList.Clear() ' Rimuovo info da lista modifica
InfoList.Remove(InfoItem)
' Riaggiungo la info eliminata
ComboItemsList.Add(InfoItem.sKey)
' Riaggiungo la info eliminata
tmpInfoList.Add(InfoItem)
' Rendo visibile il pulsante per attivare la combo
ShowInfoItemVisibility = Visibility.Visible
End Sub
Dim vsVal As String() = Nothing Private Sub GetInfoList()
EgtGetAllInfo(Map.refManageLayerExpanderVM.RightClickedTreeItemId, vsVal) Dim tmpInfoList As String() = Nothing
Dim sKeyVal() As String = Nothing
If Not m_bTempShow And Not IsNothing(vsVal) Then Dim Index As Integer = 0
Dim Ind As Integer = 0 EgtGetAllInfo(Map.refManageLayerExpanderVM.m_nObjTreeOldId, tmpInfoList)
For Each Item As String In vsVal If Not IsNothing(tmpInfoList) Then
Dim sSplitItem As String() = Item.Split("="c) For Each ItemInfo As String In tmpInfoList
tmpInfoList.Add(New InfoItem(Ind, sSplitItem(0), sSplitItem(1))) sKeyVal = ItemInfo.Trim().Split(New Char() {"="c})
Ind += 1 InfoList.Add(New InfoItem(Index, sKeyVal(0), sKeyVal(1)))
Next Index += 1
For Each InfoItem As InfoItem In tmpInfoList
ComboItemsList.Add((InfoItem.sKey & "=" & InfoItem.sValour).Trim())
Next Next
End If End If
End Sub End Sub
@@ -19,11 +19,11 @@ Public Class LayerTreeViewItem
''' </summary> ''' </summary>
Public Overrides Property IsSelected As Boolean Public Overrides Property IsSelected As Boolean
Get Get
Return m_isSelected Return m_IsSelected
End Get End Get
Set(value As Boolean) Set(value As Boolean)
If (value <> m_isSelected) Then If (value <> m_IsSelected) Then
m_isSelected = value m_IsSelected = value
If value Then If value Then
' recupero l'Id del nuovo oggetto selezionato ' recupero l'Id del nuovo oggetto selezionato
Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False) Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False)
@@ -103,6 +103,7 @@ Public Class LayerTreeViewItem
EgtDraw() EgtDraw()
End If End If
End If End If
Map.refProjectVM.EmitTitle()
End Set End Set
End Property End Property
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports EgtUILib Imports EgtUILib
Imports EgtCAM5.IniFile
Public Class ManageLayerExpanderVM Public Class ManageLayerExpanderVM
Inherits ViewModelBase Inherits ViewModelBase
@@ -29,6 +30,22 @@ Public Class ManageLayerExpanderVM
End Set End Set
End Property End Property
' Definizione comandi
Private m_cmdNewPart As ICommand
Private m_cmdNewLayer As ICommand
Private m_cmdLayerColor As ICommand
Private m_cmdTreeViewDoubleClick As ICommand
Private m_cmdTreeViewMouseUp As ICommand
Private m_cmdTreeViewMouseRightButton As ICommand
Private m_cmdSelect As ICommand
Private m_cmdDeselect As ICommand
Private m_cmdName As ICommand
Private m_cmdInfo As ICommand
Private m_cmdRelocate As ICommand
Private m_cmdCopy As ICommand
Private m_cmdDelete As ICommand
Private m_cmdSave As ICommand
' Lista dei layer ' Lista dei layer
Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem) Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem)
Public Property LayerList As ObservableCollection(Of LayerTreeViewItem) Public Property LayerList As ObservableCollection(Of LayerTreeViewItem)
@@ -37,7 +54,6 @@ Public Class ManageLayerExpanderVM
End Get End Get
Set(value As ObservableCollection(Of LayerTreeViewItem)) Set(value As ObservableCollection(Of LayerTreeViewItem))
m_LayerList = value m_LayerList = value
OnPropertyChanged("LayerList")
End Set End Set
End Property End Property
@@ -115,22 +131,6 @@ Public Class ManageLayerExpanderVM
#End Region #End Region
' Definizione comandi
Private m_cmdNewPart As ICommand
Private m_cmdNewLayer As ICommand
Private m_cmdLayerColor As ICommand
Private m_cmdTreeViewDoubleClick As ICommand
Private m_cmdTreeViewMouseUp As ICommand
Private m_cmdTreeViewMouseRightButton As ICommand
Private m_cmdSelect As ICommand
Private m_cmdDeselect As ICommand
Private m_cmdName As ICommand
Private m_cmdInfo As ICommand
Private m_cmdRelocate As ICommand
Private m_cmdCopy As ICommand
Private m_cmdDelete As ICommand
Private m_cmdSave As ICommand
#End Region #End Region
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
@@ -152,8 +152,6 @@ Public Class MachiningTreeExpanderVM
Return EgtMsg(MSG_MACHININGSDBPAGE + 12) Return EgtMsg(MSG_MACHININGSDBPAGE + 12)
Case MCH_MY.FIVEAXISMILLING Case MCH_MY.FIVEAXISMILLING
Return EgtMsg(31213) Return EgtMsg(31213)
Case MCH_MY.PROBING
Return EgtMsg(31220)
Case Else Case Else
Return "Mach" Return "Mach"
End Select End Select
@@ -1,6 +1,4 @@
Imports System.ComponentModel Imports EgtUILib
Imports System.Globalization
Imports EgtUILib
Public Class DispositionParameterExpanderVM Public Class DispositionParameterExpanderVM
Inherits ViewModelBase Inherits ViewModelBase
@@ -313,16 +311,12 @@ Public Class DispositionParameterExpanderVM
' se movimento di traslazione ' se movimento di traslazione
If m_MoveIsChecked Then If m_MoveIsChecked Then
Dim InputPoint As New Point3d(0, 0, 0) Dim InputPoint As New Point3d(0, 0, 0)
Dim dSupp As Double = -1
Dim Values() As String = m_InputValue.Split(","c) Dim Values() As String = m_InputValue.Split(","c)
If Values.Count >= 2 Then If Values.Count = 2 Then
StringToLen(Values(0), InputPoint.x) StringToLen(Values(0), InputPoint.x)
StringToLen(Values(1), InputPoint.y) StringToLen(Values(1), InputPoint.y)
If Values.Count >= 3 Then
StringToLen(Values(2), dSupp)
End If
Else Else
m_InputErrorMsg = "Il valore non è un punto X,Y" m_InputErrorMsg = "Il valore non è una cordinata XY"
OnPropertyChanged("InputErrorMsg") OnPropertyChanged("InputErrorMsg")
Return Return
End If End If
@@ -335,44 +329,13 @@ Public Class DispositionParameterExpanderVM
' imposto il riferimento della tavola ' imposto il riferimento della tavola
Dim ptTableRef As Point3d Dim ptTableRef As Point3d
EgtGetTableRef(1, ptTableRef) EgtGetTableRef(1, ptTableRef)
' calcolo il punto del grezzo da posizionare nelle coordinate di input ' calcolo il punto del grezzo da posizionar nelle coordinate di input
Dim ptRawRefPoint As Point3d = DispositionUtility.GetRawPartRefPoint(nFirstSelectedId, m_RawRefPosition) Dim ptRawRefPoint As Point3d = DispositionUtility.GetRawPartRefPoint(nFirstSelectedId, m_RawRefPosition)
' creo un punto con le coordinate di input espresse rispetto alla tavola ' creo un punto con le coordinate di input espresse rispetto alla tavola
Dim TableRefInputPoint As New Point3d(InputPoint) Dim TableRefInputPoint As New Point3d(InputPoint)
TableRefInputPoint.LocToLoc(EgtGetGridFrame(), New Frame3d(ptTableRef)) TableRefInputPoint.LocToLoc(EgtGetGridFrame(), New Frame3d(ptTableRef))
' calcolo il vettore di spostamento del grezzo ' calcolo il vettore di spostamento del grezzo
vtMove = TableRefInputPoint - ptRawRefPoint vtMove = TableRefInputPoint - ptRawRefPoint
vtMove.z = 0
' verifico ed aggiusto eventuale supporto
Dim dOldSupp As Double = 0
Dim nOldSuppId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, SUPPORT)
If nOldSuppId <> GDB_ID.NULL Then
Dim bboxSupport As New BBox3d
EgtGetBBoxGlob(nOldSuppId, GDB_BB.STANDARD, bboxSupport)
dOldSupp = bboxSupport.DimZ()
End If
If dSupp > -EPS_SMALL AndAlso Math.Abs( dSupp - dOldSupp) > EPS_SMALL Then
' da cancellare
If dSupp < EPS_SMALL Then
EgtErase( nOldSuppId)
vtMove.z = dSupp - dOldSupp
' da creare o modificare
Else
EgtErase( nOldSuppId)
Dim nNewSuppId As Integer = GDB_ID.NULL
Dim nRawOutLnId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, RAWOUTLINE)
If nRawOutLnId <> GDB_ID.NULL Then
Dim vtExtr As New Vector3d( 0, 0, -dSupp)
nNewSuppId = EgtCreateSurfTmByRegionExtrusion( nFirstSelectedId, 1, {nRawOutLnId}, vtExtr, 0.05, GDB_RT.GLOB)
End If
If nNewSuppId <> GDB_ID.NULL Then
EgtSetName( nNewSuppId, SUPPORT)
EgtSetColor( nNewSuppId, New Color3d(150, 75, 0))
If nOldSuppId <> GDB_ID.NULL Then EgtChangeId( nNewSuppId, nOldSuppId)
vtMove.z = dSupp - dOldSupp
End If
End If
End If
' se è una ventosa ' se è una ventosa
ElseIf EgtVerifyFixture(nFirstSelectedId) Then ElseIf EgtVerifyFixture(nFirstSelectedId) Then
Dim SelObjFrame3d As New Frame3d(Frame3d.GLOB) Dim SelObjFrame3d As New Frame3d(Frame3d.GLOB)
@@ -471,24 +434,8 @@ Public Class DispositionParameterExpanderVM
''' Execute the Point. This method is invoked by the DoneCommand. ''' Execute the Point. This method is invoked by the DoneCommand.
''' </summary> ''' </summary>
Public Sub CheckedRawRef(ByVal param As Object) Public Sub CheckedRawRef(ByVal param As Object)
' Assegno corner di riferimento
Dim nRawRef As MCH_CR = DirectCast(param, MCH_CR) Dim nRawRef As MCH_CR = DirectCast(param, MCH_CR)
m_RawRefPosition = nRawRef m_RawRefPosition = nRawRef
' Se grezzo selezionato, visualizzo sua posizione
Dim nFirstSelectedId As Integer = EgtGetFirstSelectedObj()
If EgtVerifyRawPartCurrPhase(nFirstSelectedId) Then
Dim ptR As Point3d = DispositionUtility.GetRawPartRefPoint(nFirstSelectedId, m_RawRefPosition)
Dim sSupp As String = ""
Dim nSuppId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, SUPPORT)
If nSuppId <> GDB_ID.NULL Then
Dim bboxSupport As New BBox3d
EgtGetBBoxGlob(nSuppId, GDB_BB.STANDARD, bboxSupport)
Dim dSupp As Double = bboxSupport.DimZ()
sSupp = "," & LenToString( dSupp, 2)
End If
m_InputValue = LenToString( ptR.x, 2) & "," & LenToString( ptR.y, 2) & sSupp
OnPropertyChanged( "InputValue")
End If
End Sub End Sub
#End Region ' CheckedRawRefCommand #End Region ' CheckedRawRefCommand
@@ -322,11 +322,11 @@ Public NotInheritable Class DispositionUtility
Dim dFixtureHeight As Double = 0 Dim dFixtureHeight As Double = 0
EgtGetInfo(nFixtureId, "H", dFixtureHeight) EgtGetInfo(nFixtureId, "H", dFixtureHeight)
' recupero altezza grezzo riferita alla tavola ' recupero altezza grezzo riferita alla tavola
Dim ptRawPartMin As Point3d = bboxRawPart.Min Dim dRawPartMin As Point3d = bboxRawPart.Min
ptRawPartMin.ToLoc(TableFrame) dRawPartMin.ToLoc(TableFrame)
' se l'altezza grezzo è minore di quella della ventosa, lo sposto alla stessa altezza ' se l'altezza grezzo è minore di quella della ventosa, lo sposto alla stessa altezza
If ptRawPartMin.z < dFixtureHeight - EPS_SMALL Then If dRawPartMin.z < dFixtureHeight - EPS_SMALL Then
Dim vtMove As New Vector3d(0, 0, dFixtureHeight - ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, dFixtureHeight - dRawPartMin.z)
EgtMoveRawPart(nRawPartId, vtMove) EgtMoveRawPart(nRawPartId, vtMove)
' ricalcolo il BBox del solido del grezzo per averlo aggiornato con la nuova Z ' ricalcolo il BBox del solido del grezzo per averlo aggiornato con la nuova Z
EgtGetBBoxGlob(nRawSolidId, GDB_BB.ONLY_VISIBLE, bboxRawPart) EgtGetBBoxGlob(nRawSolidId, GDB_BB.ONLY_VISIBLE, bboxRawPart)
@@ -358,19 +358,19 @@ Public NotInheritable Class DispositionUtility
nOtherFixtureId = EgtGetNextFixture(nOtherFixtureId) nOtherFixtureId = EgtGetNextFixture(nOtherFixtureId)
End While End While
' recupero altezza grezzo riferita alla tavola ' recupero altezza grezzo riferita alla tavola
Dim ptRawPartMin As Point3d = bboxRawPart.Min Dim dRawPartMin As Point3d = bboxRawPart.Min
ptRawPartMin.ToLoc(TableFrame) dRawPartMin.ToLoc(TableFrame)
' se non ci sono ventose sotto il grezzo ' se non ci sono ventose sotto il grezzo
If Not bIsFixtureUnderRawPart Then If Not bIsFixtureUnderRawPart Then
' verifico che il grezzo sia ad altezza tavola ' verifico che il grezzo sia ad altezza tavola
If ptRawPartMin.z <> 0 Then If dRawPartMin.z <> 0 Then
Dim vtMove As New Vector3d(0, 0, -ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, -dRawPartMin.z)
EgtMoveRawPart(nRawPartId, vtMove) EgtMoveRawPart(nRawPartId, vtMove)
End If End If
Else Else
' se ci sono verifico che l'altezza del grezzo sia quella della ventosa più alta ' se ci sono verifico che l'altezza del grezzo sia quella della ventosa più alta
If Math.Abs(ptRawPartMin.z - dMaxFixtureHeight) > EPS_SMALL Then If Math.Abs(dRawPartMin.z - dMaxFixtureHeight) > EPS_SMALL Then
Dim vtMove As New Vector3d(0, 0, dMaxFixtureHeight - ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, dMaxFixtureHeight - dRawPartMin.z)
EgtMoveRawPart(nRawPartId, vtMove) EgtMoveRawPart(nRawPartId, vtMove)
End If End If
End If End If
@@ -472,30 +472,23 @@ Public NotInheritable Class DispositionUtility
' Recupero il solido del grezzo ' Recupero il solido del grezzo
Dim nMovedRawSolidId As Integer = EgtGetFirstNameInGroup(nRawId, RAWSOLID) Dim nMovedRawSolidId As Integer = EgtGetFirstNameInGroup(nRawId, RAWSOLID)
' definisco il box del solido del grezzo ' definisco il box del solido del grezzo
Dim bboxRawPart As New BBox3d Dim bboxRawPartId As New BBox3d
EgtGetBBoxGlob(nMovedRawSolidId, GDB_BB.STANDARD, bboxRawPart) EgtGetBBoxGlob(nMovedRawSolidId, GDB_BB.ONLY_VISIBLE, bboxRawPartId)
' aggiungo il box dell'eventuale supporto o sottopezzo
Dim nSupportId As Integer = EgtGetFirstNameInGroup(nRawId, SUPPORT)
If nSupportId <> GDB_ID.NULL Then
Dim bboxSupport As New BBox3d
EgtGetBBoxGlob(nSupportId, GDB_BB.STANDARD, bboxSupport)
bboxRawPart.Add( bboxSupport)
End If
' Variabile che dice se c'è almeno una ventosa sotto il grezzo ' Variabile che dice se c'è almeno una ventosa sotto il grezzo
Dim bIsFixtureUnderRawPart As Boolean = False Dim bIsFixtureUnderRawPart As Boolean = False
Dim bboxFixture As New BBox3d Dim bboxFixture As New BBox3d
' variabile che contiene la massima altezza delle ventose sottostanti ' variabile che contiene la massima altezza delle ventose sottostanti
Dim dMaxFixtureHeight As Double = 0 Dim dMaxFixtureHeight As Double = 0
' recupero altezza grezzo riferita alla tavola ' recupero altezza grezzo riferita alla tavola
Dim ptRawPartMin As Point3d = bboxRawPart.Min Dim dRawPartMin As Point3d = bboxRawPartId.Min
ptRawPartMin.ToLoc(TableFrame) dRawPartMin.ToLoc(TableFrame)
' Ciclo sui sottopezzi presenti per verificare le collisioni con il grezzo ' Ciclo sui sottopezzi presenti per verificare le collisioni con il grezzo
Dim nFixtureId As Integer = EgtGetFirstFixture() Dim nFixtureId As Integer = EgtGetFirstFixture()
While nFixtureId <> GDB_ID.NULL While nFixtureId <> GDB_ID.NULL
' calcolo il BBox del sottopezzo ' calcolo il BBox del sottopezzo
EgtGetBBoxGlob(nFixtureId, GDB_BB.ONLY_VISIBLE, bboxFixture) EgtGetBBoxGlob(nFixtureId, GDB_BB.ONLY_VISIBLE, bboxFixture)
' verifico se c'è sovrapposizione ' verifico se c'è sovrapposizione
If bboxRawPart.OverlapsXY(bboxFixture) Then If bboxRawPartId.OverlapsXY(bboxFixture) Then
' recupero il tipo di fixture ' recupero il tipo di fixture
Dim nFxtType As FIX_TYPE = FixtureType(nFixtureId) Dim nFxtType As FIX_TYPE = FixtureType(nFixtureId)
' Se è ventosa o morsa ' Se è ventosa o morsa
@@ -508,22 +501,22 @@ Public NotInheritable Class DispositionUtility
dMaxFixtureHeight = dFixtureHeight dMaxFixtureHeight = dFixtureHeight
End If End If
' se l'altezza grezzo è diversa da quella della ventosa, lo sposto alla stessa altezza ' se l'altezza grezzo è diversa da quella della ventosa, lo sposto alla stessa altezza
If ptRawPartMin.z < dFixtureHeight - EPS_SMALL Then If dRawPartMin.z < dFixtureHeight - EPS_SMALL Then
Dim vtMove As New Vector3d(0, 0, dFixtureHeight - ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, dFixtureHeight - dRawPartMin.z)
EgtMoveRawPart(nRawId, vtMove) EgtMoveRawPart(nRawId, vtMove)
' recupero il solido del grezzo ' recupero il solido del grezzo
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawId, RAWSOLID) Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawId, RAWSOLID)
' ricalcolo il BBox del solido del grezzo per averlo aggiornato con la nuova Z ' ricalcolo il BBox del solido del grezzo per averlo aggiornato con la nuova Z
EgtGetBBoxGlob(nRawSolidId, GDB_BB.ONLY_VISIBLE, bboxRawPart) EgtGetBBoxGlob(nRawSolidId, GDB_BB.ONLY_VISIBLE, bboxRawPartId)
ptRawPartMin = bboxRawPart.Min dRawPartMin = bboxRawPartId.Min
ptRawPartMin.ToLoc(TableFrame) dRawPartMin.ToLoc(TableFrame)
End If End If
bIsFixtureUnderRawPart = True bIsFixtureUnderRawPart = True
End If End If
' Se è morsa ' Se è morsa
If nFxtType = FIX_TYPE.VISE Then If nFxtType = FIX_TYPE.VISE Then
' regolo la posizione in Z della morsa ' regolo la posizione in Z della morsa
EgtSetFixtureMobile( nFixtureId, bboxRawPart.DimZ()) EgtSetFixtureMobile( nFixtureId, bboxRawPartId.DimZ())
End If End If
' Se è un riferimento o una morsa ' Se è un riferimento o una morsa
If nFxtType = FIX_TYPE.REFERENCE Or nFxtType = FIX_TYPE.VISE Then If nFxtType = FIX_TYPE.REFERENCE Or nFxtType = FIX_TYPE.VISE Then
@@ -532,7 +525,7 @@ Public NotInheritable Class DispositionUtility
' calcolo bbox dell'arco di riferimento ' calcolo bbox dell'arco di riferimento
Dim bboxArcRef As New BBox3d Dim bboxArcRef As New BBox3d
EgtGetBBoxGlob(arcRefId, GDB_BB.STANDARD, bboxArcRef) EgtGetBBoxGlob(arcRefId, GDB_BB.STANDARD, bboxArcRef)
If bboxRawPart.OverlapsXY(bboxArcRef) Then If bboxRawPartId.OverlapsXY(bboxArcRef) Then
' recupero contorno del grezzo ' recupero contorno del grezzo
Dim ccompoRawPartOutlineId As Integer = EgtGetFirstNameInGroup(nRawId, RAWOUTLINE) Dim ccompoRawPartOutlineId As Integer = EgtGetFirstNameInGroup(nRawId, RAWOUTLINE)
'recupero il raggio dell'arco di riferimento 'recupero il raggio dell'arco di riferimento
@@ -594,14 +587,14 @@ Public NotInheritable Class DispositionUtility
' se non ci sono ventose sotto il grezzo ' se non ci sono ventose sotto il grezzo
If Not bIsFixtureUnderRawPart Then If Not bIsFixtureUnderRawPart Then
' verifico che il grezzo sia ad altezza tavola ' verifico che il grezzo sia ad altezza tavola
If ptRawPartMin.z <> 0 Then If dRawPartMin.z <> 0 Then
Dim vtMove As New Vector3d(0, 0, -ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, -dRawPartMin.z)
EgtMoveRawPart(nRawId, vtMove) EgtMoveRawPart(nRawId, vtMove)
End If End If
Else Else
' se ci sono verifico che l'altezza del grezzo sia quella della ventosa più alta ' se ci sono verifico che l'altezza del grezzo sia quella della ventosa più alta
If Math.Abs(ptRawPartMin.z - dMaxFixtureHeight) > EPS_SMALL Then If Math.Abs(dRawPartMin.z - dMaxFixtureHeight) > EPS_SMALL Then
Dim vtMove As New Vector3d(0, 0, dMaxFixtureHeight - ptRawPartMin.z) Dim vtMove As New Vector3d(0, 0, dMaxFixtureHeight - dRawPartMin.z)
EgtMoveRawPart(nRawId, vtMove) EgtMoveRawPart(nRawId, vtMove)
End If End If
End If End If
@@ -238,11 +238,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -226,11 +226,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -1,4 +1,4 @@
<UserControl x:Class="FiveAxisMachiningParameterExpanderV" <UserControl x:Class="FiveAxisMachinigParameterExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
@@ -216,11 +216,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -1,6 +1,6 @@
Imports EgtWPFLib5.EgtFloating Imports EgtWPFLib5.EgtFloating
Public Class FiveAxisMachiningParameterExpanderV Public Class FiveAxisMachinigParameterExpanderV
Private m_RightTrayV As RightTrayV Private m_RightTrayV As RightTrayV
Private EgtFloatingPanel As EgtFloatingPanel Private EgtFloatingPanel As EgtFloatingPanel
@@ -216,11 +216,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -152,9 +152,8 @@ Public Class MachiningParameterExpanderVM
Dim StoneDrillParamExpanderV As StoneDrillingParameterExpanderV Dim StoneDrillParamExpanderV As StoneDrillingParameterExpanderV
Dim SurfFinishParamExpanderV As SurfFinishingParameterExpanderV Dim SurfFinishParamExpanderV As SurfFinishingParameterExpanderV
Dim WjParamExpanderV As WaterjettingParameterExpanderV Dim WjParamExpanderV As WaterjettingParameterExpanderV
Dim FiveAxExpanderV As FiveAxisMachiningParameterExpanderV Dim FiveAxExpanderV As FiveAxisMachinigParameterExpanderV
Dim SurfRoughExpanderV As SurfRoughingParameterExpanderV Dim SurfRoughExpanderV As SurfRoughingParameterExpanderV
Dim ProbExpanderV As ProbingParameterExpanderV
Private Sub Dummy() Private Sub Dummy()
@@ -271,17 +270,13 @@ Public Class MachiningParameterExpanderVM
WjParamExpanderV.DataContext = m_CurrOperation WjParamExpanderV.DataContext = m_CurrOperation
Return WjParamExpanderV Return WjParamExpanderV
Case MCH_OY.FIVEAXISMILLING Case MCH_OY.FIVEAXISMILLING
If IsNothing(FiveAxExpanderV) Then FiveAxExpanderV = New FiveAxisMachiningParameterExpanderV If IsNothing(FiveAxExpanderV) Then FiveAxExpanderV = New FiveAxisMachinigParameterExpanderV
FiveAxExpanderV.DataContext = m_CurrOperation FiveAxExpanderV.DataContext = m_CurrOperation
Return FiveAxExpanderV Return FiveAxExpanderV
Case MCH_OY.SURFROUGHING Case MCH_OY.SURFROUGHING
If IsNothing(SurfRoughExpanderV) Then SurfRoughExpanderV = New SurfRoughingParameterExpanderV If IsNothing(SurfRoughExpanderV) Then SurfRoughExpanderV = New SurfRoughingParameterExpanderV
SurfRoughExpanderV.DataContext = m_CurrOperation SurfRoughExpanderV.DataContext = m_CurrOperation
Return SurfRoughExpanderV Return SurfRoughExpanderV
Case MCH_OY.PROBING
If IsNothing(ProbExpanderV) Then ProbExpanderV = New ProbingParameterExpanderV
ProbExpanderV.DataContext = m_CurrOperation
Return ProbExpanderV
End Select End Select
'MachiningParameterExpanderItem.ReadOperationParam() 'MachiningParameterExpanderItem.ReadOperationParam()
@@ -376,12 +371,21 @@ Public Class MachiningParameterExpanderVM
Return Return
End If End If
' Verifico se forzato ricalcolo da interfaccia Dim bRecalc As Boolean = False
Dim bRecalc As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) <> 0) If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
bRecalc = True
Else
' Controllo se il tipo e' dr o sr o lr bRecalc e' true come quando viene selezionato Shift
For Each ItemNote As NoteListBoxItem In m_CurrOperation.NotesList
bRecalc = ItemNote.Type.Equals("dr") OrElse ItemNote.Type.Equals("lr") OrElse ItemNote.Type.Equals("sr") OrElse ItemNote.Type.Equals("br")
If bRecalc Then Exit For
Next
End If
' Aggiorno parametri di lavorazione ' La modifica di alcuni parametri forza il ricalcolo della geometria
Dim ModifiedGeometry As Boolean = m_CurrOperation.m_IsModifiedSelectedFaceUseType
' aggiorno valori modificati
m_CurrOperation.WriteOperationParam() m_CurrOperation.WriteOperationParam()
' Carico tutta la geometria selezionata in una lista ' Carico tutta la geometria selezionata in una lista
Dim SelectedGeometry As New List(Of Integer) Dim SelectedGeometry As New List(Of Integer)
Dim EntityIndex As Integer = EgtGetFirstSelectedObj() Dim EntityIndex As Integer = EgtGetFirstSelectedObj()
@@ -394,19 +398,49 @@ Public Class MachiningParameterExpanderVM
(EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_MESH Or EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_FRGN) Then (EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_MESH Or EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_FRGN) Then
' Aggiorno lista speciale con facce ' Aggiorno lista speciale con facce
SelData.VerifyIdSub() SelData.VerifyIdSub()
' Imposto geometria ' Verifico se geometria cambiata, confrontando selezione attuale con facet con geometria di lavorazione
Dim nInd As Integer = 0
Dim nMchId, nMchSub As Integer
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
Dim nSelId, nSelSub As Integer
SelData.GetIdSub(nInd, nSelId, nSelSub)
While Not ModifiedGeometry And (nMchId <> GDB_ID.NULL Or nSelId <> GDB_ID.NULL)
' Controllo uguaglianza
If nMchId <> nSelId Or nMchSub <> nSelSub Then ModifiedGeometry = True
' Passo al successivo
nInd += 1
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
SelData.GetIdSub(nInd, nSelId, nSelSub)
End While
If ModifiedGeometry Then
Dim vId() As Integer = Nothing Dim vId() As Integer = Nothing
Dim vSub() As Integer = Nothing Dim vSub() As Integer = Nothing
SelData.GetAllIdSub(vId, vSub) SelData.GetAllIdSub(vId, vSub)
EgtSetMachiningGeometry(vId, vSub) EgtSetMachiningGeometry(vId, vSub)
End If
' Gestione standard per altre entità (curve, testi, ...) ' Gestione standard per altre entità (curve, testi, ...)
Else Else
' Imposto geometria ' Verifico se geometria cambiata, confrontando selezione attuale con geometria di lavorazione
Dim nInd As Integer = 0
Dim nMchId, nMchSub As Integer
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
Dim nSelId As Integer
nSelId = If(nInd < SelectedGeometry.Count(), SelectedGeometry(nInd), GDB_ID.NULL)
While Not ModifiedGeometry And (nMchId <> GDB_ID.NULL Or nSelId <> GDB_ID.NULL)
' Controllo uguaglianza
If nMchId <> nSelId Then ModifiedGeometry = True
' Passo al successivo
nInd += 1
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
nSelId = If(nInd < SelectedGeometry.Count(), SelectedGeometry(nInd), GDB_ID.NULL)
End While
' Imposto geometria selezionata come geometria di lavorazione
If ModifiedGeometry Then
EgtSetMachiningGeometry(SelectedGeometry.ToArray) EgtSetMachiningGeometry(SelectedGeometry.ToArray)
End If End If
End If
' Rigenero la lavorazione ' Ricalcolo la lavorazione
If Not EgtApplyMachining(bRecalc) Then If Not EgtApplyMachining(bRecalc Or ModifiedGeometry) Then
If EgtGetLastMachMgrErrorId() <> 0 Then If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString() Dim sErr As String = EgtGetLastMachMgrErrorString()
Dim sInfo As String = String.Empty Dim sInfo As String = String.Empty
@@ -425,7 +459,6 @@ Public Class MachiningParameterExpanderVM
Map.refStatusBarVM.NotifyStatusOutput("") Map.refStatusBarVM.NotifyStatusOutput("")
End If End If
End If End If
' Restart visualizzazione utensile ' Restart visualizzazione utensile
SetSliderScale( EgtGetPreviewMachiningToolStepCount()) SetSliderScale( EgtGetPreviewMachiningToolStepCount())
SetViewTool(True) SetViewTool(True)
@@ -234,11 +234,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -243,11 +243,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -1,275 +0,0 @@
<UserControl x:Class="ProbingParameterExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<UserControl.Resources>
<EgtCAM5:OperationParamVisibilityConverter x:Key="OperationParamVisibilityConverter"/>
<EgtCAM5:DepthUnitConverter x:Key="DepthUnitConverter"/>
<sys:Int32 x:Key="Invert">0</sys:Int32>
<sys:Int32 x:Key="LeaveTab">1</sys:Int32>
<sys:Int32 x:Key="WorkSide">2</sys:Int32>
<sys:Int32 x:Key="HeadSide">3</sys:Int32>
<sys:Int32 x:Key="LeadInType">4</sys:Int32>
<sys:Int32 x:Key="ExtLinkType">5</sys:Int32>
<sys:Int32 x:Key="LeadOutType">6</sys:Int32>
<sys:Int32 x:Key="CurveUse">7</sys:Int32>
<sys:Int32 x:Key="StepType">8</sys:Int32>
<sys:Int32 x:Key="LeadLinkType">9</sys:Int32>
<sys:Int32 x:Key="Speed">10</sys:Int32>
<sys:Int32 x:Key="Feed">11</sys:Int32>
<sys:Int32 x:Key="StartFeed">12</sys:Int32>
<sys:Int32 x:Key="EndFeed">13</sys:Int32>
<sys:Int32 x:Key="TipFeed">14</sys:Int32>
<sys:Int32 x:Key="OffSr">15</sys:Int32>
<sys:Int32 x:Key="OffSl">16</sys:Int32>
<sys:Int32 x:Key="SideAngle">17</sys:Int32>
<sys:Int32 x:Key="Approx">18</sys:Int32>
<sys:Int32 x:Key="StartPos">19</sys:Int32>
<sys:Int32 x:Key="StartSlowLen">20</sys:Int32>
<sys:Int32 x:Key="EndSlowLen">21</sys:Int32>
<sys:Int32 x:Key="ThrouAddLen">22</sys:Int32>
<sys:Int32 x:Key="StepPar">23</sys:Int32>
<sys:Int32 x:Key="ReturnPos">24</sys:Int32>
<sys:Int32 x:Key="TabLen">25</sys:Int32>
<sys:Int32 x:Key="TabDist">26</sys:Int32>
<sys:Int32 x:Key="TabHeight">27</sys:Int32>
<sys:Int32 x:Key="TabAngle">28</sys:Int32>
<sys:Int32 x:Key="LiTang">29</sys:Int32>
<sys:Int32 x:Key="LiPerp">30</sys:Int32>
<sys:Int32 x:Key="LiElev">31</sys:Int32>
<sys:Int32 x:Key="LiCompLen">32</sys:Int32>
<sys:Int32 x:Key="LoTang">33</sys:Int32>
<sys:Int32 x:Key="LoPerp">34</sys:Int32>
<sys:Int32 x:Key="LoElev">35</sys:Int32>
<sys:Int32 x:Key="LoCompLen">36</sys:Int32>
<sys:Int32 x:Key="StartAddLen">37</sys:Int32>
<sys:Int32 x:Key="EndAddLen">38</sys:Int32>
<sys:Int32 x:Key="StepExtArc">39</sys:Int32>
<sys:Int32 x:Key="StepIntArc">40</sys:Int32>
<sys:Int32 x:Key="SideStep">41</sys:Int32>
<sys:Int32 x:Key="VertFeed">42</sys:Int32>
<sys:Int32 x:Key="NamePar">43</sys:Int32>
<sys:Int32 x:Key="Tool">44</sys:Int32>
<sys:Int32 x:Key="DepthStr">45</sys:Int32>
<sys:Int32 x:Key="UserNotes">46</sys:Int32>
<sys:Int32 x:Key="OverLapStr">47</sys:Int32>
<sys:Int32 x:Key="OffsetStr">48</sys:Int32>
<sys:Int32 x:Key="SubType">49</sys:Int32>
<sys:Int32 x:Key="SolChoiceType">50</sys:Int32>
<sys:Int32 x:Key="AxRotRef">51</sys:Int32>
<sys:Int32 x:Key="BlockedAxesRef">52</sys:Int32>
<sys:Int32 x:Key="FaceUseType">53</sys:Int32>
<sys:Int32 x:Key="InvertToolDir">54</sys:Int32>
<sys:Int32 x:Key="ExpanderLeadIn">55</sys:Int32>
<sys:Int32 x:Key="ExpanderLeadOut">56</sys:Int32>
<sys:Int32 x:Key="ApproxGen">57</sys:Int32>
<sys:Int32 x:Key="OscEnable">58</sys:Int32>
<sys:Int32 x:Key="OscHeight">59</sys:Int32>
<sys:Int32 x:Key="OscRampLen">60</sys:Int32>
<sys:Int32 x:Key="OscFlatLen">61</sys:Int32>
</UserControl.Resources>
<StackPanel Name="OperationParametersStackPanel">
<StackPanel Name="OperationFirstParametersStackPanel">
<UniformGrid Columns="2">
<TextBlock Text="{Binding DepthStrTxBl}" Style="{DynamicResource MPExpander_DepthTxBlMargin}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding DepthStr, UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource DepthUnitConverter}}"
Style="{DynamicResource MPExpander_DepthTxBxMargin}"/>
</UniformGrid>
<EgtWPFLib5:CheckParamV ParamTxBl="{Binding InvertTxBl}"
ParamChBx="{Binding Path=Invert,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource CheckParamV_Margin}"/>
<UniformGrid Columns="2">
<TextBlock Text="{Binding UserNotesTxBl}"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding UserNotes, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource MPExpander_UserNotesTxBxMargin}">
<EgtWPFLib5:EgtTextBox.ToolTip>
<TextBlock Text="{Binding UserNotesTooltip}"/>
</EgtWPFLib5:EgtTextBox.ToolTip>
</EgtWPFLib5:EgtTextBox>
<TextBlock Text="{Binding SystemNotesTxBl}"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"
Visibility="{Binding SysNotes_Visibility}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SystemNotes, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource MPExpander_UserNotesTxBxMargin}"
Visibility="{Binding SysNotes_Visibility}"
IsReadOnly="True"/>
</UniformGrid>
</StackPanel>
<StackPanel Name="AutomaticCloseExpanderStackPanel">
<Expander Header="{Binding GenericExpanderHeader}" Name="GenericExpander"
Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1">
<StackPanel>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding StartPosTxBl}"
ParamTxBx="{Binding Path=StartPos,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding SubTypeTxBl}"
ParamCmBxList="{Binding Path=SubTypeList,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
ParamCmBxSelIndex="{Binding Path=SelectedSubType}"
Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel>
</Expander>
<Expander Name="AdvancedParam" IsExpanded="{Binding AdvancedParamIsExpander}"
Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1">
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="{Binding AdvancedParamMsg}"
Margin="2.5"/>
<Button Command="{Binding ShowNoteListComboCommand}"
ToolTip="{Binding ShowNoteToolTip}"
IsEnabled="{Binding ShowNoteListCombo_IsEnable}"
Visibility="{Binding ShowNoteListCombo_Visibility}"
Grid.Column="1"
HorizontalAlignment="Right"
Margin="2.5,2.5,7,2.5"
Width="20">
<Image Source="/Resources/Note/+.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Expander.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel>
<EgtWPFLib5:CheckParamV ParamTxBl="{Binding InvertToolDirTxBl}"
ParamChBx="{Binding Path=InvertToolDir,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource CheckParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding InitAngsTxBl}"
ParamTxBx="{Binding Path=InitAngs,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding BlockedAxisTxBl}"
ParamTxBx="{Binding Path=BlockedAxis,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding SolChoiceTypeTxBl}"
ParamCmBxList="{Binding Path=SolChoiceTypeList,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True,
Mode=OneWay}"
ParamCmBxSelIndex="{Binding Path=SelectedSolChoiceType}"
Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel>
<Grid Grid.Row="1" Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding NotesList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Description}"
Margin="0,5.5,29,0"
Width="82"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/>
<TabControl SelectedIndex="{Binding SelTypeValue}"
Grid.Column="1"
Background="Transparent"
BorderBrush="Transparent">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="TEXT">
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="False"/>
</TabItem>
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
Width="20"
Height="20"
Margin="5,0,0,0">
<Image Source="/Resources/Note/-.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ComboBox ItemsSource="{Binding NotesListCombo}"
SelectedItem="{Binding SelNoteItemCombo}"
Grid.Row="1"
Grid.ColumnSpan="1"
Visibility="{Binding ComboAddVisibility}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}"
Margin="2.5"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Expander>
<Expander Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<TextBlock Text="{Binding ToolExpanderHeader}"/>
</Expander.Header>
<StackPanel>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding FeedTxBl}"
ParamTxBx="{Binding Path=Feed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding TipFeedTxBl}"
ParamTxBx="{Binding Path=TipFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding StartFeedTxBl}"
ParamTxBx="{Binding Path=StartFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding EndFeedTxBl}"
ParamTxBx="{Binding Path=EndFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
</StackPanel>
</Expander>
<Interactivity:Interaction.Behaviors>
<EgtCAM5:AutomaticCloseExpander/>
</Interactivity:Interaction.Behaviors>
</StackPanel>
</StackPanel>
</UserControl>
@@ -1,83 +0,0 @@
Imports EgtWPFLib5.EgtFloating
Public Class ProbingParameterExpanderV
Private m_RightTrayV As RightTrayV
Private EgtFloatingPanel As EgtFloatingPanel
Private m_bFirst As Boolean = True
Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
If m_bFirst Then
m_RightTrayV = FindAncestor(Of RightTrayV)(Me)
EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me)
AddHandler m_RightTrayV.SizeChanged, AddressOf RightTrayV_SizeChanged
PanelHeight = EgtFloatingPanel.DesiredSize.Height
Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight
m_bFirst = False
End If
CalculateOperationParametersStackPanelMaxHeight()
End Sub
Dim m_bSizeChanging As Boolean = False
Private Sub RightTrayV_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs)
If m_bSizeChanging Then Return
m_bSizeChanging = True
CalculateOperationParametersStackPanelMaxHeight()
m_bSizeChanging = False
End Sub
Dim PanelHeight As Double = 0
Dim AutomaticCloseExpanderStackPanelHeight As Double = 0
' ricalcola spazio utilizzabile quando modificata dimensione finestra e quindi dimensione della tray
Private Sub CalculateOperationParametersStackPanelMaxHeight()
Dim AutomaticCloseExpanderStackPanelHeight As Double = 0
Dim OpenedExpanderList As New List(Of Boolean)
For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1
If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then
Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander)
If IndexedExpander.IsExpanded Then
OpenedExpanderList.Add(True)
IndexedExpander.IsExpanded = False
Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement)
CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity))
AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height
' Sottraggo anche i padding
AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom)
Else
OpenedExpanderList.Add(False)
End If
Else
OpenedExpanderList.Add(False)
End If
Next
Dim RemainingHeight As Double = m_RightTrayV.ActualHeight - PanelHeight
AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight
For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1
If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then
Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander)
If OpenedExpanderList(Index) Then
IndexedExpander.IsExpanded = True
End If
End If
Next
End Sub
' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject
Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T
Dim target As DependencyObject = dependencyObject
Do
target = LogicalTreeHelper.GetParent(target)
Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T)
If IsNothing(target) Then
target = dependencyObject
Do
target = VisualTreeHelper.GetParent(target)
Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T)
End If
Return TryCast(target, T)
End Function
End Class
@@ -215,11 +215,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -219,11 +219,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -213,11 +213,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -124,10 +124,10 @@
ValidatesOnDataErrors=True}" ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/> Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding ExtLinkTypeTxBl}" <EgtWPFLib5:ComboParamV ParamTxBl="{Binding ExtLinkTypeTxBl}"
ParamCmBxList="{Binding Path=LeadLinkTypeList, ParamCmBxList="{Binding Path=ExtLinkTypeList,
UpdateSourceTrigger=PropertyChanged, UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}" ValidatesOnDataErrors=True}"
ParamCmBxSelIndex="{Binding Path=SelectedLeadLinkType}" ParamCmBxSelIndex="{Binding Path=SelectedExtLinkType}"
Style="{DynamicResource ComboParamV_Margin}"/> Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel> </StackPanel>
</Expander> </Expander>
@@ -211,11 +211,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -219,11 +219,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -226,11 +226,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -236,11 +236,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -201,11 +201,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -220,11 +220,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -238,11 +238,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -228,11 +228,6 @@
<TabItem Header="CHECKBOX"> <TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/> <CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem> </TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl> </TabControl>
<Button Command="{Binding RemoveItemNoteCommand}" <Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2" Grid.Column="2"
@@ -5,54 +5,28 @@ Public Class DispositionOpListBoxItem
Public Property StatusAll As Boolean? Public Property StatusAll As Boolean?
Get Get
' Recupero gli indici delle operazioni della Disposizione corrente ' Ottieni gli indici delle operazioni e calcola il valore aggregato
Dim OpIndexes As List(Of Integer) = GetOpIndexes() Return GetUnifiedStatus(Function(item) item.Status)
' Ritorno il valore specificato in base agli stati delle operazioni di cui abbiamo raccolto gli indici
If OpIndexes.Count = 0 Then Return False
Dim bTemp As Boolean = DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(0)), MachiningOpListBoxItem).Status
For OpInDispIndex = 1 To OpIndexes.Count - 1
If DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(OpInDispIndex)), MachiningOpListBoxItem).Status <> bTemp Then Return Nothing
Next
Return bTemp
End Get End Get
Set(value As Boolean?) Set(value As Boolean?)
' Recupero gli indici delle operazioni della Disposizione corrente ' Aggiorna lo stato delle operazioni
Dim OpIndexes As List(Of Integer) = GetOpIndexes() UpdateAllStatus(value, Sub(item, val) item.Status = CBool(val))
If OpIndexes.Count = 0 Then
NotifyPropertyChanged(NameOf(StatusAll)) NotifyPropertyChanged(NameOf(StatusAll))
Return
End If
For Each OpInDispIndex In OpIndexes
DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpInDispIndex), MachiningOpListBoxItem).Status = If(IsNothing(value), False, CBool(value))
Next
End Set End Set
End Property End Property
Public Property OnOffAll As Boolean? Public Property OnOffAll As Boolean?
Get Get
Dim OpIndexes As List(Of Integer) = GetOpIndexes() ' Ottieni gli indici delle operazioni e calcola il valore aggregato
' Ritorno il valore specificato in base agli stati delle operazioni di cui abbiamo raccolto gli indici Return GetUnifiedStatus(Function(item) item.OnOff)
If OpIndexes.Count = 0 Then Return False
Dim bTemp As Boolean = DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(0)), MachiningOpListBoxItem).OnOff
For OpInDispIndex = 1 To OpIndexes.Count - 1
If DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(OpInDispIndex)), MachiningOpListBoxItem).OnOff <> bTemp Then Return Nothing
Next
Return bTemp
End Get End Get
Set(value As Boolean?) Set(value As Boolean?)
' Recupero gli indici delle operazioni della Disposizione corrente ' Aggiorna lo stato delle operazioni
Dim OpIndexes As List(Of Integer) = GetOpIndexes() UpdateAllStatus(value, Sub(item, val) item.OnOff = val)
If OpIndexes.Count = 0 Then
NotifyPropertyChanged(NameOf(OnOffAll)) NotifyPropertyChanged(NameOf(OnOffAll))
Return
End If
For Each OpInDispIndex In OpIndexes
DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpInDispIndex), MachiningOpListBoxItem).OnOff = If(IsNothing(value), False, CBool(value))
Next
End Set End Set
End Property End Property
Private m_Image As String = String.Empty Private m_Image As String = String.Empty
Public Property Image As String Public Property Image As String
Get Get
@@ -78,6 +52,7 @@ Public Class DispositionOpListBoxItem
Exit For Exit For
End If End If
Next Next
' Inserisco in una lista gli indici delle operazioni della Disposizione (a partire dunque dall'indice trovato) ' Inserisco in una lista gli indici delle operazioni della Disposizione (a partire dunque dall'indice trovato)
Dim OpIndexes As New List(Of Integer)() Dim OpIndexes As New List(Of Integer)()
Dim OpIndex As Integer = DispIndex + 1 Dim OpIndex As Integer = DispIndex + 1
@@ -89,4 +64,28 @@ Public Class DispositionOpListBoxItem
Return OpIndexes Return OpIndexes
End Function End Function
' Metodo per calcolare il valore aggregato (Checked/Unchecked/Indeterminate)
Private Function GetUnifiedStatus(getStatus As Func(Of MachiningOpListBoxItem, Boolean?)) As Boolean?
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
If OpIndexes.Count = 0 Then Return False
Dim firstStatus = getStatus(DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(0)), MachiningOpListBoxItem))
For Each index In OpIndexes.Skip(1)
Dim currentStatus = getStatus(DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(index), MachiningOpListBoxItem))
If currentStatus <> firstStatus Then Return Nothing
Next
Return firstStatus
End Function
' Metodo per aggiornare lo stato di tutte le operazioni
Private Sub UpdateAllStatus(value As Boolean?, updateStatus As Action(Of MachiningOpListBoxItem, Boolean?))
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
If OpIndexes.Count = 0 Then Return
For Each index In OpIndexes
Dim item = DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(index), MachiningOpListBoxItem)
updateStatus(item, If(IsNothing(value), False, CBool(value)))
Next
End Sub
End Class End Class
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel Imports EgtUILib
Imports EgtUILib
Public Class MachiningOpListBoxItem Public Class MachiningOpListBoxItem
Inherits OperationListBoxItem Inherits OperationListBoxItem
@@ -27,11 +26,29 @@ Public Class MachiningOpListBoxItem
End If End If
OpIndex += 1 OpIndex += 1
Next Next
' Se Operazione selezionata metto la lampadina in stato false
For Each tmpItem As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
If tmpItem.Id = Id Then
If tmpItem.OnOff Then
EgtSetStatus(tmpItem.Id, GDB_ST.OFF)
tmpItem.m_bThreeState = False
tmpItem.OnOff = False
Exit For
Else
EgtSetStatus(tmpItem.Id, GDB_ST.ON_)
tmpItem.OnOff = True
Exit For
End If
End If
Next
' Notifico StatusAll per calcolare lo stato della CheckBox della Disposizione ' Notifico StatusAll per calcolare lo stato della CheckBox della Disposizione
Map.refOperationsListExpanderVM.OperationList(DispIndex).NotifyPropertyChanged(NameOf(DispositionOpListBoxItem.StatusAll)) Map.refOperationsListExpanderVM.OperationList(DispIndex).NotifyPropertyChanged(NameOf(DispositionOpListBoxItem.StatusAll))
EgtSetOperationMode(Id, m_Status) EgtSetOperationMode(Id, m_Status)
EgtDraw() EgtDraw()
End If End If
Map.refProjectVM.EmitTitle()
NotifyPropertyChanged(NameOf(Status)) NotifyPropertyChanged(NameOf(Status))
End If End If
End Set End Set
@@ -100,10 +117,10 @@ Public Class MachiningOpListBoxItem
RaiseEvent m_ModifyNameGetFocus() RaiseEvent m_ModifyNameGetFocus()
' se esco da modifica ' se esco da modifica
End If End If
NotifyPropertyChanged("ModifiedName") NotifyPropertyChanged(NameOf(ModifiedName))
NotifyPropertyChanged("Name") NotifyPropertyChanged(NameOf(Name))
NotifyPropertyChanged("Name_Visibility") NotifyPropertyChanged(NameOf(Name_Visibility))
NotifyPropertyChanged("ModifyName_Visibility") NotifyPropertyChanged(NameOf(ModifyName_Visibility))
End Set End Set
End Property End Property
@@ -125,27 +142,31 @@ Public Class MachiningOpListBoxItem
End Get End Get
End Property End Property
Public m_bThreeState As Boolean = False
Private m_bOnOff As Boolean = True Private m_bOnOff As Boolean? = True
Public Property OnOff As Boolean Public Property OnOff As Boolean?
Get Get
Return m_bOnOff Return m_bOnOff
End Get End Get
Set(value As Boolean) Set(value As Boolean?)
If m_bOnOff <> value Then ' Controllo se la lampadina è messa in stato Nothing e value e false
m_bOnOff = value m_bOnOff = If(m_bThreeState AndAlso Not value, True, value)
Dim bOldEnMod As Boolean = EgtGetEnableModified() Dim bOldEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified() EgtDisableModified()
' se abilitato, eseguo operazione ' se abilitato, eseguo operazione
Dim status As Integer = GDB_ST.OFF Dim status As Integer = GDB_ST.OFF
If value Then ' Controllo se lo stato della lampadina è true o nullo
If m_bOnOff OrElse IsNothing(m_bOnOff) Then
status = GDB_ST.ON_ status = GDB_ST.ON_
End If End If
' Modifica lo stato della checkbox all delle lampadine
ModifyStatusLamp() ModifyStatusLamp()
' Setto lo stato della lampadina
EgtSetStatus(Id, status) EgtSetStatus(Id, status)
If bOldEnMod Then EgtEnableModified() If bOldEnMod Then EgtEnableModified()
EgtDraw() If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
End If m_bThreeState = False
Map.refProjectVM.EmitTitle()
NotifyPropertyChanged(NameOf(OnOff)) NotifyPropertyChanged(NameOf(OnOff))
End Set End Set
End Property End Property
@@ -250,7 +271,7 @@ Public Class MachiningOpListBoxItem
m_CloseModifyLostFocus = False m_CloseModifyLostFocus = False
MessageBox.Show(EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning) MessageBox.Show(EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
m_IsActive_ModifyName = True m_IsActive_ModifyName = True
NotifyPropertyChanged("ModifyName_Visibility") NotifyPropertyChanged(NameOf(ModifyName_Visibility))
m_Spy = True m_Spy = True
Return Return
End If End If
@@ -36,7 +36,7 @@ Public Class OperationListBoxItem
Set(value As Boolean) Set(value As Boolean)
If Not IsNothing(value) Then If Not IsNothing(value) Then
Dim indexes As List(Of OperationListBoxItem) = New List(Of OperationListBoxItem) Dim indexes As New List(Of OperationListBoxItem)
Dim Count As Integer = 0 Dim Count As Integer = 0
For Each OperationListBoxItem In Map.refOperationsListExpanderVM.OperationList For Each OperationListBoxItem In Map.refOperationsListExpanderVM.OperationList
If OperationListBoxItem.IsSelected And OperationListBoxItem.Id <> m_Id Then If OperationListBoxItem.IsSelected And OperationListBoxItem.Id <> m_Id Then
@@ -45,6 +45,23 @@ Public Class OperationListBoxItem
End If End If
Next Next
' Se Operazione selezionata metto la lampadina in stato Nothing
For Each tmpItem As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
If tmpItem.Id = Id Then
If IsNothing(tmpItem.OnOff) Then
EgtSetStatus(tmpItem.Id, GDB_ST.OFF)
tmpItem.m_bThreeState = False
tmpItem.OnOff = False
Exit For
ElseIf Not tmpitem.OnOff AndAlso Not m_IsSelected Then
EgtSetStatus(tmpItem.Id, GDB_ST.SEL)
tmpItem.OnOff = Nothing
tmpItem.m_bThreeState = True
Exit For
End If
End If
Next
If indexes.Count > 0 Then If indexes.Count > 0 Then
If EgtGetOperationPhase(Id) <> EgtGetOperationPhase(indexes(0).Id) Then If EgtGetOperationPhase(Id) <> EgtGetOperationPhase(indexes(0).Id) Then
Return Return
@@ -72,7 +89,7 @@ Public Class OperationListBoxItem
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveUp_IsEnabled") Map.refOperationsListExpanderVM.OnPropertyChanged("MoveUp_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled") Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
NotifyPropertyChanged("IsSelected") NotifyPropertyChanged(NameOf(IsSelected))
' Aggiorno visualizzazione ' Aggiorno visualizzazione
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw() If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
Return Return
@@ -136,7 +153,7 @@ Public Class OperationListBoxItem
Map.refOperationsListExpanderVM.OnPropertyChanged("DuplicateCmd_IsEnabled") Map.refOperationsListExpanderVM.OnPropertyChanged("DuplicateCmd_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MachToDb_IsEnabled") Map.refOperationsListExpanderVM.OnPropertyChanged("MachToDb_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("Rename_IsEnabled") Map.refOperationsListExpanderVM.OnPropertyChanged("Rename_IsEnabled")
NotifyPropertyChanged("IsSelected") NotifyPropertyChanged(NameOf(IsSelected))
End Set End Set
End Property End Property
@@ -177,8 +177,6 @@ Public Class OperationParametersExpanderVM
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomWaterJetting Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomWaterJetting
Case MCH_OY.FIVEAXISMILLING Case MCH_OY.FIVEAXISMILLING
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomFiveAxMilling Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomFiveAxMilling
Case MCH_OY.PROBING
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomProbing
End Select End Select
' Imposto visualizzazione utensile ' Imposto visualizzazione utensile
Map.refMachiningParameterExpanderVM.SetViewTool( True) Map.refMachiningParameterExpanderVM.SetViewTool( True)
@@ -27,9 +27,9 @@
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}"> <DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
<DataTemplate.Resources> <DataTemplate.Resources>
<Style x:Key="LayoutRoot" TargetType="Grid"> <Style x:Key="LayoutRoot" TargetType="Grid">
<!--<Style.Triggers> <!--<Style.Triggers>-->
--><!--these are the triggers that make the code cursor jump from box 1 to box 2 to box 3.--><!-- <!--these are the triggers that make the code cursor jump from box 1 to box 2 to box 3.-->
<DataTrigger Binding="{Binding ElementName=Box, Path=Visibility}" Value="Visible"> <!--<DataTrigger Binding="{Binding ElementName=Box, Path=Visibility}" Value="Visible">
<Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=Box}"/> <Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=Box}"/>
</DataTrigger> </DataTrigger>
</Style.Triggers>--> </Style.Triggers>-->
@@ -51,9 +51,10 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/> <CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/> <Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1" <!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/> IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>-->
<CheckBox Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1"
IsChecked="{Binding OnOff}" Height="15" Width="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Name}" <TextBlock Grid.Column="2" Text="{Binding Name}"
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/> Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}" <TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
@@ -80,7 +81,7 @@
</Border.InputBindings> </Border.InputBindings>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/> <CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
<CheckBox IsChecked="{Binding OnOffAll}" VerticalAlignment="Center" Margin="0,0,5,0"/> <CheckBox IsChecked="{Binding OnOffAll}" Style="{StaticResource EgtCAM5_LampToggleButton}" Height="15" Width="15" VerticalAlignment="Center" Margin="0,0,5,0"/>
<!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" <!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}"
IsChecked="{Binding OnOffAll}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>--> IsChecked="{Binding OnOffAll}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>-->
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/> <Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
@@ -671,8 +671,7 @@ Public Class OperationsListExpanderVM
If Not String.IsNullOrEmpty(sErr) Then If Not String.IsNullOrEmpty(sErr) Then
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else Else
' Errore nell'aggiornamento delle lavorazioni! MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(5346), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If End If
Else Else
Map.refStatusBarVM.NotifyStatusOutput(EgtMsg(MSG_OPERATION + 11)) Map.refStatusBarVM.NotifyStatusOutput(EgtMsg(MSG_OPERATION + 11))
@@ -1331,6 +1330,7 @@ Public Class StatusLamp
#Region "FIELDS & PROPERTIES" #Region "FIELDS & PROPERTIES"
' Id dell'operazione
Private m_nId As Integer Private m_nId As Integer
Public Property nId As Integer Public Property nId As Integer
Get Get
@@ -1341,12 +1341,13 @@ Public Class StatusLamp
End Set End Set
End Property End Property
Private m_bStatusLamp As Boolean ' Stato della lampadina: vero, falso e nullo
Public Property bStatusLamp As Boolean Private m_bStatusLamp As Boolean?
Public Property bStatusLamp As Boolean?
Get Get
Return m_bStatusLamp Return m_bStatusLamp
End Get End Get
Set(value As Boolean) Set(value? As Boolean)
m_bStatusLamp = value m_bStatusLamp = value
End Set End Set
End Property End Property
@@ -1355,38 +1356,50 @@ Public Class StatusLamp
#Region "CONSTRUCTOR" #Region "CONSTRUCTOR"
Sub New(nId As Integer, bStatusLamp As Boolean) Sub New(nId As Integer, bStatusLamp As Boolean?)
m_nId = nId m_nId = nId
m_bStatusLamp = bStatusLamp m_bStatusLamp = bStatusLamp
End Sub End Sub
Sub New() Sub New()
End Sub End Sub
#End Region ' Constructor #End Region ' Constructor
#Region "METHODS" #Region "METHODS"
''' <summary>
''' Funzione che salva gli stati di tutte le lampadine delle operazioni
''' </summary>
''' <returns></returns>
Public Function LoadStatusLamp() As ObservableCollection(Of StatusLamp) Public Function LoadStatusLamp() As ObservableCollection(Of StatusLamp)
Dim tmpStatusLampList As New ObservableCollection(Of StatusLamp) ' Utilizzo di LINQ per creare la lista in modo più conciso, carico gli stati delle lampadine per tenerli salvati
For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList Return New ObservableCollection(Of StatusLamp)(Map.refOperationsListExpanderVM.tmpOperationList.Select(Function(ItemOp) New StatusLamp(ItemOp.Id, ItemOp.OnOff)))
tmpStatusLampList.Add(New StatusLamp(ItemOp.Id, ItemOp.OnOff))
Next
Return tmpStatusLampList
End Function End Function
''' <summary>
''' Funzione che aggiorna lo stato delle lampadine delle operazioni
''' </summary>
Public Sub UpdateStatusLamp() Public Sub UpdateStatusLamp()
' Verifica che tmpOperationList non sia nulla
If IsNothing(Map.refOperationsListExpanderVM.tmpOperationList) Then Return
Dim tmpStatusLamp As StatusLamp Dim tmpStatusLamp As StatusLamp
If Not IsNothing(Map.refOperationsListExpanderVM.tmpOperationList) Then
For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
' Recuero lo stato della lampadina
tmpStatusLamp = Map.refOperationsListExpanderVM.StatusLampList.FirstOrDefault(Function(x) x.nId = ItemOp.Id) tmpStatusLamp = Map.refOperationsListExpanderVM.StatusLampList.FirstOrDefault(Function(x) x.nId = ItemOp.Id)
' Controllo se lo stato della lampadina è falso nella lista StatusLampList
If Not tmpStatusLamp.bStatusLamp Then If Not tmpStatusLamp.bStatusLamp Then
' Rimetto lo stato della lampadina a falso nella OperationList
EgtSetStatus(ItemOp.Id, GDB_ST.OFF) EgtSetStatus(ItemOp.Id, GDB_ST.OFF)
ItemOp.OnOff = False ItemOp.OnOff = False
' Controllo se lo stato della lampadina è nullo nella lista StatusLampList
ElseIf IsNothing(tmpStatusLamp.bStatusLamp) Then
' Rimetto lo stato della lampadina a nullo nella OperationList
EgtSetStatus(ItemOp.Id, GDB_ST.SEL)
ItemOp.OnOff = Nothing
End If End If
Next Next
End If
End Sub End Sub
#End Region ' Methods #End Region ' Methods
@@ -51,13 +51,6 @@
<TextBlock Text="{Binding VMillMsg}" Margin="5,0,0,0"/> <TextBlock Text="{Binding VMillMsg}" Margin="5,0,0,0"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Trace_Visibility}"
IsEnabled="{Binding Trace_IsEnabled}" Margin="10,5,10,0">
<CheckBox HorizontalAlignment="Left" VerticalAlignment="Center"
IsChecked="{Binding TraceActive}"/>
<TextBlock Text="{Binding TraceMsg}" Margin="5,0,0,0"/>
</StackPanel>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -248,8 +248,7 @@ Public Class SimulationExpanderVM
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10) Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
SliderValue = SliderVal SliderValue = SliderVal
' Gestione check VMill ' Gestione check VMill
If IsKeyEnabledVirtualMilling() And If IsKeyEnabledVirtualMilling() And EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
VMill_Visibility = Visibility.Visible VMill_Visibility = Visibility.Visible
VMill_IsEnabled = True VMill_IsEnabled = True
Dim bVal As Boolean Dim bVal As Boolean
@@ -262,16 +261,6 @@ Public Class SimulationExpanderVM
VMillActive = False VMillActive = False
EgtEnableModified() EgtEnableModified()
End If End If
' Gestione check Trace
If IniFile.GetPrivateProfileInt(S_SIMUL, K_TRACEENABLE, 0) <> 0 And
EgtUILib.GetPrivateProfileInt(S_TOOLTRACE, K_TT_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
Trace_Visibility = Visibility.Visible
Trace_IsEnabled = True
If TraceActive Then TraceActive = True
Else
Trace_Visibility = Visibility.Collapsed
Trace_IsEnabled = False
End If
' Aggiorno visualizzazione dati macchina ' Aggiorno visualizzazione dati macchina
ShowCncData() ShowCncData()
StatusMsg = EgtMsg(MSG_SIMULATION + 14) ' HOME StatusMsg = EgtMsg(MSG_SIMULATION + 14) ' HOME
@@ -376,7 +365,7 @@ Public Class SimulationExpanderVM
End If End If
Else Else
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU ' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(5) System.Threading.Thread.Sleep(4)
End If End If
' Costringo ad aggiornare UI ' Costringo ad aggiornare UI
UpdateUI() UpdateUI()
@@ -408,7 +397,6 @@ Public Class SimulationExpanderVM
MachineAxisList(Index).IsReadOnlyAxesValue = True MachineAxisList(Index).IsReadOnlyAxesValue = True
Next Next
End If End If
Trace_IsEnabled = (value = MCH_SIM_ST.UI_PAUSE OrElse value = MCH_SIM_ST.UI_STOP)
EgtSimSetUiStatus(GetStatus()) EgtSimSetUiStatus(GetStatus())
End Sub End Sub
@@ -451,15 +439,14 @@ Public Class SimulationExpanderVM
sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & sCncFile sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & sCncFile
Else Else
sCncFile = Path.ChangeExtension(sCurrFilePath, Nothing) sCncFile = Path.ChangeExtension(sCurrFilePath, Nothing)
Dim sExt As String = ".cnc"
EgtUILib.GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, sExt, sExt, IniFile.m_sCurrMachIniFilePath)
If IniFile.m_bMachiningGroup Then If IniFile.m_bMachiningGroup Then
Dim sMGrpName As String = String.Empty Dim sMGrpName As String = String.Empty
If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then
sCncFile &= "_" & sMGrpName sCncFile &= "_" & sMGrpName & ".cnc"
sInfo &= "-" & sMGrpName sInfo &= "-" & sMGrpName
End If End If
sCncFile = Path.ChangeExtension(sCncFile, sExt) Else
sCncFile &= ".cnc"
End If End If
End If End If
Return True Return True
@@ -468,16 +455,16 @@ Public Class SimulationExpanderVM
Friend Sub SimulationExpander_Update_CncData( nFlag As Integer) Friend Sub SimulationExpander_Update_CncData( nFlag As Integer)
If Simulation_IsExpanded Then If Simulation_IsExpanded Then
ShowCncData() ShowCncData()
' Se fermo per Collisione rilevata da script Lua o per altra richiesta ' Se fermo per Collisione rilevata da script Lua
If nFlag = 11 Or nFlag = 12 Then If nFlag = 11 Then
' Imposto stato Pausa ' Imposto stato Pausa
SetSimulationStatus(MCH_SIM_ST.UI_PAUSE) SetSimulationStatus(MCH_SIM_ST.UI_PAUSE)
StatusMsg = EgtMsg(MSG_SIMULATION + 11) ' PAUSA StatusMsg = EgtMsg(MSG_SIMULATION + 11) ' PAUSA
' Aggiornamenti per bottone Play/Pause ' Aggiornamenti per bottone Play/Pause
SetShowPlay(True) SetShowPlay(True)
NotifyPropertyChanged("PlayPauseImage") NotifyPropertyChanged("PlayPauseImage")
' Se fermo per Collisione, dichiaro di non arrestarsi alla successiva notifica di collisione ' Dichiaro di non arrestarsi alla successiva notifica di collisione
If nFlag = 11 Then m_bStopOnNextCollision = False m_bStopOnNextCollision = False
End If End If
End If End If
End Sub End Sub
+6 -54
View File
@@ -12,10 +12,8 @@ Friend Module OptionModule
Friend m_GridColor As Color3d Friend m_GridColor As Color3d
' Flag per visualizzazione spessa delle linee ' Flag per visualizzazione spessa delle linee
Friend m_bThickLine As Boolean Friend m_bThickLine As Boolean
' Qualità di visualizzazione delle superfici ' Flag per visualizzazione smussata delle superfici
Friend m_ShowSurfQuality As SceneSurfQualityOpt Friend m_bSmoothTriMesh As Boolean
' Tipo di visualizzazione delle Zmap
Friend m_nShowZmapType As Integer
' Colore di default in disegno ' Colore di default in disegno
Friend m_DefMaterialColor As Color3d Friend m_DefMaterialColor As Color3d
@@ -61,9 +59,7 @@ Friend Module OptionModule
Friend m_SelGeomSurfRoughing As SceneSelModeOpt Friend m_SelGeomSurfRoughing As SceneSelModeOpt
Friend m_SelGeomWaterJetting As SceneSelModeOpt Friend m_SelGeomWaterJetting As SceneSelModeOpt
Friend m_SelGeomFiveAxMilling As SceneSelModeOpt Friend m_SelGeomFiveAxMilling As SceneSelModeOpt
Friend m_SelGeomProbing As SceneSelModeOpt Friend m_SelVMillQuality As VMillSelTypeOpt
' Qualità di calcolo del virtual milling
Friend m_VMillQuality As VMillSelTypeOpt
' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata ' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata
Friend m_bNewMachiningIsLastOne As Boolean Friend m_bNewMachiningIsLastOne As Boolean
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione ' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
@@ -114,24 +110,13 @@ Friend Module OptionModule
' Inizializzo flag linee ingrossate ' Inizializzo flag linee ingrossate
m_bThickLine = (GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1) m_bThickLine = (GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1)
' Inizializzo flag visualizzazione smussata delle superfici ' Inizializzo flag visualizzazione smussata delle superfici
Dim nSSQ As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWSURFQUALITY, 0) m_bSmoothTriMesh = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
m_ShowSurfQuality = DirectCast( Math.Min( Math.Max( nSSQ, -2), 2), SceneSurfQualityOpt)
' Inizializzo tipo di visualizzazione Zmap
m_nShowZmapType = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 9)
' Inizio colore di default in disegno ' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0) Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor) GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_DefMaterialColor = DefColor m_DefMaterialColor = DefColor
' Inizializzo tolleranza geometrica ' Inizializzo tolleranza geometrica
m_dGeometryTolerance = GetPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05) m_dGeometryTolerance = GetPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05)
' Inizializzo stile corrente delle quotature
m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5)
m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5)
m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2)
m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2)
m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2)
m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont)
m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2)
' Inizializzo variabili per import ' Inizializzo variabili per import
m_dDxfScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1) m_dDxfScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1)
m_dStlScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1) m_dStlScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1)
@@ -169,12 +154,9 @@ Friend Module OptionModule
m_SelGeomSurfRoughing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) m_SelGeomSurfRoughing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMILLING, -1) Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMILLING, -1)
m_SelGeomFiveAxMilling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) m_SelGeomFiveAxMilling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMPROBING, -1) Temp = GetPrivateProfileInt(S_MACH, K_SELVMILLQUALITY, 0)
m_SelGeomProbing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt)) m_SelVMillQuality = If(Temp < -2 Or Temp > 2, VMillSelTypeOpt.HIGHER, DirectCast(Temp, VMillSelTypeOpt))
m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES
' Inizializzo qualità di virtual milling
Temp = GetPrivateProfileInt(S_MACH, K_VMILLQUALITY, 0)
m_VMillQuality = DirectCast(Math.Min( Math.Max( Temp, -2), 2), VMillSelTypeOpt)
' Inizializzo variabile che indica posizione nuova operazione di lavorazione ' Inizializzo variabile che indica posizione nuova operazione di lavorazione
m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0) m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0)
' Inizializzo variabile che indica se usare script di disposizione ' Inizializzo variabile che indica se usare script di disposizione
@@ -187,36 +169,6 @@ Friend Module OptionModule
m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0) m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
End Sub End Sub
' restituisco spessore linee
Friend Function GetLineWidth() As Integer
Return If( m_bThickLine, 2, 1)
End Function
' imposto stato visualizzazione superfici
Friend Sub SetShowSurfQuality( bRedraw As Boolean)
Dim bSmoothTriMesh As Boolean = True
Dim dSrfBezShowTol As Double = 0.2
Select m_ShowSurfQuality
Case SceneSurfQualityOpt.LOWER
bSmoothTriMesh = False
dSrfBezShowTol = 4
Case SceneSurfQualityOpt.LOW
bSmoothTriMesh = False
dSrfBezShowTol = 1
Case SceneSurfQualityOpt.STANDARD
bSmoothTriMesh = True
dSrfBezShowTol = 0.2
Case SceneSurfQualityOpt.HIGH
bSmoothTriMesh = True
dSrfBezShowTol = 0.05
Case SceneSurfQualityOpt.HIGHER
bSmoothTriMesh = True
dSrfBezShowTol = 0.01
End Select
EgtSetShowTriaAdv(bSmoothTriMesh, false)
EgtSetShowSurfBezierTol(dSrfBezShowTol, bRedraw)
End Sub
End Module End Module
' Classe che identifica una lingua del programma con nome e path del file dei messaggi ' Classe che identifica una lingua del programma con nome e path del file dei messaggi
+24 -68
View File
@@ -9,12 +9,11 @@
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False" WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382" MinWidth="400" MinHeight="382"
Width="400" Height="600" Width="400" Height="575"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"> CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<EgtWPFLib5:EgtCustomWindow.Resources> <EgtWPFLib5:EgtCustomWindow.Resources>
<local:GeomTypeConverter x:Key="GeomTypeConverter"/> <local:GeomTypeConverter x:Key="GeomTypeConverter"/>
<local:SceneSurfQualityOptConverter x:Key="SceneSurfQualityOptConverter"/>
<local:VMillTypeConverter x:Key="VMillTypeConverter"/> <local:VMillTypeConverter x:Key="VMillTypeConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources> </EgtWPFLib5:EgtCustomWindow.Resources>
@@ -66,17 +65,10 @@
Grid.Row="0" Margin="0,5,0,5"/> Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}" <CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/> Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SceneSurfQualityMsg}" VerticalAlignment="Center" <TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,5,0,5"/> Grid.Row="1" Margin="0,5,0,5"/>
<ComboBox ItemsSource="{Binding SceneSurfQualityOptList, Mode=OneWay}" <CheckBox IsChecked="{Binding SmoothTriMesh}"
SelectedItem="{Binding SelectedSceneSurfQualityOpt}" Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
Grid.Column="1" Grid.Row="1" Height="25" Margin="0,5,0,5">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource SceneSurfQualityOptConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid> </Grid>
<UniformGrid Columns="2" <UniformGrid Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
@@ -85,31 +77,7 @@
SelectedItem="{Binding SelectedTextFont}" Height="25" SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/> Margin="10,5,0,0"/>
</UniformGrid> </UniformGrid>
<GroupBox Header="ShowZmap" <Grid Margin="5,5,5,5">
Visibility="{Binding ShowZmapVisibility}"
Margin="0,0,0,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding ShowZmapSurf}"
Content="Surfaces" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="0" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapLines}"
Content="Lines" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="1" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapNormals}"
Content="Normals" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="2" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapBiColor}"
Content="BiColor" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="3" Margin="5,5,10,5" VerticalAlignment="Center"/>
</Grid>
</GroupBox>
<Grid Margin="5,100,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/> <Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid> </Grid>
</StackPanel> </StackPanel>
@@ -281,15 +249,6 @@
Header="{Binding MachiningSelGeomMsg}" Header="{Binding MachiningSelGeomMsg}"
Margin="5,5,5,0"> Margin="5,5,5,0">
<UniformGrid Columns="2"> <UniformGrid Columns="2">
<TextBlock Text="{Binding GeomTypeProbingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedProbingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25"> SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
@@ -406,7 +365,7 @@
<UniformGrid Columns="2" Grid.ColumnSpan="2" Margin="0,5,0,0"> <UniformGrid Columns="2" Grid.ColumnSpan="2" Margin="0,5,0,0">
<TextBlock Text="{Binding VMillQualityMsg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding VMillQualityMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding VMillTypeList, Mode=OneWay}" <ComboBox ItemsSource="{Binding VMillTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedVMillQualityType}" Height="25"> SelectedItem="{Binding SelectedVMillTypeType}" Height="25">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource VMillTypeConverter}}"/> <TextBlock Text="{Binding Converter={StaticResource VMillTypeConverter}}"/>
@@ -435,9 +394,9 @@
<StackPanel> <StackPanel>
<Grid Margin="5,20,5,0"> <Grid Margin="5,20,5,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
@@ -446,34 +405,31 @@
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="{Binding BeamMsg}" <TextBlock Text="{Binding SpecialMsg}"
Grid.Row="0" Grid.Column="0" Margin="0,5,0,5"/> Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding BeamOn}" IsEnabled="{Binding BeamEnabled}" <CheckBox IsChecked="{Binding SpecialOn}"
Grid.Row="0" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/> Grid.Row="0" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding BeamMsg}"
Grid.Row="1" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding BeamOn}" IsEnabled="{Binding BeamEnabled}"
Grid.Row="1" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding BeamActive}" <Button Content="{Binding UpdateMsg}" IsEnabled="{Binding BeamActive}"
Command="{Binding UpdateBeam_Command}" Command="{Binding UpdateBeam_Command}"
Grid.Row="0" Grid.Column="2" Height="26"/> Grid.Row="1" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding WallMsg}" <TextBlock Text="{Binding WallMsg}"
Grid.Row="1" Grid.Column="0" Margin="0,5,0,5"/> Grid.Row="2" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding WallOn}" IsEnabled="{Binding WallEnabled}" <CheckBox IsChecked="{Binding WallOn}" IsEnabled="{Binding WallEnabled}"
Grid.Row="1" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/> Grid.Row="2" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding WallActive}" <Button Content="{Binding UpdateMsg}" IsEnabled="{Binding WallActive}"
Command="{Binding UpdateWall_Command}" Command="{Binding UpdateWall_Command}"
Grid.Row="1" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding DoorsMsg}" VerticalAlignment="Center"
Grid.Row="2" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding DoorsOn}" IsEnabled="{Binding DoorsEnabled}"
Grid.Row="2" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding DoorsActive}"
Command="{Binding UpdateDoors_Command}"
Grid.Row="2" Grid.Column="2" Height="26"/> Grid.Row="2" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding GunstockMsg}" VerticalAlignment="Center" <TextBlock Text="{Binding DoorsMsg}" VerticalAlignment="Center"
Grid.Row="3" Grid.Column="0" Margin="0,5,0,5"/> Grid.Row="3" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding GunstockOn}" IsEnabled="{Binding GunstockEnabled}" <CheckBox IsChecked="{Binding DoorsOn}" IsEnabled="{Binding DoorsEnabled}"
Grid.Row="3" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/> Grid.Row="3" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SpecialMsg}" <TextBlock Text="{Binding GunstockMsg}" VerticalAlignment="Center"
Grid.Row="4" Margin="0,5,0,5"/> Grid.Row="4" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SpecialOn}" <CheckBox IsChecked="{Binding GunstockOn}" IsEnabled="{Binding GunstockEnabled}"
Grid.Row="4" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/> Grid.Row="4" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
</Grid> </Grid>
</StackPanel> </StackPanel>
+32 -269
View File
@@ -34,13 +34,6 @@ Public Class OptionWindowVM
End Get End Get
End Property End Property
Private m_SceneSurfQualityOptList As ObservableCollection(Of SceneSurfQualityOpt) = New ObservableCollection(Of SceneSurfQualityOpt)({SceneSurfQualityOpt.LOWER, SceneSurfQualityOpt.LOW, SceneSurfQualityOpt.STANDARD, SceneSurfQualityOpt.HIGH, SceneSurfQualityOpt.HIGHER})
Public ReadOnly Property SceneSurfQualityOptList As ObservableCollection(Of SceneSurfQualityOpt)
Get
Return m_SceneSurfQualityOptList
End Get
End Property
Private m_FontList As New ObservableCollection(Of String) Private m_FontList As New ObservableCollection(Of String)
Public ReadOnly Property FontList As ObservableCollection(Of String) Public ReadOnly Property FontList As ObservableCollection(Of String)
Get Get
@@ -105,18 +98,6 @@ Public Class OptionWindowVM
End Set End Set
End Property End Property
Public Property SelectedSceneSurfQualityOpt As SceneSurfQualityOpt
Get
Return OptionModule.m_ShowSurfQuality
End Get
Set(value As SceneSurfQualityOpt)
If WritePrivateProfileString(S_SCENE, K_SHOWSURFQUALITY, CInt(value).ToString()) Then
OptionModule.m_ShowSurfQuality = value
OptionModule.SetShowSurfQuality( true)
End If
End Set
End Property
Public Property SelectedMillingGeomType As SceneSelModeOpt Public Property SelectedMillingGeomType As SceneSelModeOpt
Get Get
Return OptionModule.m_SelGeomMilling Return OptionModule.m_SelGeomMilling
@@ -177,6 +158,7 @@ Public Class OptionWindowVM
End If End If
End Set End Set
End Property End Property
Public Property SelectedGenGeomType As SceneSelModeOpt Public Property SelectedGenGeomType As SceneSelModeOpt
Get Get
Return OptionModule.m_SelGeomGenMachining Return OptionModule.m_SelGeomGenMachining
@@ -187,6 +169,7 @@ Public Class OptionWindowVM
End If End If
End Set End Set
End Property End Property
Public Property SelectedSurfRoughGeomType As SceneSelModeOpt Public Property SelectedSurfRoughGeomType As SceneSelModeOpt
Get Get
Return OptionModule.m_SelGeomSurfRoughing Return OptionModule.m_SelGeomSurfRoughing
@@ -197,6 +180,7 @@ Public Class OptionWindowVM
End If End If
End Set End Set
End Property End Property
Public Property SelectedSurfFinishGeomType As SceneSelModeOpt Public Property SelectedSurfFinishGeomType As SceneSelModeOpt
Get Get
Return OptionModule.m_SelGeomSurfFinishing Return OptionModule.m_SelGeomSurfFinishing
@@ -218,6 +202,7 @@ Public Class OptionWindowVM
' End If ' End If
' End Set ' End Set
'End Property 'End Property
Public Property SelectedFiveAxGeomType As SceneSelModeOpt Public Property SelectedFiveAxGeomType As SceneSelModeOpt
Get Get
Return OptionModule.m_SelGeomFiveAxMilling Return OptionModule.m_SelGeomFiveAxMilling
@@ -228,24 +213,14 @@ Public Class OptionWindowVM
End If End If
End Set End Set
End Property End Property
Public Property SelectedProbingGeomType As SceneSelModeOpt
Get
Return OptionModule.m_SelGeomProbing
End Get
Set(value As SceneSelModeOpt)
If WritePrivateProfileString(S_MACH, K_SELGEOMPROBING, CInt(value).ToString()) Then
OptionModule.m_SelGeomProbing = value
End If
End Set
End Property
Public Property SelectedVMillQualityType As VMillSelTypeOpt Public Property SelectedVMillTypeType As VMillSelTypeOpt
Get Get
Return OptionModule.m_VMillQuality Return OptionModule.m_SelVMillQuality
End Get End Get
Set(value As VMillSelTypeOpt) Set(value As VMillSelTypeOpt)
If WritePrivateProfileString(S_MACH, K_VMILLQUALITY, CInt(value).ToString()) Then If WritePrivateProfileString(S_MACH, K_SELVMILLQUALITY, CInt(value).ToString()) Then
OptionModule.m_VMillQuality = value OptionModule.m_SelVMillQuality = value
End If End If
End Set End Set
End Property End Property
@@ -326,10 +301,19 @@ Public Class OptionWindowVM
End Get End Get
Set(value As Boolean) Set(value As Boolean)
OptionModule.m_bThickLine = value OptionModule.m_bThickLine = value
Dim nThickLine As Integer = OptionModule.GetLineWidth() WritePrivateProfileString(S_SCENE, K_LINEWIDTH, If(value, "2", "1"))
WritePrivateProfileString(S_SCENE, K_LINEWIDTH, nThickLine.ToString()) EgtSetLineAttribs(If(value, 2, 1))
EgtSetLineAttribs(nThickLine) End Set
EgtDraw() End Property
Public Property SmoothTriMesh As Boolean
Get
Return OptionModule.m_bSmoothTriMesh
End Get
Set(value As Boolean)
OptionModule.m_bSmoothTriMesh = value
WritePrivateProfileString(S_SCENE, K_SHOWTRIAADV, If(value, "1", "0"))
EgtSetShowTriaAdv(value)
End Set End Set
End Property End Property
@@ -339,68 +323,13 @@ Public Class OptionWindowVM
End Get End Get
Set(value As String) Set(value As String)
OptionModule.m_sFontText = value OptionModule.m_sFontText = value
EgtSetFont("", OptionModule.m_sFontText) Dim sNfeDir As String = String.Empty
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
EgtSetFont(sNfeDir, OptionModule.m_sFontText)
WritePrivateProfileString(S_GEOMDB, K_DEFAULTFONT, OptionModule.m_sFontText) WritePrivateProfileString(S_GEOMDB, K_DEFAULTFONT, OptionModule.m_sFontText)
End Set End Set
End Property End Property
Public Property ShowZmapSurf As Boolean
Get
Return (( OptionModule.m_nShowZmapType And 1) <> 0)
End Get
Set(value As Boolean)
If value Then
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType Or 1)
Else
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType And Not 1)
End If
WritePrivateProfileString(S_SCENE, K_SHOWZMAP, OptionModule.m_nShowZmapType.ToString())
EgtSetShowZmap( OptionModule.m_nShowZmapType, True)
End Set
End Property
Public Property ShowZmapLines As Boolean
Get
Return (( OptionModule.m_nShowZmapType And 2) <> 0)
End Get
Set(value As Boolean)
If value Then
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType Or 2)
Else
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType And Not 2)
End If
WritePrivateProfileString(S_SCENE, K_SHOWZMAP, OptionModule.m_nShowZmapType.ToString())
EgtSetShowZmap( OptionModule.m_nShowZmapType, True)
End Set
End Property
Public Property ShowZmapNormals As Boolean
Get
Return (( OptionModule.m_nShowZmapType And 4) <> 0)
End Get
Set(value As Boolean)
If value Then
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType Or 4)
Else
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType And Not 4)
End If
WritePrivateProfileString(S_SCENE, K_SHOWZMAP, OptionModule.m_nShowZmapType.ToString())
EgtSetShowZmap( OptionModule.m_nShowZmapType, True)
End Set
End Property
Public Property ShowZmapBiColor As Boolean
Get
Return (( OptionModule.m_nShowZmapType And 8) <> 0)
End Get
Set(value As Boolean)
If value Then
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType Or 8)
Else
OptionModule.m_nShowZmapType = ( OptionModule.m_nShowZmapType And Not 8)
End If
WritePrivateProfileString(S_SCENE, K_SHOWZMAP, OptionModule.m_nShowZmapType.ToString())
EgtSetShowZmap( OptionModule.m_nShowZmapType, True)
End Set
End Property
Public Property DxfScaleFactor As String Public Property DxfScaleFactor As String
Get Get
Return LenToString(OptionModule.m_dDxfScaleFactor, 5) Return LenToString(OptionModule.m_dDxfScaleFactor, 5)
@@ -858,11 +787,6 @@ Public Class OptionWindowVM
Return (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 Return (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0
End Get End Get
End Property End Property
Public ReadOnly Property DoorsActive As Boolean
Get
Return IniFile.IsActiveDoors()
End Get
End Property
Public Property DoorsOn As Boolean Public Property DoorsOn As Boolean
Get Get
Return DoorsEnabled AndAlso OptionModule.m_bDoorsOn Return DoorsEnabled AndAlso OptionModule.m_bDoorsOn
@@ -900,7 +824,6 @@ Public Class OptionWindowVM
Private m_cmdExportMachineCmd As ICommand Private m_cmdExportMachineCmd As ICommand
Private m_cmdUpdateBeamCmd As ICommand Private m_cmdUpdateBeamCmd As ICommand
Private m_cmdUpdateWallCmd As ICommand Private m_cmdUpdateWallCmd As ICommand
Private m_cmdUpdateDoorsCmd As ICommand
#Region "Messages" #Region "Messages"
@@ -946,9 +869,9 @@ Public Class OptionWindowVM
Return EgtMsg(6536) ' Linee spesse Return EgtMsg(6536) ' Linee spesse
End Get End Get
End Property End Property
Public ReadOnly Property SceneSurfQualityMsg As String Public ReadOnly Property SmoothTriMeshMsg As String
Get Get
Return EgtMsg(6518) ' Qualità visualizzazione superfici Return EgtMsg(6518) ' Superfici smussate
End Get End Get
End Property End Property
Public ReadOnly Property UpdateLicenceMsg As String Public ReadOnly Property UpdateLicenceMsg As String
@@ -1162,7 +1085,7 @@ Public Class OptionWindowVM
End Property End Property
Public ReadOnly Property DoorsMsg As String Public ReadOnly Property DoorsMsg As String
Get Get
Return "Doors (" & Path.GetFileName( IniFile.m_sDoorsDirPath) & ")" Return "Doors"
End Get End Get
End Property End Property
Public ReadOnly Property GunstockMsg As String Public ReadOnly Property GunstockMsg As String
@@ -1206,12 +1129,6 @@ Public Class OptionWindowVM
End Get End Get
End Property End Property
Public ReadOnly Property GeomTypeProbingMsg As String
Get
Return EgtMsg(31220)
End Get
End Property
Public ReadOnly Property VMillQualityMsg As String Public ReadOnly Property VMillQualityMsg As String
Get Get
Return EgtMsg(31214) Return EgtMsg(31214)
@@ -1221,17 +1138,6 @@ Public Class OptionWindowVM
#End Region #End Region
#Region "Visibility"
Public ReadOnly Property ShowZmapVisibility As Visibility
Get
Return If( (IniFile.m_nUserLevel > 5), Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#End Region
#Region "COMMANDS" #Region "COMMANDS"
#Region "TopSceneBackground" #Region "TopSceneBackground"
@@ -1443,18 +1349,10 @@ Public Class OptionWindowVM
Dim sMachDir As String = Path.Combine(IniFile.m_sMachinesRoot, sMachName) Dim sMachDir As String = Path.Combine(IniFile.m_sMachinesRoot, sMachName)
' Preparo direttorio temporaneo ' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sMachinesRoot, "Temp") Dim sTempDir As String = Path.Combine(IniFile.m_sMachinesRoot, "Temp")
Try
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents) My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If End If
My.Computer.FileSystem.CreateDirectory(sTempDir) My.Computer.FileSystem.CreateDirectory(sTempDir)
Catch
' Problemi di accesso al direttorio delle macchine
Dim sErr As String = EgtMsg(6564)
EgtOutLog(sErr & " (" & sTempDir & ")")
MessageBox.Show(sErr, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
Return
End Try
' Unzip nel direttorio temporaneo ' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sMachZip) Using zip As New Ionic.Zip.ZipFile(sMachZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite) zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
@@ -1855,116 +1753,6 @@ Public Class OptionWindowVM
#End Region ' UpdateWall #End Region ' UpdateWall
#Region "UpdateDoors"
Public ReadOnly Property UpdateDoors_Command() As ICommand
Get
If m_cmdUpdateDoorsCmd Is Nothing Then
m_cmdUpdateDoorsCmd = New RelayCommand(AddressOf UpdateDoorsCmd)
End If
Return m_cmdUpdateDoorsCmd
End Get
End Property
Public Sub UpdateDoorsCmd()
' Recupero la versione del programma in esecuzione
Dim sExeVer As String = IniFile.GetProgramVersion()
' Verifico presenza di una precedente installazione del Doors (file Version.lua oppure Main.lua)
Dim sDoorsVer As String = ""
IniFile.GetSpecialLuaVersion(IniFile.m_sDoorsDirPath, sDoorsVer)
If String.IsNullOrEmpty(sDoorsVer) Then
If My.Computer.FileSystem.FileExists(Path.Combine(IniFile.m_sDoorsDirPath, "Main.lua")) AndAlso
My.Computer.FileSystem.FileExists(Path.Combine(IniFile.m_sDoorsDirPath, "Machining.lua")) Then
sDoorsVer = "2.6l9"
Else
' Il modulo "{0}" non è stato trovato, impossibile aggiornare. - Avviso
Dim sOut As String = String.Format(EgtMsg(6555), "Doors")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Esco
Return
End If
End If
' Apro dialogo per richiesta file zip del Doors
Dim DoorsDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".zip",
.Filter = "Doors (.zip)|*.zip",
.CheckFileExists = True,
.ValidateNames = True
}
If DoorsDlg.ShowDialog() <> True Then Return
Dim sDoorsZip As String = DoorsDlg.FileName
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(IniFile.m_sTempDir, "Doors")
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory(sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sDoorsZip)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Recupero i dati del nuovo Doors
Dim sNewName = ""
Dim sNewVer = ""
Dim sNewMinExe = ""
IniFile.GetSpecialLuaData(sTempDir, sNewName, sNewVer, sNewMinExe)
' Verifico che sia veramente il Doors
If String.Compare(sNewName, "Doors") <> 0 Then
' Il file zip non contiene il modulo "{0}". - Avviso
Dim sOut As String = String.Format(EgtMsg(6556), "Doors")
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione minima del programma
If String.Compare(sExeVer, sNewMinExe) < 0 Then
' Il nuovo modulo "{0}" richiede un programma con versione minima {1}. - Avviso
Dim sOut As String = String.Format(EgtMsg(6557), "Doors", sNewMinExe)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Verifico la versione del Doors e se più vecchia chiedo cosa fare
If String.Compare(sNewVer, sDoorsVer) < 0 Then
' La versione del nuovo modulo "{0}" è più vecchia dell'attuale. Vuoi sovrascrivere lo stesso ?
Dim sOut As String = String.Format(EgtMsg(6558), "Doors")
If MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15003), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.No Then
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
End If
' Faccio una copia di backup del Doors corrente
Dim sBackupDir As String = IniFile.m_sDoorsDirPath & ".old"
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.CopyDirectory(IniFile.m_sDoorsDirPath, sBackupDir, True)
Catch ex As Exception
' L'aggiornamento del modulo "{0}" non è riuscito. - Errore
Dim sOut As String = String.Format(EgtMsg(6559), "Doors")
EgtOutLog(sOut)
MessageBox.Show(Application.Current.MainWindow, sOut, EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End Try
' Installo il Doors
My.Computer.FileSystem.CopyDirectory(sTempDir, IniFile.m_sDoorsDirPath, True)
' Rimuovo il direttorio temporaneo di installazione
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
' Il modulo "{0}" è stata aggiornato con successo. - Info
Dim sOk As String = String.Format(EgtMsg(6560), "Doors")
EgtOutLog(sOk)
MessageBox.Show(Application.Current.MainWindow, sOk, EgtMsg(15003), MessageBoxButton.OK)
End Sub
#End Region ' UpdateDoors
#Region "CloseOptionsCommand" #Region "CloseOptionsCommand"
''' <summary> ''' <summary>
@@ -2049,46 +1837,21 @@ Public Class GeomTypeConverter
End Class End Class
Public Class SceneSurfQualityOptConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
Select Case CInt(value)
Case SceneSurfQualityOpt.LOWER
Return EgtMsg(31215) ' Inferiore
Case SceneSurfQualityOpt.LOW
Return EgtMsg(31216) ' Bassa
Case SceneSurfQualityOpt.STANDARD
Return EgtMsg(31217) ' Media
Case SceneSurfQualityOpt.HIGH
Return EgtMsg(31218) ' Alta
Case SceneSurfQualityOpt.HIGHER
Return EgtMsg(31219) ' Superiore
Case Else
Return ""
End Select
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
Public Class VMillTypeConverter Public Class VMillTypeConverter
Implements IValueConverter Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
Select Case CInt(value) Select Case CInt(value)
Case VMillSelTypeOpt.LOWER Case VMillSelTypeOpt.LOWER
Return EgtMsg(31215) ' Inferiore Return EgtMsg(31215)
Case VMillSelTypeOpt.LOW Case VMillSelTypeOpt.LOW
Return EgtMsg(31216) ' Bassa Return EgtMsg(31216)
Case VMillSelTypeOpt.STANDARD Case VMillSelTypeOpt.STANDARD
Return EgtMsg(31217) ' Media Return EgtMsg(31217)
Case VMillSelTypeOpt.HIGH Case VMillSelTypeOpt.HIGH
Return EgtMsg(31218) ' Alta Return EgtMsg(31218)
Case VMillSelTypeOpt.HIGHER Case VMillSelTypeOpt.HIGHER
Return EgtMsg(31219) ' Superiore Return EgtMsg(31219)
Case Else Case Else
Return "" Return ""
End Select End Select
+28 -21
View File
@@ -294,9 +294,19 @@ Public Class ProjectVM
Private Sub PreInitializeScene() Private Sub PreInitializeScene()
' imposto colore di default ' imposto colore di default
m_ProjectScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor) Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_ProjectScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo ' imposto colori sfondo
m_ProjectScene.SetViewBackground(OptionModule.m_TopSceneBackground, OptionModule.m_BotSceneBackground) Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto spessore linee
Dim nLineWidth As Integer = 1
nLineWidth = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
m_ProjectScene.SetLineWidth(nLineWidth)
' imposto colori di evidenziazione ' imposto colori di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0) Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor) GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
@@ -360,21 +370,27 @@ Public Class ProjectVM
' modo di visualizzazione ' modo di visualizzazione
Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING) Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
Map.refShowPanelVM.ShowModeState(nShowMode) Map.refShowPanelVM.ShowModeState(nShowMode)
' imposto spessore curve
EgtSetLineAttribs(OptionModule.GetLineWidth())
' visualizzazione direzione curve ' visualizzazione direzione curve
Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0) Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
Map.refShowPanelVM.ShowCurveDir(nShowCurveDir) Map.refShowPanelVM.ShowCurveDir(nShowCurveDir)
' qualità di visualizzazione delle superfici ' visualizzazione avanzata dei triangoli costituenti le superfici
OptionModule.SetShowSurfQuality( False) Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' tipo visualizzazione per Zmap ' tipo visualizzazione per Zmap
EgtSetShowZmap( OptionModule.m_nShowZmapType, False) Dim nShowZmap As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(nShowZmap, False)
' dimensione lineare max in pixel delle textures ' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096) Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix) EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' stile corrente delle quotature ' stile corrente delle quotature
EgtSetCurrDimensionStyle(OptionModule.m_dExtLineLen, OptionModule.m_dArrowLen, OptionModule.m_dTextDist, OptionModule.m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5)
OptionModule.m_nLenIsMM, OptionModule.m_nDecDigit, OptionModule.m_sFont, OptionModule.m_dTextHeight) OptionModule.m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5)
OptionModule.m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2)
OptionModule.m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2)
OptionModule.m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2)
OptionModule.m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont)
OptionModule.m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2)
EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' lettura da ini della variabile che abilita i gruppi di lavorazione ' lettura da ini della variabile che abilita i gruppi di lavorazione
IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0) IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0)
Map.refTopCommandBarVM.DrawMode_IsChecked() Map.refTopCommandBarVM.DrawMode_IsChecked()
@@ -417,7 +433,7 @@ Public Class ProjectVM
Dim nFlag As Integer = 1 Dim nFlag As Integer = 1
If Environment.GetCommandLineArgs.Count() > 4 Then Integer.TryParse(Environment.GetCommandLineArgs(4), nFlag) If Environment.GetCommandLineArgs.Count() > 4 Then Integer.TryParse(Environment.GetCommandLineArgs(4), nFlag)
' Modalità cieco con valori 0, 3 e 4 ' Modalità cieco con valori 0, 3 e 4
Return (nFlag <> 0 And nFlag <> 3 And nFlag <> 4 And nFlag <> 8) Return (nFlag <> 0 And nFlag <> 3 And nFlag <> 4)
End If End If
If sExt = ".ddf" And Environment.GetCommandLineArgs.Count() > 2 Then If sExt = ".ddf" And Environment.GetCommandLineArgs.Count() > 2 Then
' Flag ' Flag
@@ -581,7 +597,7 @@ Public Class ProjectVM
bOk = ExecWall(sFile, sMachine, nFlag, False) bOk = ExecWall(sFile, sMachine, nFlag, False)
End If End If
' Se richiesta uscita immediata ' Se richiesta uscita immediata
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Or nFlag = 8 Then If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine() Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd() Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se errore ' Altrimenti se errore
@@ -1393,11 +1409,6 @@ Public Class ProjectVM
Analyze.CreateAnalyzeGroup() Analyze.CreateAnalyzeGroup()
Analyze.CreateFacetNormal(nId, nFac) Analyze.CreateFacetNormal(nId, nFac)
Analyze.CreateFacetLoops(nId, nFac) Analyze.CreateFacetLoops(nId, nFac)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Analyze.CreateTriaLoop(nId, nSub)
End If
' Recupero i dati (in globale o griglia a seconda della impostazione) ' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d Dim ptC As Point3d
Dim vtN As Vector3d Dim vtN As Vector3d
@@ -1409,10 +1420,6 @@ Public Class ProjectVM
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" + " : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" + " N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2) " / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
sOut &= ", Triangle " + nSub.ToString()
End If
Map.refStatusBarVM.NotifyStatusOutput(sOut) Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If End If
' Se Regione, visualizzo dati parte toccata ' Se Regione, visualizzo dati parte toccata
@@ -1557,7 +1564,7 @@ Public Class ProjectVM
nFlag = GetPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE) nFlag = GetPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
ElseIf nType = FT.BTL Or nType = FT.BTLX Then ElseIf nType = FT.BTL Or nType = FT.BTLX Then
nFlag = GetPrivateProfileInt(S_IMPORT, K_BTLFLAG, EIB_FL.NONE) nFlag = GetPrivateProfileInt(S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
ElseIf nType = FT._3MF Then ElseIf nType = FT._3MF
nFlag = GetPrivateProfileInt(S_IMPORT, K_3MFFLAG, EI3_FL.NONE) nFlag = GetPrivateProfileInt(S_IMPORT, K_3MFFLAG, EI3_FL.NONE)
ElseIf nType = FT.OBJ Or nType = FT.IGES Or nType = FT.STEP_ Or nType = FT.ACIS Or ElseIf nType = FT.OBJ Or nType = FT.IGES Or nType = FT.STEP_ Or nType = FT.ACIS Or
nType = FT.PARASOLID Or nType = FT.JT Or nType = FT.VRML Or nType = FT.C3D Then nType = FT.PARASOLID Or nType = FT.JT Or nType = FT.VRML Or nType = FT.C3D Then
Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

+1 -1
View File
@@ -175,7 +175,7 @@ Public Class MTableDbV
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs) Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
Dim Element As Object = e.OriginalSource Dim Element As Object = e.OriginalSource
While Not IsNothing(Element) AndAlso Not TypeOf Element Is ScrollBar While Not IsNothing(Element) AndAlso Not TypeOf Element Is ScrollBar
Element = VisualTreeHelper.GetParent(CType(Element, DependencyObject)) Element = VisualTreeHelper.GetParent(Element)
End While End While
' verifico che non sia ScrollBar, di modo che questa continui a funzionare, ma non possa selezionare piu' righe trascinando ' verifico che non sia ScrollBar, di modo che questa continui a funzionare, ma non possa selezionare piu' righe trascinando
If IsNothing(Element) OrElse Not TypeOf Element Is ScrollBar Then If IsNothing(Element) OrElse Not TypeOf Element Is ScrollBar Then
+5 -11
View File
@@ -10,11 +10,6 @@ Public Class SpecialPanelVM
Return m_ButtonList Return m_ButtonList
End Get End Get
End Property End Property
Public ReadOnly Property ButtonCount As Integer
Get
Return m_ButtonList.Count()
End Get
End Property
Private m_SpecialPanel_Visibility As Visibility Private m_SpecialPanel_Visibility As Visibility
Public ReadOnly Property SpecialPanel_Visibility As Visibility Public ReadOnly Property SpecialPanel_Visibility As Visibility
@@ -31,14 +26,13 @@ Public Class SpecialPanelVM
' Creo riferimento a questa classe in Map ' Creo riferimento a questa classe in Map
Map.SetRefSpecialPanelVM(Me) Map.SetRefSpecialPanelVM(Me)
' se attivo, inizializzo i bottoni leggendoli da file ini ' se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveSpecialPanel(False) Then If IniFile.IsActiveSpecialPanel Then
Dim BtlIndexMax As Integer = If( IniFile.m_nUserLevel > 5, 199, 99) Dim BtnIndex As Integer = 1
For BtnIndex As Integer = 1 To BtlIndexMax
Dim CurrBtn As ButtonItem = Nothing Dim CurrBtn As ButtonItem = Nothing
If GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn) While GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)
m_ButtonList.Add(CurrBtn) m_ButtonList.Add(CurrBtn)
End If BtnIndex += 1
Next End While
End If End If
End Sub End Sub
+2 -7
View File
@@ -533,7 +533,7 @@ Public Class MyStatusBarVM
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
' Se previsto, imposto progress ' Se previsto, imposto progress
If nProg > 0 Then SetLoadingProgress(Math.Min(nProg, 100)) If nProg > 0 Then SetLoadingProgress(Math.Min(nProg, 100))
' Se simulazione attiva, notifico aggiornamento dati ' Notifico a simulazione aggiornamento dati
If Not IsNothing( Map.refSimulationExpanderVM) Then If Not IsNothing( Map.refSimulationExpanderVM) Then
' Uso i valori negativi del primo parametro come flag per la Simulazione ' Uso i valori negativi del primo parametro come flag per la Simulazione
Dim nFlag As Integer = If( nProg < 0, -nProg, 0) Dim nFlag As Integer = If( nProg < 0, -nProg, 0)
@@ -541,13 +541,8 @@ Public Class MyStatusBarVM
End If End If
' Costringo ad aggiornare ' Costringo ad aggiornare
UpdateUI() UpdateUI()
' Se richiesta pausa ' Eventuale attesa
If nPause >= 0 Then
Thread.Sleep(nPause) Thread.Sleep(nPause)
' se altrimenti richiesto aggiornamento visualizzazione
ElseIf nPause = -1
EgtDraw()
End If
' Ritorno eventuale stop ' Ritorno eventuale stop
If m_bStopScript Then If m_bStopScript Then
m_bStopScript = False m_bStopScript = False
+25
View File
@@ -108,6 +108,7 @@ Public Class InfoItem
#End Region ' Fields & Properties #End Region ' Fields & Properties
' Comandi ' Comandi
Private m_cmdRemoveInfoItem As ICommand
Private m_cmdDoneInfo As ICommand Private m_cmdDoneInfo As ICommand
#Region "CONSTRUCTORS" #Region "CONSTRUCTORS"
@@ -122,6 +123,30 @@ Public Class InfoItem
#Region "COMMANDS" #Region "COMMANDS"
#Region "RemoveItemNoteCommand"
''' <summary>
''' Comando per rimuovere l'informazione selezionata dalla combobox
''' </summary>
Public ReadOnly Property RemoveInfoItemCommand As ICommand
Get
If m_cmdRemoveInfoItem Is Nothing Then
m_cmdRemoveInfoItem = New Command(AddressOf RemoveInfoItem)
End If
Return m_cmdRemoveInfoItem
End Get
End Property
''' <summary>
''' Rimuove l'informazione selezionata dalla combobox
''' </summary>
''' <param name="param"></param>
Public Sub RemoveInfoItem(ByVal param As Object)
Map.refInputExpanderVM.RemoveItemInfo(Me)
End Sub
#End Region ' RemoveItemNoteCommand
#Region "DoneInfoCommand" #Region "DoneInfoCommand"
''' <summary> ''' <summary>
+1 -1
View File
@@ -26,11 +26,11 @@
</EgtFloating:EgtFloatingPanel> </EgtFloating:EgtFloatingPanel>
<local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/> <local:MachinePanelV DataContext="{StaticResource DbPanelViewModel}"/>
<local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/> <local:ExecutePanelV DataContext="{StaticResource ExecutePanelViewModel}"/>
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
<local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/> <local:BeamPanelV DataContext="{StaticResource BeamPanelViewModel}"/>
<local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/> <local:WallPanelV DataContext="{StaticResource WallPanelViewModel}"/>
<local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/> <local:BeamWallPanelV DataContext="{StaticResource BeamWallPanelViewModel}"/>
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/> <local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/> <local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
</WrapPanel> </WrapPanel>
-10
View File
@@ -66,16 +66,6 @@ Module Analyze
Return True Return True
End Function End Function
Function CreateTriaLoop( nId As Integer, nT As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
Dim nCrvId As Integer = EgtExtractSurfTmTriaLoop( nId, nT, m_AnaGrpId)
EgtSetColor( nCrvId, New Color3d( 255, 255,0))
If bEnMod Then EgtEnableModified()
Return True
End Function
Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified() Dim bEnMod As Boolean = EgtGetEnableModified()
+6 -21
View File
@@ -600,19 +600,6 @@
<Setter Property="Width" Value="30"/> <Setter Property="Width" Value="30"/>
</Style> </Style>
<Style x:Key="ExecuteOkWindow_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Margin" Value="0,5,0,5"/>
</Style>
<Style x:Key="ExecuteWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Margin" Value="2,5,5,5"/>
</Style>
<Style x:Key="DrawOptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}"> <Style x:Key="DrawOptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
</Style> </Style>
@@ -683,11 +670,15 @@
Value="/Resources/TreeView/LampOff.png" /> Value="/Resources/TreeView/LampOff.png" />
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, <DataTrigger Binding="{Binding IsChecked,
RelativeSource={RelativeSource AncestorType= RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}" Value="True">
{x:Type ToggleButton}}}" Value="True">
<Setter Property="Image.Source" <Setter Property="Image.Source"
Value="/Resources/TreeView/LampOn.png" /> Value="/Resources/TreeView/LampOn.png" />
</DataTrigger> </DataTrigger>
<DataTrigger Binding="{Binding IsChecked,
RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}" Value="{x:Null}">
<Setter Property="Image.Source"
Value="/Resources/TreeView/LampSel.png" />
</DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Image.Style> </Image.Style>
@@ -783,12 +774,6 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="ExecuteWindow_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style x:Key="ToggleButtonTabStyle" TargetType="{x:Type ToggleButton}"> <Style x:Key="ToggleButtonTabStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/> <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Background" Value="{StaticResource Button.Static.Background}"/> <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
+4 -17
View File
@@ -17,14 +17,6 @@ Public Module IniFile
ONLYDRAW = 3 ONLYDRAW = 3
End Enum End Enum
Public Enum SceneSurfQualityOpt As Integer
LOWER = -2
LOW = -1
STANDARD = 0
HIGH = 1
HIGHER = 2
End Enum
Public Enum SceneSelModeOpt As Integer Public Enum SceneSelModeOpt As Integer
NULL = 0 NULL = 0
PARTCURVES = 1 PARTCURVES = 1
@@ -296,11 +288,7 @@ Public Module IniFile
Friend Function IsActiveDoors() As Boolean Friend Function IsActiveDoors() As Boolean
Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 And (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0) Dim bIsActive As Boolean = (IniFile.m_nKeyOptions And KEY_OPT.DOORS) <> 0 And (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
If bIsActive Then If bIsActive Then GetPrivateProfileString(S_DOORS, K_BASEDIR, "", m_sDoorsDirPath)
Dim sTemp As String = ""
GetPrivateProfileString(S_DOORS, K_BASEDIR, "", sTemp)
m_sDoorsDirPath = sTemp.TrimEnd( "\"c)
End If
Return bIsActive Return bIsActive
End Function End Function
@@ -328,10 +316,9 @@ Public Module IniFile
Return (IniFile.m_nKeyOptions And KEY_OPT.ADVMACHINING) <> 0 Return (IniFile.m_nKeyOptions And KEY_OPT.ADVMACHINING) <> 0
End Function End Function
Friend Function IsActiveSpecialPanel( Optional bTestButton As Boolean = true) As Boolean Friend Function IsActiveSpecialPanel() As Boolean
If GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) = 0 Then Return False Dim btDummy As ButtonItem = Nothing
If Not bTestButton Then Return True Return GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0 AndAlso GetPrivateProfileButton(S_SPECIAL, K_BUTTON & "1", "", btDummy)
Return (Not IsNothing(Map.refSpecialPanelVM) AndAlso Map.refSpecialPanelVM.ButtonCount > 0)
End Function End Function
Friend Function GetSpecialLuaVersion( sSpecialLuaDir As String, ByRef sVersion As String) As Boolean Friend Function GetSpecialLuaVersion( sSpecialLuaDir As String, ByRef sVersion As String) As Boolean
-6
View File
@@ -11,9 +11,6 @@ Public Module MachineModel
''' </summary> ''' </summary>
Friend Function ReadActiveMachiningsFamilies() As MachiningsType() Friend Function ReadActiveMachiningsFamilies() As MachiningsType()
Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType) Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType)
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_PROBING, 0, m_sCurrMachIniFilePath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.PROBING, .TypeName = EgtMsg(31220)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, m_sCurrMachIniFilePath) <> 0 Then If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, m_sCurrMachIniFilePath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.DRILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 1)}) ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.DRILLING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 1)})
End If End If
@@ -166,9 +163,6 @@ Public Module MachineModel
''' </summary> ''' </summary>
Friend Function ReadActiveToolsFamilies() As ToolsFamily() Friend Function ReadActiveToolsFamilies() As ToolsFamily()
Dim ActiveToolsFamiliesList As New List(Of ToolsFamily) Dim ActiveToolsFamiliesList As New List(Of ToolsFamily)
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_PROBE, 0, m_sCurrMachIniFilePath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.PROBE, EgtMsg(31011))) ' Tastatore
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, m_sCurrMachIniFilePath) <> 0 Then If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, m_sCurrMachIniFilePath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.DRILLBIT, EgtMsg(MSG_TOOLSDBPAGE + 1))) ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.DRILLBIT, EgtMsg(MSG_TOOLSDBPAGE + 1)))
End If End If
-12
View File
@@ -21,7 +21,6 @@ Module SelData
Private m_IdSub As New List(Of SelData) Private m_IdSub As New List(Of SelData)
Private m_SelGrpId As Integer = GDB_ID.NULL Private m_SelGrpId As Integer = GDB_ID.NULL
Private Const AUX_ID As String = "AuxId"
Friend Sub ClearIdSub() Friend Sub ClearIdSub()
RemoveSelGroup() RemoveSelGroup()
@@ -33,8 +32,6 @@ Module SelData
Dim i As Integer = 0 Dim i As Integer = 0
Do While i < m_IdSub.Count() - 1 Do While i < m_IdSub.Count() - 1
If Not EgtIsSelectedObj( m_IdSub( i).m_nId) Then If Not EgtIsSelectedObj( m_IdSub( i).m_nId) Then
Dim nAuxId As Integer = GDB_ID.NULL
If EgtGetInfo( m_IdSub( i).m_nSel, AUX_ID, nAuxId) Then EgtErase( nAuxId)
EgtErase( m_IdSub( i).m_nSel) EgtErase( m_IdSub( i).m_nSel)
m_IdSub.RemoveAt( i) m_IdSub.RemoveAt( i)
Else Else
@@ -59,8 +56,6 @@ Module SelData
' Ricerca ed eliminazione del record con la coppia Id,Sub da rimuovere ' Ricerca ed eliminazione del record con la coppia Id,Sub da rimuovere
For i As Integer = 0 To m_IdSub.Count() - 1 For i As Integer = 0 To m_IdSub.Count() - 1
If m_IdSub( i).m_nId = nId And m_IdSub( i).m_nSub = nSub Then If m_IdSub( i).m_nId = nId And m_IdSub( i).m_nSub = nSub Then
Dim nAuxId As Integer = GDB_ID.NULL
If EgtGetInfo( m_IdSub( i).m_nSel, AUX_ID, nAuxId) Then EgtErase( nAuxId)
EgtErase( m_IdSub( i).m_nSel) EgtErase( m_IdSub( i).m_nSel)
m_IdSub.RemoveAt( i) m_IdSub.RemoveAt( i)
Exit For Exit For
@@ -73,8 +68,6 @@ Module SelData
' Ricerca ed eliminazione di record con identificativo da rimuovere ' Ricerca ed eliminazione di record con identificativo da rimuovere
For i As Integer = m_IdSub.Count() - 1 To 0 Step -1 For i As Integer = m_IdSub.Count() - 1 To 0 Step -1
If m_IdSub( i).m_nId = nId Then If m_IdSub( i).m_nId = nId Then
Dim nAuxId As Integer = GDB_ID.NULL
If EgtGetInfo( m_IdSub( i).m_nSel, AUX_ID, nAuxId) Then EgtErase( nAuxId)
EgtErase( m_IdSub( i).m_nSel) EgtErase( m_IdSub( i).m_nSel)
m_IdSub.RemoveAt( i) m_IdSub.RemoveAt( i)
End If End If
@@ -160,11 +153,6 @@ Module SelData
For nCrvId As Integer = nFirstId + 1 To nFirstId + nCount - 1 For nCrvId As Integer = nFirstId + 1 To nFirstId + nCount - 1
EgtErase( nCrvId) EgtErase( nCrvId)
Next Next
Dim ptZM As New Point3d()
EgtAtParamPoint( nFirstId, 0.5, m_SelGrpId, ptZM)
Dim nSpheId = EgtCreateSurfTmSphere( m_SelGrpId, ptZM, 1, 0.1, GDB_RT.LOC)
EgtSetColor( nSpheId, New Color3d( 255, 0,0))
EgtSetInfo( nFirstId, AUX_ID, nSpheId)
End If End If
If bEnMod Then EgtEnableModified() If bEnMod Then EgtEnableModified()
Return nFirstId Return nFirstId