Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2e365765d | |||
| e88e19ed3f | |||
| 87fba7e739 | |||
| 92a6cefe67 | |||
| 9193518d4f | |||
| 6e06d76a7c | |||
| dda46787db | |||
| ca2144f058 | |||
| e0ea153122 | |||
| 0b471786cc | |||
| ece48a6523 | |||
| 5e151fd7ec | |||
| ade3d5c1aa | |||
| b3db41c0ae | |||
| ad21ccf4d8 | |||
| 29dd3ca6d4 | |||
| 2174bdfd20 | |||
| d28ac71a5e | |||
| 1f92a28e44 | |||
| 3944eb085f | |||
| 30b436c33b | |||
| d2f947b9b1 | |||
| 50c06fee70 | |||
| 265938c37f | |||
| 3d4cfc0eb8 | |||
| c5ddcff63f | |||
| dc7a3b78cd | |||
| 4147457b7d | |||
| f2d465ff14 | |||
| 3cac37cb0d | |||
| ffa0ce03bb | |||
| 68063e5b39 | |||
| 18505bfa5d | |||
| a7999c4182 | |||
| b0186d096f | |||
| 6e5f917d6f | |||
| 5819bc4bf8 | |||
| dee67518e7 | |||
| 50f5e0528f |
@@ -51,6 +51,9 @@ Module ConstGen
|
||||
' Chiave di Info in gruppo di lavoro per none part-program
|
||||
Public Const KEY_MCHGRP_NCNAME As String = "NcName"
|
||||
|
||||
' File Dimensioni Griglia CAM5
|
||||
Public Const DIMENSION_FILE_NAME As String = "Dimension.ini"
|
||||
|
||||
' Costante per flag di BBox
|
||||
Public Const BBFLAG As Integer = GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM
|
||||
|
||||
|
||||
@@ -1530,6 +1530,8 @@ Public Class DrawPanelVM
|
||||
Public Sub SolidIntersectSurf(ByVal param As Object)
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CUTSURFSURF)
|
||||
ElseIf (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
|
||||
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.TRIMSURFTMWITHCURVE)
|
||||
Else
|
||||
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.SOLIDINTERSECTSURF)
|
||||
End If
|
||||
|
||||
@@ -322,6 +322,7 @@
|
||||
<Compile Include="Utility\Analyze.vb" />
|
||||
<Compile Include="Utility\BasePanelVM.vb" />
|
||||
<Compile Include="Utility\BindingProxy.vb" />
|
||||
<Compile Include="Utility\DynamicGridModule.vb" />
|
||||
<Compile Include="Utility\Map.vb" />
|
||||
<Compile Include="Internals\MruList.vb" />
|
||||
<Compile Include="Utility\MachineModel.vb" />
|
||||
@@ -1086,6 +1087,15 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ExecuteWindow\reload.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ToolPreview\Head.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ToolPreview\Tool.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ToolPreview\Delete.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
|
||||
|
||||
+42
-30
@@ -46,6 +46,13 @@ Public Class MainWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sDimensionDir As String = String.Empty
|
||||
Public ReadOnly Property DimensionDir As String
|
||||
Get
|
||||
Return m_sDimensionDir
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_cmdMainWindow_ContentRendered As ICommand
|
||||
Private m_cmdAboutBox As ICommand
|
||||
' MainWindow Activated Event
|
||||
@@ -97,11 +104,11 @@ Public Class MainWindowVM
|
||||
|
||||
Public ReadOnly Property IconSource As String
|
||||
Get
|
||||
#If PLATFORM = "x64" Then
|
||||
#If PLATFORM = "x64" Then
|
||||
Return "/Resources/EgtCAM5_64.ico"
|
||||
#else
|
||||
Return "/Resources/EgtCAM5.ico"
|
||||
#End If
|
||||
#Else
|
||||
Return "/Resources/EgtCAM5.ico"
|
||||
#End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -189,13 +196,7 @@ Public Class MainWindowVM
|
||||
' Salvo impostazione macchina corrente
|
||||
Map.refMachinePanelVM.SaveCurrentMachine()
|
||||
' Aggiorno istanze usate
|
||||
m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (IniFile.m_nInstance - 1))
|
||||
WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
ReleaseInstance()
|
||||
' Chiudo la finestra principale del programma
|
||||
Application.Current.MainWindow.Close()
|
||||
Else
|
||||
@@ -203,15 +204,9 @@ Public Class MainWindowVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function OnTerminateProcess( nExitCode As Integer) As Boolean
|
||||
Private Function OnTerminateProcess(nExitCode As Integer) As Boolean
|
||||
' Aggiorno istanze usate
|
||||
m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (IniFile.m_nInstance - 1))
|
||||
WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
ReleaseInstance()
|
||||
' Dichiaro di procedere con la terminazione del programma
|
||||
Return True
|
||||
End Function
|
||||
@@ -306,12 +301,9 @@ Public Class MainWindowVM
|
||||
Map.refMainWindowVM.ManageClosingApplication()
|
||||
' Terminazione generale di EgtInterface
|
||||
EgtExit()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
' Aggiorno istanze usate
|
||||
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (IniFile.m_nInstance - 1))
|
||||
WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
ReleaseInstance()
|
||||
' Termino
|
||||
Application.Current.Shutdown()
|
||||
End Sub
|
||||
|
||||
@@ -362,6 +354,8 @@ Public Class MainWindowVM
|
||||
Else
|
||||
IniFile.m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKER_DFL_DIR
|
||||
End If
|
||||
' Recupero percorso file Dimension
|
||||
m_sDimensionDir = m_sConfigDir & "\" & DIMENSION_FILE_NAME
|
||||
' Verifico indice di istanza
|
||||
ManageInstance()
|
||||
' Imposto tipo di chiave
|
||||
@@ -385,8 +379,8 @@ Public Class MainWindowVM
|
||||
EgtSetLockId(sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 3101, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 3101, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 3103, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 3103, 1, IniFile.m_nKeyOptions)
|
||||
' Leggo e imposto livello utilizzatore
|
||||
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
|
||||
' Imposto abilitazione lavorazioni avanzate
|
||||
@@ -529,6 +523,17 @@ Public Class MainWindowVM
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ReleaseInstance()
|
||||
' Aggiorno istanze usate
|
||||
Dim bOk As Boolean = m_objMutex.WaitOne(1000)
|
||||
Dim nTmp As Integer = GetPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
|
||||
nTmp -= (1 << (IniFile.m_nInstance - 1))
|
||||
WritePrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
|
||||
If bOk Then m_objMutex.ReleaseMutex()
|
||||
' Rilascio mutex
|
||||
If Not IsNothing(m_objMutex) Then m_objMutex.Close()
|
||||
End Sub
|
||||
|
||||
Friend Sub NotifyMainWindow_ContentRendered()
|
||||
' Notifico ProjectVM
|
||||
@@ -597,18 +602,25 @@ Public Class MainWindowVM
|
||||
' pulisco output
|
||||
Map.refStatusBarVM.NotifyStatusOutput("")
|
||||
Map.refInputExpanderVM.ResetInputBox()
|
||||
If not IsNothing( Map.refMachiningParameterExpanderVM) Then
|
||||
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
|
||||
' Nascondo la combobox delle usernotes
|
||||
Map.refMachiningParameterExpanderVM.CurrOperation.SetComboAddVisibility(Visibility.Collapsed)
|
||||
'riattivo il pulsante per visualizzare la combobox delle note
|
||||
Map.refMachiningParameterExpanderVM.CurrOperation.SetShowNoteListCombo_IsEnable(True)
|
||||
End If
|
||||
ElseIf e.Key = Key.Left OrElse e.Key = Key.Right OrElse e.Key = Key.Up OrElse e.Key = Key.Down AndAlso
|
||||
Map.refTopCommandBarVM.MachiningIsChecked AndAlso Map.refOperationParametersExpanderVM.OperationParameters.IsEnabled Then
|
||||
ElseIf (e.Key = Key.Left OrElse e.Key = Key.Right) AndAlso Map.refTopCommandBarVM.MachiningIsChecked AndAlso Map.refOperationParametersExpanderVM.OperationParameters.IsEnabled Then
|
||||
Map.refMachiningParameterExpanderVM.FocusSlider()
|
||||
Dim nStep As Integer = If(e.Key = Key.Right OrElse e.Key = Key.Up, 1, -1)
|
||||
Dim nStep As Integer = If(e.Key = Key.Right, 1, -1)
|
||||
Map.refMachiningParameterExpanderVM.SetSliderValue(nStep)
|
||||
e.Handled = True
|
||||
ElseIf (e.Key = Key.Up OrElse e.Key = Key.Down) AndAlso Map.refTopCommandBarVM.MachiningIsChecked AndAlso Map.refOperationParametersExpanderVM.OperationParameters.IsEnabled Then
|
||||
Map.refMachiningParameterExpanderVM.FocusButtonPreview()
|
||||
If e.Key = Key.Down Then
|
||||
Map.refMachiningParameterExpanderVM.RevertPreviewMachiningTool()
|
||||
Else
|
||||
Map.refMachiningParameterExpanderVM.PreviewMachiningTool()
|
||||
End If
|
||||
e.Handled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -70,6 +70,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("3.1.1.3")>
|
||||
<Assembly: AssemblyFileVersion("3.1.1.3")>
|
||||
<Assembly: AssemblyVersion("3.1.3.2")>
|
||||
<Assembly: AssemblyFileVersion("3.1.3.2")>
|
||||
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
<Expander.Header>
|
||||
<TextBlock Text="{Binding PropertiesMsg}"/>
|
||||
</Expander.Header>
|
||||
<UniformGrid>
|
||||
<TextBox Text="{Binding InfoBox, Mode=OneWay}" MaxHeight="100" IsReadOnly="True"
|
||||
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"/>
|
||||
</UniformGrid>
|
||||
<TextBox Text="{Binding InfoBox, Mode=OneWay}" IsReadOnly="True"
|
||||
HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"/>
|
||||
</Expander>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -21,6 +21,7 @@ Public Class InfoExpanderVM
|
||||
Set(value As Boolean)
|
||||
If value <> m_IsExpanded Then
|
||||
m_IsExpanded = value
|
||||
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(m_IsExpanded)
|
||||
OnPropertyChanged("IsEnabled")
|
||||
End If
|
||||
End Set
|
||||
|
||||
@@ -24,6 +24,7 @@ Public Class LayerTreeViewItem
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(value)
|
||||
If value Then
|
||||
' recupero l'Id del nuovo oggetto selezionato
|
||||
Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
|
||||
xmlns:local="clr-namespace:EgtCAM5">
|
||||
|
||||
<Expander IsExpanded="True" Style="{StaticResource ExpanderStyle}">
|
||||
<Expander IsExpanded="{Binding ManageLayerIsExpanded}" Style="{StaticResource ExpanderStyle}">
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding HeaderName}" Margin="0,0,5,0"/>
|
||||
@@ -13,7 +13,11 @@
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
|
||||
<StackPanel>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding NewPartMsg}" Command="{Binding NewPartCommand}" Height="30"/>
|
||||
@@ -21,7 +25,7 @@
|
||||
<Button Content="{Binding ColorMsg}" Command="{Binding LayerColorCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
|
||||
<TreeView x:Name="LayerTreeView" MinHeight="300" MaxHeight="400"
|
||||
<TreeView Grid.Row="1" x:Name="LayerTreeView"
|
||||
ItemsSource="{Binding Path=LayerList}"
|
||||
VirtualizingStackPanel.IsVirtualizing = "True"
|
||||
VirtualizingStackPanel.VirtualizationMode = "Recycling">
|
||||
@@ -116,6 +120,6 @@
|
||||
</ContextMenu>
|
||||
</TreeView.ContextMenu>
|
||||
</TreeView>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Expander>
|
||||
</UserControl>
|
||||
|
||||
@@ -55,6 +55,22 @@ Public Class ManageLayerExpanderVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ManageLayerIsExpanded As Boolean
|
||||
Public Property ManageLayerIsExpanded As Boolean
|
||||
Get
|
||||
Return m_ManageLayerIsExpanded
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_ManageLayerIsExpanded = value
|
||||
Map.refDrawOptionPanelVM.SetManageLayerRowIsExpanded(m_ManageLayerIsExpanded)
|
||||
OnPropertyChanged("ManageLayerIsExpanded")
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetManageLayerIsExpanded(value As Boolean)
|
||||
m_ManageLayerIsExpanded = value
|
||||
OnPropertyChanged("ManageLayerIsExpanded")
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property NewPartMsg As String
|
||||
@@ -140,6 +156,7 @@ Public Class ManageLayerExpanderVM
|
||||
Map.SetRefManageLayerExpanderVM(Me)
|
||||
'Imposto tempo di evidenziazione delle entità clickate
|
||||
ObjTreeTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
SetManageLayerIsExpanded(True)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -241,6 +258,7 @@ Public Class ManageLayerExpanderVM
|
||||
If m_nObjTreeOldId <> GDB_ID.NULL Then
|
||||
Map.refProjectVM.SetLastInteger(m_nObjTreeOldId)
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
|
||||
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,15 +1,29 @@
|
||||
<UserControl x:Class="DrawOptionPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
|
||||
|
||||
<StackPanel Name="ciao" Background="Transparent" Margin="0,0,3.5001,0" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
|
||||
<Grid x:Name="DrawGrid" Background="Transparent" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="100" MaxHeight="800"
|
||||
EgtCAM5:DrawOptionPanelVM.RowId="ManageLayer"
|
||||
EgtCAM5:DrawOptionPanelVM.IsExpanded="{Binding ManageLayerRowIsExpanded}"
|
||||
EgtCAM5:DrawOptionPanelVM.TargetSplitter="{Binding ElementName=ManagerLayerGridSplitter}"/>
|
||||
<RowDefinition MinHeight="100" MaxHeight="400"
|
||||
EgtCAM5:DrawOptionPanelVM.RowId="Info"
|
||||
EgtCAM5:DrawOptionPanelVM.IsExpanded="{Binding InfoRowIsExpanded}"
|
||||
EgtCAM5:DrawOptionPanelVM.TargetSplitter="{Binding ElementName=InfoGridSplitter}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--ContentPresenter that contains the ManageLayerExpander-->
|
||||
<ContentPresenter Content="{Binding ManageLayerExpander,Mode=OneWay}"/>
|
||||
<GridSplitter x:Name="ManagerLayerGridSplitter" Style="{StaticResource General_GridSplitter}"/>
|
||||
<!--ContentPresenter that contains the InfoExpander-->
|
||||
<ContentPresenter Content="{Binding InfoExpander}"/>
|
||||
<ContentPresenter Grid.Row="1" Content="{Binding InfoExpander}"/>
|
||||
<GridSplitter x:Name="InfoGridSplitter" Grid.Row="1" Style="{StaticResource General_GridSplitter}"/>
|
||||
<!--ContentPresenter that contains the InputExpander-->
|
||||
<ContentPresenter Content="{Binding InputExpander}"/>
|
||||
</StackPanel>
|
||||
<ContentPresenter Grid.Row="2" Content="{Binding InputExpander}"/>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
</UserControl>
|
||||
@@ -1,7 +1,30 @@
|
||||
Public Class DrawOptionPanelV
|
||||
|
||||
Private Sub Me_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
||||
Dim x = ciao.MaxHeight
|
||||
Sub New()
|
||||
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Map.SetRefDrawOptionPanelV(Me)
|
||||
If Not IsActivePlugin() Then
|
||||
AddHandler DrawGrid.Loaded,
|
||||
Sub()
|
||||
DynamicGridModule.RestoreDrawGridLayout(DrawGrid, "ManageLayer", 0, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
DynamicGridModule.RestoreDrawGridLayout(DrawGrid, "Info", 1, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
DrawGrid.UpdateLayout()
|
||||
End Sub
|
||||
|
||||
AddHandler ManagerLayerGridSplitter.DragCompleted,
|
||||
Sub()
|
||||
DynamicGridModule.SaveDrawGridLayout(DrawGrid, "ManageLayer", If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
End Sub
|
||||
|
||||
AddHandler InfoGridSplitter.DragCompleted,
|
||||
Sub()
|
||||
DynamicGridModule.SaveDrawGridLayout(DrawGrid, "Info", If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
End Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
|
||||
Public Class DrawOptionPanelVM
|
||||
Inherits ViewModelBase
|
||||
@@ -37,6 +37,28 @@ Public Class DrawOptionPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ManageLayerRowIsExpanded As Boolean = True
|
||||
Public ReadOnly Property ManageLayerRowIsExpanded As Boolean
|
||||
Get
|
||||
Return m_ManageLayerRowIsExpanded
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetManageLayerRowIsExpanded(value As Boolean)
|
||||
m_ManageLayerRowIsExpanded = value
|
||||
OnPropertyChanged("ManageLayerRowIsExpanded")
|
||||
End Sub
|
||||
|
||||
Private m_InfoRowIsExpanded As Boolean = True
|
||||
Public ReadOnly Property InfoRowIsExpanded As Boolean
|
||||
Get
|
||||
Return m_InfoRowIsExpanded
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetInfoRowIsExpanded(value As Boolean)
|
||||
m_InfoRowIsExpanded = value
|
||||
OnPropertyChanged("InfoRowIsExpanded")
|
||||
End Sub
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
@@ -60,4 +82,93 @@ Public Class DrawOptionPanelVM
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "DEPENCY PROPERTY"
|
||||
|
||||
Public Shared ReadOnly RowIdProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"RowId",
|
||||
GetType(String),
|
||||
GetType(DrawOptionPanelVM),
|
||||
New PropertyMetadata(Nothing)
|
||||
)
|
||||
|
||||
Public Shared Sub SetRowId(element As DependencyObject, value As String)
|
||||
element.SetValue(RowIdProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetRowId(element As DependencyObject) As String
|
||||
Return CType(element.GetValue(RowIdProperty), String)
|
||||
End Function
|
||||
|
||||
Public Shared ReadOnly IsExpandedProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"IsExpanded",
|
||||
GetType(Boolean),
|
||||
GetType(DrawOptionPanelVM),
|
||||
New PropertyMetadata(True, AddressOf OnIsExpandedChanged)
|
||||
)
|
||||
|
||||
Public Shared Sub SetIsExpanded(element As DependencyObject, value As Boolean)
|
||||
element.SetValue(IsExpandedProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetIsExpanded(element As DependencyObject) As Boolean
|
||||
Return CType(element.GetValue(IsExpandedProperty), Boolean)
|
||||
End Function
|
||||
|
||||
Public Shared Function GetTargetSplitter(d As DependencyObject) As GridSplitter
|
||||
Return CType(d.GetValue(TargetSplitterProperty), GridSplitter)
|
||||
End Function
|
||||
|
||||
Public Shared Sub SetTargetSplitter(d As DependencyObject, value As GridSplitter)
|
||||
d.SetValue(TargetSplitterProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared ReadOnly TargetSplitterProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"TargetSplitter",
|
||||
GetType(GridSplitter),
|
||||
GetType(DrawOptionPanelVM),
|
||||
New PropertyMetadata(Nothing)
|
||||
)
|
||||
|
||||
Private Shared Sub OnIsExpandedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
|
||||
Dim row As RowDefinition = TryCast(d, RowDefinition)
|
||||
If IsNothing(row) Then Return
|
||||
|
||||
Dim isExpanded As Boolean = CBool(e.NewValue)
|
||||
|
||||
Dim splitter = DrawOptionPanelVM.GetTargetSplitter(row)
|
||||
If splitter IsNot Nothing Then
|
||||
splitter.IsEnabled = isExpanded
|
||||
splitter.Visibility = If(isExpanded, Visibility.Visible, Visibility.Collapsed)
|
||||
End If
|
||||
|
||||
Dim rowId As String = GetRowId(row)
|
||||
Dim rowHeight As Double = 0
|
||||
|
||||
If rowId = "ManageLayer" Then
|
||||
rowHeight = 400
|
||||
ElseIf rowId = "Info" Then
|
||||
rowHeight = 150
|
||||
End If
|
||||
|
||||
If Not isExpanded Then
|
||||
row.ClearValue(RowDefinition.HeightProperty)
|
||||
|
||||
row.Height = New GridLength(1, GridUnitType.Auto)
|
||||
row.MinHeight = 0
|
||||
Else
|
||||
If File.Exists(Map.refMainWindowVM.DimensionDir) Then
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "ManageLayer", 0, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "Info", 1, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
Map.refDrawOptionPanelV.DrawGrid.UpdateLayout()
|
||||
Else
|
||||
row.Height = New GridLength(rowHeight)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Depency Property
|
||||
|
||||
End Class
|
||||
@@ -18,6 +18,7 @@ Public Class EstimationsExpanderVM
|
||||
Set(value As Boolean)
|
||||
If value <> m_Estimation_IsExpanded Then
|
||||
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.ESTIMATIONS, value)
|
||||
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(False)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -138,7 +139,7 @@ Public Class EstimationsExpanderVM
|
||||
If Not String.IsNullOrEmpty(sCurrFilePath) Then
|
||||
sInfo = "EgtCAM5 - " & sCurrFilePath
|
||||
If EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sEstFile) AndAlso Not String.IsNullOrWhiteSpace(sEstFile) Then
|
||||
sEstFile = Path.ChangeExtension(Path.GetDirectoryName(sCurrFilePath) & "\" & sEstFile, ".html")
|
||||
sEstFile = Path.ChangeExtension(Path.GetDirectoryName(sCurrFilePath) & "\" & Path.GetFileName( sEstFile), ".html")
|
||||
Else
|
||||
sEstFile = Path.ChangeExtension(sCurrFilePath, Nothing)
|
||||
If IniFile.m_bMachiningGroup Then
|
||||
|
||||
+11
-19
@@ -94,26 +94,18 @@ Public Class MachiningTreeExpanderVM
|
||||
' Sposto la lavorazione aggiunta subito dopo quella appena selezionata
|
||||
EgtRelocate(MachiningId, nSelectedOperationId, GDB_POS.AFTER)
|
||||
End If
|
||||
' Recupero geometria correntemente selezionata e la metto in un vettore
|
||||
Dim SelectedEntities As New List(Of Integer)
|
||||
Dim EntityId As Integer = EgtGetFirstSelectedObj()
|
||||
While EntityId <> GDB_ID.NULL
|
||||
SelectedEntities.Add(EntityId)
|
||||
EntityId = EgtGetNextSelectedObj()
|
||||
' Imposto geometria da lavorare (tutta quella selezionata)
|
||||
Dim vId(EgtGetSelectedObjCount() - 1) As Integer
|
||||
Dim vSub(EgtGetSelectedObjCount() - 1) As Integer
|
||||
Dim nInd As Integer = 0
|
||||
Dim EntId As Integer = EgtGetFirstSelectedObj()
|
||||
While EntId <> GDB_ID.NULL
|
||||
vId(nInd) = EntId
|
||||
SelData.GetSubFromId( EntId, vSub(nInd))
|
||||
nInd += 1
|
||||
EntId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Imposto l'operazione appena creata come corrente
|
||||
EgtSetCurrMachining(MachiningId)
|
||||
' Gestione speciale per superfici ( si aggiunge l'identificazione della faccia)
|
||||
If SelectedEntities.Count() > 0 AndAlso EgtGetType(SelectedEntities(0)) = GDB_TY.SRF_MESH Then
|
||||
Dim vId() As Integer = Nothing
|
||||
Dim vSub() As Integer = Nothing
|
||||
SelData.GetAllIdSub(vId, vSub)
|
||||
EgtSetMachiningGeometry(vId, vSub)
|
||||
' Gestione standard per altre entità (curve, regioni, ...)
|
||||
Else
|
||||
' Imposto il vettore come geometria di lavorazione
|
||||
EgtSetMachiningGeometry(SelectedEntities.ToArray)
|
||||
End If
|
||||
EgtSetMachiningGeometry(vId, vSub)
|
||||
' Calcolo la lavorazione con la nuova geometria
|
||||
EgtApplyMachining(True)
|
||||
EgtDraw()
|
||||
|
||||
+9
-12
@@ -80,28 +80,25 @@
|
||||
|
||||
<Button Name="ApplyMachBtn" Height="30" Content="{Binding UpdateMachiningBtnMsg}"
|
||||
Command="{Binding UpdateMachiningCommand}" Background="{Binding UpdateMachiningBtn_Background}"/>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,2.5,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<CheckBox Name="ViewToolBtn"
|
||||
Content="{Binding ViewToolBtnMsg}"
|
||||
IsChecked="{Binding ViewTool}"
|
||||
Style="{StaticResource ViewTool_CheckBox}"/>
|
||||
<Button Command="{Binding PreviewMachiningTool_Command}"
|
||||
x:Name="ButtonPreview"
|
||||
Style="{StaticResource PreviewTool_Button}">
|
||||
<Image Source="{Binding sToolPreview_Image}" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
<Slider Grid.Row="1"
|
||||
<Slider Grid.Column="1"
|
||||
x:Name="SliderV"
|
||||
Value="{Binding SliderValue}"
|
||||
IsEnabled="{Binding IsChecked, ElementName=ViewToolBtn}"
|
||||
IsEnabled="{Binding Slider_IsEnable}"
|
||||
TickFrequency="{Binding SliderTick}"
|
||||
Minimum="1"
|
||||
Maximum="{Binding SliderScale}"
|
||||
IsSnapToTickEnabled="False"
|
||||
Style="{StaticResource SliderValue_Slider}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
+13
-3
@@ -1,5 +1,5 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtWPFLib5.EgtFloating
|
||||
Imports EgtCAM5.MachiningParameterExpanderVM
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MachiningParameterExpanderV
|
||||
|
||||
@@ -9,9 +9,12 @@ Public Class MachiningParameterExpanderV
|
||||
InitializeComponent()
|
||||
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
|
||||
Me.SliderV.Focusable = False
|
||||
' Associo il gestore evento m_EventFocusOnSlider all'evento generato da FocusOnSlider
|
||||
AddHandler Map.refMachiningParameterExpanderVM.m_EventFocusOnSlider, AddressOf FocusOnSlider
|
||||
' Associo il gestore evento m_EventFocusOnButtonPreview all'evento generato da FocusOnButtonPreview
|
||||
AddHandler Map.refMachiningParameterExpanderVM.m_EventFocusOnButtonPreview, AddressOf FocusOnButtonPreview
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@@ -21,4 +24,11 @@ Public Class MachiningParameterExpanderV
|
||||
Me.SliderV.Focus()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che mette il focus sul bottone
|
||||
''' </summary>
|
||||
Friend Sub FocusOnButtonPreview()
|
||||
Me.ButtonPreview.Focus()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+126
-59
@@ -1,6 +1,4 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class MachiningParameterExpanderVM
|
||||
@@ -10,6 +8,32 @@ Public Class MachiningParameterExpanderVM
|
||||
''' Evento che permette di mettere il focus sullo slider
|
||||
''' </summary>
|
||||
Friend Event m_EventFocusOnSlider()
|
||||
''' <summary>
|
||||
''' Evento che permette di mettere il focus sul bottone
|
||||
''' </summary>
|
||||
Friend Event m_EventFocusOnButtonPreview()
|
||||
|
||||
Private m_nPreviewMachiningTool As Integer
|
||||
Public ReadOnly Property nPreviewMachiningTool As Integer
|
||||
Get
|
||||
Return m_nPreviewMachiningTool
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetPreviewMachiningTool(value As MCH_LOOK)
|
||||
m_nPreviewMachiningTool = value
|
||||
NotifyPropertyChanged(NameOf(nPreviewMachiningTool))
|
||||
End Sub
|
||||
|
||||
Private m_sToolPreview_Image As String
|
||||
Public ReadOnly Property sToolPreview_Image As String
|
||||
Get
|
||||
Return m_sToolPreview_Image
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetToolPreview_Image(value As String)
|
||||
m_sToolPreview_Image = value
|
||||
NotifyPropertyChanged(NameOf(sToolPreview_Image))
|
||||
End Sub
|
||||
|
||||
Private WithEvents m_CurrOperation As MachiningTreeViewItem
|
||||
Public Property CurrOperation As MachiningTreeViewItem
|
||||
@@ -54,29 +78,6 @@ Public Class MachiningParameterExpanderVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_bPreviewTool As Boolean = False
|
||||
Public Property ViewTool As Boolean
|
||||
Get
|
||||
Return m_bPreviewTool
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value Then
|
||||
EgtPreparePreviewMachiningTool()
|
||||
m_bPreviewTool = True
|
||||
ResetSliderValue()
|
||||
Else
|
||||
EgtRemovePreviewMachiningTool()
|
||||
m_bPreviewTool = False
|
||||
ResetSliderValue()
|
||||
End If
|
||||
EgtDraw()
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetViewTool(value As Boolean)
|
||||
ViewTool = value
|
||||
NotifyPropertyChanged("ViewTool")
|
||||
End Sub
|
||||
|
||||
' Slider per muovere l'utensile in aggiunta ai pulsanti indietro e avanti
|
||||
Private m_SliderScale As Integer = 100
|
||||
Public ReadOnly Property SliderScale As Integer
|
||||
@@ -85,15 +86,15 @@ Public Class MachiningParameterExpanderVM
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSliderScale(value As Integer)
|
||||
m_SliderScale = Math.Max( value, 1)
|
||||
m_SliderScale = Math.Max(value, 1)
|
||||
If m_SliderScale <= 10 Then
|
||||
m_SliderTick = 1
|
||||
Else
|
||||
m_SliderTick = CInt( m_SliderScale / 10)
|
||||
m_SliderTick = CInt(m_SliderScale / 10)
|
||||
End If
|
||||
NotifyPropertyChanged( NameOf(SliderScale))
|
||||
NotifyPropertyChanged( NameOf(SliderTick))
|
||||
End Sub
|
||||
NotifyPropertyChanged(NameOf(SliderScale))
|
||||
NotifyPropertyChanged(NameOf(SliderTick))
|
||||
End Sub
|
||||
|
||||
Private m_SliderTick As Integer = 10
|
||||
Public ReadOnly Property SliderTick As Integer
|
||||
@@ -109,7 +110,7 @@ Public Class MachiningParameterExpanderVM
|
||||
Return m_SliderValue
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
If m_bPreviewTool Then
|
||||
If m_nPreviewMachiningTool = MCH_LOOK.TAB_TOOL OrElse m_nPreviewMachiningTool = MCH_LOOK.TAB_HEAD Then
|
||||
Dim nId As Integer = EgtPreviewMachiningTool(m_nPtEntId, value - m_SliderValue)
|
||||
If nId <> GDB_ID.NULL Then m_nPtEntId = nId
|
||||
EgtDraw()
|
||||
@@ -118,7 +119,7 @@ Public Class MachiningParameterExpanderVM
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub ResetSliderValue()
|
||||
If m_bPreviewTool Then
|
||||
If m_nPreviewMachiningTool = MCH_LOOK.TAB_TOOL OrElse m_nPreviewMachiningTool = MCH_LOOK.TAB_HEAD Then
|
||||
m_nPtEntId = EgtPreviewMachiningTool(GDB_ID.NULL, MCH_PTM.AFTER)
|
||||
Else
|
||||
m_nPtEntId = GDB_ID.NULL
|
||||
@@ -127,8 +128,9 @@ Public Class MachiningParameterExpanderVM
|
||||
NotifyPropertyChanged(NameOf(SliderValue))
|
||||
End Sub
|
||||
Friend Sub SetSliderValue(value As Integer)
|
||||
If m_nPreviewMachiningTool = MCH_LOOK.NONE Then Return
|
||||
Dim nOldSliderValue As Integer = m_SliderValue
|
||||
m_SliderValue = Math.Min( Math.Max( m_SliderValue + value, 1), m_SliderScale)
|
||||
m_SliderValue = Math.Min(Math.Max(m_SliderValue + value, 1), m_SliderScale)
|
||||
Dim nStep As Integer = m_SliderValue - nOldSliderValue
|
||||
If nStep = 0 Then Return
|
||||
Dim nId As Integer = EgtPreviewMachiningTool(m_nPtEntId, nStep)
|
||||
@@ -137,6 +139,17 @@ Public Class MachiningParameterExpanderVM
|
||||
NotifyPropertyChanged(NameOf(SliderValue))
|
||||
End Sub
|
||||
|
||||
Private m_Slider_IsEnable As Boolean
|
||||
Public ReadOnly Property Slider_IsEnable As Boolean
|
||||
Get
|
||||
Return m_Slider_IsEnable
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSlider_IsEnable(value As Boolean)
|
||||
m_Slider_IsEnable = value
|
||||
NotifyPropertyChanged(NameOf(Slider_IsEnable))
|
||||
End Sub
|
||||
|
||||
Dim WoodDrillParamExpanderV As WoodDrillingParameterExpanderV
|
||||
Dim WoodSawParamExpanderV As WoodSawingParameterExpanderV
|
||||
Dim WoodMillParamExpanderV As WoodMillingParameterExpanderV
|
||||
@@ -319,9 +332,8 @@ Public Class MachiningParameterExpanderVM
|
||||
#End Region ' Messages
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdNextStepTool As ICommand
|
||||
Private m_cmdPrevStepTool As ICommand
|
||||
Private m_cmdUpdateMachining As ICommand
|
||||
Private m_cmdPreviewMachiningTool As ICommand
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -342,6 +354,51 @@ Public Class MachiningParameterExpanderVM
|
||||
RaiseEvent m_EventFocusOnSlider()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che attiva l'evento che mette il focus sul bottone
|
||||
''' </summary>
|
||||
Public Sub FocusButtonPreview()
|
||||
RaiseEvent m_EventFocusOnButtonPreview()
|
||||
End Sub
|
||||
|
||||
Friend Sub PreviewMachiningTool()
|
||||
Select Case nPreviewMachiningTool
|
||||
Case MCH_LOOK.NONE
|
||||
SetPreviewMachiningTool(MCH_LOOK.TAB_TOOL)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Tool.png")
|
||||
SetSlider_IsEnable(True)
|
||||
Case MCH_LOOK.TAB_TOOL
|
||||
SetPreviewMachiningTool(MCH_LOOK.TAB_HEAD)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Head.png")
|
||||
SetSlider_IsEnable(True)
|
||||
Case MCH_LOOK.TAB_HEAD
|
||||
SetPreviewMachiningTool(MCH_LOOK.NONE)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Delete.png")
|
||||
SetSlider_IsEnable(False)
|
||||
End Select
|
||||
EgtChangePreviewMachiningToolShow(nPreviewMachiningTool)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Friend Sub RevertPreviewMachiningTool()
|
||||
Select Case nPreviewMachiningTool
|
||||
Case MCH_LOOK.NONE
|
||||
SetPreviewMachiningTool(MCH_LOOK.TAB_HEAD)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Head.png")
|
||||
SetSlider_IsEnable(True)
|
||||
Case MCH_LOOK.TAB_TOOL
|
||||
SetPreviewMachiningTool(MCH_LOOK.NONE)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Delete.png")
|
||||
SetSlider_IsEnable(False)
|
||||
Case MCH_LOOK.TAB_HEAD
|
||||
SetPreviewMachiningTool(MCH_LOOK.TAB_TOOL)
|
||||
SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Tool.png")
|
||||
SetSlider_IsEnable(True)
|
||||
End Select
|
||||
EgtChangePreviewMachiningToolShow(nPreviewMachiningTool)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -382,28 +439,18 @@ Public Class MachiningParameterExpanderVM
|
||||
' Aggiorno parametri di lavorazione
|
||||
m_CurrOperation.WriteOperationParam()
|
||||
|
||||
' Carico tutta la geometria selezionata in una lista
|
||||
Dim SelectedGeometry As New List(Of Integer)
|
||||
Dim EntityIndex As Integer = EgtGetFirstSelectedObj()
|
||||
While EntityIndex <> GDB_ID.NULL
|
||||
SelectedGeometry.Add(EntityIndex)
|
||||
EntityIndex = EgtGetNextSelectedObj()
|
||||
' Imposto geometria da lavorare (tutta quella selezionata)
|
||||
Dim vId(EgtGetSelectedObjCount() - 1) As Integer
|
||||
Dim vSub(EgtGetSelectedObjCount() - 1) As Integer
|
||||
Dim nInd As Integer = 0
|
||||
Dim EntId As Integer = EgtGetFirstSelectedObj()
|
||||
While EntId <> GDB_ID.NULL
|
||||
vId(nInd) = EntId
|
||||
SelData.GetSubFromId(EntId, vSub(nInd))
|
||||
nInd += 1
|
||||
EntId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Gestione speciale per superfici ( si aggiunge l'identificazione della faccia)
|
||||
If SelectedGeometry.Count() > 0 AndAlso
|
||||
(EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_MESH Or EgtGetType(SelectedGeometry(0)) = GDB_TY.SRF_FRGN) Then
|
||||
' Aggiorno lista speciale con facce
|
||||
SelData.VerifyIdSub()
|
||||
' Imposto geometria
|
||||
Dim vId() As Integer = Nothing
|
||||
Dim vSub() As Integer = Nothing
|
||||
SelData.GetAllIdSub(vId, vSub)
|
||||
EgtSetMachiningGeometry(vId, vSub)
|
||||
' Gestione standard per altre entità (curve, testi, ...)
|
||||
Else
|
||||
' Imposto geometria
|
||||
EgtSetMachiningGeometry(SelectedGeometry.ToArray)
|
||||
End If
|
||||
EgtSetMachiningGeometry(vId, vSub)
|
||||
|
||||
' Rigenero la lavorazione
|
||||
If Not EgtApplyMachining(bRecalc) Then
|
||||
@@ -427,8 +474,11 @@ Public Class MachiningParameterExpanderVM
|
||||
End If
|
||||
|
||||
' Restart visualizzazione utensile
|
||||
SetSliderScale( EgtGetPreviewMachiningToolStepCount())
|
||||
SetViewTool(True)
|
||||
EgtPreparePreviewMachiningTool()
|
||||
EgtChangePreviewMachiningToolShow(nPreviewMachiningTool)
|
||||
SetSliderScale(EgtGetPreviewMachiningToolStepCount())
|
||||
SetSlider_IsEnable(True)
|
||||
ResetSliderValue()
|
||||
IsModified(False)
|
||||
ErrorOnOperation(False)
|
||||
EgtDraw()
|
||||
@@ -437,6 +487,23 @@ Public Class MachiningParameterExpanderVM
|
||||
|
||||
#End Region ' UpdateMachiningCommand
|
||||
|
||||
#Region "PreviewMachiningTool_Command"
|
||||
|
||||
Public ReadOnly Property PreviewMachiningTool_Command As ICommand
|
||||
Get
|
||||
If m_cmdPreviewMachiningTool Is Nothing Then
|
||||
m_cmdPreviewMachiningTool = New RelayCommand(AddressOf PreviewMachiningTool)
|
||||
End If
|
||||
Return m_cmdPreviewMachiningTool
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub PreviewMachiningTool(ByVal param As Object)
|
||||
PreviewMachiningTool()
|
||||
End Sub
|
||||
|
||||
#End Region ' PreviewMachiningTool_Command
|
||||
|
||||
#End Region ' Commands
|
||||
|
||||
Private Sub IsModified(IsModified As Boolean) Handles m_CurrOperation.m_IsModified
|
||||
|
||||
+11
-6
@@ -1,7 +1,4 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class OperationParametersExpanderVM
|
||||
Inherits ViewModelBase
|
||||
@@ -32,6 +29,7 @@ Public Class OperationParametersExpanderVM
|
||||
' disattivo MTable e SpecialPanel se vado sulla modifica di una lavorazione
|
||||
Map.refDoorPanelVM.MTableIsEnabled(Not m_ParametersIsExpanded)
|
||||
Map.refSpecialPanelVM.SpecialPanelIsEnabled(Not m_ParametersIsExpanded)
|
||||
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(False)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -181,7 +179,11 @@ Public Class OperationParametersExpanderVM
|
||||
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomProbing
|
||||
End Select
|
||||
' Imposto visualizzazione utensile
|
||||
Map.refMachiningParameterExpanderVM.SetViewTool( True)
|
||||
Map.refMachiningParameterExpanderVM.SetPreviewMachiningTool(MCH_LOOK.TAB_TOOL)
|
||||
Map.refMachiningParameterExpanderVM.SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Tool.png")
|
||||
Map.refMachiningParameterExpanderVM.SetSlider_IsEnable(True)
|
||||
EgtPreparePreviewMachiningTool()
|
||||
EgtDraw()
|
||||
End If
|
||||
OnPropertyChanged("ParametersIsExpanded")
|
||||
Return True
|
||||
@@ -211,7 +213,10 @@ Public Class OperationParametersExpanderVM
|
||||
EgtDraw()
|
||||
Else
|
||||
' Nascondo visualizzazione utensile
|
||||
Map.refMachiningParameterExpanderVM.SetViewTool( False)
|
||||
Map.refMachiningParameterExpanderVM.SetPreviewMachiningTool(MCH_LOOK.NONE)
|
||||
Map.refMachiningParameterExpanderVM.SetSlider_IsEnable(False)
|
||||
Map.refMachiningParameterExpanderVM.ResetSliderValue()
|
||||
EgtRemovePreviewMachiningTool()
|
||||
End If
|
||||
ParametersExpanderName = String.Empty
|
||||
' Disabilito la selezione delle lavorazioni
|
||||
|
||||
+154
-155
@@ -1,177 +1,176 @@
|
||||
<UserControl x:Class="OperationsListExpanderV"
|
||||
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">
|
||||
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">
|
||||
|
||||
<StackPanel Name="OperationsListExpanderViewStackPanel" IsEnabled="{Binding OpersListViewIsEnabled}">
|
||||
<Expander Header="{Binding OperationListHeader}"
|
||||
IsEnabled="{Binding OpersListViewIsEnabled}"
|
||||
IsExpanded="{Binding ListIsExpanded}" Name="OperationsListExpander"
|
||||
Style="{StaticResource ExpanderStyle}">
|
||||
<Expander.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="{Binding CancelOperationCommand}" CommandParameter="Escape"/>
|
||||
</Expander.InputBindings>
|
||||
|
||||
<Expander Header="{Binding OperationListHeader}" IsExpanded="{Binding ListIsExpanded}" Name="OperationsListExpander"
|
||||
Style="{StaticResource ExpanderStyle}">
|
||||
<Expander.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="{Binding CancelOperationCommand}" CommandParameter="Escape"/>
|
||||
</Expander.InputBindings>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel>
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding NewMachiningBtnContent}" Command="{Binding NewMachiningCommand}" Height="30"/>
|
||||
<Button Content="{Binding NewPositioningBtnContent}" Command="{Binding NewPositioningCommand}" Height="30"/>
|
||||
<Button Content="{Binding CancelOperationBtnContent}" Command="{Binding CancelOperationCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding NewMachiningBtnContent}" Command="{Binding NewMachiningCommand}" Height="30"/>
|
||||
<Button Content="{Binding NewPositioningBtnContent}" Command="{Binding NewPositioningCommand}" Height="30"/>
|
||||
<Button Content="{Binding CancelOperationBtnContent}" Command="{Binding CancelOperationCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
<ListBox IsSynchronizedWithCurrentItem="False" ItemsSource="{Binding OperationList}"
|
||||
Height="200" x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
|
||||
<DataTemplate.Resources>
|
||||
<Style x:Key="LayoutRoot" TargetType="Grid">
|
||||
<!--<Style.Triggers>
|
||||
--><!--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">
|
||||
<Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=Box}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>-->
|
||||
</Style>
|
||||
</DataTemplate.Resources>
|
||||
<Border Background="Transparent">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
<ListBox Grid.Row="1"
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemsSource="{Binding OperationList}"
|
||||
x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended">
|
||||
<ListBox.Resources>
|
||||
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
|
||||
<DataTemplate.Resources>
|
||||
<Style x:Key="LayoutRoot" TargetType="Grid"/>
|
||||
</DataTemplate.Resources>
|
||||
<Border Background="Transparent">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
</Border.InputBindings>
|
||||
<Grid Style="{StaticResource LayoutRoot}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
|
||||
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
|
||||
<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"/>
|
||||
</Border.InputBindings>
|
||||
<Grid Style="{StaticResource LayoutRoot}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
|
||||
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
|
||||
<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"/>
|
||||
|
||||
<TextBlock Grid.Column="2" Text="{Binding Name}"
|
||||
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
|
||||
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="150"
|
||||
x:Name="Box"
|
||||
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
|
||||
<!--IsVisibleChanged="MachiningOpListBoxItem_IsVisibleChanged"
|
||||
<TextBlock Grid.Column="2" Text="{Binding Name}"
|
||||
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
|
||||
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="150"
|
||||
x:Name="Box"
|
||||
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
|
||||
<!--IsVisibleChanged="MachiningOpListBoxItem_IsVisibleChanged"
|
||||
LostKeyboardFocus="MachiningOpListBoxItem_LostKeyboardFocus">-->
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding ModifyNameEnterCommand}"/>
|
||||
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type EgtCAM5:DispositionOpListBoxItem}">
|
||||
<Border CornerRadius="1" Background="{StaticResource EgaltechBlue3}">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding ModifyNameEnterCommand}"/>
|
||||
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type EgtCAM5:DispositionOpListBoxItem}">
|
||||
<Border CornerRadius="1" Background="{StaticResource EgaltechBlue3}">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
</Border.InputBindings>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||
<CheckBox IsChecked="{Binding OnOffAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||
<!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}"
|
||||
</Border.InputBindings>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||
<CheckBox IsChecked="{Binding OnOffAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||
<!--<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}"
|
||||
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"/>
|
||||
<TextBlock Text="{Binding Name}" Foreground="White"
|
||||
FontSize="15" FontWeight="SemiBold"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<!--<Interactivity:Interaction.Triggers>
|
||||
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
|
||||
<TextBlock Text="{Binding Name}" Foreground="White"
|
||||
FontSize="15" FontWeight="SemiBold"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ListBox.Resources>
|
||||
<!--<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>-->
|
||||
<!--<Interactivity:Interaction.Triggers>
|
||||
<Interactivity:EventTrigger EventName="MouseDoubleClick">
|
||||
<Interactivity:InvokeCommandAction Command="{Binding OperationListDoubleClickCommand}"/>
|
||||
</Interactivity:EventTrigger>
|
||||
</Interactivity:Interaction.Triggers>-->
|
||||
<!--<Interactivity:Interaction.Behaviors>
|
||||
<!--<Interactivity:Interaction.Behaviors>
|
||||
<EgtCAM5:ScrollIntoViewForListBox/>
|
||||
</Interactivity:Interaction.Behaviors>-->
|
||||
<ListBox.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding CancelOperationCommand}"/>
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Selector.IsSelectionActive" Value="False"/>
|
||||
<Condition Property="IsSelected" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Selector.IsSelectionActive" Value="True"/>
|
||||
<Condition Property="IsSelected" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{Binding DuplicateMachMsg}"
|
||||
Command="{Binding DuplicateMachCommand}"
|
||||
IsEnabled="{Binding DuplicateCmd_IsEnabled}">
|
||||
</MenuItem>
|
||||
<MenuItem Header="{Binding MachToDbMsg}"
|
||||
Command="{Binding MachToDbCommand}"
|
||||
IsEnabled="{Binding MachToDb_IsEnabled}">
|
||||
</MenuItem>
|
||||
<MenuItem Header="{Binding RenameMsg}"
|
||||
Command="{Binding RenameCommand}"
|
||||
IsEnabled="{Binding Rename_IsEnabled}">
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
<ListBox.Style>
|
||||
<Style TargetType="ListBox">
|
||||
<EventSetter Event="SelectionChanged" Handler="ItemsControl_SelectionChanged"/>
|
||||
</Style>
|
||||
</ListBox.Style>
|
||||
</ListBox>
|
||||
<ListBox.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding CancelOperationCommand}"/>
|
||||
</ListBox.InputBindings>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Selector.IsSelectionActive" Value="False"/>
|
||||
<Condition Property="IsSelected" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Selector.IsSelectionActive" Value="True"/>
|
||||
<Condition Property="IsSelected" Value="True"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{Binding DuplicateMachMsg}"
|
||||
Command="{Binding DuplicateMachCommand}"
|
||||
IsEnabled="{Binding DuplicateCmd_IsEnabled}">
|
||||
</MenuItem>
|
||||
<MenuItem Header="{Binding MachToDbMsg}"
|
||||
Command="{Binding MachToDbCommand}"
|
||||
IsEnabled="{Binding MachToDb_IsEnabled}">
|
||||
</MenuItem>
|
||||
<MenuItem Header="{Binding RenameMsg}"
|
||||
Command="{Binding RenameCommand}"
|
||||
IsEnabled="{Binding Rename_IsEnabled}">
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
<ListBox.Style>
|
||||
<Style TargetType="ListBox">
|
||||
<EventSetter Event="SelectionChanged" Handler="ItemsControl_SelectionChanged"/>
|
||||
</Style>
|
||||
</ListBox.Style>
|
||||
</ListBox>
|
||||
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="{Binding MoveUpMsg}" Command="{Binding MoveUpCommand}" Height="30" IsEnabled="{Binding MoveUp_IsEnabled}" />
|
||||
<Button Content="{Binding MoveDownMsg}" Command="{Binding MoveDownCommand}" Height="30" IsEnabled="{Binding MoveDown_IsEnabled}"/>
|
||||
<Button Content="{Binding UpdateMsg}" Command="{Binding UpdateCommand}" Height="30"/>
|
||||
<Button Content="{Binding SetUpMsg}" Command="{Binding SetUpCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
<UniformGrid Grid.Row="2" Rows="1">
|
||||
<Button Content="{Binding MoveUpMsg}" Command="{Binding MoveUpCommand}" Height="30" IsEnabled="{Binding MoveUp_IsEnabled}" />
|
||||
<Button Content="{Binding MoveDownMsg}" Command="{Binding MoveDownCommand}" Height="30" IsEnabled="{Binding MoveDown_IsEnabled}"/>
|
||||
<Button Content="{Binding UpdateMsg}" Command="{Binding UpdateCommand}" Height="30"/>
|
||||
<Button Content="{Binding SetUpMsg}" Command="{Binding SetUpCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Expander>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -85,6 +85,7 @@ Public Class OperationsListExpanderVM
|
||||
If value <> m_ListIsExpanded Then
|
||||
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.OPERATIONLIST, value)
|
||||
SetStatusOnLamp()
|
||||
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(value)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -469,8 +470,11 @@ Public Class OperationsListExpanderVM
|
||||
If EgtGetOperationType(selOperation.Id) <> MCH_OY.DISP Then
|
||||
Map.refMachiningParameterExpanderVM.SetSliderScale(EgtGetPreviewMachiningToolStepCount())
|
||||
Map.refMachiningParameterExpanderVM.ResetSliderValue()
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
|
||||
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' OperationListDoubleClickCommand
|
||||
@@ -1301,8 +1305,11 @@ Public Class OperationsListExpanderVM
|
||||
' Annullo creazione nuova lavorazione
|
||||
If m_NewMachining Then EndNewMachining(GDB_ID.NULL)
|
||||
' Disabilito visualizzazione utensile
|
||||
If Not IsNothing(m_MachiningParameterExpander) Then
|
||||
Map.refMachiningParameterExpanderVM.SetViewTool(False)
|
||||
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
|
||||
Map.refMachiningParameterExpanderVM.SetPreviewMachiningTool(MCH_LOOK.NONE)
|
||||
Map.refMachiningParameterExpanderVM.SetSlider_IsEnable(False)
|
||||
Map.refMachiningParameterExpanderVM.ResetSliderValue()
|
||||
EgtRemovePreviewMachiningTool()
|
||||
End If
|
||||
' Deseleziono le operazioni correnti per eliminare il mark
|
||||
For Each Operation In OperationList
|
||||
|
||||
@@ -20,6 +20,7 @@ Public Class SimulationExpanderVM
|
||||
Map.refOperationsListExpanderVM.StatusLampList.Clear()
|
||||
Dim tmpStatusLamp As New StatusLamp()
|
||||
Map.refOperationsListExpanderVM.StatusLampList = tmpStatusLamp.LoadStatusLamp()
|
||||
Map.refMachiningOptionPanelVM.SetOperationsListRowIsExpanded(False)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -448,7 +449,7 @@ Public Class SimulationExpanderVM
|
||||
sInfo = "EgtCAM5 ver." & Map.refMainWindowVM.Version() & " - " & sCurrFilePath
|
||||
#End If
|
||||
If EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sCncFile) AndAlso Not String.IsNullOrWhiteSpace(sCncFile) Then
|
||||
sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & sCncFile
|
||||
sCncFile = Path.GetDirectoryName(sCurrFilePath) & "\" & Path.GetFileName(sCncFile)
|
||||
Else
|
||||
sCncFile = Path.ChangeExtension(sCurrFilePath, Nothing)
|
||||
If IniFile.m_bMachiningGroup Then
|
||||
|
||||
@@ -1,24 +1,37 @@
|
||||
<UserControl x:Class="MachiningOptionPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5">
|
||||
|
||||
<StackPanel Name="ciao" Background="Transparent" Margin="0,0,3.5001,0" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
|
||||
<Grid x:Name="MachiningGrid" Background="Transparent" MaxHeight="{Binding MaxHeight,RelativeSource={RelativeSource AncestorType={x:Type EgtFloating:EgtFloatingPanel}}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="100" Height="400" MaxHeight="800"
|
||||
EgtCAM5:MachiningOptionPanelVM.IsExpanded="{Binding OperationsListRowIsExpanded}"
|
||||
EgtCAM5:MachiningOptionPanelVM.TargetSplitter="{Binding ElementName=MachiningGridSplitter}"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!--ContentPresenter that contains the OperationsListExpander-->
|
||||
<ContentPresenter Content="{Binding OperationsListExpander,Mode=OneWay}"/>
|
||||
<GridSplitter Name="MachiningGridSplitter" Style="{StaticResource General_GridSplitter}"/>
|
||||
<!--ContentPresenter that contains the OperationParametersExpander-->
|
||||
<ContentPresenter Content="{Binding OperationParametersExpander,Mode=OneWay}"/>
|
||||
<ContentPresenter Grid.Row="1" Content="{Binding OperationParametersExpander,Mode=OneWay}"/>
|
||||
<!--ContentPresenter that contains the MachiningsTreeExpander-->
|
||||
<ContentPresenter Content="{Binding MachiningsTreeExpander}"/>
|
||||
<ContentPresenter Grid.Row="2" Content="{Binding MachiningsTreeExpander}"/>
|
||||
<!--ContentPresenter that contains the SimulationExpander-->
|
||||
<ContentPresenter Content="{Binding SimulationExpander}"/>
|
||||
<ContentPresenter Grid.Row="3" Content="{Binding SimulationExpander}"/>
|
||||
<!--ContentPresenter that contains the EstimationsExpander-->
|
||||
<ContentPresenter Content="{Binding EstimationsExpander}"/>
|
||||
<ContentPresenter Grid.Row="4" Content="{Binding EstimationsExpander}"/>
|
||||
|
||||
<Button Content="{Binding GenerateMsg}" Height="30"
|
||||
<Button Grid.Row="5"
|
||||
Content="{Binding GenerateMsg}" Height="30"
|
||||
IsEnabled="{Binding GenerateIsEnabled}"
|
||||
Command="{Binding GenerateCommand}"/>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
Public Class MachiningOptionPanelV
|
||||
|
||||
Private Sub Me_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
|
||||
Dim x = ciao.MaxHeight
|
||||
Sub New()
|
||||
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
|
||||
' Add any initialization after the InitializeComponent() call.
|
||||
Map.SetRefMachiningOptionPanelV(Me)
|
||||
|
||||
If Not IsActivePlugin() Then
|
||||
AddHandler MachiningGrid.Loaded,
|
||||
Sub()
|
||||
DynamicGridModule.RestoreMachiningGridLayout(MachiningGrid, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_MACHINING_PLUGIN, DynamicGridModule.PROJECT_MACHINING))
|
||||
MachiningGrid.UpdateLayout()
|
||||
End Sub
|
||||
|
||||
AddHandler MachiningGridSplitter.DragCompleted,
|
||||
Sub()
|
||||
DynamicGridModule.SaveMachiningGridLayout(MachiningGrid, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_MACHINING_PLUGIN, DynamicGridModule.PROJECT_MACHINING))
|
||||
End Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
|
||||
Public Class MachiningOptionPanelVM
|
||||
Inherits ViewModelBase
|
||||
@@ -132,6 +133,17 @@ Public Class MachiningOptionPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_OperationsListRowIsExpanded As Boolean = True
|
||||
Public ReadOnly Property OperationsListRowIsExpanded As Boolean
|
||||
Get
|
||||
Return m_OperationsListRowIsExpanded
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetOperationsListRowIsExpanded(value As Boolean)
|
||||
m_OperationsListRowIsExpanded = value
|
||||
OnPropertyChanged("OperationsListRowIsExpanded")
|
||||
End Sub
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property GenerateMsg As String
|
||||
@@ -195,4 +207,67 @@ Public Class MachiningOptionPanelVM
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
#Region "DEPENCY PROPERTY"
|
||||
|
||||
Public Shared ReadOnly IsExpandedProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"IsExpanded",
|
||||
GetType(Boolean),
|
||||
GetType(MachiningOptionPanelVM),
|
||||
New PropertyMetadata(True, AddressOf OnIsExpandedChanged)
|
||||
)
|
||||
|
||||
Public Shared Sub SetIsExpanded(element As DependencyObject, value As Boolean)
|
||||
element.SetValue(IsExpandedProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared Function GetIsExpanded(element As DependencyObject) As Boolean
|
||||
Return CType(element.GetValue(IsExpandedProperty), Boolean)
|
||||
End Function
|
||||
|
||||
Public Shared Function GetTargetSplitter(d As DependencyObject) As GridSplitter
|
||||
Return CType(d.GetValue(TargetSplitterProperty), GridSplitter)
|
||||
End Function
|
||||
|
||||
Public Shared Sub SetTargetSplitter(d As DependencyObject, value As GridSplitter)
|
||||
d.SetValue(TargetSplitterProperty, value)
|
||||
End Sub
|
||||
|
||||
Public Shared ReadOnly TargetSplitterProperty As DependencyProperty =
|
||||
DependencyProperty.RegisterAttached(
|
||||
"TargetSplitter",
|
||||
GetType(GridSplitter),
|
||||
GetType(MachiningOptionPanelVM),
|
||||
New PropertyMetadata(Nothing)
|
||||
)
|
||||
|
||||
Private Shared Sub OnIsExpandedChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
|
||||
Dim row As RowDefinition = TryCast(d, RowDefinition)
|
||||
If IsNothing(row) Then Return
|
||||
|
||||
Dim isExpanded As Boolean = CBool(e.NewValue)
|
||||
|
||||
Dim splitter = MachiningOptionPanelVM.GetTargetSplitter(row)
|
||||
If Not IsNothing(splitter) Then
|
||||
splitter.IsEnabled = isExpanded
|
||||
splitter.Visibility = If(isExpanded, Visibility.Visible, Visibility.Collapsed)
|
||||
End If
|
||||
|
||||
If Not isExpanded Then
|
||||
row.ClearValue(RowDefinition.HeightProperty)
|
||||
|
||||
row.Height = New GridLength(1, GridUnitType.Auto)
|
||||
row.MinHeight = 0
|
||||
Else
|
||||
If File.Exists(Map.refMainWindowVM.DimensionDir) Then
|
||||
DynamicGridModule.RestoreMachiningGridLayout(Map.refMachiningOptionPanelV.MachiningGrid, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_MACHINING_PLUGIN, DynamicGridModule.PROJECT_MACHINING))
|
||||
Map.refMachiningOptionPanelV.MachiningGrid.UpdateLayout()
|
||||
Else
|
||||
row.Height = New GridLength(350)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Depency Property
|
||||
|
||||
End Class
|
||||
@@ -1,6 +1,6 @@
|
||||
<EgtFloating:EgtFloatingPanel x:Class="OptionPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="250"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
|
||||
TitleBarOrientation="Vertical"
|
||||
Visibility="{Binding Panel_Visibility}">
|
||||
|
||||
@@ -60,6 +60,7 @@ Public Class OptionPanelVM
|
||||
Map.refSimulationExpanderVM.Simulation_IsExpanded = False
|
||||
Map.refEstimationsExpanderVM.Estimation_IsExpanded = False
|
||||
End If
|
||||
If Not IsNothing(Map.refManageLayerExpanderVM) Then Map.refManageLayerExpanderVM.SetManageLayerIsExpanded(True)
|
||||
NotifyPropertyChanged("ModePanel")
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemContainerStyle>
|
||||
<Style>
|
||||
<Setter Property="DockPanel.Dock" Value="{Binding}" />
|
||||
<Setter Property="DockPanel.Dock" Value="{Binding}"/>
|
||||
</Style>
|
||||
</ItemsControl.ItemContainerStyle>
|
||||
|
||||
|
||||
+109
-17
@@ -1,8 +1,10 @@
|
||||
Imports System.Windows.Forms.Integration
|
||||
Imports System.Windows.Interop
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Globalization
|
||||
Imports System.Windows.Forms.Integration
|
||||
Imports System.Windows.Interop
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtUILib
|
||||
Imports EgtUILib.EgtInterface
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ProjectVM
|
||||
@@ -57,9 +59,15 @@ Public Class ProjectVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Private m_DynamicGrid As New Grid()
|
||||
Public ReadOnly Property DynamicGrid As Grid
|
||||
Get
|
||||
Return m_DynamicGrid
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "EGTUILIB FIELDS"
|
||||
|
||||
Private m_bCPlaneTypePos As Boolean
|
||||
@@ -79,6 +87,17 @@ Public Class ProjectVM
|
||||
TMDbParamVisibility.bFirst = True
|
||||
' Inizializza i parametri della scena
|
||||
'InitializeEgtProject()
|
||||
|
||||
Dim m_TopTrayV As New TopTrayV
|
||||
Dim m_LeftTrayV As New LeftTrayV
|
||||
Dim m_RightTrayV As New RightTrayV
|
||||
Dim m_BottomTrayV As New BottomTrayV
|
||||
Dim m_SceneContentControlV As New SceneContentControlV
|
||||
|
||||
DynamicGridModule.CreateDynamicGrid()
|
||||
|
||||
Dim gridSplitter As GridSplitter = DynamicGridModule.CreateGridSplitter()
|
||||
|
||||
' aggiungo componenti interfaccia
|
||||
Dim bPlugin As Boolean = False
|
||||
Dim PluginDirNameList() As String = {}
|
||||
@@ -105,12 +124,17 @@ Public Class ProjectVM
|
||||
Dim ConfigurationData As IPluginConfigData = Map.refMainWindowVM.GetConfigData(Of IPluginConfigData)(PluginName & ".ConfigurationData")
|
||||
If Not IsNothing(ConfigurationData) And ConfigurationData.ControlList.Count > 0 Then
|
||||
For Each Element In ConfigurationData.ControlList
|
||||
PopolateGridWithPlugIn(m_TopTrayV, m_RightTrayV, m_BottomTrayV, m_SceneContentControlV, gridSplitter)
|
||||
Select Case Element.Name
|
||||
Case PLUGIN_RIGHT_TRAY
|
||||
m_PanelList.Add(New RightTrayV)
|
||||
'm_PanelList.Add(New RightTrayV)
|
||||
'aggiungo RightTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_RightTrayV)
|
||||
Map.refOptionPanelVM.SetPanelViewState(Element.ViewPanelState)
|
||||
Case PLUGIN_LEFT_TRAY
|
||||
m_PanelList.Add(New LeftTrayV)
|
||||
'm_PanelList.Add(New LeftTrayV)
|
||||
' aggiungo LeftTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_LeftTrayV)
|
||||
Case Else
|
||||
m_PanelList.Add(Map.refMainWindowVM.GetControlByName(Of IPluginControl)(Element))
|
||||
End Select
|
||||
@@ -118,17 +142,43 @@ Public Class ProjectVM
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
m_PanelList.Add(New BottomTrayV)
|
||||
m_PanelList.Add(New TopTrayV)
|
||||
'm_PanelList.Add(New BottomTrayV)
|
||||
'm_PanelList.Add(New TopTrayV)
|
||||
' aggiungo gridSplitter alla griglia
|
||||
m_DynamicGrid.Children.Add(gridSplitter)
|
||||
' aggiungo BottomTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_BottomTrayV)
|
||||
' aggiungo TopTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_TopTrayV)
|
||||
' nascondo tasti gestione progetto se attivo plugin
|
||||
Map.refTopCommandBarVM.SetProjectManagerVisibility(False)
|
||||
Else
|
||||
m_PanelList.Add(New TopTrayV)
|
||||
m_PanelList.Add(New LeftTrayV)
|
||||
m_PanelList.Add(New RightTrayV)
|
||||
m_PanelList.Add(New BottomTrayV)
|
||||
'm_PanelList.Add(New TopTrayV)
|
||||
'm_PanelList.Add(New LeftTrayV)
|
||||
'm_PanelList.Add(New RightTrayV)
|
||||
'm_PanelList.Add(New BottomTrayV)
|
||||
DynamicGridModule.PopulateGrid(m_TopTrayV, m_LeftTrayV, m_RightTrayV, m_BottomTrayV, m_SceneContentControlV, gridSplitter)
|
||||
' aggiungo TopTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_TopTrayV)
|
||||
' aggiungo LeftTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_LeftTrayV)
|
||||
' aggiungo gridSplitter alla griglia
|
||||
m_DynamicGrid.Children.Add(gridSplitter)
|
||||
' aggiungo RightTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_RightTrayV)
|
||||
' aggiungo BottomTrayV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_BottomTrayV)
|
||||
End If
|
||||
m_PanelList.Add(New SceneContentControlV)
|
||||
'm_PanelList.Add(New SceneContentControlV)
|
||||
' aggiungo SceneContentControlV alla griglia
|
||||
m_DynamicGrid.Children.Add(m_SceneContentControlV)
|
||||
' Carico le dimensioni salvate su ini se presenti
|
||||
AddHandler m_DynamicGrid.Loaded,
|
||||
Sub()
|
||||
DynamicGridModule.RestoreGridLayout(If(IsActivePlugin(), DynamicGridModule.PROJECT_EGTCAM5_PLUGIN, DynamicGridModule.PROJECT_EGTCAM5))
|
||||
m_DynamicGrid.UpdateLayout()
|
||||
End Sub
|
||||
m_PanelList.Add(m_DynamicGrid)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -212,6 +262,27 @@ Public Class ProjectVM
|
||||
Dim sOut As String = "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath
|
||||
EgtOutLog(sOut)
|
||||
End If
|
||||
If IniFile.IsActiveWindow() Then
|
||||
bExtensions = True
|
||||
Dim sVersion As String = "---"
|
||||
IniFile.GetSpecialLuaVersion(IniFile.m_sWindowDirPath, sVersion)
|
||||
Dim sOut As String = "Window ver. " & sVersion & " " & IniFile.m_sWindowDirPath
|
||||
EgtOutLog(sOut)
|
||||
End If
|
||||
If IniFile.IsActiveTrimming() Then
|
||||
bExtensions = True
|
||||
Dim sVersion As String = "---"
|
||||
IniFile.GetSpecialLuaVersion(IniFile.m_sTrimmingDirPath, sVersion)
|
||||
Dim sOut As String = "Trimming ver. " & sVersion & " " & IniFile.m_sTrimmingDirPath
|
||||
EgtOutLog(sOut)
|
||||
End If
|
||||
If IniFile.IsActiveReversePost() Then
|
||||
bExtensions = True
|
||||
Dim sVersion As String = "---"
|
||||
IniFile.GetSpecialLuaVersion(IniFile.m_sReversePostDirPath, sVersion)
|
||||
Dim sOut As String = "ReversePost ver. " & sVersion & " " & IniFile.m_sReversePostDirPath
|
||||
EgtOutLog(sOut)
|
||||
End If
|
||||
If IniFile.IsActiveGunStock() Then
|
||||
bExtensions = True
|
||||
Dim sVersion As String = "---"
|
||||
@@ -366,9 +437,9 @@ Public Class ProjectVM
|
||||
Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
|
||||
Map.refShowPanelVM.ShowCurveDir(nShowCurveDir)
|
||||
' qualità di visualizzazione delle superfici
|
||||
OptionModule.SetShowSurfQuality( False)
|
||||
OptionModule.SetShowSurfQuality(False)
|
||||
' tipo visualizzazione per Zmap
|
||||
EgtSetShowZmap( OptionModule.m_nShowZmapType, False)
|
||||
EgtSetShowZmap(OptionModule.m_nShowZmapType, False)
|
||||
' dimensione lineare max in pixel delle textures
|
||||
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
|
||||
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
||||
@@ -1113,7 +1184,7 @@ Public Class ProjectVM
|
||||
EgtGetPlaneSnapPoint(e.Location, Vector3d.Z_AX, TableRef.z, ptCurr)
|
||||
DispositionUtility.VtHookFinder(nFixtureId, ptCurr)
|
||||
Exit While
|
||||
ElseIf DispositionUtility.VerifyTableAxis( nFixtureId) Then
|
||||
ElseIf DispositionUtility.VerifyTableAxis(nFixtureId) Then
|
||||
m_SelType = DispositionUtility.SelType.BARS
|
||||
m_nIdToSel = nFixtureId
|
||||
' Drag possibile
|
||||
@@ -1211,7 +1282,7 @@ Public Class ProjectVM
|
||||
m_nIdToDesel = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
Return
|
||||
' altrimenti verifico il tipo del primo oggetto selezionato
|
||||
' altrimenti verifico il tipo del primo oggetto selezionato
|
||||
Else
|
||||
Dim nFirstSelId As Integer = EgtGetFirstSelectedObj()
|
||||
' se è un riferimento resetto lo stato di selezione ed esco
|
||||
@@ -1322,6 +1393,13 @@ Public Class ProjectVM
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
' Carico se presenti le dimensioni della griglia
|
||||
Application.Current.Dispatcher.BeginInvoke(
|
||||
Sub()
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "ManageLayer", 0, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "Info", 1, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
End Sub,
|
||||
DispatcherPriority.Render)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedColor(ByVal sender As Object, ByVal nId As Integer) Handles m_ProjectScene.OnMouseSelectedColor
|
||||
@@ -1440,6 +1518,20 @@ Public Class ProjectVM
|
||||
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
|
||||
Map.refStatusBarVM.NotifyStatusOutput(sOut)
|
||||
End If
|
||||
ElseIf EgtGetType(nId) = GDB_TY.SRF_BEZ Then
|
||||
' Visualizzo il punto selezionato, la normale e le tangenti nelle direzioni dei parametri
|
||||
Analyze.CreateAnalyzeGroup()
|
||||
Dim dU As Double
|
||||
Dim dV As Double
|
||||
If Analyze.CreateSBzPointNormalAndTangents(nId, ptSel, dU, dV) Then
|
||||
Dim sOut As String = "U = " + dU.ToString("F3") +
|
||||
"; V = " + dV.ToString("F3")
|
||||
Map.refStatusBarVM.NotifyStatusOutput(sOut)
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
Analyze.CreateSBzIsoParam(nId, dU, dV)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
' Aggiorno la visualizzazione
|
||||
EgtDraw()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 683 B |
Binary file not shown.
|
After Width: | Height: | Size: 806 B |
Binary file not shown.
|
After Width: | Height: | Size: 774 B |
@@ -2,6 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:EgtCAM5"
|
||||
DockPanel.Dock="Right">
|
||||
DockPanel.Dock="Right"
|
||||
Margin="1,0,0,0">
|
||||
<local:OptionPanelV DataContext="{StaticResource OptionPanelViewModel}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SpecialPanelVM
|
||||
@@ -32,10 +33,10 @@ Public Class SpecialPanelVM
|
||||
Map.SetRefSpecialPanelVM(Me)
|
||||
' se attivo, inizializzo i bottoni leggendoli da file ini
|
||||
If IniFile.IsActiveSpecialPanel(False) Then
|
||||
Dim BtlIndexMax As Integer = If( IniFile.m_nUserLevel > 5, 199, 99)
|
||||
Dim BtlIndexMax As Integer = If(IniFile.m_nUserLevel > 5, 199, 99)
|
||||
For BtnIndex As Integer = 1 To BtlIndexMax
|
||||
Dim CurrBtn As ButtonListItem = Nothing
|
||||
If GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn)Then
|
||||
If GetPrivateProfileButton(S_SPECIAL, K_BUTTON & BtnIndex, "", CurrBtn) Then
|
||||
m_ButtonList.Add(CurrBtn)
|
||||
End If
|
||||
Next
|
||||
@@ -191,6 +192,9 @@ Public Class ButtonItem
|
||||
Map.refProjectVM.PreExecScript(False)
|
||||
Map.refProjectVM.ExecScript(m_sLuaCmdPath, bRaiseEvent)
|
||||
m_sCurrBarName = Nothing
|
||||
' Carico se presenti le dimensioni della griglia
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "ManageLayer", 0, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
DynamicGridModule.RestoreDrawGridLayout(Map.refDrawOptionPanelV.DrawGrid, "Info", 1, If(IniFile.IsActivePlugin(), DynamicGridModule.PROJECT_DRAW_PLUGIN, DynamicGridModule.PROJECT_DRAW))
|
||||
End Sub
|
||||
|
||||
Private Shared Sub OnPreControllerExec(sFilePath As String) Handles m_ProjectVM.OnPreControllerExec
|
||||
|
||||
@@ -811,6 +811,7 @@ Public Class TopCommandBarVM
|
||||
Map.refDoorPanelVM.SetDoorPanelVisibility(IniFile.IsActiveDoors())
|
||||
Map.refWindowPanelVM.SetWindowPanelVisibility(IniFile.IsActiveWindow())
|
||||
Map.refTrimmingPanelVM.SetTrimmingPanelVisibility(IniFile.IsActiveTrimming())
|
||||
Map.refReversePostPanelVM.SetReversePostPanelVisibility(IniFile.IsActiveReversePost())
|
||||
Map.refGunStockPanelVM.SetGunStockPanelVisibility(IniFile.IsActiveGunStock())
|
||||
If Not IsNothing(Map.refDrawPanelVM) Then Map.refDrawPanelVM.SetDrawPanelVisibility(True)
|
||||
Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False)
|
||||
@@ -860,7 +861,8 @@ Public Class TopCommandBarVM
|
||||
Map.refBeamWallPanelVM.SetBeamWallPanelVisibility(False)
|
||||
Map.refDoorPanelVM.SetDoorPanelVisibility(IniFile.IsActiveDoors())
|
||||
Map.refWindowPanelVM.SetWindowPanelVisibility(False)
|
||||
Map.refTrimmingPanelVM.SettrimmingPanelVisibility(False)
|
||||
Map.refTrimmingPanelVM.SetTrimmingPanelVisibility(False)
|
||||
Map.refReversePostPanelVM.SetReversePostPanelVisibility(False)
|
||||
Map.refGunStockPanelVM.SetGunStockPanelVisibility(False)
|
||||
If Not IsNothing(Map.refDrawPanelVM) Then Map.refDrawPanelVM.SetDrawPanelVisibility(False)
|
||||
Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(IniFile.m_bMachiningGroup)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<local:DoorPanelV DataContext="{StaticResource DoorsPanelViewModel}"/>
|
||||
<local:WindowPanelV DataContext="{StaticResource WindowPanelViewModel}"/>
|
||||
<local:TrimmingPanelV DataContext="{StaticResource TrimmingPanelViewModel}"/>
|
||||
<local:TrimmingPanelV DataContext="{StaticResource ReversePostPanelViewModel}"/>
|
||||
<local:ReversePostPanelV DataContext="{StaticResource ReversePostPanelViewModel}"/>
|
||||
<local:GunStockPanelV DataContext="{StaticResource GunStockPanelViewModel}"/>
|
||||
<local:SpecialPanelV DataContext="{StaticResource SpecialPanelViewModel}"/>
|
||||
|
||||
|
||||
@@ -76,6 +76,20 @@ Module Analyze
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Function CreateTriaNormal( nId As Integer, nT As Integer) As Boolean
|
||||
'If m_AnaGrpId = GDB_ID.NULL Then Return False
|
||||
'Dim bEnMod As Boolean = EgtGetEnableModified()
|
||||
'EgtDisableModified()
|
||||
'Dim ptC As Point3d
|
||||
'Dim vtN As Vector3d
|
||||
'If EgtSurfTmTriangleNormVersor( nId, nT, GDB_ID.ROOT, ptC, vtN) Then
|
||||
' Dim nNormId As Integer = EgtCreateGeoVector( m_AnaGrpId, 50 * vtN, ptC, GDB_RT.GLOB)
|
||||
' EgtSetColor( nNormId, New Color3d( 255, 0,0))
|
||||
'End If
|
||||
'If bEnMod Then EgtEnableModified()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean
|
||||
If m_AnaGrpId = GDB_ID.NULL Then Return False
|
||||
Dim bEnMod As Boolean = EgtGetEnableModified()
|
||||
@@ -149,4 +163,30 @@ Module Analyze
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Function CreateSBzPointNormalAndTangents( nId As Integer, ptBez As Point3d, ByRef dU As Double, ByRef dV As Double) As Boolean
|
||||
If m_AnaGrpId = GDB_ID.NULL Then Return False
|
||||
Dim bEnMod As Boolean = EgtGetEnableModified()
|
||||
EgtDisableModified()
|
||||
|
||||
Dim bOk As Boolean = EgtSurfBezParamsFromPoint( nId, ptBez, m_AnaGrpId, dU, dV)
|
||||
|
||||
If bEnMod Then EgtEnableModified()
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Function CreateSBzIsoParam( nId As Integer, ByRef dU As Double, ByRef dV As Double) As Boolean
|
||||
If m_AnaGrpId = GDB_ID.NULL Then Return False
|
||||
Dim bEnMod As Boolean = EgtGetEnableModified()
|
||||
EgtDisableModified()
|
||||
Dim nIdCrv As Integer = EgtSurfBezierGetCurveU( nId, dV, m_AnaGrpId)
|
||||
EgtSetColor( nIdCrv, New Color3d(128,128,255))
|
||||
Dim bOk As Boolean = nIdCrv <> GDB_ID.NULL
|
||||
nIdCrv = EgtSurfBezierGetCurveV( nId, dU, m_AnaGrpId)
|
||||
bOk = bOk And nIdCrv <> GDB_ID.NULL
|
||||
EgtSetColor( nIdCrv, New Color3d(255,128,128))
|
||||
|
||||
If bEnMod Then EgtEnableModified()
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
+22
-3
@@ -41,8 +41,6 @@
|
||||
<EgtCAM5:ReversePostPanelVM x:Key="ReversePostPanelViewModel"/>
|
||||
<EgtCAM5:GunStockPanelVM x:Key="GunStockPanelViewModel"/>
|
||||
<EgtCAM5:MyMachGroupPanelVM x:Key="MachGroupPanelViewModel"/>
|
||||
<!--<EgtCAM5:MachGroupPanelVM x:Key="MachGroupPanelViewModel"/>-->
|
||||
<!--<EgtCAM5:OperationExpanderVM x:Key="OperationExpanderViewModel"/>-->
|
||||
|
||||
<!--
|
||||
This template applies a StatusBarView to an instance
|
||||
@@ -144,6 +142,13 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PreviewTool_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="Width" Value="30"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
<Setter Property="IsDefault" Value="True"/>
|
||||
</Style>
|
||||
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Expander Style -->
|
||||
@@ -1270,9 +1275,12 @@
|
||||
<!-- Style Slider -->
|
||||
|
||||
<Style x:Key="SliderValue_Slider" TargetType="{x:Type Slider}">
|
||||
<Setter Property="Width" Value="235"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Width" Value="Auto"/>
|
||||
<Setter Property="SmallChange" Value="1"/>
|
||||
<Setter Property="TickPlacement" Value="TopLeft"/>
|
||||
<Setter Property="Margin" Value="1,2,0,2"/>
|
||||
<Setter Property="IsSnapToTickEnabled" Value="False"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.5"/>
|
||||
@@ -1315,4 +1323,15 @@
|
||||
<Setter Property="CornerRadius" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- Style GridSplitter-->
|
||||
|
||||
<Style x:Key="General_GridSplitter" TargetType="{x:Type GridSplitter}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Bottom"/>
|
||||
<Setter Property="Height" Value="5"/>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Module DynamicGridModule
|
||||
|
||||
Friend Const PROJECT_EGTCAM5 As String = "Project_EgtCAM5"
|
||||
Friend Const PROJECT_EGTCAM5_PLUGIN As String = "Project_EgtCAM5_PlugIn"
|
||||
|
||||
Friend Const PROJECT_MACHINING As String = "Project_Machinig"
|
||||
Friend Const PROJECT_MACHINING_PLUGIN As String = "Project_Machinig_PlugIn"
|
||||
|
||||
Friend Const PROJECT_DRAW As String = "Project_Draw"
|
||||
Friend Const PROJECT_DRAW_PLUGIN As String = "Project_Draw_PlugIn"
|
||||
|
||||
''' <summary>
|
||||
''' Funzione per popolare la griglia
|
||||
''' </summary>
|
||||
''' <param name="m_TopTrayV"></param>
|
||||
''' <param name="m_LeftTrayV"></param>
|
||||
''' <param name="m_RightTrayV"></param>
|
||||
''' <param name="m_BottomTrayV"></param>
|
||||
''' <param name="m_SceneContentControlV"></param>
|
||||
''' <param name="gridSplitter"></param>
|
||||
Friend Sub PopulateGrid(m_TopTrayV As TopTrayV, m_LeftTrayV As LeftTrayV, m_RightTrayV As RightTrayV, m_BottomTrayV As BottomTrayV, m_SceneContentControlV As SceneContentControlV, gridSplitter As GridSplitter)
|
||||
' aggiungo TopTrayV
|
||||
Grid.SetRow(m_TopTrayV, 0)
|
||||
Grid.SetColumnSpan(m_TopTrayV, 3)
|
||||
|
||||
' aggiungo LeftTrayV
|
||||
Grid.SetRow(m_LeftTrayV, 1)
|
||||
Grid.SetColumn(m_LeftTrayV, 0)
|
||||
|
||||
' aggiungo RightTrayV
|
||||
Grid.SetRow(m_RightTrayV, 1)
|
||||
Grid.SetColumn(m_RightTrayV, 2)
|
||||
|
||||
'aggiungo gridSplitter
|
||||
Grid.SetRow(gridSplitter, 1)
|
||||
Grid.SetColumn(gridSplitter, 2)
|
||||
|
||||
' aggiungo BottomTrayV
|
||||
Grid.SetRow(m_BottomTrayV, 2)
|
||||
Grid.SetColumn(m_BottomTrayV, 1)
|
||||
|
||||
' aggiungo Scena
|
||||
Grid.SetRow(m_SceneContentControlV, 1)
|
||||
Grid.SetColumn(m_SceneContentControlV, 1)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione per popolare la griglia con PlugIn
|
||||
''' </summary>
|
||||
''' <param name="m_TopTrayV"></param>
|
||||
''' <param name="m_RightTrayV"></param>
|
||||
''' <param name="m_BottomTrayV"></param>
|
||||
''' <param name="m_SceneContentControlV"></param>
|
||||
''' <param name="gridSplitter"></param>
|
||||
Friend Sub PopolateGridWithPlugIn(m_TopTrayV As TopTrayV, m_RightTrayV As RightTrayV, m_BottomTrayV As BottomTrayV, m_SceneContentControlV As SceneContentControlV, gridSplitter As GridSplitter)
|
||||
' aggiungo TopTrayV
|
||||
Grid.SetRow(m_TopTrayV, 0)
|
||||
Grid.SetColumn(m_TopTrayV, 1)
|
||||
|
||||
' aggiungo RightTrayV
|
||||
Grid.SetRow(m_RightTrayV, 0)
|
||||
Grid.SetColumn(m_RightTrayV, 2)
|
||||
|
||||
'aggiungo gridSplitter
|
||||
Grid.SetRow(gridSplitter, 0)
|
||||
Grid.SetColumn(gridSplitter, 2)
|
||||
|
||||
' aggiungo BottomTrayV
|
||||
Grid.SetRow(m_BottomTrayV, 2)
|
||||
Grid.SetColumn(m_BottomTrayV, 1)
|
||||
|
||||
' aggiungo Scena
|
||||
Grid.SetRow(m_SceneContentControlV, 1)
|
||||
Grid.SetColumn(m_SceneContentControlV, 1)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creazione GridSplitter
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Friend Function CreateGridSplitter() As GridSplitter
|
||||
' creo gridsplitter
|
||||
Dim gridSplitter As New GridSplitter With {
|
||||
.Width = 30,
|
||||
.HorizontalAlignment = HorizontalAlignment.Left,
|
||||
.VerticalAlignment = VerticalAlignment.Stretch,
|
||||
.Background = Brushes.Transparent
|
||||
}
|
||||
AddHandler gridSplitter.DragCompleted,
|
||||
Sub()
|
||||
SaveGridLayout(If(IsActivePlugin(), PROJECT_EGTCAM5_PLUGIN, PROJECT_EGTCAM5))
|
||||
End Sub
|
||||
|
||||
Return gridSplitter
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Creazione Griglia Dinamica
|
||||
''' </summary>
|
||||
Friend Sub CreateDynamicGrid()
|
||||
' creo colonne griglia dinamica
|
||||
Dim gridCol1 As New ColumnDefinition With {
|
||||
.Width = New GridLength(1, GridUnitType.Auto)
|
||||
}
|
||||
Dim gridCol2 As New ColumnDefinition With {
|
||||
.Width = New GridLength(1, GridUnitType.Star)
|
||||
}
|
||||
Dim gridCol3 As New ColumnDefinition With {
|
||||
.Width = New GridLength(250),
|
||||
.MinWidth = 150
|
||||
}
|
||||
' aggiungo le colonne alla griglia
|
||||
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol1)
|
||||
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol2)
|
||||
Map.refProjectVM.DynamicGrid.ColumnDefinitions.Add(gridCol3)
|
||||
|
||||
' creo righe griglia dinamica
|
||||
Dim gridRow1 As New RowDefinition With {
|
||||
.Height = New GridLength(1, GridUnitType.Auto)
|
||||
}
|
||||
Dim gridRow2 As New RowDefinition With {
|
||||
.Height = New GridLength(1, GridUnitType.Star)
|
||||
}
|
||||
Dim gridRow3 As New RowDefinition With {
|
||||
.Height = New GridLength(1, GridUnitType.Auto)
|
||||
}
|
||||
' aggiungo righe alla griglia
|
||||
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow1)
|
||||
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow2)
|
||||
Map.refProjectVM.DynamicGrid.RowDefinitions.Add(gridRow3)
|
||||
End Sub
|
||||
|
||||
Friend Sub SaveGridLayout(GridTitle As String)
|
||||
Dim Index As Integer = 0
|
||||
|
||||
' Salvo colonna 2
|
||||
Dim valueCol2 As String = 0 & "," & 0 & "," & Map.refProjectVM.DynamicGrid.ColumnDefinitions(2).ActualWidth.ToString()
|
||||
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueCol2, Map.refMainWindowVM.DimensionDir)
|
||||
|
||||
Index = 1
|
||||
For i As Integer = 1 To Map.refProjectVM.DynamicGrid.RowDefinitions.Count - 1
|
||||
Dim row = Map.refProjectVM.DynamicGrid.RowDefinitions(i)
|
||||
Dim value As String = i.ToString() & "," & 1 & "," & row.ActualHeight.ToString()
|
||||
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), value, Map.refMainWindowVM.DimensionDir)
|
||||
Index += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Sub RestoreGridLayout(GridTitle As String)
|
||||
Dim Index As Integer = 0
|
||||
Dim IndexRow As Integer = 1
|
||||
Dim sValue = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir) > 0
|
||||
Dim sValueParams() As String = sValue.Split(","c)
|
||||
If sValueParams.Count >= 3 Then
|
||||
' cancello spazi
|
||||
For I As Integer = 0 To sValueParams.Count - 1
|
||||
sValueParams(I) = sValueParams(I).Trim()
|
||||
Next
|
||||
' creo valore
|
||||
Dim nDimType As Integer
|
||||
Dim GridLenValue As Double
|
||||
Integer.TryParse(sValueParams(1), nDimType)
|
||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||
If nDimType = 0 Then
|
||||
Map.refProjectVM.DynamicGrid.ColumnDefinitions(2).Width = New GridLength(GridLenValue, GridUnitType.Pixel)
|
||||
Else
|
||||
Map.refProjectVM.DynamicGrid.RowDefinitions(IndexRow).Height = If(GridLenValue = 0, New GridLength(1, GridUnitType.Auto), New GridLength(GridLenValue, GridUnitType.Star))
|
||||
IndexRow += 1
|
||||
End If
|
||||
End If
|
||||
Index += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Friend Sub SaveMachiningGridLayout(MachGrid As Grid, GridTitle As String)
|
||||
Dim Index As Integer = 0
|
||||
' Salvo riga 0
|
||||
Dim valueRow As String = Index & "," & Index & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
|
||||
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
|
||||
End Sub
|
||||
|
||||
Friend Sub RestoreMachiningGridLayout(MachGrid As Grid, GridTitle As String)
|
||||
Dim Index As Integer = 0
|
||||
Dim sValue = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir) > 0
|
||||
Dim sValueParams() As String = sValue.Split(","c)
|
||||
If sValueParams.Count >= 3 Then
|
||||
' cancello spazi
|
||||
For I As Integer = 0 To sValueParams.Count - 1
|
||||
sValueParams(I) = sValueParams(I).Trim()
|
||||
Next
|
||||
' creo valore
|
||||
Dim GridLenValue As Double
|
||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||
MachGrid.RowDefinitions(0).Height = New GridLength(GridLenValue)
|
||||
End If
|
||||
Index += 1
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Friend Sub SaveDrawGridLayout(MachGrid As Grid, RowId As String, GridTitle As String)
|
||||
Dim Index As Integer = 0
|
||||
Dim valueRow As String = String.Empty
|
||||
' Salvo riga 0
|
||||
If RowId = "ManageLayer" Then
|
||||
valueRow = Index & "," & Index & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
|
||||
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
|
||||
Else
|
||||
Index = 1
|
||||
valueRow = Index & "," & 0 & "," & MachGrid.RowDefinitions(Index).ActualHeight.ToString()
|
||||
EgtUILib.WritePrivateProfileString(GridTitle, Index.ToString(), valueRow, Map.refMainWindowVM.DimensionDir)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub RestoreDrawGridLayout(MachGrid As Grid, RowId As String, Index As Integer, GridTitle As String)
|
||||
Dim sValue = String.Empty
|
||||
EgtUILib.GetPrivateProfileString(GridTitle, Index.ToString(), String.Empty, sValue, Map.refMainWindowVM.DimensionDir)
|
||||
Dim sValueParams() As String = sValue.Split(","c)
|
||||
If sValueParams.Count >= 3 Then
|
||||
' cancello spazi
|
||||
For I As Integer = 0 To sValueParams.Count - 1
|
||||
sValueParams(I) = sValueParams(I).Trim()
|
||||
Next
|
||||
' creo valore
|
||||
Dim GridLenValue As Double
|
||||
StringToDoubleAdv(sValueParams(2), GridLenValue)
|
||||
If RowId = "ManageLayer" Then
|
||||
MachGrid.RowDefinitions(0).Height = New GridLength(GridLenValue)
|
||||
Else
|
||||
MachGrid.RowDefinitions(1).Height = New GridLength(GridLenValue)
|
||||
End If
|
||||
Else
|
||||
If RowId = "ManageLayer" Then
|
||||
MachGrid.RowDefinitions(0).Height = New GridLength(400)
|
||||
Else
|
||||
MachGrid.RowDefinitions(1).Height = New GridLength(150)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
@@ -38,6 +38,8 @@ Module Map
|
||||
Private m_refReversePostPanelVM As ReversePostPanelVM
|
||||
Private m_refGunStockPanelVM As GunStockPanelVM
|
||||
Private m_refMachiningParameterExpanderVM As MachiningParameterExpanderVM
|
||||
Private m_refMachiningOptionPanelV As MachiningOptionPanelV
|
||||
Private m_refDrawOptionPanelV As DrawOptionPanelV
|
||||
|
||||
#Region "Get"
|
||||
|
||||
@@ -171,6 +173,11 @@ Module Map
|
||||
Return m_refTrimmingPanelVM
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property refReversePostPanelVM As ReversePostPanelVM
|
||||
Get
|
||||
Return m_refReversePostPanelVM
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property refSpecialPanelVM As SpecialPanelVM
|
||||
Get
|
||||
Return m_refSpecialPanelVM
|
||||
@@ -206,6 +213,16 @@ Module Map
|
||||
Return m_refMachiningParameterExpanderVM
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property refMachiningOptionPanelV As MachiningOptionPanelV
|
||||
Get
|
||||
Return m_refMachiningOptionPanelV
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property refDrawOptionPanelV As DrawOptionPanelV
|
||||
Get
|
||||
Return m_refDrawOptionPanelV
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Get
|
||||
|
||||
@@ -344,6 +361,14 @@ Module Map
|
||||
m_refMachiningParameterExpanderVM = MachiningParameterExpanderVM
|
||||
Return Not IsNothing(m_refMachiningParameterExpanderVM)
|
||||
End Function
|
||||
Friend Function SetRefMachiningOptionPanelV(MachiningOptionPanelV As MachiningOptionPanelV) As Boolean
|
||||
m_refMachiningOptionPanelV = MachiningOptionPanelV
|
||||
Return Not IsNothing(m_refMachiningOptionPanelV)
|
||||
End Function
|
||||
Friend Function SetRefDrawOptionPanelV(DrawOptionPanelV As DrawOptionPanelV) As Boolean
|
||||
m_refDrawOptionPanelV = DrawOptionPanelV
|
||||
Return Not IsNothing(m_refDrawOptionPanelV)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
|
||||
@@ -122,6 +122,17 @@ Module SelData
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function GetSubFromId( nId As Integer, ByRef nSub As Integer) As Boolean
|
||||
For i As Integer = 0 To m_IdSub.Count() - 1
|
||||
If m_IdSub(i).m_nId = nId Then
|
||||
nSub = m_IdSub(i).m_nSub
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
nSub = -1
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function VerifySelGroup() As Boolean
|
||||
If m_SelGrpId <> GDB_ID.NULL Then Return True
|
||||
Dim bEnMod As Boolean = EgtGetEnableModified()
|
||||
|
||||
Reference in New Issue
Block a user