Compare commits

..

2 Commits

Author SHA1 Message Date
Demetrio Cassarino 7558449b06 Merge remote-tracking branch 'origin/master' into feature/Note_Utensile 2024-07-30 10:21:32 +02:00
Demetrio Cassarino c727e98f8f Merge remote-tracking branch 'origin/master' into feature/Note_Utensile 2024-07-23 10:06:55 +02:00
114 changed files with 1710 additions and 4951 deletions
+1 -19
View File
@@ -30,7 +30,7 @@ Public Class AboutBoxWndV
" Inst" & IniFile.m_nInstance.ToString() &
" Ulv" & IniFile.m_nUserLevel.ToString() & " Dbg" & Map.refMainWindowVM.DebugLevel().ToString() & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "SupportPlan " & sAssStatus & Environment.NewLine
sInfo &= "SupportPlane " & sAssStatus & Environment.NewLine
sInfo &= "DataRoot " & IniFile.m_sDataRoot & Environment.NewLine
If IniFile.m_ProjectMode <> ProjectModeOpt.ONLYDRAW Then
sInfo &= "MachinesRoot " & IniFile.m_sMachinesRoot & Environment.NewLine
@@ -70,24 +70,6 @@ Public Class AboutBoxWndV
IniFile.GetSpecialLuaVersion( IniFile.m_sDoorsDirPath, sVersion)
sInfo &= Environment.NewLine & "Doors ver. " & sVersion & " " & IniFile.m_sDoorsDirPath
End If
If IniFile.IsActiveWindow() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sWindowDirPath, sVersion)
sInfo &= Environment.NewLine & "Window ver. " & sVersion & " " & IniFile.m_sWindowDirPath
End If
If IniFile.IsActiveTrimming() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sTrimmingDirPath, sVersion)
sInfo &= Environment.NewLine & "Trimming ver. " & sVersion & " " & IniFile.m_sTrimmingDirPath
End If
If IniFile.IsActiveReversePost() Then
bExtensions = True
Dim sVersion As String = "---"
IniFile.GetSpecialLuaVersion( IniFile.m_sReversePostDirPath, sVersion)
sInfo &= Environment.NewLine & "ReversePost ver. " & sVersion & " " & IniFile.m_sReversePostDirPath
End If
If IniFile.IsActiveGunStock() Then
bExtensions = True
Dim sVersion As String = "---"
+4 -5
View File
@@ -31,8 +31,8 @@ Public Class TreeViewItemBase
End Set
End Property
Friend m_isExpanded As Boolean
Public Property IsExpanded As Boolean
Private m_isExpanded As Boolean
Public Property IsExpanded As Boolean
Get
Return m_isExpanded
End Get
@@ -92,7 +92,6 @@ Public Class InheritableTreeViewItem
Implements INotifyPropertyChanged
Friend m_Name As String
Public Property Name As String
Get
Return m_Name
@@ -196,6 +195,7 @@ Public Class ParentItem
Inherits TreeViewItemBase
Private m_sPictureString As String
Private m_Items As ObservableCollection(Of ChildItem)
Public Property PictureString As String
Get
@@ -209,7 +209,6 @@ Public Class ParentItem
End Set
End Property
Private m_Items As ObservableCollection(Of ChildItem)
Public Property Items As ObservableCollection(Of ChildItem)
Get
Return m_Items
@@ -256,4 +255,4 @@ Public Class ChildItem
MyBase.New(Name, IsSelected, IsExpanded, IsActive)
End Sub
End Class
End Class
@@ -13,7 +13,7 @@ Public Class BeamMachiningsWindowV
m_BeamMachiningsWindowVM = BeamMachiningsWindowVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.OnCloseWindow
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BeamMachiningsWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
+5 -25
View File
@@ -69,11 +69,10 @@ Module ConstIni
Public Const K_SHOWGFRAME As String = "ShowGFrame"
Public Const K_LINEWIDTH As String = "LineWidth"
Public Const K_MARK As String = "Mark"
Public Const K_MARK2 As String = "Mark2"
Public Const K_SELSURF As String = "SelSurf"
Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_CURVEDIR As String = "CurveDir"
Public Const K_SHOWSURFQUALITY As String = "ShowSurfQuality"
Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
Public Const K_SHOWZMAP As String = "ShowZmap"
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
Public Const K_ZOOMWIN As String = "ZoomWin"
@@ -105,15 +104,11 @@ Module ConstIni
Public Const S_IMPORT As String = "Import"
Public Const K_DXFSCALE As String = "DxfScale"
Public Const K_STLSCALE As String = "StlScale"
Public Const K_OFFSCALE As String = "OffScale"
Public Const K_PLYSCALE As String = "PlyScale"
Public Const K_IMGSCALE As String = "ImgScale"
Public Const K_CNCFLAG As String = "CncFlag"
Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_BTLAUXDIR As String = "BtlAuxDir"
Public Const K_3MFFLAG As String = "3mfFlag"
Public Const K_ADVFLAG As String = "AdvFlag"
Public Const K_ADVTOLER As String = "AdvToler"
Public Const S_EXPORT As String = "Export"
Public Const K_DXFFLAG As String = "DxfFlag"
@@ -144,6 +139,10 @@ Module ConstIni
Public Const K_BEAMWALLBASEDIR As String = "BaseDir"
Public Const K_BEAMWALLBUTTON As String = "Button"
Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_ENABLE As String = "Enable"
Public Const K_3PRNBASEDIR As String = "BaseDir"
Public Const S_DOORS As String = "Doors"
Public Const K_DDFENABLE As String = "DdfEnable"
Public Const K_BASEDIR As String = "BaseDir"
@@ -155,22 +154,6 @@ Module ConstIni
Public Const K_TABLESDIR As String = "TablesDir"
Public Const K_CURRMTABLE As String = "CurrMTable"
Public Const K_MTABLEWINPLACE As String = "MTableWinPlace"
Public Const K_OPTIMIZEMACHFORLINE As String = "OptimizeMachForLine"
Public Const S_WINDOW As String = "Window"
Public Const K_WINDOWENABLE As String = "JwdEnable"
Public Const K_WINDOWBASEDIR As String = "BaseDir"
Public Const K_WINDOWBUTTON As String = "Button"
Public Const S_TRIMMING As String = "Trimming"
Public Const K_TRIMMINGENABLE As String = "TrimEnable"
Public Const K_TRIMMINGBASEDIR As String = "BaseDir"
Public Const K_TRIMMINGBUTTON As String = "Button"
Public Const S_REVERSEPOST As String = "ReversePost"
Public Const K_REVERSEPOSTENABLE As String = "RevEnable"
Public Const K_REVERSEPOSTBASEDIR As String = "BaseDir"
Public Const K_REVERSEPOSTBUTTON As String = "Button"
Public Const S_GUNSTOCK As String = "GunStock"
Public Const K_GUNSTOCKENABLE As String = "GsEnable"
@@ -200,8 +183,6 @@ Module ConstIni
Public Const K_SELGEOMSURFFINISHING As String = "SelGeomSurfFinishing"
Public Const K_SELGEOMSURFROUGHING As String = "SelGeomSurfRoughing"
Public Const K_SELGEOMFIVEAXMILLING As String = "SelGeomFiveAxMilling"
Public Const K_SELGEOMPROBING As String = "SelGeomProbing"
Public Const K_VMILLQUALITY As String = "VMillQuality"
Public Const K_MACHININGGROUP As String = "MachiningGroup"
Public Const K_SHOWONLYTABLE As String = "ShowOnlyTable"
Public Const K_MOVETHROUGHDISPS As String = "MoveThroughDisps"
@@ -210,7 +191,6 @@ Module ConstIni
Public Const S_SIMUL As String = "Simul"
Public Const K_SLIDERX As String = "SliderX"
Public Const K_SLIDERVAL As String = "SliderVal"
Public Const K_TRACEENABLE As String = "TraceEnable"
Public Const S_OPTIONS As String = "Options"
Public Const K_NEWMACHININGISLASTONE As String = "NewMachiningIsLastOne"
+14 -19
View File
@@ -1,13 +1,6 @@
Module ConstMachIni
Public Const S_MCH_GENERAL As String = "General"
Public Const K_MATERIAL As String = "Material"
Public Const S_PARTPROGRAM As String = "PartProgram"
Public Const K_EXTENSION As String = "Extension"
Public Const S_TOOLS As String = "Tools"
Public Const K_PROBE As String = "Probe"
Public Const K_DRILLBIT As String = "Drillbit"
Public Const K_SAWBLADE As String = "Sawblade"
Public Const K_MILL As String = "Mill"
@@ -15,17 +8,22 @@
Public Const K_CHISEL As String = "Chisel"
Public Const K_WATERJET As String = "WaterJet"
Public Const K_COMPO As String = "Compo"
Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger"
Public Const K_SHOWHEADEXIT As String = "ShowHeadExit"
Public Const K_DRILLHOLDER As String = "DrillHolder"
Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder"
Public Const K_MILLHOLDER As String = "MillHolder"
Public Const K_DRILLMAKER As String = "DrillMaker"
Public Const K_SAWBLADEMAKER As String = "SawbladeMaker"
Public Const K_MILLMAKER As String = "MillMaker"
Public Const K_MORTISEMAKER As String = "MortiseMaker"
Public Const K_CHISELMAKER As String = "ChiselMaker"
Public Const K_MOUNTEDTOOLCONFIG As String = "MountedToolConfig"
Public Const K_ACTIVE As String = "Active"
Public Const S_TOOLHOLDER As String = "ToolHolder"
Public Const S_MACHININGS As String = "Machinings"
Public Const K_PROBING As String = "Probing"
Public Const K_SAWING As String = "Sawing"
Public Const K_DRILLING As String = "Drilling"
Public Const K_MILLING As String = "Milling"
@@ -39,12 +37,18 @@
Public Const K_SURFFINISHING As String = "SurfFinishing"
Public Const K_5AXMILLING As String = "5AxMilling"
Public Const K_WATERJETTING As String = "WaterJetting"
Public Const K_SAWINGONARCS As String = "SawingOnArcs"
Public Const S_GENMACHINING As String = "GenMachining"
Public Const K_GENSCRIPT As String = "GenScript"
Public Const S_5AXMILLING As String = "5AxMilling"
Public Const K_5AXSCRIPT As String = "5AxScript"
Public Const S_TOOLCHANGER As String = "ToolChanger"
Public Const K_NUMBER As String = "Number"
Public Const K_POS As String = "Pos"
Public Const K_NAME As String = "Name"
Public Const K_MANUALNUMBER As String = "ManualNumber"
Public Const K_MANUALPOS As String = "ManualPos"
Public Const K_MANUALNAME As String = "ManualName"
Public Const S_DISPOSITION As String = "Disposition"
Public Const K_DISP_INITSCRIPT As String = "InitScript"
@@ -64,16 +68,7 @@
Public Const S_VMILL As String = "VMill"
Public Const K_VM_ENABLE As String = "Enable"
Public Const S_TOOLTRACE As String = "ToolTrace"
Public Const K_TT_ENABLE As String = "Enable"
Public Const S_ESTIMATIONS As String = "Estimations"
Public Const K_EST_ENABLE As String = "Enable"
' Tipi di materiali previsti attualmente per le macchine
Public Const MCH_MAT_STONE As String = "Stone"
Public Const MCH_MAT_WOOD As String = "Wood"
Public Const MCH_MAT_BEAM As String = "Beam"
Public Const MCH_MAT_ADDITIVE As String = "Additive"
End Module
+1 -1
View File
@@ -11,7 +11,7 @@
m_CurrSetUpVM = CurrSetUpVM
End Sub
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpDbVM.OnCloseWindow
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpDbVM.m_CloseWindow
' Me.DialogResult = bDialogResult
'End Sub
@@ -1,4 +0,0 @@
Public Interface IListItemConverter
Function Convert(ByVal masterListItem As Object) As Object
Function ConvertBack(ByVal targetListItem As Object) As Object
End Interface
@@ -1,80 +0,0 @@
Imports System.Windows.Controls.Primitives
Imports System.ComponentModel
Public Class MultiSelectorBehaviours
Public Shared ReadOnly SynchronizedSelectedItemsProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizedSelectedItems", GetType(IList), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing, AddressOf OnSynchronizedSelectedItemsChanged))
Public Shared ReadOnly SynchronizationManagerProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizationManager", GetType(SynchronizationManager), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing))
Public Shared Function GetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject) As IList
Return CType(dependencyObject.GetValue(SynchronizedSelectedItemsProperty), IList)
End Function
Public Shared Sub SetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject, ByVal value As IList)
dependencyObject.SetValue(SynchronizedSelectedItemsProperty, value)
End Sub
Private Shared Function GetSynchronizationManager(ByVal dependencyObject As DependencyObject) As SynchronizationManager
Return CType(dependencyObject.GetValue(SynchronizationManagerProperty), SynchronizationManager)
End Function
Private Shared Sub SetSynchronizationManager(ByVal dependencyObject As DependencyObject, ByVal value As SynchronizationManager)
dependencyObject.SetValue(SynchronizationManagerProperty, value)
End Sub
Private Shared Sub OnSynchronizedSelectedItemsChanged(ByVal dependencyObject As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
If e.OldValue IsNot Nothing Then
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
synchronizer.StopSynchronizing()
SetSynchronizationManager(dependencyObject, Nothing)
End If
Dim list As IList = TryCast(e.NewValue, IList)
Dim selector As Selector = TryCast(dependencyObject, Selector)
If list IsNot Nothing AndAlso selector IsNot Nothing Then
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
If synchronizer Is Nothing Then
synchronizer = New SynchronizationManager(selector)
SetSynchronizationManager(dependencyObject, synchronizer)
End If
synchronizer.StartSynchronizingList()
End If
End Sub
Private Class SynchronizationManager
Private ReadOnly _multiSelector As Selector
Private _synchronizer As TwoListSynchronizer
Friend Sub New(ByVal selector As Selector)
_multiSelector = selector
End Sub
Public Sub StartSynchronizingList()
Dim list As IList = GetSynchronizedSelectedItems(_multiSelector)
If list IsNot Nothing Then
_synchronizer = New TwoListSynchronizer(GetSelectedItemsCollection(_multiSelector), list)
_synchronizer.StartSynchronizing()
End If
End Sub
Public Sub StopSynchronizing()
_synchronizer.StopSynchronizing()
End Sub
Public Shared Function GetSelectedItemsCollection(ByVal selector As Selector) As IList
If TypeOf selector Is MultiSelector Then
Return (TryCast(selector, MultiSelector)).SelectedItems
ElseIf TypeOf selector Is ListBox Then
Return (TryCast(selector, ListBox)).SelectedItems
Else
Throw New InvalidOperationException("Target object has no SelectedItems property to bind.")
End If
End Function
End Class
End Class
@@ -1,163 +0,0 @@
Imports System.Collections.Specialized
Public Class TwoListSynchronizer
Implements IWeakEventListener
Private Shared ReadOnly DefaultConverter As IListItemConverter = New DoNothingListItemConverter()
Private ReadOnly _masterList As IList
Private ReadOnly _masterTargetConverter As IListItemConverter
Private ReadOnly _targetList As IList
Public Sub New(ByVal masterList As IList, ByVal targetList As IList, ByVal masterTargetConverter As IListItemConverter)
_masterList = masterList
_targetList = targetList
_masterTargetConverter = masterTargetConverter
End Sub
Public Sub New(ByVal masterList As IList, ByVal targetList As IList)
Me.New(masterList, targetList, DefaultConverter)
End Sub
Private Delegate Sub ChangeListAction(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
Public Sub StartSynchronizing()
ListenForChangeEvents(_masterList)
ListenForChangeEvents(_targetList)
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
If Not TargetAndMasterCollectionsAreEqual() Then
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Public Sub StopSynchronizing()
StopListeningForChangeEvents(_masterList)
StopListeningForChangeEvents(_targetList)
End Sub
Public Function ReceiveWeakEvent(ByVal managerType As Type, ByVal sender As Object, ByVal e As EventArgs) As Boolean Implements IWeakEventListener.ReceiveWeakEvent
HandleCollectionChanged(TryCast(sender, IList), TryCast(e, NotifyCollectionChangedEventArgs))
Return True
End Function
Protected Sub ListenForChangeEvents(ByVal list As IList)
If TypeOf list Is INotifyCollectionChanged Then
CollectionChangedEventManager.AddListener(TryCast(list, INotifyCollectionChanged), Me)
End If
End Sub
Protected Sub StopListeningForChangeEvents(ByVal list As IList)
If TypeOf list Is INotifyCollectionChanged Then
CollectionChangedEventManager.RemoveListener(TryCast(list, INotifyCollectionChanged), Me)
End If
End Sub
Private Sub AddItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
Dim itemCount As Integer = e.NewItems.Count
For i As Integer = 0 To itemCount - 1
Dim insertionPoint As Integer = e.NewStartingIndex + i
If insertionPoint > list.Count Then
list.Add(converter(e.NewItems(i)))
Else
list.Insert(insertionPoint, converter(e.NewItems(i)))
End If
Next
End Sub
Private Function ConvertFromMasterToTarget(ByVal masterListItem As Object) As Object
Return If(_masterTargetConverter Is Nothing, masterListItem, _masterTargetConverter.Convert(masterListItem))
End Function
Private Function ConvertFromTargetToMaster(ByVal targetListItem As Object) As Object
Return If(_masterTargetConverter Is Nothing, targetListItem, _masterTargetConverter.ConvertBack(targetListItem))
End Function
Private Sub HandleCollectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
Dim sourceList As IList = TryCast(sender, IList)
Select Case e.Action
Case NotifyCollectionChangedAction.Add
PerformActionOnAllLists(AddressOf AddItems, sourceList, e)
Case NotifyCollectionChangedAction.Move
PerformActionOnAllLists(AddressOf MoveItems, sourceList, e)
Case NotifyCollectionChangedAction.Remove
PerformActionOnAllLists(AddressOf RemoveItems, sourceList, e)
Case NotifyCollectionChangedAction.Replace
PerformActionOnAllLists(AddressOf ReplaceItems, sourceList, e)
Case NotifyCollectionChangedAction.Reset
UpdateListsFromSource(TryCast(sender, IList))
Case Else
End Select
End Sub
Private Sub MoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
RemoveItems(list, e, converter)
AddItems(list, e, converter)
End Sub
Private Sub PerformActionOnAllLists(ByVal action As ChangeListAction, ByVal sourceList As IList, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs)
If sourceList Is _masterList Then
PerformActionOnList(_targetList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
Else
PerformActionOnList(_masterList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Private Sub PerformActionOnList(ByVal list As IList, ByVal action As ChangeListAction, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
StopListeningForChangeEvents(list)
action(list, collectionChangedArgs, converter)
ListenForChangeEvents(list)
End Sub
Private Sub RemoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
If e.OldItems.Count = 1 AndAlso e.OldStartingIndex <= list.Count - 1 Then
list.RemoveAt(e.OldStartingIndex)
Else
For Each Item In e.OldItems
list.Remove(Item)
Next
End If
End Sub
Private Sub ReplaceItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
RemoveItems(list, e, converter)
AddItems(list, e, converter)
End Sub
Private Sub SetListValuesFromSource(ByVal sourceList As IList, ByVal targetList As IList, ByVal converter As Converter(Of Object, Object))
StopListeningForChangeEvents(targetList)
targetList.Clear()
For Each o As Object In sourceList
targetList.Add(converter(o))
Next
ListenForChangeEvents(targetList)
End Sub
Private Function TargetAndMasterCollectionsAreEqual() As Boolean
Return _masterList.Cast(Of Object)().SequenceEqual(_targetList.Cast(Of Object)().[Select](Function(item) ConvertFromTargetToMaster(item)))
End Function
Private Sub UpdateListsFromSource(ByVal sourceList As IList)
If sourceList Is _masterList Then
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
Else
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Friend Class DoNothingListItemConverter
Implements IListItemConverter
Public Function Convert(ByVal masterListItem As Object) As Object Implements IListItemConverter.Convert
Return masterListItem
End Function
Public Function ConvertBack(ByVal targetListItem As Object) As Object Implements IListItemConverter.ConvertBack
Return targetListItem
End Function
End Class
End Class
+6 -18
View File
@@ -34,11 +34,6 @@
Command="{Binding ArcCSECommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/ArcCSE.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Arc2PRToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding Arc2PRCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/Arc2PR.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Arc3PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding Arc3PCommand}" IsEnabled="{Binding bLayerOk}">
@@ -49,28 +44,21 @@
Command="{Binding ArcPDPCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/ArcPDP.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding BiArcToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding BiArcCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/BiArc.png" Stretch="Uniform"/>
</Button>
<Button Style="{StaticResource DrawPanelButton}"
Visibility="Hidden"/>
<Button ToolTip="{Binding CircleCPToolTip}" Style="{StaticResource DrawPanelButton}"
<Button ToolTip="{Binding CirclePDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCPCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCP.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding CircleCDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCDCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCD.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Circle3PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding Circle3PCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/Circle3P.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding CircleCDToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding CircleCDCommand}" IsEnabled="{Binding bLayerOk}">
<Image Source="/Resources/DrawPanel/CircleCD.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Rectangle2PToolTip}" Style="{StaticResource DrawPanelButton}"
ToolTipService.ShowOnDisabled="True"
Command="{Binding Rectangle2PCommand}" IsEnabled="{Binding bLayerOk}">
+2 -66
View File
@@ -50,7 +50,7 @@ Public Class DrawPanelVM
Return EgtMsg(MSG_DRAWPANEL + 3)
End Get
End Property
Public ReadOnly Property CircleCPToolTip As String
Public ReadOnly Property CirclePDToolTip As String
Get
Return EgtMsg(MSG_DRAWPANEL + 4)
End Get
@@ -72,25 +72,14 @@ Public Class DrawPanelVM
End Property
Public ReadOnly Property Arc3PToolTip As String
Get
Return EgtMsg(5207)
End Get
End Property
Public ReadOnly Property Arc2PRToolTip As String
Get
Return EgtMsg(5169)
Return EgtMsg(MSG_DRAWPANEL + 7)
End Get
End Property
Public ReadOnly Property ArcPDPToolTip As String
Get
Return EgtMsg(MSG_DRAWPANEL + 8)
End Get
End Property
Public ReadOnly Property BiArcToolTip As String
Get
Return EgtMsg(5170)
End Get
End Property
Public ReadOnly Property Rectangle2PToolTip As String
Get
Return EgtMsg(MSG_DRAWPANEL + 11)
@@ -481,9 +470,7 @@ Public Class DrawPanelVM
Private m_cmdCircle3P As ICommand
Private m_cmdArcCSE As ICommand
Private m_cmdArc3P As ICommand
Private m_cmdArc2PR As ICommand
Private m_cmdArcPDP As ICommand
Private m_cmdBiArc As ICommand
Private m_cmdRectangle2P As ICommand
Private m_cmdPolygon As ICommand
Private m_cmdPolygonSide As ICommand
@@ -761,29 +748,6 @@ Public Class DrawPanelVM
#End Region ' Arc3PCommand
#Region "Arc2PRCommand"
''' <summary>
''' Returns a command that do Arc2PR.
''' </summary>
Public ReadOnly Property Arc2PRCommand As ICommand
Get
If m_cmdArc2PR Is Nothing Then
m_cmdArc2PR = New RelayCommand(AddressOf Arc2PR)
End If
Return m_cmdArc2PR
End Get
End Property
''' <summary>
''' Execute the Arc2PR. This method is invoked by the Arc2PRCommand.
''' </summary>
Public Sub Arc2PR(ByVal param As Object)
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.ARC2PR)
End Sub
#End Region ' Arc2PRCommand
#Region "ArcPDPCommand"
''' <summary>
@@ -814,33 +778,6 @@ Public Class DrawPanelVM
#End Region ' ArcPDPCommand
#Region "BiArcCommand"
''' <summary>
''' Returns a command that do BiArc.
''' </summary>
Public ReadOnly Property BiArcCommand As ICommand
Get
If m_cmdBiArc Is Nothing Then
m_cmdBiArc = New RelayCommand(AddressOf BiArc)
End If
Return m_cmdBiArc
End Get
End Property
''' <summary>
''' Execute the BiArc. This method is invoked by the BiArcCommand.
''' </summary>
Public Sub BiArc(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.BIARC)
Else
Map.refProjectVM.GetController.ExecuteCommand(Controller.CMD.CURVEBEZIER)
End If
End Sub
#End Region ' BiArcCommand
#Region "Rectangle2PCommand"
''' <summary>
@@ -2219,7 +2156,6 @@ Public Class DrawPanelVM
If Not IniFile.m_ProjectSceneContext = 0 Then
bSelOk = EgtGetFirstSelectedObj() <> GDB_ID.NULL
bLayerOkAndSelOk = m_bLayerOk And m_bSelOk
Map.refStatusBarVM.UpdateSelectedCount()
End If
If Application.m_UpdateLayerTree Then
+1 -52
View File
@@ -161,13 +161,6 @@
<DependentUpon>CurrSetUpV.xaml</DependentUpon>
</Compile>
<Compile Include="CurrSetUp\CurrSetUpVM.vb" />
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
<Compile Include="ExecuteWindow\ExecuteWindowV.xaml.vb">
<DependentUpon>ExecuteWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="ExecuteWindow\ExecuteWindowVM.vb" />
<Compile Include="LeftTray\LeftTrayV.xaml.vb">
<DependentUpon>LeftTrayV.xaml</DependentUpon>
</Compile>
@@ -177,9 +170,6 @@
<DependentUpon>EstimationsExpanderV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningOptionPanel\EstimationsExpander\EstimationsExpander.vb" />
<Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\ProbingParameterExpanderV.xaml.vb">
<DependentUpon>ProbingParameterExpanderV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml.vb">
<DependentUpon>FiveAxisMachinigParameterExpanderV.xaml</DependentUpon>
</Compile>
@@ -293,20 +283,8 @@
<Compile Include="Special-BeamWall\WallPanelV.xaml.vb">
<DependentUpon>WallPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-BeamWall\Wall.vb" />
<Compile Include="Special-BeamWall\WallPanelVM.vb" />
<Compile Include="Special-ReversePost\ReversePostPanelV.xaml.vb">
<DependentUpon>ReversePostPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-ReversePost\ReversePostPanelVM.vb" />
<Compile Include="Special-Trimming\TrimmingPanelV.xaml.vb">
<DependentUpon>TrimmingPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-Trimming\TrimmingPanelVM.vb" />
<Compile Include="Special-Window\WindowPanelV.xaml.vb">
<DependentUpon>WindowPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="Special-Window\WindowPanelVM.vb" />
<Compile Include="Special-BeamWall\Wall.vb" />
<Compile Include="SpecialPanel\SpecialPanelV.xaml.vb">
<DependentUpon>SpecialPanelV.xaml</DependentUpon>
</Compile>
@@ -482,10 +460,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ExecuteWindow\ExecuteWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="LeftTray\LeftTrayV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -498,10 +472,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\ProbingParameterExpanderV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionPanel\MachiningOptionPanel\OperationExpander\MachiningParameterExpander\FiveAxisMachinigParameterExpanderV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -654,18 +624,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Special-ReversePost\ReversePostPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Special-Trimming\TrimmingPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Special-Window\WindowPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SpecialPanel\SpecialPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1077,15 +1035,6 @@
<ItemGroup>
<Resource Include="Resources\DrawPanel\StmMoveVertex.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\Arc2PR.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\BiArc.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ExecuteWindow\reload.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
+1 -1
View File
@@ -6,7 +6,7 @@
<StackPanel Orientation="Horizontal">
<Button Command="{Binding ExecCommand}" ToolTip="{Binding ExecToolTip}"
Style="{StaticResource GridViewPanelButton}" ContextMenuService.Placement="Bottom">
Style="{StaticResource GridViewPanelButton}" ContextMenuService.Placement="Bottom">
<Button.ContextMenu>
<ContextMenu ItemsSource="{Binding MruScriptNames}" ItemContainerStyle="{StaticResource MruScriptItem}">
</ContextMenu>
+2 -7
View File
@@ -65,13 +65,8 @@ Public Class ExecutePanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Exec(ByVal param As Object)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Dim ExecuteWindow As New ExecuteWindowV(Application.Current.MainWindow, New ExecuteWindowVM)
ExecuteWindow.ShowDialog()
Else
Map.refProjectVM.PreExecScript(True)
Map.refProjectVM.ExecScript(String.Empty)
End If
Map.refProjectVM.PreExecScript(True)
Map.refProjectVM.ExecScript(String.Empty)
End Sub
#End Region ' ExecCommand
-39
View File
@@ -1,39 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ExecuteWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="Execute Window"
Height="500" Width="400"
IsResizable="True"
IsMinimizable="False"
WindowStartupLocation="CenterOwner"
ShowInTaskbar="False"
TitleBarHeight="32"
PreviewKeyDown="EgtCustomWindow_PreviewKeyDown"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Text="{Binding sScriptText}"
Style="{StaticResource ExecuteWindow_TextBox}"/>
<Button Grid.Row="1"
Grid.ColumnSpan="2"
Content="{Binding OkMsg}"
Command="{Binding Ok_Command}"
Style="{StaticResource EgtCAM5_InputButton}"/>
<Button Grid.Column="1"
Command="{Binding Reload_Command}"
IsEnabled="{Binding bReload_IsEnable}"
Style="{StaticResource ExecuteWindow_Button}">
<Image Source="/Resources/ExecuteWindow/reload.png" Stretch="Uniform"/>
</Button>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
-32
View File
@@ -1,32 +0,0 @@
Public Class ExecuteWindowV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_ExecuteWindowVM As ExecuteWindowVM
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(Owner As Window, ExecuteWindowVM As ExecuteWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ExecuteWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ExecuteWindowVM = ExecuteWindowVM
End Sub
#End Region ' Constructor
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ExecuteWindowVM.OnCloseWindow
Me.DialogResult = bDialogResult
End Sub
Private Sub EgtCustomWindow_PreviewKeyDown(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
Me.Close()
End If
End Sub
End Class
-130
View File
@@ -1,130 +0,0 @@
Imports System.Text
Imports EgtUILib
Imports System.IO
Public Class ExecuteWindowVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
' Evento per chiusura finestra
Friend Event OnCloseWindow(bDialogResult As Boolean)
Private ReadOnly sScriptFilePath As String = Path.Combine(IniFile.m_sTempDir, "ImmExec" & IniFile.m_nInstance.ToString() & ".lua")
Private m_sScriptText As String
Public Property sScriptText As String
Get
Return m_sScriptText
End Get
Set(value As String)
m_sScriptText = value
NotifyPropertyChanged(NameOf(sScriptText))
End Set
End Property
Private Sub SetScriptFile(value As String)
m_sScriptText = value
NotifyPropertyChanged(NameOf(sScriptText))
End Sub
Private m_bReload_IsEnable As Boolean = File.Exists(sScriptFilePath)
Public ReadOnly Property bReload_IsEnable As Boolean
Get
Return m_bReload_IsEnable
End Get
End Property
#Region "Messages"
Public ReadOnly Property OkMsg As String
Get
Return EgtMsg(20041)
End Get
End Property
Public ReadOnly Property SaveMsg As String
Get
Return EgtMsg(6453)
End Get
End Property
#End Region ' Messages
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdReload As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub SaveScript(sPathFileScript As String, sScriptText As String)
If String.IsNullOrWhiteSpace(sPathFileScript) OrElse String.IsNullOrWhiteSpace(sScriptText) Then Return
File.WriteAllText(sPathFileScript, sScriptText, Encoding.UTF8)
End Sub
Private Function ReadScript(sPathFileScript As String) As String
If String.IsNullOrWhiteSpace(sPathFileScript) Then Return String.Empty
Return File.ReadAllText(sPathFileScript)
End Function
#End Region ' Methods
#Region "COMMANDS"
#Region "Ok_Command"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
' Verifico ci sia del testo
If String.IsNullOrWhiteSpace(m_sScriptText) Then Return
' Salva il file script
SaveScript(sScriptFilePath, m_sScriptText)
' Esegue il file script
Map.refProjectVM.PreExecScript(False)
Map.refProjectVM.ExecScript(sScriptFilePath)
' Se non passato a lavorazione, aggiornamento visualizzazione
If IniFile.m_ProjectMode <> ProjectModeOpt.MACHINING Then EgtDraw()
' Chiudo finestra
RaiseEvent OnCloseWindow(True)
End Sub
#End Region ' Ok_Command
#Region "Reload_Command"
Public ReadOnly Property Reload_Command As ICommand
Get
If m_cmdReload Is Nothing Then
m_cmdReload = New Command(AddressOf Reload)
End If
Return m_cmdReload
End Get
End Property
Public Sub Reload()
If File.Exists(sScriptFilePath) Then
SetScriptFile(ReadScript(sScriptFilePath))
End If
End Sub
#End Region ' Reload_Command
#End Region ' Commands
End Class
+13 -15
View File
@@ -2,6 +2,7 @@
Imports System.IO
Imports EgtCAM5.MyMachinePanelVM
Imports System.Security.Cryptography
Imports System.Windows.Forms.AxHost
Imports EgtUILib
Imports EgtWPFLib5
@@ -97,23 +98,20 @@ Public Class MyMachGroupPanelVM
' Vuoi creare un nuovo Gruppo di Lavoro con i pezzi selezionati ? - LAVORA
If MessageBox.Show(EgtMsg(5552), EgtMsg(5002), MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Return If(AddNewMachGroup(nGroupId, vPart), 0, 1)
Else
Else
Return -2
End If
End If
' Se non ci sono pezzi selezionati
' Se non ci sono pezzi selezionati
Else
' se ci sono gruppi di lavorazione
If bMachGroup Then
nGroupId = EgtGetCurrMachGroup()
If nGroupId = GDB_ID.NULL Then
nGroupId = EgtGetFirstMachGroup()
End If
nGroupId = EgtGetLastMachGroup()
Return If(EgtSetCurrMachGroup(nGroupId), 0, 1)
' se altrimenti ammessi gruppi di lavoro vuoti
' se altrimenti ammessi gruppi di lavoro vuoti
ElseIf bAllowEmpty Then
Return If(AddNewMachGroup(nGroupId, vPart), 0, 1)
' altrimenti esco
' altrimenti esco
Else
Return -1
End If
@@ -311,19 +309,19 @@ Public Class MyMachGroupPanelVM
End Sub
Private Sub LoadMaterialType()
Dim sMatType As String = MCH_MAT_WOOD
Dim sMatType As String = "Wood"
' IniFile.m_sMachineName = Map.refStatusBarVM.SelectedMachine.Name
' IniFile.m_sCurrMachIniFilePath = Map.refStatusBarVM.SelectedMachine.MachineDirPath & "\" & Map.refStatusBarVM.SelectedMachine.Name & ".ini"
Dim sMachineIniPath = IniFile.m_sCurrMachIniFilePath
EgtUILib.GetPrivateProfileString(S_MCH_GENERAL, K_MATERIAL, sMatType, sMatType, sMachineIniPath)
EgtUILib.GetPrivateProfileString(S_GENERAL, EgtWPFLib5.EstConstMachIni.K_MATERIAL, sMatType, sMatType, sMachineIniPath)
Select Case sMatType
Case MCH_MAT_STONE
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE5
Case MCH_MAT_WOOD
Case "Stone"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.STONE
Case "Wood"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case MCH_MAT_BEAM
Case "Beam"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.BEAM
Case MCH_MAT_ADDITIVE
Case "Additive"
EgtWPFLib5.MachiningTreeViewItem.m_MatType = MaterialType.WOOD
Case Else
' Se il materiale specificato nel file INI della macchina non corrisponde ai 4 sopracitati viene emesso un messaggio di errore
+6 -18
View File
@@ -16,8 +16,10 @@
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -26,8 +28,6 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0" Columns="2" Margin="0,0,0,5">
@@ -57,24 +57,12 @@
</ComboBox>
</UniformGrid>
<UniformGrid Grid.Row="4" Columns="2" Margin="0,0,0,5"
Visibility="{Binding StoneVisibility}">
<TextBlock Text="{Binding ExtSawArcMinRadMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ExtSawArcMinRad}" Height="25" Margin="10,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Row="5" Columns="2" Margin="0,0,0,5"
Visibility="{Binding StoneVisibility}">
<TextBlock Text="{Binding IntSawArcMaxSideAngMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding IntSawArcMaxSideAng}" Height="25" Margin="10,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Row="6" Columns="2" Margin="0,0,0,5">
<UniformGrid Grid.Row="4" Columns="2" Margin="0,0,0,5">
<TextBlock Text="{Binding ApproxLinTolMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ApproxLinTol}" Height="25" Margin="10,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Row="7" Columns="2">
<UniformGrid Grid.Row="5" Columns="2">
<TextBlock Text="{Binding DefaultSetUpMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ArchivedSetUpList}" Height="25" Margin="10,0,0,0"
SelectedItem="{Binding SelectedDefaultSetUp}" IsEnabled="{Binding IsActiveDefaultSetUp}"/>
+20 -83
View File
@@ -1,6 +1,5 @@
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachOptionVM
@@ -49,6 +48,21 @@ Public Class MachOptionVM
End Set
End Property
Private m_sApproxLinTol As String
Public Property ApproxLinTol As String
Get
Return m_sApproxLinTol
End Get
Set(value As String)
Dim dApproxLinTol As Double = 0
If StringToLen(value, dApproxLinTol) Then
EgtMdbSetGeneralParam(MCH_GP.APPROXLINTOL, dApproxLinTol)
EgtMdbSave()
m_sApproxLinTol = value
End If
End Set
End Property
Private m_SplitArcsList As New List(Of MCH_SA)({MCH_SA.NEVER, MCH_SA.GEN_PLANE, MCH_SA.NO_XY_PLANE, MCH_SA.ALWAYS})
Public ReadOnly Property SplitArcsList As List(Of MCH_SA)
Get
@@ -68,51 +82,6 @@ Public Class MachOptionVM
End Set
End Property
Private m_sExtSawArcMinRad As String
Public Property ExtSawArcMinRad As String
Get
Return m_sExtSawArcMinRad
End Get
Set(value As String)
Dim dExtSawArcMinRad As Double = 0
If StringToLen(value, dExtSawArcMinRad) Then
EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dExtSawArcMinRad)
EgtMdbSave()
m_sExtSawArcMinRad = value
End If
End Set
End Property
Private m_sIntSawArcMaxSideAng As String
Public Property IntSawArcMaxSideAng As String
Get
Return m_sIntSawArcMaxSideAng
End Get
Set(value As String)
Dim dIntSawArcMaxSideAng As Double = 0
If StringToLen(value, dIntSawArcMaxSideAng) Then
EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dIntSawArcMaxSideAng)
EgtMdbSave()
m_sIntSawArcMaxSideAng = value
End If
End Set
End Property
Private m_sApproxLinTol As String
Public Property ApproxLinTol As String
Get
Return m_sApproxLinTol
End Get
Set(value As String)
Dim dApproxLinTol As Double = 0
If StringToLen(value, dApproxLinTol) Then
EgtMdbSetGeneralParam(MCH_GP.APPROXLINTOL, dApproxLinTol)
EgtMdbSave()
m_sApproxLinTol = value
End If
End Set
End Property
Private m_ArchivedSetUpList As New List(Of String)
Public Property ArchivedSetUpList As List(Of String)
Get
@@ -152,6 +121,11 @@ Public Class MachOptionVM
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 9)
End Get
End Property
Public ReadOnly Property ApproxLinTolMsg As String
Get
Return EgtMsg(6410) ' Tolleranza di approssimazione
End Get
End Property
Public ReadOnly Property SplitArcsMsg As String
Get
@@ -159,24 +133,6 @@ Public Class MachOptionVM
End Get
End Property
Public ReadOnly Property ExtSawArcMinRadMsg As String
Get
Return EgtMsg(6411) ' Minimo raggio arco esterno con lama
End Get
End Property
Public ReadOnly Property IntSawArcMaxSideAngMsg As String
Get
Return EgtMsg(6412) ' Massima inclinazione arco interno con lama
End Get
End Property
Public ReadOnly Property ApproxLinTolMsg As String
Get
Return EgtMsg(6410) ' Tolleranza di approssimazione
End Get
End Property
Public ReadOnly Property DefaultSetUpMsg As String
Get
Return EgtMsg(MSG_MACHININGOPTIONPAGE + 7)
@@ -205,14 +161,6 @@ Public Class MachOptionVM
Dim nVal As Integer = 0
EgtMdbGetGeneralParam(MCH_GP.SPLITARCS, nVal)
m_SelectedSplitArcs = DirectCast(nVal, MCH_SA)
' Leggo minimo raggio arco esterno lavorabile con lama
dVal = 0
EgtMdbGetGeneralParam(MCH_GP.EXTSAWARCMINRAD, dVal)
m_sExtSawArcMinRad = LenToString(dVal, 4)
' Leggo massima inclinazione lama per lavorare archi interni
dVal = 0
EgtMdbGetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, dVal)
m_sIntSawArcMaxSideAng = LenToString(dVal, 4)
' Leggo tolleranza lineare di approssimazione
dVal = 0
EgtMdbGetGeneralParam(MCH_GP.APPROXLINTOL, dVal)
@@ -237,17 +185,6 @@ Public Class MachOptionVM
End If
End Sub
#Region "Visibility"
Public ReadOnly Property StoneVisibility As Visibility
Get
Dim sGenMat As String = ""
EgtUILib.GetPrivateProfileString(S_MCH_GENERAL, K_MATERIAL, MCH_MAT_WOOD, sGenMat, IniFile.m_sCurrMachIniFilePath)
Return If( sGenMat = MCH_MAT_STONE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#End Region
#Region "COMMANDS"
#Region "CloseMachOptionsCommand"
+11 -20
View File
@@ -385,8 +385,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, 2607, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 2607, 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
@@ -422,14 +422,7 @@ Public Class MainWindowVM
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", OptionModule.m_sFontText)
EgtSetFont(sNfeDir, OptionModule.m_sFontText)
' Imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
EgtSetLuaLibs(sLuaLibsDir)
Dim sLuaBaseLib As String = String.Empty
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' Imposto direttorio ausiliario per import/gestione BTL (sempre dopo impostazioni lua)
' Imposto direttorio ausiliario per import/gestione BTL
Dim sBtlAuxDir As String = String.Empty
GetPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
EgtSetBtlAuxDir(sBtlAuxDir)
@@ -437,6 +430,13 @@ Public Class MainWindowVM
Dim sThreeJSLibDir As String = String.Empty
GetPrivateProfileString(S_EXPORT, K_THREEJSLIBDIR, "", sThreeJSLibDir)
EgtSetThreeJSLibDir(sThreeJSLibDir)
' Imposto dir di default per libreria Lua e lancio libreria di base
Dim sLuaLibsDir As String = String.Empty
GetPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
EgtSetLuaLibs(sLuaLibsDir)
Dim sLuaBaseLib As String = String.Empty
GetPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
EgtLuaRequire(sLuaBaseLib)
' Imposto direttorio temporaneo a EgtInterface
EgtSetTempDir(m_sTempDir)
' Imposto IniFile a EgtInterface
@@ -597,17 +597,8 @@ Public Class MainWindowVM
' pulisco output
Map.refStatusBarVM.NotifyStatusOutput("")
Map.refInputExpanderVM.ResetInputBox()
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 OrElse e.Key = Key.Up OrElse e.Key = Key.Down 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)
Map.refMachiningParameterExpanderVM.SetSliderValue(nStep)
e.Handled = True
End If
End Sub
+3 -3
View File
@@ -30,7 +30,7 @@ Imports System.Windows
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtCAM5")>
<Assembly: AssemblyCopyright("Copyright © 2016-2026 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2016-2024 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -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("2.6.7.6")>
<Assembly: AssemblyFileVersion("2.6.7.6")>
+2 -2
View File
@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+20 -22
View File
@@ -1,7 +1,7 @@
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
' Runtime Version:4.0.30319.34209
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
@@ -12,16 +12,15 @@ Option Strict On
Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
@@ -29,17 +28,17 @@ Namespace My
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
@@ -50,11 +49,10 @@ Namespace My
End SyncLock
End If
#End If
Return defaultInstance
End Get
End Property
End Class
End Namespace
Return defaultInstance
End Get
End Property
End Class
Namespace My
@@ -64,9 +62,9 @@ Namespace My
Friend Module MySettingsProperty
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
Friend ReadOnly Property Settings() As Global.EgtCAM5.My.MySettings
Friend ReadOnly Property Settings() As Global.EgtCAM5.MySettings
Get
Return Global.EgtCAM5.My.MySettings.Default
Return Global.EgtCAM5.MySettings.Default
End Get
End Property
End Module
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander IsExpanded="{Binding IsEnabled}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ExpanderStyle}">
Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<TextBlock Text="{Binding PropertiesMsg}"/>
</Expander.Header>
@@ -1,11 +1,9 @@
<UserControl x:Class="InputExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander Header="{Binding Title}" IsExpanded="{Binding IsExpanded}" IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ExpanderStyle}">
Style="{StaticResource ExpanderStyle}">
<StackPanel>
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
@@ -18,42 +16,26 @@
</StackPanel.Style>
<TextBlock Text="{Binding TextBlock}"
Visibility="{Binding TextVisibility}" Margin="5,5,0,5"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox x:Name="Txt" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
PreviewKeyDown="TextBox_PreviewKeyDown" IsVisibleChanged="Txt_IsVisibleChanged"
Visibility="{Binding TextVisibility}" Height="Auto" Margin="5,0,5,5" >
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
</TextBox.InputBindings>
</TextBox>
<Button Grid.Column="1"
Content="+"
Command="{Binding ShowInfoItemCommand}"
Visibility="{Binding ShowInfoItemVisibility}"
Width="20"
Height="20"
Margin="5,-1,5,0"
VerticalAlignment="Top"/>
</Grid>
<TextBox Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding TextVisibility}" Margin="5,0,5,5">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
</TextBox.InputBindings>
</TextBox>
<CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"
Visibility="{Binding CheckVisibility}" Margin="5,0,5,5"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding ComboVisibility}" Margin="5,5,5,5"/>
Visibility="{Binding ComboVisibility}" Margin="5,0,5,5"/>
<Grid Margin="5,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding ShowCommand}" Visibility="{Binding ShowBtnVisibility}"
Content="{Binding ShowMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
Content="{Binding ShowMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
<Button Command="{Binding DoneCommand}" Grid.Column="1"
Content="{Binding OkMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
Content="{Binding OkMsg}" Style="{StaticResource EgtCAM5_InputButton}"/>
</Grid>
</StackPanel>
</Expander>
@@ -1,17 +1,3 @@
Public Class InputExpanderV
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
If (e.Key = Key.Enter And (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) Or
(e.Key = Key.V And (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control) Then
Txt.AcceptsReturn = True
Txt.TextWrapping = TextWrapping.Wrap
End If
End Sub
Private Sub Txt_IsVisibleChanged(sender As Object, e As DependencyPropertyChangedEventArgs)
If Txt.IsVisible Then
Txt.Focus()
End If
End Sub
End Class
@@ -1,18 +1,11 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports MS.Internal
Public Class InputExpanderVM
Inherits ViewModelBase
#Region "FIELDS & PROPERTIES"
' Variabile temporanea per salvare bShow
Private m_bTempShow As Boolean
' Lista temporanea delle Info
Private m_TempInfoList As New List(Of InfoItem)
' Expander fields
Private m_IsExpanded As Boolean
Public Property IsExpanded As Boolean
@@ -153,26 +146,9 @@ Public Class InputExpanderVM
Return m_ComboSelectedIndex
End Get
Set(value As Integer)
If m_bTempShow Then Map.refProjectVM.SetLastInteger(value)
Map.refProjectVM.SetLastInteger(value)
m_ComboSelectedIndex = value
' se la combo è di Info ed è valida, la aggiungo alla textbox
If m_ComboSelectedIndex >= 0 AndAlso m_TempInfoList.Count() > 0 Then
Dim CurrItem As InfoItem = m_TempInfoList(m_ComboSelectedIndex)
If String.IsNullOrEmpty(m_TextBox) Then
m_TextBox = CurrItem.sKey & "=" & CurrItem.sValue
Else
If Not m_TextBox.EndsWith(vbCrLf) Then m_TextBox &= vbCrLf
m_TextBox &= CurrItem.sKey & "=" & CurrItem.sValue
End If
ComboVisibility = Visibility.Collapsed
ComboItemsList.RemoveAt(m_ComboSelectedIndex)
m_TempInfoList.RemoveAt(m_ComboSelectedIndex)
m_ComboSelectedIndex = -1
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
End If
OnPropertyChanged("ComboSelectedIndex")
OnPropertyChanged("ComboItemsList")
OnPropertyChanged("TextBox")
End Set
End Property
@@ -201,26 +177,9 @@ Public Class InputExpanderVM
End Set
End Property
Private m_ShowInfoItemVisibility As Visibility
''' <summary>
''' Propietà visibilità bottone +
''' </summary>
Public Property ShowInfoItemVisibility As Visibility
Get
Return m_ShowInfoItemVisibility
End Get
Set(value As Visibility)
If value <> m_ShowInfoItemVisibility Then
m_ShowInfoItemVisibility = value
OnPropertyChanged("ShowInfoItemVisibility")
End If
End Set
End Property
' Commands definition
Private m_cmdShow As ICommand
Private m_cmdDone As ICommand
Private m_cmdShowInfoItem As ICommand
#Region "Messages"
@@ -244,7 +203,6 @@ Public Class InputExpanderVM
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefInputExpanderVM(Me)
ComboSelectedIndex = -1
End Sub
#End Region ' Constructor
@@ -311,69 +269,23 @@ Public Class InputExpanderVM
#End Region ' DoneCommand
#Region "ShowInfoItemCommand"
''' <summary>
''' Comando per la visualizzazione della combobox
''' </summary>
Public ReadOnly Property ShowInfoItemCommand As ICommand
Get
If m_cmdShowInfoItem Is Nothing Then
m_cmdShowInfoItem = New Command(AddressOf ShowInfoItem)
End If
Return m_cmdShowInfoItem
End Get
End Property
''' <summary>
''' Funzione per la visualizzazione della combobox
''' </summary>
''' <param name="param"></param>
Public Sub ShowInfoItem(ByVal param As Object)
' Se presente info inserita in textbox
If Not String.IsNullOrWhiteSpace( m_TextBox) Then
Dim vLines As String() = m_TextBox.Split( vbCrLf.ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
For Each sLine As String In vLines
Dim vKeyVal As String() = sLine.Split("="c)
Dim nInd As Integer = m_TempInfoList.FindIndex( Function(x) x.sKey = vKeyVal(0))
If nInd <> -1 Then
ComboItemsList.RemoveAt( nInd)
m_TempInfoList.RemoveAt( nInd)
End If
Next
End If
ComboVisibility = Visibility.Visible
End Sub
#End Region ' ShowInfoItemCommand
#End Region
#Region "METHODS"
Friend Sub PrepareInputBox(PrepareInputBoxParam As PrepareInputBoxParam)
' Divido il titolo che può contenere comandi dopo il ';'
Dim vsSplitTitle As String() = PrepareInputBoxParam.sTitle.Split(";"c)
Title = vsSplitTitle(0)
Title = PrepareInputBoxParam.sTitle
If PrepareInputBoxParam.sLabel <> "" Then
TextBlock = PrepareInputBoxParam.sLabel
TextBox = ""
TextVisibility = Visibility.Visible
' Se presente il comando "Sic=1"
If vsSplitTitle.Count() > 1 AndAlso vsSplitTitle(1) = "Sic=1" Then
m_bTempShow = False
ComboInfo()
If ComboItemsList.Count > 0 Then ShowInfoItemVisibility = Visibility.Visible
End If
End If
If PrepareInputBoxParam.sCheckLabel <> "" Then
CheckBoxText = PrepareInputBoxParam.sCheckLabel
CheckVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowCombo Then
m_bTempShow = PrepareInputBoxParam.bShowCombo
ComboItemsList.Clear()
m_TempInfoList.Clear()
ComboVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowBtn Then
@@ -390,7 +302,6 @@ Public Class InputExpanderVM
CheckVisibility = Visibility.Collapsed
ComboVisibility = Visibility.Collapsed
ShowBtnVisibility = Visibility.Collapsed
ShowInfoItemVisibility = Visibility.Collapsed
IsExpanded = False
IsEnabled = False
End Sub
@@ -418,33 +329,12 @@ Public Class InputExpanderVM
Private Function AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) As Boolean
ComboItemsList.Add(sText)
If bSelected Then
ComboSelectedIndex = ComboItemsList.Count - 1
End If
Return True
End Function
''' <summary>
''' Funzione che popola la lista ComboItemsList
''' </summary>
Private Sub ComboInfo()
m_TempInfoList.Clear()
ComboItemsList.Clear()
Dim vsInfo As String() = Nothing
EgtGetAllInfo( Map.refManageLayerExpanderVM.RightClickedTreeItemId, vsInfo)
If Not m_bTempShow And Not IsNothing( vsInfo) Then
For nInd As Integer = 0 To vsInfo.Count() - 1
Dim vKeyVal As String() = vsInfo( nInd).Split("="c)
m_TempInfoList.Add(New InfoItem( nInd, vKeyVal(0), vKeyVal(1)))
ComboItemsList.Add( vsInfo( nInd))
Next
End If
End Sub
#End Region ' Methods
End Class
@@ -19,11 +19,11 @@ Public Class LayerTreeViewItem
''' </summary>
Public Overrides Property IsSelected As Boolean
Get
Return m_isSelected
Return m_IsSelected
End Get
Set(value As Boolean)
If (value <> m_isSelected) Then
m_isSelected = value
If (value <> m_IsSelected) Then
m_IsSelected = value
If value Then
' recupero l'Id del nuovo oggetto selezionato
Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False)
@@ -69,17 +69,17 @@ Public Class LayerTreeViewItem
Return m_bOnOff
End Get
Set(value As Boolean)
'If Map.refProjectVM.GetController().GetStep() <> 0 Then Return
If Map.refProjectVM.GetController().GetStep() <> 0 Then Return
If m_bOnOff <> value Then
m_bOnOff = value
' se abilitato, eseguo operazione
If m_SendCmd Then
Map.refProjectVM.SetLastInteger(Id)
If value Then
EgtSetStatus(Id, GDB_ST.ON_)
Map.refProjectVM.ExecuteCommand(Controller.CMD.SHOW)
Else
EgtSetStatus(Id, GDB_ST.OFF)
Map.refProjectVM.ExecuteCommand(Controller.CMD.HIDE)
End If
EgtDraw()
End If
Dim bOnOffGroup As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) AndAlso Items.Count > 0
If bOnOffGroup Then
@@ -1,9 +1,9 @@
<UserControl x:Class="ManageLayerExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:expression="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:local="clr-namespace:EgtCAM5">
<Expander IsExpanded="True" Style="{StaticResource ExpanderStyle}">
<Expander.Header>
@@ -20,11 +20,11 @@
<Button Content="{Binding NewLayerMsg}" Command="{Binding NewLayerCommand}" Height="30"/>
<Button Content="{Binding ColorMsg}" Command="{Binding LayerColorCommand}" Height="30"/>
</UniformGrid>
<TreeView x:Name="LayerTreeView" MinHeight="300" MaxHeight="400"
ItemsSource="{Binding Path=LayerList}"
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling">
<TreeView Name="LayerTreeView" MinHeight="150" MaxHeight="250"
ItemsSource="{Binding Path=LayerList}"
VirtualizingStackPanel.IsVirtualizing = "True"
VirtualizingStackPanel.VirtualizationMode = "Recycling">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="MouseDoubleClick">
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}"/>
@@ -50,8 +50,8 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="0"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="True" Height="15" Width="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="0"
IsChecked="{Binding OnOff}" Visibility="{Binding IsHidden}" Focusable="False" Height="15" Width="15" Margin="0,0,5,0"/>
<Image Grid.Column="1" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Name}" Margin="0,0,5,0"/>
<Ellipse Grid.Column="3" Height="10" Width="10" Fill="{Binding LayerColor}" />
@@ -61,7 +61,7 @@
</TreeView.Resources>
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia
che si presenta quando la categoria rimane vuota (ombra causata dal multibinding).-->
che si presenta quando la categoria rimane vuota (ombra causata dal multibinding).-->
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtCAM5.IniFile
Public Class ManageLayerExpanderVM
Inherits ViewModelBase
@@ -29,6 +30,22 @@ Public Class ManageLayerExpanderVM
End Set
End Property
' Definizione comandi
Private m_cmdNewPart As ICommand
Private m_cmdNewLayer As ICommand
Private m_cmdLayerColor As ICommand
Private m_cmdTreeViewDoubleClick As ICommand
Private m_cmdTreeViewMouseUp As ICommand
Private m_cmdTreeViewMouseRightButton As ICommand
Private m_cmdSelect As ICommand
Private m_cmdDeselect As ICommand
Private m_cmdName As ICommand
Private m_cmdInfo As ICommand
Private m_cmdRelocate As ICommand
Private m_cmdCopy As ICommand
Private m_cmdDelete As ICommand
Private m_cmdSave As ICommand
' Lista dei layer
Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem)
Public Property LayerList As ObservableCollection(Of LayerTreeViewItem)
@@ -37,7 +54,6 @@ Public Class ManageLayerExpanderVM
End Get
Set(value As ObservableCollection(Of LayerTreeViewItem))
m_LayerList = value
OnPropertyChanged("LayerList")
End Set
End Property
@@ -115,22 +131,6 @@ Public Class ManageLayerExpanderVM
#End Region
' Definizione comandi
Private m_cmdNewPart As ICommand
Private m_cmdNewLayer As ICommand
Private m_cmdLayerColor As ICommand
Private m_cmdTreeViewDoubleClick As ICommand
Private m_cmdTreeViewMouseUp As ICommand
Private m_cmdTreeViewMouseRightButton As ICommand
Private m_cmdSelect As ICommand
Private m_cmdDeselect As ICommand
Private m_cmdName As ICommand
Private m_cmdInfo As ICommand
Private m_cmdRelocate As ICommand
Private m_cmdCopy As ICommand
Private m_cmdDelete As ICommand
Private m_cmdSave As ICommand
#End Region
#Region "CONSTRUCTOR"
@@ -166,7 +166,7 @@ Public Class ManageLayerExpanderVM
Public Sub NewPart(ByVal param As Object)
Map.refProjectVM.ExecuteCommand(Controller.CMD.NEWPART)
' Seleziono nell'albero il layer del pezzo appena creato
SelectIdInObjTreeNoMark(EgtGetCurrLayer())
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
#End Region ' NewPartCommand
@@ -191,7 +191,7 @@ Public Class ManageLayerExpanderVM
Public Sub NewLayer(ByVal param As Object)
Map.refProjectVM.ExecuteCommand(Controller.CMD.NEWLAYER)
' Seleziono nell'albero il layer appena creato
SelectIdInObjTreeNoMark(EgtGetCurrLayer())
SelectIdInObjTree(EgtGetCurrLayer(), False)
End Sub
#End Region ' NewLayerCommand
@@ -492,7 +492,7 @@ Public Class ManageLayerExpanderVM
Map.refProjectVM.SetLastInteger(RightClickedTreeItemId)
Map.refProjectVM.ExecuteCommand(Controller.CMD.DELETE)
' Seleziono prossimo
SelectIdInObjTreeNoMark(nNewId)
SelectIdInObjTree(nNewId, False)
End Sub
#End Region ' DeleteCommand
@@ -528,18 +528,16 @@ Public Class ManageLayerExpanderVM
#Region "METHODS"
Private WithEvents ObjTreeTimer As New System.Windows.Threading.DispatcherTimer
Friend m_nObjTreeOldId As Integer = GDB_ID.NULL
Private m_nObjTreeOldId As Integer = GDB_ID.NULL
Private m_nObjTreeMenuId As Integer = GDB_ID.NULL
Private m_bEnableUpdateObjInObjTree As Boolean = True
Friend Sub SelectIdInObjTreeNoMark(nId As Integer)
LayerTreeViewItem.m_MarkOnSel = False
MySelectIdInObjTree(nId)
LayerTreeViewItem.m_MarkOnSel = True
SelectIdInObjTree(nId, False)
End Sub
Friend Sub SelectIdInObjTree(nId As Integer)
MySelectIdInObjTree(nId)
SelectIdInObjTree(nId, True)
End Sub
Friend Sub UpdateObjTreeOldId(ObjTreeOldId As Integer)
@@ -583,7 +581,7 @@ Public Class ManageLayerExpanderVM
AddGroupInObjTree(GDB_ID.ROOT, GDB_LV.USER, GDB_MD.STD, 0, LayerList)
If nOldId <> GDB_ID.NULL Then
m_bEnableUpdateObjInObjTree = False
If Not MySelectIdInObjTree(nOldId) Then
If Not SelectIdInObjTree(nOldId, True) Then
Map.refInfoExpanderVM.SetInfoBox(String.Empty)
End If
m_bEnableUpdateObjInObjTree = True
@@ -805,11 +803,14 @@ Public Class ManageLayerExpanderVM
Return nOldId
End Function
Private Function MySelectIdInObjTree(nId As Integer) As Boolean
Private Function SelectIdInObjTree(nId As Integer, bMark As Boolean) As Boolean
Dim tNode As LayerTreeViewItem = SearchIdInLayerList(LayerList, nId, True)
If Not IsNothing(tNode) Then
If Not bMark Then LayerTreeViewItem.m_MarkOnSel = False
tNode.IsSelected = True
tNode.NotifyPropertyChanged("IsSelected")
If Not bMark Then LayerTreeViewItem.m_MarkOnSel = True
tNode.IsExpanded = True
m_nObjTreeOldId = nId
Return True
Else
@@ -177,17 +177,12 @@ Public Class EstimationsExpanderVM
If Not bOk Then Return False
' Calcolo della stima
If Not EgtEstimate(sEstFile, sInfo) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
sErr = sErr.Replace("Cnc", "Est")
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(5317), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(MSG_SIMULATION + 17), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
bOk = False
End If
@@ -152,8 +152,6 @@ Public Class MachiningTreeExpanderVM
Return EgtMsg(MSG_MACHININGSDBPAGE + 12)
Case MCH_MY.FIVEAXISMILLING
Return EgtMsg(31213)
Case MCH_MY.PROBING
Return EgtMsg(31220)
Case Else
Return "Mach"
End Select
@@ -1,6 +1,4 @@
Imports System.ComponentModel
Imports System.Globalization
Imports EgtUILib
Imports EgtUILib
Public Class DispositionParameterExpanderVM
Inherits ViewModelBase
@@ -275,7 +273,7 @@ Public Class DispositionParameterExpanderVM
End If
Select Case m_ActiveObject
Case ObjectType.RAWPART
' Abilito la selezione dei Grezzi
' Abilito la selezione delle Fixture
Map.refProjectVM.SceneSelType = SceneSelTypeOpt.RAWPART
Case ObjectType.FIXTURE
' Abilito la selezione delle Fixture
@@ -283,7 +281,6 @@ Public Class DispositionParameterExpanderVM
End Select
Map.refRawPartOptionVM.SetMoveWithFixture(False)
Map.refFixtureParametersVM.UpdateFixtureTypeList()
DispositionUtility.InitHookData()
End Sub
#End Region ' METHODS
@@ -313,16 +310,12 @@ Public Class DispositionParameterExpanderVM
' se movimento di traslazione
If m_MoveIsChecked Then
Dim InputPoint As New Point3d(0, 0, 0)
Dim dSupp As Double = -1
Dim Values() As String = m_InputValue.Split(","c)
If Values.Count >= 2 Then
If Values.Count = 2 Then
StringToLen(Values(0), InputPoint.x)
StringToLen(Values(1), InputPoint.y)
If Values.Count >= 3 Then
StringToLen(Values(2), dSupp)
End If
Else
m_InputErrorMsg = "Il valore non è un punto X,Y"
m_InputErrorMsg = "Il valore non è una cordinata XY"
OnPropertyChanged("InputErrorMsg")
Return
End If
@@ -335,44 +328,13 @@ Public Class DispositionParameterExpanderVM
' imposto il riferimento della tavola
Dim ptTableRef As Point3d
EgtGetTableRef(1, ptTableRef)
' calcolo il punto del grezzo da posizionare nelle coordinate di input
' calcolo il punto del grezzo da posizionar nelle coordinate di input
Dim ptRawRefPoint As Point3d = DispositionUtility.GetRawPartRefPoint(nFirstSelectedId, m_RawRefPosition)
' creo un punto con le coordinate di input espresse rispetto alla tavola
Dim TableRefInputPoint As New Point3d(InputPoint)
TableRefInputPoint.LocToLoc(EgtGetGridFrame(), New Frame3d(ptTableRef))
' calcolo il vettore di spostamento del grezzo
vtMove = TableRefInputPoint - ptRawRefPoint
vtMove.z = 0
' verifico ed aggiusto eventuale supporto
Dim dOldSupp As Double = 0
Dim nOldSuppId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, SUPPORT)
If nOldSuppId <> GDB_ID.NULL Then
Dim bboxSupport As New BBox3d
EgtGetBBoxGlob(nOldSuppId, GDB_BB.STANDARD, bboxSupport)
dOldSupp = bboxSupport.DimZ()
End If
If dSupp > -EPS_SMALL AndAlso Math.Abs( dSupp - dOldSupp) > EPS_SMALL Then
' da cancellare
If dSupp < EPS_SMALL Then
EgtErase( nOldSuppId)
vtMove.z = dSupp - dOldSupp
' da creare o modificare
Else
EgtErase( nOldSuppId)
Dim nNewSuppId As Integer = GDB_ID.NULL
Dim nRawOutLnId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, RAWOUTLINE)
If nRawOutLnId <> GDB_ID.NULL Then
Dim vtExtr As New Vector3d( 0, 0, -dSupp)
nNewSuppId = EgtCreateSurfTmByRegionExtrusion( nFirstSelectedId, 1, {nRawOutLnId}, vtExtr, 0.05, GDB_RT.GLOB)
End If
If nNewSuppId <> GDB_ID.NULL Then
EgtSetName( nNewSuppId, SUPPORT)
EgtSetColor( nNewSuppId, New Color3d(150, 75, 0))
If nOldSuppId <> GDB_ID.NULL Then EgtChangeId( nNewSuppId, nOldSuppId)
vtMove.z = dSupp - dOldSupp
End If
End If
End If
' se è una ventosa
ElseIf EgtVerifyFixture(nFirstSelectedId) Then
Dim SelObjFrame3d As New Frame3d(Frame3d.GLOB)
@@ -471,24 +433,8 @@ Public Class DispositionParameterExpanderVM
''' Execute the Point. This method is invoked by the DoneCommand.
''' </summary>
Public Sub CheckedRawRef(ByVal param As Object)
' Assegno corner di riferimento
Dim nRawRef As MCH_CR = DirectCast(param, MCH_CR)
m_RawRefPosition = nRawRef
' Se grezzo selezionato, visualizzo sua posizione
Dim nFirstSelectedId As Integer = EgtGetFirstSelectedObj()
If EgtVerifyRawPartCurrPhase(nFirstSelectedId) Then
Dim ptR As Point3d = DispositionUtility.GetRawPartRefPoint(nFirstSelectedId, m_RawRefPosition)
Dim sSupp As String = ""
Dim nSuppId As Integer = EgtGetFirstNameInGroup(nFirstSelectedId, SUPPORT)
If nSuppId <> GDB_ID.NULL Then
Dim bboxSupport As New BBox3d
EgtGetBBoxGlob(nSuppId, GDB_BB.STANDARD, bboxSupport)
Dim dSupp As Double = bboxSupport.DimZ()
sSupp = "," & LenToString( dSupp, 2)
End If
m_InputValue = LenToString( ptR.x, 2) & "," & LenToString( ptR.y, 2) & sSupp
OnPropertyChanged( "InputValue")
End If
End Sub
#End Region ' CheckedRawRefCommand
@@ -5,6 +5,8 @@ Imports EgtUILib
Public Class FixtureParametersVM
Inherits ViewModelBase
Friend Const USED As String = "USED"
Private m_FixtureTypeList As ObservableCollection(Of FixtureListItem)
Public ReadOnly Property FixtureTypeList As ObservableCollection(Of FixtureListItem)
Get
@@ -62,8 +64,8 @@ Public Class FixtureParametersVM
Dim nUsedFixtureId As Integer = EgtGetFirstFixture()
While nUsedFixtureId <> GDB_ID.NULL
Dim sUsedFixtureName As String = String.Empty
EgtGetName(nUsedFixtureId, sUsedFixtureName)
For Index = 0 To m_FixtureTypeList.Count - 1
EgtGetName(nUsedFixtureId, sUsedFixtureName)
If sUsedFixtureName = m_FixtureTypeList(Index).Name Then
Dim CurrFixtureType As FixtureType = DirectCast(m_FixtureTypeList(Index), FixtureType)
CurrFixtureType.UsedNumber += 1
@@ -76,7 +78,6 @@ Public Class FixtureParametersVM
Friend Sub UpdateFixtureTypeList()
m_FixtureTypeList = New ObservableCollection(Of FixtureListItem)(FixtureType.ReadFixtureTypeFromMachIni())
UpdateFixtureCount()
OnPropertyChanged("FixtureTypeList")
End Sub
@@ -121,36 +122,27 @@ Public Class FixtureParametersVM
OnPropertyChanged("FixtureErrorMsg")
Return
End If
' dimensioni tavola
Dim vtTabDim As Vector3d = ptTableMax - ptTableMin
' calcolo il centro della tavola
Dim ptTableMid As Point3d = Point3d.ORIG() + 0.5 * vtTabDim
Dim ptTableMid As New Point3d((ptTableMax.x - ptTableMin.x) / 2, (ptTableMax.y - ptTableMin.y) / 2, (ptTableMax.z - ptTableMin.z) / 2)
' posiziono il nuovo sottopezzo al centro della tavola
Dim nAddedFixtureId As Integer = EgtAddFixture(SelectedFixture.Name, ptTableMid, 0, 20)
Dim nAddedFixtureId As Integer = EgtAddFixture(SelectedFixture.Name, ptTableMid, 0, 0)
If nAddedFixtureId = GDB_ID.NULL Then
m_FixtureErrorMsg = "Impossibile posizionare la ventosa sulla tavola"
OnPropertyChanged("FixtureErrorMsg")
Return
End If
' Se la ventosa ha punti di hook da ancorare
' verifico se la ventosa ha punti di hook da ancorare
If IsFixtureWithHook(nAddedFixtureId) Then
If Not PositionFixtureOnNearestHook(nAddedFixtureId) Then
EgtMoveFixture( nAddedFixtureId, 0.2 * vtTabDim.y * Vector3d.Y_AX())
If Not PositionFixtureOnNearestHook(nAddedFixtureId) Then
EgtMoveFixture( nAddedFixtureId, 0.2 * vtTabDim.y * Vector3d.Y_AX())
If Not PositionFixtureOnNearestHook(nAddedFixtureId) Then
' non ci sono punti liberi, quindi rimuovo la ventosa e segnalo
EgtRemoveFixture(nAddedFixtureId)
EgtSetFixtureLink( nAddedFixtureId, "")
MessageBox.Show("No free hook point!", "ERROR")
Return
End If
End If
' non ci sono punti liberi, quindi rimuovo la ventosa e segnalo
EgtRemoveFixture(nAddedFixtureId)
MessageBox.Show("No free hook point!", "ERROR")
Return
End If
' altrimenti ventosa con movimento continuo
Else
' verifico se è in una posizione valida
If Not DispositionUtility.VerifyFixturePosition(nAddedFixtureId, New Vector3d) Then
' se non ha punti di ancoraggio
' verifico se è in una posizione valida
If Not DispositionUtility.VerifyFixturePosition(nAddedFixtureId, New Vector3d) Then
' se non trovo una posizione valida, esco
If Not SearchOkFixturePosition(nAddedFixtureId, ptTableMin, ptTableMax, ptTableMid) Then
Return
@@ -165,76 +157,76 @@ Public Class FixtureParametersVM
' Funzione che cerca una posizione valida per la ventosa libera di muoversi
Private Function SearchOkFixturePosition(nAddedFixtureId As Integer, ptTableMin As Point3d, ptTableMax As Point3d, ptTableMid As Point3d) As Boolean
' creo un gruppo temporaneo
Dim nTempGroupId As Integer = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(nTempGroupId, GDB_LV.USER)
EgtSetMode(nTempGroupId, GDB_MD.STD)
' calcolo ingombro sottopezzo aggiunto
Dim bboxAddedFixture As New BBox3d
EgtGetBBoxGlob(nAddedFixtureId, GDB_BB.STANDARD, bboxAddedFixture)
' calcolo bbox tavolo
Dim bboxTableArea As New BBox3d(ptTableMin, ptTableMax)
bboxTableArea.Expand(-bboxAddedFixture.DimX / 2, -bboxAddedFixture.DimY / 2, 0)
' creo superficie delle misure della tavola
Dim nTableFrId As Integer = EgtCreateSurfFrRectangle(nTempGroupId, bboxTableArea.Min, bboxTableArea.Max)
' ciclo su tutti i pezzi di questa fase
Dim nFixtureId As Integer = EgtGetFirstFixture()
While nFixtureId <> GDB_ID.NULL
' creo il bbox del sottopezzo
Dim bboxFixture As New BBox3d
EgtGetBBoxGlob(nFixtureId, GDB_BB.STANDARD, bboxFixture)
' faccio offset del bbox del sottopezzo per includere metà del sottopezzo da aggiungere
bboxFixture.Expand(bboxAddedFixture.DimX / 2, bboxAddedFixture.DimY / 2, 0)
' lo porto all'altezza della tavola
Dim ptMinFixtureFr As New Point3d(bboxFixture.Min)
Dim ptMaxFixtureFr As New Point3d(bboxFixture.Max)
ptMinFixtureFr.z = ptTableMin.z
ptMaxFixtureFr.z = ptTableMin.z
' creo la regione occupata dal bbox del sottopezzo
Dim nFixtureFrId As Integer = EgtCreateSurfFrRectangle(nTempGroupId, ptMinFixtureFr, ptMaxFixtureFr)
' sottraggo la regione del sottopezzo da quella della tavola
Dim x = EgtSurfFrSubtract(nTableFrId, nFixtureFrId)
nFixtureId = EgtGetNextFixture(nFixtureId)
End While
' creo gruppo con i bordi della regione di tavola avanzata
Dim TableFrBorderGroupId As Integer = EgtCreateGroup(nTempGroupId)
Dim nTableFrBorderCount As Integer = 0
Dim nChunk As Integer = EgtSurfFrChunkCount(nTableFrId)
For Index = 0 To nChunk - 1
EgtExtractSurfFrChunkLoops(nTableFrId, Index, TableFrBorderGroupId, nTableFrBorderCount)
Next
' verifico se c'è almeno un bordo
If nTableFrBorderCount = 0 Then
m_FixtureErrorMsg = "Impossibile posizionare la ventosa sulla tavola"
OnPropertyChanged("FixtureErrorMsg")
Return False
End If
' converto il punto medio della tavola in coordinate globali
Dim PtTableRef As Point3d
EgtGetTableRef(1, PtTableRef)
Dim frTableRef As New Frame3d(PtTableRef)
ptTableMid.ToGlob(frTableRef)
' ciclo sui bordi per trovare il punto più vicino
Dim dMinDist As Double = (bboxTableArea.Max - bboxTableArea.Min).SqLenXY
Dim ptMinAbs As Point3d
Dim BorderId As Integer = EgtGetFirstInGroup(TableFrBorderGroupId)
While BorderId <> GDB_ID.NULL
Dim dDist As Double = 0
Dim ptMinRel As Point3d
Dim nSide As Integer = 0
EgtPointCurveDistSide(ptTableMid, BorderId, Vector3d.Z_AX, GDB_ID.ROOT, dDist, ptMinRel, nSide)
If dDist < dMinDist Then
dMinDist = dDist
ptMinAbs = ptMinRel
' creo un gruppo temporaneo
Dim nTempGroupId As Integer = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(nTempGroupId, GDB_LV.USER)
EgtSetMode(nTempGroupId, GDB_MD.STD)
' calcolo ingombro sottopezzo aggiunto
Dim bboxAddedFixture As New BBox3d
EgtGetBBoxGlob(nAddedFixtureId, GDB_BB.STANDARD, bboxAddedFixture)
' calcolo bbox tavolo
Dim bboxTableArea As New BBox3d(ptTableMin, ptTableMax)
bboxTableArea.Expand(-bboxAddedFixture.DimX / 2, -bboxAddedFixture.DimY / 2, 0)
' creo superficie delle misure della tavola
Dim nTableFrId As Integer = EgtCreateSurfFrRectangle(nTempGroupId, bboxTableArea.Min, bboxTableArea.Max)
' ciclo su tutti i pezzi di questa fase
Dim nFixtureId As Integer = EgtGetFirstFixture()
While nFixtureId <> GDB_ID.NULL
' creo il bbox del sottopezzo
Dim bboxFixture As New BBox3d
EgtGetBBoxGlob(nFixtureId, GDB_BB.STANDARD, bboxFixture)
' faccio offset del bbox del sottopezzo per includere metà del sottopezzo da aggiungere
bboxFixture.Expand(bboxAddedFixture.DimX / 2, bboxAddedFixture.DimY / 2, 0)
' lo porto all'altezza della tavola
Dim ptMinFixtureFr As New Point3d(bboxFixture.Min)
Dim ptMaxFixtureFr As New Point3d(bboxFixture.Max)
ptMinFixtureFr.z = ptTableMin.z
ptMaxFixtureFr.z = ptTableMin.z
' creo la regione occupata dal bbox del sottopezzo
Dim nFixtureFrId As Integer = EgtCreateSurfFrRectangle(nTempGroupId, ptMinFixtureFr, ptMaxFixtureFr)
' sottraggo la regione del sottopezzo da quella della tavola
Dim x = EgtSurfFrSubtract(nTableFrId, nFixtureFrId)
nFixtureId = EgtGetNextFixture(nFixtureId)
End While
' creo gruppo con i bordi della regione di tavola avanzata
Dim TableFrBorderGroupId As Integer = EgtCreateGroup(nTempGroupId)
Dim nTableFrBorderCount As Integer = 0
Dim nChunk As Integer = EgtSurfFrChunkCount(nTableFrId)
For Index = 0 To nChunk - 1
EgtExtractSurfFrChunkLoops(nTableFrId, Index, TableFrBorderGroupId, nTableFrBorderCount)
Next
' verifico se c'è almeno un bordo
If nTableFrBorderCount = 0 Then
m_FixtureErrorMsg = "Impossibile posizionare la ventosa sulla tavola"
OnPropertyChanged("FixtureErrorMsg")
Return False
End If
BorderId = EgtGetNext(BorderId)
End While
' sposto il sottopezzo nel punto trovato
Dim vtFixtureMove As Vector3d = ptMinAbs - ptTableMid
vtFixtureMove.z = 0
EgtMoveFixture(nAddedFixtureId, vtFixtureMove)
' cancello il gruppo temporaneo
EgtErase(nTempGroupId)
' converto il punto medio della tavola in coordinate globali
Dim PtTableRef As Point3d
EgtGetTableRef(1, PtTableRef)
Dim frTableRef As New Frame3d(PtTableRef)
ptTableMid.ToGlob(frTableRef)
' ciclo sui bordi per trovare il punto più vicino
Dim dMinDist As Double = (bboxTableArea.Max - bboxTableArea.Min).SqLenXY
Dim ptMinAbs As Point3d
Dim BorderId As Integer = EgtGetFirstInGroup(TableFrBorderGroupId)
While BorderId <> GDB_ID.NULL
Dim dDist As Double = 0
Dim ptMinRel As Point3d
Dim nSide As Integer = 0
EgtPointCurveDistSide(ptTableMid, BorderId, Vector3d.Z_AX, GDB_ID.ROOT, dDist, ptMinRel, nSide)
If dDist < dMinDist Then
dMinDist = dDist
ptMinAbs = ptMinRel
End If
BorderId = EgtGetNext(BorderId)
End While
' sposto il sottopezzo nel punto trovato
Dim vtFixtureMove As Vector3d = ptMinAbs - ptTableMid
vtFixtureMove.z = 0
EgtMoveFixture(nAddedFixtureId, vtFixtureMove)
' cancello il gruppo temporaneo
EgtErase(nTempGroupId)
Return True
End Function
@@ -247,7 +239,9 @@ Public Class FixtureParametersVM
' leggo tipo
Dim sType As String = ""
EgtGetInfo(nFixtHookId, DispositionUtility.TYPE, sType)
If sType.Equals(DispositionUtility.POINT) Then
If sType.Equals(DispositionUtility.FREE) Then
Return False
ElseIf sType.Equals(DispositionUtility.POINT) Then
Return True
ElseIf sType.Equals(DispositionUtility.LINE) Then
Return True
@@ -256,7 +250,7 @@ Public Class FixtureParametersVM
End If
End Function
' Funzione che cerca un hook libero adatto alla ventosa e se trovato la posiziona
' Funzione che aggancia la ventosa al più vicino hook libero
Friend Shared Function PositionFixtureOnNearestHook(nFixtureId As Integer) As Boolean
' cerco punto hook sulla ventosa
Dim nFixtSolidId As Integer = EgtGetFirstNameInGroup(nFixtureId, SOLID)
@@ -268,21 +262,26 @@ Public Class FixtureParametersVM
Dim nFixtHookType As DispositionUtility.HOOKTYPE = DispositionUtility.HOOKTYPE.FREE
Dim sType As String = ""
EgtGetInfo(nFixtHookId, DispositionUtility.TYPE, sType)
If sType.Equals(DispositionUtility.POINT) Then
If sType.Equals(DispositionUtility.FREE) Then
nFixtHookType = DispositionUtility.HOOKTYPE.FREE
' esco perchè non devo cercare alcun punto
Return True
ElseIf sType.Equals(DispositionUtility.POINT) Then
nFixtHookType = DispositionUtility.HOOKTYPE.POINT
ElseIf sType.Equals(DispositionUtility.LINE) Then
nFixtHookType = DispositionUtility.HOOKTYPE.LINE
Else
nFixtHookType = DispositionUtility.HOOKTYPE.FREE
' esco perchè non devo cercare alcun punto
Return True
End If
Dim nFixtHookClass As Integer = 0
EgtGetInfo(nFixtHookId, DispositionUtility.CLASS_, nFixtHookClass)
' Recupero Id tavola corrente
' cerco id tavola
Dim sTableName As String = ""
EgtGetTableName(sTableName)
Dim nTableId As Integer = EgtGetTableId(sTableName)
' *** Cerco hook su tavola ***
' cerco hook su tavola macchina
Dim nTableSolidId As Integer = EgtGetFirstNameInGroup(nTableId, SOLID)
Dim nCurrHookId As Integer = EgtGetFirstNameInGroup(nTableSolidId, DispositionUtility.HOOK)
' Punto di hook a cui spostare la ventosa
@@ -294,23 +293,33 @@ Public Class FixtureParametersVM
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
' verifico se è in una posizione valida
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
Else
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
End If
EgtSetFixtureLink( nFixtureId, "")
EgtSetInfo(nCurrHookId, used, nFixtureId)
Return True
Else
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
End If
End If
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
End While
' *** Cerco hook su barre fisse ***
' cerco hook su barra fissa
Dim nTableFixedId As Integer = EgtGetFirstNameInGroup(nTableId, DispositionUtility.FIXED)
While nTableFixedId <> GDB_ID.NULL
nCurrHookId = EgtGetFirstNameInGroup(nTableFixedId, DispositionUtility.HOOK)
nCurrHookId = EgtGetFirstNameInGroup(nTableFixedId, DispositionUtility.HOOK)
While nCurrHookId <> GDB_ID.NULL
' se punto di aggancio valido
If HookAnalyzer(nCurrHookId, nFixtHookType, nFixtHookClass, ptFixtHook, ptCurrHook) Then
' sposto la ventosa
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
' verifico se è in una posizione valida
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
EgtSetInfo(nCurrHookId, USED, nFixtureId)
Return True
End If
End If
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
End While
' cerco hook su barre mobili
Dim nMobileInd As Integer = 1
Dim nMobile As Integer = EgtGetFirstNameInGroup(nTableId, DispositionUtility.MOBILE & nMobileInd)
While nMobile <> GDB_ID.NULL
nCurrHookId = EgtGetFirstNameInGroup(nMobile, DispositionUtility.HOOK)
While nCurrHookId <> GDB_ID.NULL
' se punto di aggancio valido
If HookAnalyzer(nCurrHookId, nFixtHookType, nFixtHookClass, ptFixtHook, ptCurrHook) Then
@@ -318,114 +327,46 @@ Public Class FixtureParametersVM
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
' verifico se è in una posizione valida
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
Else
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
End If
EgtSetFixtureLink( nFixtureId, "")
EgtSetInfo(nCurrHookId, USED, nFixtureId)
Return True
Else
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
End If
End If
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
End While
nTableFixedId = EgtGetNextName( nTableFixedId, DispositionUtility.FIXED)
End While
' *** Cerco hook su barre mobili ***
Dim nBarId As Integer = EgtGetFirstGroupInGroup(nTableId)
While nBarId <> GDB_ID.NULL
Dim sBarName As String = ""
If EgtGetName( nBarId, sBarName) AndAlso EgtGetAxisId( sBarName) <> GDB_ID.NULL Then
nCurrHookId = EgtGetFirstNameInGroup(nBarId, DispositionUtility.HOOK)
While nCurrHookId <> GDB_ID.NULL
' se punto di aggancio valido
If HookAnalyzer(nCurrHookId, nFixtHookType, nFixtHookClass, ptFixtHook, ptCurrHook) Then
' sposto la ventosa
Dim vtMove As Vector3d = ptCurrHook - ptFixtHook
EgtMoveFixture(nFixtureId, vtMove)
' verifico se è in una posizione valida
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
Else
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
End If
EgtSetFixtureLink( nFixtureId, sBarName)
Return True
Else
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
End If
End If
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
End While
' Cerco su eventuali carrelli
Dim nCharId As Integer = EgtGetFirstGroupInGroup(nBarId)
While nCharId <> GDB_ID.NULL
Dim sCharName As String = ""
If EgtGetName( nCharId, sCharName) AndAlso EgtGetAxisId( sCharName) <> GDB_ID.NULL Then
nCurrHookId = EgtGetFirstNameInGroup(nCharId, DispositionUtility.HOOK)
While nCurrHookId <> GDB_ID.NULL
' se punto di aggancio valido
If HookAnalyzer(nCurrHookId, nFixtHookType, nFixtHookClass, ptFixtHook, ptCurrHook) Then
' sposto la ventosa
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
' verifico se è in una posizione valida
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
Else
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
End If
EgtSetFixtureLink( nFixtureId, sCharName)
Return True
Else
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
End If
End If
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
End While
End If
nCharId = EgtGetNextGroup(nCharId)
End While
End If
nBarId = EgtGetNextGroup(nBarId)
nMobileInd += 1
nMobile = EgtGetFirstNameInGroup(nTableId, DispositionUtility.MOBILE & nMobileInd)
End While
Return False
End Function
' Funzione che analizza l'hook e se valido ne restituisce la posizione (punto)
Private Shared Function HookAnalyzer(nCurrHookId As Integer, nFixtHookType As Integer, nFixtHookClass As Integer,
ptFixtHook As Point3d, ByRef ptCurrHook As Point3d) As Boolean
' Verifico se del tipo giusto
' Funzione che analizza l'hook e se valido ne prestituisce lo posizione(punto)
Private Shared Function HookAnalyzer(nCurrHookId As Integer, nFixtHookType As Integer, nFixtHookClass As Integer, ptFixtHook As Point3d, ByRef ptCurrHook As Point3d) As Boolean
' verifico se del tipo giusto
Dim nTableHookType As GDB_TY = EgtGetType(nCurrHookId)
If Not (nTableHookType = GDB_TY.GEO_POINT And nFixtHookType = DispositionUtility.HOOKTYPE.POINT) AndAlso
Not (nTableHookType = GDB_TY.CRV_LINE And nFixtHookType = DispositionUtility.HOOKTYPE.LINE) Then
Return False
End If
' Verifico se della stessa classe
Dim nTableHookClass As Integer = DispositionUtility.GetHookClass( nCurrHookId)
If nTableHookClass <> nFixtHookClass Then
Return False
End If
Dim dDist As Double = 0
' punto a distanza minima sull'hook
If nTableHookType = GDB_TY.GEO_POINT Then
' verifico se utilizzato
If Not DispositionUtility.GetIsHookUsed( nCurrHookId) Then
' calcolo distanza punto hook tavola dal punto hook della ventosa
EgtStartPoint(nCurrHookId, GDB_ID.ROOT, ptCurrHook)
Return True
If (nTableHookType = GDB_TY.GEO_POINT And nFixtHookType = DispositionUtility.HOOKTYPE.POINT) OrElse (nTableHookType = GDB_TY.CRV_LINE And nFixtHookType = DispositionUtility.HOOKTYPE.LINE) Then
' verifico se della stessa classe
Dim nTableHookClass As Integer = 0
EgtGetInfo(nCurrHookId, DispositionUtility.CLASS_, nTableHookClass)
If nTableHookClass = nFixtHookClass Then
Dim dDist As Double = 0
' punto a distanza minima sull'hook
If nTableHookType = GDB_TY.GEO_POINT Then
' verifico se utilizzato
Dim nTableHookUsed As Boolean = False
If Not EgtGetInfo(nCurrHookId, DispositionUtility.USED, nTableHookUsed) Then
' calcolo distanza punto hook tavola dal punto hook della ventosa
EgtStartPoint(nCurrHookId, GDB_ID.ROOT, ptCurrHook)
Return True
End If
ElseIf nTableHookType = GDB_TY.CRV_LINE Then
' calcolo distanza linea hook tavola dal punto hook della ventosa
Dim nRefId As Integer = 0
Dim dU As Double = 0
EgtPointCurveDist(ptFixtHook, nCurrHookId, nRefId, dDist, dU)
EgtAtParamPoint(nCurrHookId, dU, GDB_ID.ROOT, ptCurrHook)
Return True
End If
End If
ElseIf nTableHookType = GDB_TY.CRV_LINE Then
' calcolo distanza linea hook tavola dal punto hook della ventosa
Dim ptL1 As Point3d : EgtStartPoint( nCurrHookId, GDB_ID.ROOT, ptL1)
Dim ptL2 As Point3d : EgtEndPoint( nCurrHookId, GDB_ID.ROOT, ptL2)
ptCurrHook = DispositionUtility.DistPointSegment( ptFixtHook, ptL1, ptL2)
Return True
End If
Return False
End Function
@@ -455,7 +396,6 @@ Public Class FixtureParametersVM
Dim NextSelectedId As Integer = EgtGetNextSelectedObj()
If EgtVerifyFixture(SelectedFixtureId) Then
EgtRemoveFixture(SelectedFixtureId)
DispositionUtility.RemoveFixtureFromHook( SelectedFixtureId)
For Index = 0 To FixtureTypeList.Count - 1
Dim SelFixtureName As String = String.Empty
EgtGetName(SelectedFixtureId, SelFixtureName)
@@ -7,7 +7,7 @@
<CheckBox Content="Move with Fixture" IsChecked="{Binding MoveWithFixture, Mode=TwoWay}"/>
<UniformGrid Columns="2" Margin="0,5,0,0">
<Button Content="New" Command="{Binding NewRawPartCommand}"/>
<Button Content="Remove" Command="{Binding RemoveRawPartCommand}"/>
<Button Content="Remove"/> <!--Command="{Binding RemoveRawPartCommand}"-->
</UniformGrid>
<Grid Visibility="{Binding RawPartParamVisibility, Mode=OneWay}">
<Grid.RowDefinitions>
@@ -117,7 +117,7 @@ Public Class RawPartOptionVM
End Property
''' <summary>
''' Execute NewRawPart. This method is invoked by the DoneCommand.
''' Execute the Point. This method is invoked by the DoneCommand.
''' </summary>
Public Sub NewRawPart()
DispositionUtility.ShowParts()
@@ -127,36 +127,6 @@ Public Class RawPartOptionVM
#End Region ' NewRawPartCommand
#Region "RemoveRawPartCommand"
''' <summary>
''' Returns a command that do Done.
''' </summary>
Public ReadOnly Property RemoveRawPartCommand As ICommand
Get
If m_cmdRemoveRawPart Is Nothing Then
m_cmdRemoveRawPart = New RelayCommand(AddressOf RemoveRawPart)
End If
Return m_cmdRemoveRawPart
End Get
End Property
''' <summary>
''' Execute RemoveRawPart. This method is invoked by the DoneCommand.
''' </summary>
Public Sub RemoveRawPart()
' ciclo sui grezzi selezionati
Dim nSelRawPartId As Integer = EgtGetFirstSelectedObj()
While nSelRawPartId <> GDB_ID.NULL
' rimuovo il grezzo dalla disposizione
EgtRemoveRawPart(nSelRawPartId)
nSelRawPartId = EgtGetNextSelectedObj()
End While
EgtDraw()
End Sub
#End Region ' RemoveRawPartCommand
#End Region ' Commands
End Class
@@ -238,11 +238,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -226,11 +226,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -1,4 +1,4 @@
<UserControl x:Class="FiveAxisMachiningParameterExpanderV"
<UserControl x:Class="FiveAxisMachinigParameterExpanderV"
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"
@@ -216,11 +216,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -1,6 +1,6 @@
Imports EgtWPFLib5.EgtFloating
Public Class FiveAxisMachiningParameterExpanderV
Public Class FiveAxisMachinigParameterExpanderV
Private m_RightTrayV As RightTrayV
Private EgtFloatingPanel As EgtFloatingPanel
@@ -216,11 +216,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -126,16 +126,6 @@ Public Class MachiningParameterExpanderVM
m_SliderValue = 1
NotifyPropertyChanged(NameOf(SliderValue))
End Sub
Friend Sub SetSliderValue(value As Integer)
Dim nOldSliderValue As Integer = m_SliderValue
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)
If nId <> GDB_ID.NULL Then m_nPtEntId = nId
EgtDraw()
NotifyPropertyChanged(NameOf(SliderValue))
End Sub
Dim WoodDrillParamExpanderV As WoodDrillingParameterExpanderV
Dim WoodSawParamExpanderV As WoodSawingParameterExpanderV
@@ -152,9 +142,8 @@ Public Class MachiningParameterExpanderVM
Dim StoneDrillParamExpanderV As StoneDrillingParameterExpanderV
Dim SurfFinishParamExpanderV As SurfFinishingParameterExpanderV
Dim WjParamExpanderV As WaterjettingParameterExpanderV
Dim FiveAxExpanderV As FiveAxisMachiningParameterExpanderV
Dim FiveAxExpanderV As FiveAxisMachinigParameterExpanderV
Dim SurfRoughExpanderV As SurfRoughingParameterExpanderV
Dim ProbExpanderV As ProbingParameterExpanderV
Private Sub Dummy()
@@ -193,7 +182,7 @@ Public Class MachiningParameterExpanderVM
Select Case nType
Case MCH_OY.DRILLING
If MatType = MaterialType.STONE5 Then
If MatType = MaterialType.STONE Then
If IsNothing(StoneDrillParamExpanderV) Then StoneDrillParamExpanderV = New StoneDrillingParameterExpanderV
StoneDrillParamExpanderV.DataContext = m_CurrOperation
Return StoneDrillParamExpanderV
@@ -203,7 +192,7 @@ Public Class MachiningParameterExpanderVM
Return WoodDrillParamExpanderV
End If
Case MCH_OY.SAWING
If MatType = MaterialType.STONE5 Then
If MatType = MaterialType.STONE Then
If IsNothing(StoneSawParamExpanderV) Then StoneSawParamExpanderV = New StoneSawingParameterExpanderV
StoneSawParamExpanderV.DataContext = m_CurrOperation
Return StoneSawParamExpanderV
@@ -217,7 +206,7 @@ Public Class MachiningParameterExpanderVM
If IsNothing(BeamMillParamExpanderV) Then BeamMillParamExpanderV = New BeamMillingParameterExpanderV
BeamMillParamExpanderV.DataContext = m_CurrOperation
Return BeamMillParamExpanderV
ElseIf MatType = MaterialType.STONE5 Then
ElseIf MatType = MaterialType.STONE Then
If IsNothing(StoneMillParamExpanderV) Then StoneMillParamExpanderV = New StoneMillingParameterExpanderV
StoneMillParamExpanderV.DataContext = m_CurrOperation
Return StoneMillParamExpanderV
@@ -235,7 +224,7 @@ Public Class MachiningParameterExpanderVM
StoneSawFinishParamExpanderV.DataContext = m_CurrOperation
Return StoneSawFinishParamExpanderV
Case MCH_OY.POCKETING
If MatType = MaterialType.STONE5 Then
If MatType = MaterialType.STONE Or MatType = MaterialType.STONE5 Then
' se macchina di tipo STONE ricavo il tipo di utensile
Dim sMachiningToolName = String.Empty
EgtMdbSetCurrMachining(sName)
@@ -271,17 +260,13 @@ Public Class MachiningParameterExpanderVM
WjParamExpanderV.DataContext = m_CurrOperation
Return WjParamExpanderV
Case MCH_OY.FIVEAXISMILLING
If IsNothing(FiveAxExpanderV) Then FiveAxExpanderV = New FiveAxisMachiningParameterExpanderV
If IsNothing(FiveAxExpanderV) Then FiveAxExpanderV = New FiveAxisMachinigParameterExpanderV
FiveAxExpanderV.DataContext = m_CurrOperation
Return FiveAxExpanderV
Case MCH_OY.SURFROUGHING
If IsNothing(SurfRoughExpanderV) Then SurfRoughExpanderV = New SurfRoughingParameterExpanderV
SurfRoughExpanderV.DataContext = m_CurrOperation
Return SurfRoughExpanderV
Case MCH_OY.PROBING
If IsNothing(ProbExpanderV) Then ProbExpanderV = New ProbingParameterExpanderV
ProbExpanderV.DataContext = m_CurrOperation
Return ProbExpanderV
End Select
'MachiningParameterExpanderItem.ReadOperationParam()
@@ -376,12 +361,21 @@ Public Class MachiningParameterExpanderVM
Return
End If
' Verifico se forzato ricalcolo da interfaccia
Dim bRecalc As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) <> 0)
Dim bRecalc As Boolean = False
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
bRecalc = True
Else
' Controllo se il tipo e' dr o sr o lr bRecalc e' true come quando viene selezionato Shift
For Each ItemNote As NoteListBoxItem In m_CurrOperation.NotesList
bRecalc = ItemNote.Type.Equals("dr") OrElse ItemNote.Type.Equals("lr") OrElse ItemNote.Type.Equals("sr") OrElse ItemNote.Type.Equals("br")
If bRecalc Then Exit For
Next
End If
' Aggiorno parametri di lavorazione
' La modifica di alcuni parametri forza il ricalcolo della geometria
Dim ModifiedGeometry As Boolean = m_CurrOperation.m_IsModifiedSelectedFaceUseType
' aggiorno valori modificati
m_CurrOperation.WriteOperationParam()
' Carico tutta la geometria selezionata in una lista
Dim SelectedGeometry As New List(Of Integer)
Dim EntityIndex As Integer = EgtGetFirstSelectedObj()
@@ -394,19 +388,49 @@ Public Class MachiningParameterExpanderVM
(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, ...)
' Verifico se geometria cambiata, confrontando selezione attuale con facet con geometria di lavorazione
Dim nInd As Integer = 0
Dim nMchId, nMchSub As Integer
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
Dim nSelId, nSelSub As Integer
SelData.GetIdSub(nInd, nSelId, nSelSub)
While Not ModifiedGeometry And (nMchId <> GDB_ID.NULL Or nSelId <> GDB_ID.NULL)
' Controllo uguaglianza
If nMchId <> nSelId Or nMchSub <> nSelSub Then ModifiedGeometry = True
' Passo al successivo
nInd += 1
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
SelData.GetIdSub(nInd, nSelId, nSelSub)
End While
If ModifiedGeometry Then
Dim vId() As Integer = Nothing
Dim vSub() As Integer = Nothing
SelData.GetAllIdSub(vId, vSub)
EgtSetMachiningGeometry(vId, vSub)
End If
' Gestione standard per altre entità (curve, testi, ...)
Else
' Imposto geometria
EgtSetMachiningGeometry(SelectedGeometry.ToArray)
' Verifico se geometria cambiata, confrontando selezione attuale con geometria di lavorazione
Dim nInd As Integer = 0
Dim nMchId, nMchSub As Integer
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
Dim nSelId As Integer
nSelId = If(nInd < SelectedGeometry.Count(), SelectedGeometry(nInd), GDB_ID.NULL)
While Not ModifiedGeometry And (nMchId <> GDB_ID.NULL Or nSelId <> GDB_ID.NULL)
' Controllo uguaglianza
If nMchId <> nSelId Then ModifiedGeometry = True
' Passo al successivo
nInd += 1
EgtGetMachiningGeometry(nInd, nMchId, nMchSub)
nSelId = If(nInd < SelectedGeometry.Count(), SelectedGeometry(nInd), GDB_ID.NULL)
End While
' Imposto geometria selezionata come geometria di lavorazione
If ModifiedGeometry Then
EgtSetMachiningGeometry(SelectedGeometry.ToArray)
End If
End If
' Rigenero la lavorazione
If Not EgtApplyMachining(bRecalc) Then
' Ricalcolo la lavorazione
If Not EgtApplyMachining(bRecalc Or ModifiedGeometry) Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
Dim sInfo As String = String.Empty
@@ -425,7 +449,6 @@ Public Class MachiningParameterExpanderVM
Map.refStatusBarVM.NotifyStatusOutput("")
End If
End If
' Restart visualizzazione utensile
SetSliderScale( EgtGetPreviewMachiningToolStepCount())
SetViewTool(True)
@@ -234,11 +234,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -243,11 +243,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -1,275 +0,0 @@
<UserControl x:Class="ProbingParameterExpanderV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<UserControl.Resources>
<EgtCAM5:OperationParamVisibilityConverter x:Key="OperationParamVisibilityConverter"/>
<EgtCAM5:DepthUnitConverter x:Key="DepthUnitConverter"/>
<sys:Int32 x:Key="Invert">0</sys:Int32>
<sys:Int32 x:Key="LeaveTab">1</sys:Int32>
<sys:Int32 x:Key="WorkSide">2</sys:Int32>
<sys:Int32 x:Key="HeadSide">3</sys:Int32>
<sys:Int32 x:Key="LeadInType">4</sys:Int32>
<sys:Int32 x:Key="ExtLinkType">5</sys:Int32>
<sys:Int32 x:Key="LeadOutType">6</sys:Int32>
<sys:Int32 x:Key="CurveUse">7</sys:Int32>
<sys:Int32 x:Key="StepType">8</sys:Int32>
<sys:Int32 x:Key="LeadLinkType">9</sys:Int32>
<sys:Int32 x:Key="Speed">10</sys:Int32>
<sys:Int32 x:Key="Feed">11</sys:Int32>
<sys:Int32 x:Key="StartFeed">12</sys:Int32>
<sys:Int32 x:Key="EndFeed">13</sys:Int32>
<sys:Int32 x:Key="TipFeed">14</sys:Int32>
<sys:Int32 x:Key="OffSr">15</sys:Int32>
<sys:Int32 x:Key="OffSl">16</sys:Int32>
<sys:Int32 x:Key="SideAngle">17</sys:Int32>
<sys:Int32 x:Key="Approx">18</sys:Int32>
<sys:Int32 x:Key="StartPos">19</sys:Int32>
<sys:Int32 x:Key="StartSlowLen">20</sys:Int32>
<sys:Int32 x:Key="EndSlowLen">21</sys:Int32>
<sys:Int32 x:Key="ThrouAddLen">22</sys:Int32>
<sys:Int32 x:Key="StepPar">23</sys:Int32>
<sys:Int32 x:Key="ReturnPos">24</sys:Int32>
<sys:Int32 x:Key="TabLen">25</sys:Int32>
<sys:Int32 x:Key="TabDist">26</sys:Int32>
<sys:Int32 x:Key="TabHeight">27</sys:Int32>
<sys:Int32 x:Key="TabAngle">28</sys:Int32>
<sys:Int32 x:Key="LiTang">29</sys:Int32>
<sys:Int32 x:Key="LiPerp">30</sys:Int32>
<sys:Int32 x:Key="LiElev">31</sys:Int32>
<sys:Int32 x:Key="LiCompLen">32</sys:Int32>
<sys:Int32 x:Key="LoTang">33</sys:Int32>
<sys:Int32 x:Key="LoPerp">34</sys:Int32>
<sys:Int32 x:Key="LoElev">35</sys:Int32>
<sys:Int32 x:Key="LoCompLen">36</sys:Int32>
<sys:Int32 x:Key="StartAddLen">37</sys:Int32>
<sys:Int32 x:Key="EndAddLen">38</sys:Int32>
<sys:Int32 x:Key="StepExtArc">39</sys:Int32>
<sys:Int32 x:Key="StepIntArc">40</sys:Int32>
<sys:Int32 x:Key="SideStep">41</sys:Int32>
<sys:Int32 x:Key="VertFeed">42</sys:Int32>
<sys:Int32 x:Key="NamePar">43</sys:Int32>
<sys:Int32 x:Key="Tool">44</sys:Int32>
<sys:Int32 x:Key="DepthStr">45</sys:Int32>
<sys:Int32 x:Key="UserNotes">46</sys:Int32>
<sys:Int32 x:Key="OverLapStr">47</sys:Int32>
<sys:Int32 x:Key="OffsetStr">48</sys:Int32>
<sys:Int32 x:Key="SubType">49</sys:Int32>
<sys:Int32 x:Key="SolChoiceType">50</sys:Int32>
<sys:Int32 x:Key="AxRotRef">51</sys:Int32>
<sys:Int32 x:Key="BlockedAxesRef">52</sys:Int32>
<sys:Int32 x:Key="FaceUseType">53</sys:Int32>
<sys:Int32 x:Key="InvertToolDir">54</sys:Int32>
<sys:Int32 x:Key="ExpanderLeadIn">55</sys:Int32>
<sys:Int32 x:Key="ExpanderLeadOut">56</sys:Int32>
<sys:Int32 x:Key="ApproxGen">57</sys:Int32>
<sys:Int32 x:Key="OscEnable">58</sys:Int32>
<sys:Int32 x:Key="OscHeight">59</sys:Int32>
<sys:Int32 x:Key="OscRampLen">60</sys:Int32>
<sys:Int32 x:Key="OscFlatLen">61</sys:Int32>
</UserControl.Resources>
<StackPanel Name="OperationParametersStackPanel">
<StackPanel Name="OperationFirstParametersStackPanel">
<UniformGrid Columns="2">
<TextBlock Text="{Binding DepthStrTxBl}" Style="{DynamicResource MPExpander_DepthTxBlMargin}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding DepthStr, UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource DepthUnitConverter}}"
Style="{DynamicResource MPExpander_DepthTxBxMargin}"/>
</UniformGrid>
<EgtWPFLib5:CheckParamV ParamTxBl="{Binding InvertTxBl}"
ParamChBx="{Binding Path=Invert,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource CheckParamV_Margin}"/>
<UniformGrid Columns="2">
<TextBlock Text="{Binding UserNotesTxBl}"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding UserNotes, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource MPExpander_UserNotesTxBxMargin}">
<EgtWPFLib5:EgtTextBox.ToolTip>
<TextBlock Text="{Binding UserNotesTooltip}"/>
</EgtWPFLib5:EgtTextBox.ToolTip>
</EgtWPFLib5:EgtTextBox>
<TextBlock Text="{Binding SystemNotesTxBl}"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"
Visibility="{Binding SysNotes_Visibility}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SystemNotes, UpdateSourceTrigger=PropertyChanged}"
Style="{DynamicResource MPExpander_UserNotesTxBxMargin}"
Visibility="{Binding SysNotes_Visibility}"
IsReadOnly="True"/>
</UniformGrid>
</StackPanel>
<StackPanel Name="AutomaticCloseExpanderStackPanel">
<Expander Header="{Binding GenericExpanderHeader}" Name="GenericExpander"
Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1">
<StackPanel>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding StartPosTxBl}"
ParamTxBx="{Binding Path=StartPos,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding SubTypeTxBl}"
ParamCmBxList="{Binding Path=SubTypeList,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
ParamCmBxSelIndex="{Binding Path=SelectedSubType}"
Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel>
</Expander>
<Expander Name="AdvancedParam" IsExpanded="{Binding AdvancedParamIsExpander}"
Style="{StaticResource ExpanderStyle}" Margin="0,1,0,1">
<Expander.Header>
<UniformGrid Columns="2">
<TextBlock Text="{Binding AdvancedParamMsg}"
Margin="2.5"/>
<Button Command="{Binding ShowNoteListComboCommand}"
ToolTip="{Binding ShowNoteToolTip}"
IsEnabled="{Binding ShowNoteListCombo_IsEnable}"
Visibility="{Binding ShowNoteListCombo_Visibility}"
Grid.Column="1"
HorizontalAlignment="Right"
Margin="2.5,2.5,7,2.5"
Width="20">
<Image Source="/Resources/Note/+.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Expander.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel>
<EgtWPFLib5:CheckParamV ParamTxBl="{Binding InvertToolDirTxBl}"
ParamChBx="{Binding Path=InvertToolDir,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource CheckParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding InitAngsTxBl}"
ParamTxBx="{Binding Path=InitAngs,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding BlockedAxisTxBl}"
ParamTxBx="{Binding Path=BlockedAxis,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding SolChoiceTypeTxBl}"
ParamCmBxList="{Binding Path=SolChoiceTypeList,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True,
Mode=OneWay}"
ParamCmBxSelIndex="{Binding Path=SelectedSolChoiceType}"
Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel>
<Grid Grid.Row="1" Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding NotesList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Description}"
Margin="0,5.5,29,0"
Width="82"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/>
<TabControl SelectedIndex="{Binding SelTypeValue}"
Grid.Column="1"
Background="Transparent"
BorderBrush="Transparent">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="TEXT">
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}"
IsReadOnly="False"/>
</TabItem>
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
Width="20"
Height="20"
Margin="5,0,0,0">
<Image Source="/Resources/Note/-.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<ComboBox ItemsSource="{Binding NotesListCombo}"
SelectedItem="{Binding SelNoteItemCombo}"
Grid.Row="1"
Grid.ColumnSpan="1"
Visibility="{Binding ComboAddVisibility}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Description}"
Margin="2.5"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
</Grid>
</Expander>
<Expander Style="{StaticResource ExpanderStyle}">
<Expander.Header>
<TextBlock Text="{Binding ToolExpanderHeader}"/>
</Expander.Header>
<StackPanel>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding FeedTxBl}"
ParamTxBx="{Binding Path=Feed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding TipFeedTxBl}"
ParamTxBx="{Binding Path=TipFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding StartFeedTxBl}"
ParamTxBx="{Binding Path=StartFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:StringParamV ParamTxBl="{Binding EndFeedTxBl}"
ParamTxBx="{Binding Path=EndFeed,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
</StackPanel>
</Expander>
<Interactivity:Interaction.Behaviors>
<EgtCAM5:AutomaticCloseExpander/>
</Interactivity:Interaction.Behaviors>
</StackPanel>
</StackPanel>
</UserControl>
@@ -1,83 +0,0 @@
Imports EgtWPFLib5.EgtFloating
Public Class ProbingParameterExpanderV
Private m_RightTrayV As RightTrayV
Private EgtFloatingPanel As EgtFloatingPanel
Private m_bFirst As Boolean = True
Private Sub OperationExpanderView_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
If m_bFirst Then
m_RightTrayV = FindAncestor(Of RightTrayV)(Me)
EgtFloatingPanel = FindAncestor(Of EgtFloatingPanel)(Me)
AddHandler m_RightTrayV.SizeChanged, AddressOf RightTrayV_SizeChanged
PanelHeight = EgtFloatingPanel.DesiredSize.Height
Me.AutomaticCloseExpanderStackPanelHeight = AutomaticCloseExpanderStackPanel.ActualHeight
m_bFirst = False
End If
CalculateOperationParametersStackPanelMaxHeight()
End Sub
Dim m_bSizeChanging As Boolean = False
Private Sub RightTrayV_SizeChanged(sender As Object, e As System.Windows.SizeChangedEventArgs)
If m_bSizeChanging Then Return
m_bSizeChanging = True
CalculateOperationParametersStackPanelMaxHeight()
m_bSizeChanging = False
End Sub
Dim PanelHeight As Double = 0
Dim AutomaticCloseExpanderStackPanelHeight As Double = 0
' ricalcola spazio utilizzabile quando modificata dimensione finestra e quindi dimensione della tray
Private Sub CalculateOperationParametersStackPanelMaxHeight()
Dim AutomaticCloseExpanderStackPanelHeight As Double = 0
Dim OpenedExpanderList As New List(Of Boolean)
For Index = 0 To AutomaticCloseExpanderStackPanel.Children.Count - 1
If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then
Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander)
If IndexedExpander.IsExpanded Then
OpenedExpanderList.Add(True)
IndexedExpander.IsExpanded = False
Dim CurrExpanderContent As FrameworkElement = DirectCast(IndexedExpander.Content, FrameworkElement)
CurrExpanderContent.Measure(New Size(Double.PositiveInfinity, Double.PositiveInfinity))
AutomaticCloseExpanderStackPanelHeight -= CurrExpanderContent.DesiredSize.Height
' Sottraggo anche i padding
AutomaticCloseExpanderStackPanelHeight -= (IndexedExpander.Padding.Top + IndexedExpander.Padding.Bottom)
Else
OpenedExpanderList.Add(False)
End If
Else
OpenedExpanderList.Add(False)
End If
Next
Dim RemainingHeight As Double = m_RightTrayV.ActualHeight - PanelHeight
AutomaticCloseExpanderStackPanel.MaxHeight = Me.AutomaticCloseExpanderStackPanelHeight + RemainingHeight
For Index = AutomaticCloseExpanderStackPanel.Children.Count - 1 To 0 Step -1
If TypeOf AutomaticCloseExpanderStackPanel.Children(Index) Is Expander Then
Dim IndexedExpander As Expander = DirectCast(AutomaticCloseExpanderStackPanel.Children(Index), Expander)
If OpenedExpanderList(Index) Then
IndexedExpander.IsExpanded = True
End If
End If
Next
End Sub
' Funzione che permette di trovare il primo contenitore di tipo T di un elemento grafico dependencyObject
Public Function FindAncestor(Of T As Class)(dependencyObject As DependencyObject) As T
Dim target As DependencyObject = dependencyObject
Do
target = LogicalTreeHelper.GetParent(target)
Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T)
If IsNothing(target) Then
target = dependencyObject
Do
target = VisualTreeHelper.GetParent(target)
Loop While target IsNot Nothing AndAlso Not (TypeOf target Is T)
End If
Return TryCast(target, T)
End Function
End Class
@@ -215,11 +215,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -219,11 +219,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -213,11 +213,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -124,10 +124,10 @@
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<EgtWPFLib5:ComboParamV ParamTxBl="{Binding ExtLinkTypeTxBl}"
ParamCmBxList="{Binding Path=LeadLinkTypeList,
ParamCmBxList="{Binding Path=ExtLinkTypeList,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
ParamCmBxSelIndex="{Binding Path=SelectedLeadLinkType}"
ParamCmBxSelIndex="{Binding Path=SelectedExtLinkType}"
Style="{DynamicResource ComboParamV_Margin}"/>
</StackPanel>
</Expander>
@@ -211,11 +211,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -219,11 +219,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -226,11 +226,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -236,11 +236,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -201,11 +201,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -220,11 +220,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -238,11 +238,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -228,11 +228,6 @@
<TabItem Header="CHECKBOX">
<CheckBox IsChecked="{Binding Value, UpdateSourceTrigger=PropertyChanged}"/>
</TabItem>
<TabItem Header="COMBOBOX">
<ComboBox ItemsSource="{Binding ListKeyValue}"
SelectedItem="{Binding SelKeyValue, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="KeyValue"/>
</TabItem>
</TabControl>
<Button Command="{Binding RemoveItemNoteCommand}"
Grid.Column="2"
@@ -28,31 +28,6 @@ Public Class DispositionOpListBoxItem
End Set
End Property
Public Property OnOffAll As Boolean?
Get
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
' Ritorno il valore specificato in base agli stati delle operazioni di cui abbiamo raccolto gli indici
If OpIndexes.Count = 0 Then Return False
Dim bTemp As Boolean = DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(0)), MachiningOpListBoxItem).OnOff
For OpInDispIndex = 1 To OpIndexes.Count - 1
If DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(OpInDispIndex)), MachiningOpListBoxItem).OnOff <> bTemp Then Return Nothing
Next
Return bTemp
End Get
Set(value As Boolean?)
' Recupero gli indici delle operazioni della Disposizione corrente
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
If OpIndexes.Count = 0 Then
NotifyPropertyChanged(NameOf(OnOffAll))
Return
End If
For Each OpInDispIndex In OpIndexes
DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpInDispIndex), MachiningOpListBoxItem).OnOff = If(IsNothing(value), False, CBool(value))
Next
End Set
End Property
Private m_Image As String = String.Empty
Public Property Image As String
Get
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class MachiningOpListBoxItem
@@ -125,31 +126,6 @@ Public Class MachiningOpListBoxItem
End Get
End Property
Private m_bOnOff As Boolean = True
Public Property OnOff As Boolean
Get
Return m_bOnOff
End Get
Set(value As Boolean)
If m_bOnOff <> value Then
m_bOnOff = value
Dim bOldEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
' se abilitato, eseguo operazione
Dim status As Integer = GDB_ST.OFF
If value Then
status = GDB_ST.ON_
End If
ModifyStatusLamp()
EgtSetStatus(Id, status)
If bOldEnMod Then EgtEnableModified()
EgtDraw()
End If
NotifyPropertyChanged(NameOf(OnOff))
End Set
End Property
' Definizione comandi
Private m_cmdModifyNameEnter As ICommand
Private m_cmdModifyNameEsc As ICommand
@@ -201,21 +177,6 @@ Public Class MachiningOpListBoxItem
End Select
End Function
Private Sub ModifyStatusLamp()
' Recupero l'indice dell'operazione a cui abbiamo appena modificato lo Status e l'indice della Disposizione che la contiene
Dim DispIndex As Integer = 0
Dim OpIndex As Integer = 0
For Each OpItem In Map.refOperationsListExpanderVM.OperationList
If EgtGetOperationType(OpItem.Id) = MCH_OY.DISP Then DispIndex = OpIndex
If OpItem.Id = Id Then
Exit For
End If
OpIndex += 1
Next
' Notifico StatusAll per calcolare lo stato della CheckBox della Disposizione
Map.refOperationsListExpanderVM.OperationList(DispIndex).NotifyPropertyChanged(NameOf(DispositionOpListBoxItem.OnOffAll))
End Sub
#Region "COMMANDS"
#Region "ModifyNameEnterCommand"
@@ -74,7 +74,7 @@ Public Class OperationListBoxItem
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
NotifyPropertyChanged("IsSelected")
' Aggiorno visualizzazione
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
EgtDraw()
Return
End If
' Imposto la fase di lavorazione corrente
@@ -106,32 +106,26 @@ Public Class OperationListBoxItem
Dim EntityIndex As Integer = 0
Dim SubEntityIndex As Integer = 0
While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
EgtSelectObj(EntityIndex)
If EgtGetType(EntityIndex) = GDB_TY.SRF_MESH Or EgtGetType(EntityIndex) = GDB_TY.SRF_FRGN Then
EgtSelectObj( EntityIndex)
If EgtGetType( EntityIndex) = GDB_TY.SRF_MESH Or EgtGetType( EntityIndex) = GDB_TY.SRF_FRGN Then
SelData.AddIdSub(EntityIndex, SubEntityIndex)
End If
CountIndex += 1
End While
End If
' Notifico al contentcontrol OperationParameter di aggiornarsi
If Not IsNothing(Map.refOperationParametersExpanderVM) Then
If Not IsNothing( Map.refOperationParametersExpanderVM) Then
Map.refOperationParametersExpanderVM.OnPropertyChanged("OperationParameters")
End If
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveUp_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
' Notifico l'operazione selezionata all'expander con l'albero delle lavorazioni aggiungibili
If Not IsNothing(Map.refMachiningTreeExpanderVM) Then
If Not IsNothing( Map.refMachiningTreeExpanderVM) Then
Map.refMachiningTreeExpanderVM.nSelectedOperationId = Me.Id
End If
' Aggiorno visualizzazione
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
EgtDraw()
End If
' Resetto valori slider
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
Map.refMachiningParameterExpanderVM.SetSliderScale(EgtGetPreviewMachiningToolStepCount())
Map.refMachiningParameterExpanderVM.ResetSliderValue()
End If
'OnPropertyChanged("ToolExpanderHeader")
Map.refOperationsListExpanderVM.OnPropertyChanged("DuplicateCmd_IsEnabled")
Map.refOperationsListExpanderVM.OnPropertyChanged("MachToDb_IsEnabled")
@@ -177,8 +177,6 @@ Public Class OperationParametersExpanderVM
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomWaterJetting
Case MCH_OY.FIVEAXISMILLING
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomFiveAxMilling
Case MCH_OY.PROBING
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomProbing
End Select
' Imposto visualizzazione utensile
Map.refMachiningParameterExpanderVM.SetViewTool( True)
@@ -43,7 +43,6 @@
</Border.InputBindings>
<Grid Style="{StaticResource LayoutRoot}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
@@ -51,12 +50,9 @@
</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}"
<TextBlock Grid.Column="1" Text="{Binding Name}"
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
<TextBox Grid.Column="1" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
Width="150"
x:Name="Box"
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
@@ -67,7 +63,7 @@
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
</TextBox.InputBindings>
</TextBox>
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
<TextBlock Grid.Column="2" Text="{Binding Info}"/>
</Grid>
</Border>
</DataTemplate>
@@ -80,9 +76,6 @@
</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"/>
@@ -84,7 +84,6 @@ Public Class OperationsListExpanderVM
Set(value As Boolean)
If value <> m_ListIsExpanded Then
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.OPERATIONLIST, value)
SetStatusOnLamp()
End If
End Set
End Property
@@ -112,37 +111,6 @@ Public Class OperationsListExpanderVM
End Set
End Property
Private m_tmpOperationList As New ObservableCollection(Of MachiningOpListBoxItem)
Public Property tmpOperationList As ObservableCollection(Of MachiningOpListBoxItem)
Get
Return m_tmpOperationList
End Get
Set(value As ObservableCollection(Of MachiningOpListBoxItem))
m_tmpOperationList = value
End Set
End Property
Private m_StatusLampList As New ObservableCollection(Of StatusLamp)
Public Property StatusLampList As ObservableCollection(Of StatusLamp)
Get
Return m_StatusLampList
End Get
Set(value As ObservableCollection(Of StatusLamp))
m_StatusLampList = value
End Set
End Property
' Forza il disegno quando seleziono la lampadina
Private m_ForceDrawInIsSelected As Boolean = True
Public Property ForceDrawInIsSelected As Boolean
Get
Return m_ForceDrawInIsSelected
End Get
Set(value As Boolean)
m_ForceDrawInIsSelected = value
End Set
End Property
Public ReadOnly Property DuplicateCmd_IsEnabled As Boolean
Get
Dim SelType As Integer = MCH_OY.NONE
@@ -290,7 +258,7 @@ Public Class OperationsListExpanderVM
#Region "CONSTRUCTOR"
Sub New()
m_bMoveThroughDisps = (GetPrivateProfileInt(S_MACH, K_MOVETHROUGHDISPS, 0) <> 0)
m_bMoveThroughDisps = ( GetPrivateProfileInt( S_MACH, K_MOVETHROUGHDISPS, 0) <> 0)
' Creo riferimento a questa classe in Map
Map.SetRefOperationsListExpanderVM(Me)
Me.ListIsExpanded = True
@@ -361,11 +329,10 @@ Public Class OperationsListExpanderVM
' Aggiungo la nuova fase
Dim nPhase As Integer = EgtAddPhase()
Dim nDispId As Integer = EgtGetPhaseDisposition(nPhase)
' Confermo grezzi, movimenti assi di disposizione e bloccaggi sopra salvati
' Confermo grezzi e bloccaggi sopra salvati
For Each nId As Integer In vRawId
EgtKeepRawPart(nId, nLastPhase)
Next
EgtKeepAllDispAxes(nLastPhase)
For Each nId As Integer In vFxtId
EgtKeepFixture(nId, nLastPhase)
Next
@@ -466,10 +433,8 @@ Public Class OperationsListExpanderVM
If EgtGetOperationMode(selOperation.Id) Then
Map.refOperationParametersExpanderVM.ParametersIsExpanded = True
If EgtGetOperationType(selOperation.Id) <> MCH_OY.DISP Then
Map.refMachiningParameterExpanderVM.SetSliderScale(EgtGetPreviewMachiningToolStepCount())
Map.refMachiningParameterExpanderVM.ResetSliderValue()
End If
Map.refMachiningParameterExpanderVM.SetSliderScale( EgtGetPreviewMachiningToolStepCount())
Map.refMachiningParameterExpanderVM.ResetSliderValue()
End If
End Sub
@@ -494,55 +459,55 @@ Public Class OperationsListExpanderVM
''' </summary>
Public Sub MoveUp()
' Verifico il numero di elementi selezionati
Dim indexes As New List(Of Integer)()
Dim indexes As New List( Of Integer)()
For index As Integer = 0 To OperationList.Count - 1
' Verifico gli elementi selezionati
If OperationList.Item(index).IsSelected Then
If OperationList.Item( index).IsSelected Then
' Se presente una disposizione esco
If EgtGetOperationType(OperationList.Item(index).Id) = MCH_OY.DISP Then Return
If EgtGetOperationType( OperationList.Item( index).Id) = MCH_OY.DISP Then Return
' Aggiungo l'operazione
indexes.Add(index)
indexes.Add( index)
End If
Next
Dim lenIndexes As Integer = indexes.Count
' Recupero Id ultima entità selezionata e precedente a quelle selezionate
Dim LastSelectedId As Integer = OperationList(indexes(lenIndexes - 1)).Id
Dim PreviousId As Integer = OperationList(indexes(0) - 1).Id
Dim LastSelectedId As Integer = OperationList( indexes( lenIndexes - 1)).Id
Dim PreviousId As Integer = OperationList( indexes( 0) - 1).Id
' Sposto l'operazione precedente a quelle selezionate nell'ambiente Egt
If EgtRelocate(PreviousId, LastSelectedId, GDB_POS.AFTER) Then
If EgtRelocate( PreviousId, LastSelectedId, GDB_POS.AFTER) Then
' Sposto l'operazione precedente a quelle selezionate nella grafica
OperationList.Move(indexes(0) - 1, indexes(lenIndexes - 1)) ' + 1)
OperationList.Move( indexes(0) - 1, indexes( lenIndexes - 1)) ' + 1)
' Ricalcolo le lavorazioni selezionate e quella che era precedente (e ora è seguente)
If Not m_bMoveThroughDisps Then
For index As Integer = 0 To indexes.Count - 1
EgtSetCurrMachining(OperationList(indexes(index)).Id)
EgtApplyMachining(False)
EgtSetCurrMachining( OperationList( indexes( index)).Id)
EgtApplyMachining( False)
Next
EgtSetCurrMachining(PreviousId)
EgtApplyMachining(False)
EgtSetCurrMachining( PreviousId)
EgtApplyMachining( False)
EgtDraw()
OnPropertyChanged("MoveUp_IsEnabled")
OnPropertyChanged("MoveDown_IsEnabled")
OnPropertyChanged( "MoveUp_IsEnabled")
OnPropertyChanged( "MoveDown_IsEnabled")
Map.refProjectVM.EmitTitle()
Else
Dim nCurrPhase As Integer = EgtGetOperationPhase(LastSelectedId)
For index As Integer = 0 To indexes.Count - 1
Dim nOpeId As Integer = OperationList(indexes(index) - 1).Id
If EgtGetOperationType(nOpeId) <> MCH_OY.DISP Then
EgtAdjustOperationPhase(nOpeId)
EgtSetCurrMachining(nOpeId)
EgtApplyMachining(False)
Dim nOpeId As Integer = OperationList( indexes( index) - 1).Id
If EgtGetOperationType( nOpeId) <> MCH_OY.DISP Then
EgtAdjustOperationPhase( nOpeId)
EgtSetCurrMachining( nOpeId)
EgtApplyMachining( False)
End If
Next
If EgtGetOperationType(PreviousId) <> MCH_OY.DISP Then
EgtSetCurrMachining(PreviousId)
EgtApplyMachining(False)
If EgtGetOperationType( PreviousId) <> MCH_OY.DISP Then
EgtSetCurrMachining( PreviousId)
EgtApplyMachining( False)
End If
Dim nNewPhase As Integer = EgtGetOperationPhase(LastSelectedId)
If nNewPhase <> nCurrPhase Then EgtSetCurrPhase(nNewPhase)
If nNewPhase <> nCurrPhase Then EgtSetCurrPhase( nNewPhase)
EgtDraw()
OnPropertyChanged(NameOf(MoveUp_IsEnabled))
OnPropertyChanged(NameOf(MoveDown_IsEnabled))
OnPropertyChanged( NameOf(MoveUp_IsEnabled))
OnPropertyChanged( NameOf(MoveDown_IsEnabled))
Map.refProjectVM.EmitTitle()
End If
End If
@@ -569,52 +534,52 @@ Public Class OperationsListExpanderVM
''' </summary>
Public Sub MoveDown()
' Verifico il numero di elementi selezionati
Dim indexes As New List(Of Integer)()
Dim indexes As New List( Of Integer)()
For index As Integer = 0 To OperationList.Count - 1
' Verifico gli elementi selezionati
If OperationList.Item(index).IsSelected Then
If OperationList.Item( index).IsSelected Then
' Se presente una disposizione esco
If EgtGetOperationType(OperationList.Item(index).Id) = MCH_OY.DISP Then Return
If EgtGetOperationType( OperationList.Item( index).Id) = MCH_OY.DISP Then Return
' Aggiungo l'operazione
indexes.Add(index)
indexes.Add( index)
End If
Next
Dim lenIndexes As Integer = indexes.Count
' Recupero Id prima entità selezionata e successiva a quelle selezionate
Dim FirstSelectedId As Integer = OperationList(indexes(0)).Id
Dim NextId As Integer = OperationList(indexes(lenIndexes - 1) + 1).Id
Dim FirstSelectedId As Integer = OperationList( indexes( 0)).Id
Dim NextId As Integer = OperationList( indexes( lenIndexes - 1) + 1).Id
' Sposto l'operazione successiva a quelle selezionate nell'ambiente Egt
If EgtRelocate(NextId, FirstSelectedId, GDB_POS.BEFORE) Then
If EgtRelocate( NextId, FirstSelectedId, GDB_POS.BEFORE) Then
' Sposto l'operazione successiva a quelle selezionate nella grafica
OperationList.Move(indexes(lenIndexes - 1) + 1, indexes(0))
OperationList.Move( indexes( lenIndexes - 1) + 1, indexes( 0))
' Ricalcolo la lavorazioni selezionate e quella che era seguente (e ora è precedente)
If Not m_bMoveThroughDisps Then
EgtSetCurrMachining(NextId)
EgtApplyMachining(False)
EgtSetCurrMachining( NextId)
EgtApplyMachining( False)
For index As Integer = 0 To indexes.Count - 1
EgtSetCurrMachining(OperationList(indexes(index)).Id)
EgtApplyMachining(False)
EgtSetCurrMachining( OperationList( indexes( index)).Id)
EgtApplyMachining( False)
Next
EgtDraw()
OnPropertyChanged("MoveUp_IsEnabled")
OnPropertyChanged("MoveDown_IsEnabled")
OnPropertyChanged( "MoveUp_IsEnabled")
OnPropertyChanged( "MoveDown_IsEnabled")
Map.refProjectVM.EmitTitle()
Else
If EgtGetOperationType(NextId) <> MCH_OY.DISP Then
EgtSetCurrMachining(NextId)
EgtApplyMachining(False)
If EgtGetOperationType( NextId) <> MCH_OY.DISP Then
EgtSetCurrMachining( NextId)
EgtApplyMachining( False)
End If
For index As Integer = 0 To indexes.Count - 1
Dim nOpeId As Integer = OperationList(indexes(index) + 1).Id
If EgtGetOperationType(nOpeId) <> MCH_OY.DISP Then
EgtAdjustOperationPhase(nOpeId)
EgtSetCurrMachining(nOpeId)
EgtApplyMachining(False)
Dim nOpeId As Integer = OperationList( indexes( index) + 1).Id
If EgtGetOperationType( nOpeId) <> MCH_OY.DISP Then
EgtAdjustOperationPhase( nOpeId)
EgtSetCurrMachining( nOpeId)
EgtApplyMachining( False)
End If
Next
EgtDraw()
OnPropertyChanged(NameOf(MoveUp_IsEnabled))
OnPropertyChanged(NameOf(MoveDown_IsEnabled))
OnPropertyChanged( NameOf( MoveUp_IsEnabled))
OnPropertyChanged( NameOf( MoveDown_IsEnabled))
Map.refProjectVM.EmitTitle()
End If
End If
@@ -640,8 +605,6 @@ Public Class OperationsListExpanderVM
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub Update()
Dim tmpStatusLamp As New StatusLamp()
Map.refOperationsListExpanderVM.StatusLampList = tmpStatusLamp.LoadStatusLamp()
' Cursore di attesa
Application.Current.MainWindow.ForceCursor = True
Application.Current.MainWindow.Cursor = Cursors.Wait
@@ -651,7 +614,6 @@ Public Class OperationsListExpanderVM
Dim bOk As Boolean = EgtApplyAllMachinings(bRecalc, False, sErr)
EgtSetModified()
' Deseleziono l'Operazione selezionata e la de-evidenzio nel Disegno
m_ForceDrawInIsSelected = False
For Each Operation In OperationList
If Operation.IsSelected Then
Operation.IsSelected = False
@@ -659,9 +621,6 @@ Public Class OperationsListExpanderVM
Next
' Ricarico la lista delle Operazioni
LoadOperationList(GDB_ID.NULL)
' Rimetto le lampadine in modo corretto
tmpStatusLamp.UpdateStatusLamp()
m_ForceDrawInIsSelected = True
' Aggiorno visualizzazione e ritorno a cursore standard
EgtDraw()
Application.Current.MainWindow.ForceCursor = False
@@ -671,8 +630,7 @@ Public Class OperationsListExpanderVM
If Not String.IsNullOrEmpty(sErr) Then
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
' Errore nell'aggiornamento delle lavorazioni!
MessageBox.Show(EgtMsg(5346), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
Else
Map.refStatusBarVM.NotifyStatusOutput(EgtMsg(MSG_OPERATION + 11))
@@ -1038,9 +996,7 @@ Public Class OperationsListExpanderVM
Private Sub LoadOperationList()
OperationList.Clear()
tmpOperationList.Clear()
Dim Id As Integer
Dim OpStatusOnOff As Integer
Dim OpStatus As Boolean = True
Dim OpName As String = String.Empty
Dim OpType As Integer = 0
@@ -1053,14 +1009,9 @@ Public Class OperationsListExpanderVM
If IsValidMachiningType(OpType) Then
EgtSetCurrMachining(Id)
OpStatus = EgtGetOperationMode(Id)
EgtGetStatus(Id, OpStatusOnOff)
EgtGetMachiningParam(MCH_MP.TOOL, OpTool)
EgtGetMachiningParam(MCH_MP.NAME, OpMach)
' Dichiarato per far si che le due liste operino in contemporaneo
Dim local_MachiningOpListBoxItem As New MachiningOpListBoxItem(Id, OpStatus, OpName, OpType, OpTool, OpMach)
OperationList.Add(local_MachiningOpListBoxItem)
' Lista creata per lavorare solo su le operazioni di macchina, utilizzata per la gestione dello spegnimento e accensione delle lamp
tmpOperationList.Add(local_MachiningOpListBoxItem)
OperationList.Add(New MachiningOpListBoxItem(Id, OpStatus, OpName, OpType, OpTool, OpMach))
ElseIf IsValidDispositionType(OpType) Then
OpStatus = True
OpTool = String.Empty
@@ -1302,7 +1253,7 @@ Public Class OperationsListExpanderVM
If m_NewMachining Then EndNewMachining(GDB_ID.NULL)
' Disabilito visualizzazione utensile
If Not IsNothing(m_MachiningParameterExpander) Then
Map.refMachiningParameterExpanderVM.SetViewTool(False)
Map.refMachiningParameterExpanderVM.SetViewTool( False)
End If
' Deseleziono le operazioni correnti per eliminare il mark
For Each Operation In OperationList
@@ -1312,83 +1263,6 @@ Public Class OperationsListExpanderVM
Next
End Sub
Private Sub SetStatusOnLamp()
If Not IsNothing(m_tmpOperationList) Then
For Each ItemOp As MachiningOpListBoxItem In m_tmpOperationList
If Not ItemOp.OnOff Then
EgtSetStatus(ItemOp.Id, GDB_ST.OFF)
End If
Next
End If
EgtDraw()
End Sub
#End Region ' Methods
End Class
Public Class StatusLamp
#Region "FIELDS & PROPERTIES"
Private m_nId As Integer
Public Property nId As Integer
Get
Return m_nId
End Get
Set(value As Integer)
m_nId = value
End Set
End Property
Private m_bStatusLamp As Boolean
Public Property bStatusLamp As Boolean
Get
Return m_bStatusLamp
End Get
Set(value As Boolean)
m_bStatusLamp = value
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(nId As Integer, bStatusLamp As Boolean)
m_nId = nId
m_bStatusLamp = bStatusLamp
End Sub
Sub New()
End Sub
#End Region ' Constructor
#Region "METHODS"
Public Function LoadStatusLamp() As ObservableCollection(Of StatusLamp)
Dim tmpStatusLampList As New ObservableCollection(Of StatusLamp)
For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
tmpStatusLampList.Add(New StatusLamp(ItemOp.Id, ItemOp.OnOff))
Next
Return tmpStatusLampList
End Function
Public Sub UpdateStatusLamp()
Dim tmpStatusLamp As StatusLamp
If Not IsNothing(Map.refOperationsListExpanderVM.tmpOperationList) Then
For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
tmpStatusLamp = Map.refOperationsListExpanderVM.StatusLampList.FirstOrDefault(Function(x) x.nId = ItemOp.Id)
If Not tmpStatusLamp.bStatusLamp Then
EgtSetStatus(ItemOp.Id, GDB_ST.OFF)
ItemOp.OnOff = False
End If
Next
End If
End Sub
#End Region ' Methods
End Class
@@ -51,14 +51,7 @@
<TextBlock Text="{Binding VMillMsg}" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Visibility="{Binding Trace_Visibility}"
IsEnabled="{Binding Trace_IsEnabled}" Margin="10,5,10,0">
<CheckBox HorizontalAlignment="Left" VerticalAlignment="Center"
IsChecked="{Binding TraceActive}"/>
<TextBlock Text="{Binding TraceMsg}" Margin="5,0,0,0"/>
</StackPanel>
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
@@ -17,9 +18,6 @@ Public Class SimulationExpanderVM
Set(value As Boolean)
If value <> m_Simulation_IsExpanded Then
Map.refMachiningOptionPanelVM.Set_IsExpanded(MachiningOptionPanelVM.MachiningOptionPanelExpander.SIMULATION, value)
Map.refOperationsListExpanderVM.StatusLampList.Clear()
Dim tmpStatusLamp As New StatusLamp()
Map.refOperationsListExpanderVM.StatusLampList = tmpStatusLamp.LoadStatusLamp()
End If
End Set
End Property
@@ -103,11 +101,9 @@ Public Class SimulationExpanderVM
If Not GetCncFileName(True, sCncFile, sInfo) Then Return
' Eseguo
If Not EgtGenerate(sCncFile, sInfo) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
Dim nErr = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation)
@@ -229,16 +225,11 @@ Public Class SimulationExpanderVM
UpdateUI()
' Messaggio in caso di errore
If Not bOk Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
End If
End If
' Imposto stato corrente
@@ -248,8 +239,7 @@ Public Class SimulationExpanderVM
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
SliderValue = SliderVal
' Gestione check VMill
If IsKeyEnabledVirtualMilling() And
EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
If IsKeyEnabledVirtualMilling() And EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
VMill_Visibility = Visibility.Visible
VMill_IsEnabled = True
Dim bVal As Boolean
@@ -262,16 +252,6 @@ Public Class SimulationExpanderVM
VMillActive = False
EgtEnableModified()
End If
' Gestione check Trace
If IniFile.GetPrivateProfileInt(S_SIMUL, K_TRACEENABLE, 0) <> 0 And
EgtUILib.GetPrivateProfileInt(S_TOOLTRACE, K_TT_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
Trace_Visibility = Visibility.Visible
Trace_IsEnabled = True
If TraceActive Then TraceActive = True
Else
Trace_Visibility = Visibility.Collapsed
Trace_IsEnabled = False
End If
' Aggiorno visualizzazione dati macchina
ShowCncData()
StatusMsg = EgtMsg(MSG_SIMULATION + 14) ' HOME
@@ -287,16 +267,11 @@ Public Class SimulationExpanderVM
Map.refEstimationsExpanderVM.NotifyPropertyChanged("Estimation_IsEnabled")
m_bStopOnNextCollision = True
If Not EgtSimStart(False) Then
Dim nErr As Integer = EgtGetLastMachMgrErrorId()
If nErr = 1000 Then
MessageBox.Show(EgtMsg(5333), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr = 1001 Then
MessageBox.Show(EgtMsg(5334), EgtMsg(5320), MessageBoxButton.OK, MessageBoxImage.Information)
ElseIf nErr <> 0 Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation) '.... - ERRORE
Else
MessageBox.Show(EgtMsg(15010), EgtMsg(5305), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) 'Errore sconosciuto - ERRORE
End If
SetSimulationStatus(MCH_SIM_ST.UI_STOP)
End If
@@ -361,10 +336,8 @@ Public Class SimulationExpanderVM
End If
' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
UpdateMachView()
' Aggiorno visualizzazione (solo se interfaccia non minimizzata, per aumentare velocità)
If Application.Current.MainWindow.WindowState <> WindowState.Minimized Then
EgtDraw()
End If
' Aggiorno visualizzazione
EgtDraw()
' Aggiorno dati CNC
If nShowDataCounter = 5 Or GetSimulationStatus() = MCH_SIM_ST.UI_PAUSE Or GetSimulationStatus() = MCH_SIM_ST.UI_STOP Then
ShowCncData()
@@ -376,7 +349,7 @@ Public Class SimulationExpanderVM
End If
Else
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(5)
System.Threading.Thread.Sleep(4)
End If
' Costringo ad aggiornare UI
UpdateUI()
@@ -408,7 +381,6 @@ Public Class SimulationExpanderVM
MachineAxisList(Index).IsReadOnlyAxesValue = True
Next
End If
Trace_IsEnabled = (value = MCH_SIM_ST.UI_PAUSE OrElse value = MCH_SIM_ST.UI_STOP)
EgtSimSetUiStatus(GetStatus())
End Sub
@@ -454,13 +426,12 @@ Public Class SimulationExpanderVM
If IniFile.m_bMachiningGroup Then
Dim sMGrpName As String = String.Empty
If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then
sCncFile &= "_" & sMGrpName
sCncFile &= "_" & sMGrpName & ".cnc"
sInfo &= "-" & sMGrpName
End If
Else
sCncFile &= ".cnc"
End If
Dim sExt As String = ".cnc"
EgtUILib.GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, sExt, sExt, IniFile.m_sCurrMachIniFilePath)
sCncFile = Path.ChangeExtension(sCncFile, sExt)
End If
Return True
End Function
@@ -468,16 +439,16 @@ Public Class SimulationExpanderVM
Friend Sub SimulationExpander_Update_CncData( nFlag As Integer)
If Simulation_IsExpanded Then
ShowCncData()
' Se fermo per Collisione rilevata da script Lua o per altra richiesta
If nFlag = 11 Or nFlag = 12 Then
' Se fermo per Collisione rilevata da script Lua
If nFlag = 11 Then
' Imposto stato Pausa
SetSimulationStatus(MCH_SIM_ST.UI_PAUSE)
StatusMsg = EgtMsg(MSG_SIMULATION + 11) ' PAUSA
' Aggiornamenti per bottone Play/Pause
SetShowPlay(True)
NotifyPropertyChanged("PlayPauseImage")
' Se fermo per Collisione, dichiaro di non arrestarsi alla successiva notifica di collisione
If nFlag = 11 Then m_bStopOnNextCollision = False
' Dichiaro di non arrestarsi alla successiva notifica di collisione
m_bStopOnNextCollision = False
End If
End If
End Sub
+3 -66
View File
@@ -12,10 +12,8 @@ Friend Module OptionModule
Friend m_GridColor As Color3d
' Flag per visualizzazione spessa delle linee
Friend m_bThickLine As Boolean
' Qualità di visualizzazione delle superfici
Friend m_ShowSurfQuality As SceneSurfQualityOpt
' Tipo di visualizzazione delle Zmap
Friend m_nShowZmapType As Integer
' Flag per visualizzazione smussata delle superfici
Friend m_bSmoothTriMesh As Boolean
' Colore di default in disegno
Friend m_DefMaterialColor As Color3d
@@ -25,10 +23,7 @@ Friend Module OptionModule
' Parametri per import
Friend m_dDxfScaleFactor As Double
Friend m_dStlScaleFactor As Double
Friend m_dOffScaleFactor As Double
Friend m_dPlyScaleFactor As Double
Friend m_dImgScaleFactor As Double
Friend m_dAdvImpTolerance As Double
' Parametri per export
Friend m_nExportDxfFlag As Integer
@@ -61,9 +56,6 @@ Friend Module OptionModule
Friend m_SelGeomSurfRoughing As SceneSelModeOpt
Friend m_SelGeomWaterJetting As SceneSelModeOpt
Friend m_SelGeomFiveAxMilling As SceneSelModeOpt
Friend m_SelGeomProbing As SceneSelModeOpt
' Qualità di calcolo del virtual milling
Friend m_VMillQuality As VMillSelTypeOpt
' Flag per aggiungere una nuova lavorazione alla fine della fase o subito dopo la lavorazione selezionata
Friend m_bNewMachiningIsLastOne As Boolean
' Variabile che indica se usare lo script per calcolare automaticamente la disposizione quando si passa in lavorazione
@@ -74,9 +66,6 @@ Friend Module OptionModule
Friend m_bBeamOn As Boolean
Friend m_bWallOn As Boolean
Friend m_bDoorsOn As Boolean
Friend m_bWindowOn As Boolean
Friend m_bTrimmingOn As Boolean
Friend m_bReversePostOn As Boolean
Friend m_bGunstockOn As Boolean
' inizializzazione lettura variabili ad inizio programma
@@ -117,31 +106,17 @@ Friend Module OptionModule
' Inizializzo flag linee ingrossate
m_bThickLine = (GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1)
' Inizializzo flag visualizzazione smussata delle superfici
Dim nSSQ As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWSURFQUALITY, 0)
m_ShowSurfQuality = DirectCast( Math.Min( Math.Max( nSSQ, -2), 2), SceneSurfQualityOpt)
' Inizializzo tipo di visualizzazione Zmap
m_nShowZmapType = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 9)
m_bSmoothTriMesh = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_DefMaterialColor = DefColor
' Inizializzo tolleranza geometrica
m_dGeometryTolerance = GetPrivateProfileDouble(S_GEOMDB, K_SURFTMTOLER, 0.05)
' Inizializzo stile corrente delle quotature
m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5)
m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5)
m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2)
m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2)
m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2)
m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont)
m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2)
' Inizializzo variabili per import
m_dDxfScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1)
m_dStlScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1)
m_dOffScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_OFFSCALE, 1)
m_dPlyScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_PLYSCALE, 1)
m_dImgScaleFactor = GetPrivateProfileDouble(S_IMPORT, K_IMGSCALE, 1)
m_dAdvImpTolerance = GetPrivateProfileDouble(S_IMPORT, K_ADVTOLER, 0.05)
' Inizializzo variabili per export
m_nExportDxfFlag = GetPrivateProfileInt(S_EXPORT, K_DXFFLAG, EEX_FL.COMP_LAYER)
m_nImgWidth = GetPrivateProfileInt(S_EXPORT, K_IMGWIDTH, 400)
@@ -172,12 +147,7 @@ Friend Module OptionModule
m_SelGeomSurfRoughing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMFIVEAXMILLING, -1)
m_SelGeomFiveAxMilling = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
Temp = GetPrivateProfileInt(S_MACH, K_SELGEOMPROBING, -1)
m_SelGeomProbing = If(Temp < 0 Or Temp > 3, SceneSelModeOpt.PARTCURVESANDSURFACES, DirectCast(Temp, SceneSelModeOpt))
m_SelGeomWaterJetting = SceneSelModeOpt.PARTCURVES
' Inizializzo qualità di virtual milling
Temp = GetPrivateProfileInt(S_MACH, K_VMILLQUALITY, 0)
m_VMillQuality = DirectCast(Math.Min( Math.Max( Temp, -2), 2), VMillSelTypeOpt)
' Inizializzo variabile che indica posizione nuova operazione di lavorazione
m_bNewMachiningIsLastOne = (GetPrivateProfileInt(S_OPTIONS, K_NEWMACHININGISLASTONE, 0) <> 0)
' Inizializzo variabile che indica se usare script di disposizione
@@ -187,42 +157,9 @@ Friend Module OptionModule
m_bBeamOn = (GetPrivateProfileInt(S_BEAM, K_BEAMENABLE, 0) <> 0)
m_bWallOn = (GetPrivateProfileInt(S_WALL, K_WALLENABLE, 0) <> 0)
m_bDoorsOn = (GetPrivateProfileInt(S_DOORS, K_DDFENABLE, 0) <> 0)
m_bWindowOn = (GetPrivateProfileInt(S_WINDOW, K_WINDOWENABLE, 0) <> 0)
m_bTrimmingOn = (GetPrivateProfileInt(S_TRIMMING, K_TRIMMINGENABLE, 0) <> 0)
m_bReversePostOn = (GetPrivateProfileInt(S_REVERSEPOST, K_REVERSEPOSTENABLE, 0) <> 0)
m_bGunstockOn = (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
End Sub
' restituisco spessore linee
Friend Function GetLineWidth() As Integer
Return If( m_bThickLine, 2, 1)
End Function
' imposto stato visualizzazione superfici
Friend Sub SetShowSurfQuality( bRedraw As Boolean)
Dim bSmoothTriMesh As Boolean = True
Dim dSrfBezShowTol As Double = 0.2
Select m_ShowSurfQuality
Case SceneSurfQualityOpt.LOWER
bSmoothTriMesh = False
dSrfBezShowTol = 4
Case SceneSurfQualityOpt.LOW
bSmoothTriMesh = False
dSrfBezShowTol = 1
Case SceneSurfQualityOpt.STANDARD
bSmoothTriMesh = True
dSrfBezShowTol = 0.2
Case SceneSurfQualityOpt.HIGH
bSmoothTriMesh = True
dSrfBezShowTol = 0.05
Case SceneSurfQualityOpt.HIGHER
bSmoothTriMesh = True
dSrfBezShowTol = 0.01
End Select
EgtSetShowTriaAdv(bSmoothTriMesh, false)
EgtSetShowSurfBezierTol(dSrfBezShowTol, bRedraw)
End Sub
End Module
' Classe che identifica una lingua del programma con nome e path del file dei messaggi
+46 -152
View File
@@ -9,13 +9,11 @@
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="600"
Width="400" Height="520"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<local:GeomTypeConverter x:Key="GeomTypeConverter"/>
<local:SceneSurfQualityOptConverter x:Key="SceneSurfQualityOptConverter"/>
<local:VMillTypeConverter x:Key="VMillTypeConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<TabControl Margin="5,5,5,5">
@@ -66,17 +64,10 @@
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SceneSurfQualityMsg}" VerticalAlignment="Center"
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,5,0,5"/>
<ComboBox ItemsSource="{Binding SceneSurfQualityOptList, Mode=OneWay}"
SelectedItem="{Binding SelectedSceneSurfQualityOpt}"
Grid.Column="1" Grid.Row="1" Height="25" Margin="0,5,0,5">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource SceneSurfQualityOptConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<CheckBox IsChecked="{Binding SmoothTriMesh}"
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
</Grid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
@@ -85,31 +76,7 @@
SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/>
</UniformGrid>
<GroupBox Header="ShowZmap"
Visibility="{Binding ShowZmapVisibility}"
Margin="0,0,0,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding ShowZmapSurf}"
Content="Surfaces" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="0" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapLines}"
Content="Lines" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="1" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapNormals}"
Content="Normals" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="2" Margin="5,5,10,5" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding ShowZmapBiColor}"
Content="BiColor" FlowDirection="RightToLeft"
Grid.Row="0" Grid.Column="3" Margin="5,5,10,5" VerticalAlignment="Center"/>
</Grid>
</GroupBox>
<Grid Margin="5,100,5,5">
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
@@ -168,9 +135,6 @@
</TabItem>
<TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0">
<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header=""
Margin="0,0,0,5">
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
@@ -182,12 +146,10 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}"/>
Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/>
@@ -196,12 +158,12 @@
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,5,0,5"/>
Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,5,0,5"/>
Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1"
@@ -214,47 +176,17 @@
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="3" Grid.Column="0"
Text="{Binding OffScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding ScaleOffList, Mode=OneWay}"
SelectedItem="{Binding SelectedOffScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="3" Grid.Column="2"
Text="{Binding OffScaleFactor}" Height="25"
IsEnabled="{Binding OffScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="4" Grid.Column="0"
Text="{Binding PlyScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="4" Grid.Column="1"
ItemsSource="{Binding ScalePlyList, Mode=OneWay}"
SelectedItem="{Binding SelectedPlyScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="4" Grid.Column="2"
Text="{Binding PlyScaleFactor}" Height="25"
IsEnabled="{Binding PlyScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="5" Grid.Column="0"
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="5" Grid.Column="1"
<ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="5" Grid.Column="2"
<TextBox Grid.Row="3" Grid.Column="2"
Text="{Binding ImageScaleFactor}" Height="25"
IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</Grid>
</GroupBox>
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,5,0,5">
<TextBlock Text="{Binding AdvImpToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding AdvImpTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding ExportMsg}">
@@ -281,15 +213,6 @@
Header="{Binding MachiningSelGeomMsg}"
Margin="5,5,5,0">
<UniformGrid Columns="2">
<TextBlock Text="{Binding GeomTypeProbingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedProbingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
@@ -393,41 +316,30 @@
</UniformGrid>
</GroupBox>
<Grid Margin="10,5,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<UniformGrid Columns="2" Grid.ColumnSpan="2" Margin="0,5,0,0">
<TextBlock Text="{Binding VMillQualityMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding VMillTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedVMillQualityType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource VMillTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</UniformGrid>
<TextBlock Grid.Row="1" Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Margin="0,8,0,5"/>
<CheckBox Grid.Row="1" Grid.Column="1" IsChecked="{Binding NewMachiningIsLastOne}"
Margin="4,8,0,0" VerticalAlignment="Center"/>
<TextBlock Grid.Row="2" Text="{Binding UseDispositionScriptMsg}"
VerticalAlignment="Center" Margin="0,5,0,5"/>
<CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding UseDispositionScript}"
Margin="4,5,0,0" VerticalAlignment="Center"/>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding UseDispositionScript}"
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<UniformGrid Rows="2">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,10,100,5"/>
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</UniformGrid>
</StackPanel>
</TabItem>
@@ -435,9 +347,9 @@
<StackPanel>
<Grid Margin="5,20,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
@@ -445,51 +357,33 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding BeamMsg}"
Grid.Row="0" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding BeamOn}" IsEnabled="{Binding BeamEnabled}"
<TextBlock Text="{Binding SpecialMsg}"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SpecialOn}"
Grid.Row="0" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding BeamMsg}"
Grid.Row="1" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding BeamOn}" IsEnabled="{Binding BeamEnabled}"
Grid.Row="1" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding BeamActive}"
Command="{Binding UpdateBeam_Command}"
Grid.Row="0" Grid.Column="2" Height="26"/>
Grid.Row="1" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding WallMsg}"
Grid.Row="1" Grid.Column="0" Margin="0,5,0,5"/>
Grid.Row="2" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding WallOn}" IsEnabled="{Binding WallEnabled}"
Grid.Row="1" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
Grid.Row="2" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding WallActive}"
Command="{Binding UpdateWall_Command}"
Grid.Row="1" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding DoorsMsg}" VerticalAlignment="Center"
Grid.Row="2" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding DoorsOn}" IsEnabled="{Binding DoorsEnabled}"
Grid.Row="2" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<Button Content="{Binding UpdateMsg}" IsEnabled="{Binding DoorsActive}"
Command="{Binding UpdateDoors_Command}"
Grid.Row="2" Grid.Column="2" Height="26"/>
<TextBlock Text="{Binding WindowMsg}" VerticalAlignment="Center"
<TextBlock Text="{Binding DoorsMsg}" VerticalAlignment="Center"
Grid.Row="3" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding WindowOn}" IsEnabled="{Binding WindowEnabled}"
<CheckBox IsChecked="{Binding DoorsOn}" IsEnabled="{Binding DoorsEnabled}"
Grid.Row="3" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TrimmingMsg}" VerticalAlignment="Center"
Grid.Row="4" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding TrimmingOn}" IsEnabled="{Binding TrimmingEnabled}"
Grid.Row="4" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding ReversePostMsg}" VerticalAlignment="Center"
Grid.Row="5" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ReversePostOn}" IsEnabled="{Binding ReversePostEnabled}"
Grid.Row="5" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding GunstockMsg}" VerticalAlignment="Center"
Grid.Row="6" Grid.Column="0" Margin="0,5,0,5"/>
Grid.Row="4" Grid.Column="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding GunstockOn}" IsEnabled="{Binding GunstockEnabled}"
Grid.Row="6" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SpecialMsg}"
Grid.Row="7" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SpecialOn}"
Grid.Row="7" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
Grid.Row="4" Grid.Column="1" Margin="4,5,0,5" VerticalAlignment="Center"/>
</Grid>
</StackPanel>
</TabItem>
File diff suppressed because it is too large Load Diff
+9 -9
View File
@@ -1,24 +1,24 @@
<UserControl x:Class="PopUpGridPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Background="#93D5F4" Orientation="Horizontal">
<Button Command="{Binding CPlaneViewCommand}" ToolTip="{Binding CPlaneViewToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="3,3,1,3">
<StackPanel Background="Transparent" Orientation="Horizontal">
<Button Command="{Binding CPlaneViewCommand}" ToolTip="{Binding CPlaneViewToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/CplaneView.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CPlaneInvertCommand}" ToolTip="{Binding CPlaneInvertToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="1,3,1,3">
<Button Command="{Binding CPlaneInvertCommand}" ToolTip="{Binding CPlaneInvertToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/CplaneInvert.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CPlaneRotateCommand}" ToolTip="{Binding CPlaneRotateToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="1,3,1,3">
<Button Command="{Binding CPlaneRotateCommand}" ToolTip="{Binding CPlaneRotateToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/CplaneROTATE.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CPlane3PCommand}" ToolTip="{Binding CPlane3PointsToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="1,3,1,3">
<Button Command="{Binding CPlane3PCommand}" ToolTip="{Binding CPlane3PointsToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/Cplane3POINTS.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CPlanePerpObjCommand}" ToolTip="{Binding CPlanePerpCurveToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="1,3,1,3">
<Button Command="{Binding CPlanePerpObjCommand}" ToolTip="{Binding CPlanePerpCurveToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/CplanePERPCURVE.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding CPlaneObjCommand}" ToolTip="{Binding CPlaneObjectToolTip}" Style="{StaticResource GridViewPanelButton}" Margin="1,3,3,3">
<Button Command="{Binding CPlaneObjCommand}" ToolTip="{Binding CPlaneObjectToolTip}" Style="{StaticResource GridViewPanelButton}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png" Stretch="Uniform"/>
</Button>
</StackPanel>
+9 -9
View File
@@ -1,24 +1,24 @@
<UserControl x:Class="PopUpViewPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel Background="#93D5F4" Orientation="Horizontal">
<Button ToolTip="{Binding ZoomInToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomInCommand}" Margin="3,3,1,3">
<StackPanel Background="Transparent" Orientation="Horizontal">
<Button ToolTip="{Binding ZoomInToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomInCommand}">
<Image Source="/Resources/GridViewPanel/ZoomIn.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ZoomOutToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomOutCommand}" Margin="1,3,1,3">
<Button ToolTip="{Binding ZoomOutToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomOutCommand}">
<Image Source="/Resources/GridViewPanel/ZoomOut.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ZoomSelToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomSelCommand}" Margin="1,3,1,3">
<Button ToolTip="{Binding ZoomSelToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ZoomSelCommand}">
<Image Source="/Resources/GridViewPanel/ZoomSel.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_NEToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding IsoViewNECommand}" Margin="1,3,1,3">
<Button ToolTip="{Binding LookFromIso_NEToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding IsoViewNECommand}">
<Image Source="/Resources/GridViewPanel/LookFromISO_NE.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_NWToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding IsoViewNWCommand}" Margin="1,3,1,3">
<Button ToolTip="{Binding LookFromIso_NWToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding IsoViewNWCommand}">
<Image Source="/Resources/GridViewPanel/LookFromISO_NW.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding ViewToCPlaneToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ViewToCPlaneCommand}" Margin="1,3,3,3">
<Button ToolTip="{Binding ViewToCPlaneToolTip}" Style="{StaticResource GridViewPanelButton}" Command="{Binding ViewToCPlaneCommand}">
<Image Source="/Resources/GridViewPanel/CplaneView.png" Stretch="Uniform"/>
</Button>
</StackPanel>
+7
View File
@@ -11,6 +11,13 @@ Public Class ProjectV
Private Sub UserControl_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creo riferimento a questa classe in Map
Map.SetRefProjectV(Me)
'SpecialPanel.Visibility = Visibility.Collapsed
'BeamPanel.Visibility = Visibility.Collapsed
'WallPanel.Visibility = Visibility.Collapsed
'DoorsPanel.Visibility = Visibility.Collapsed
'GunStockPanel.Visibility = Visibility.Collapsed
'PrintingPanel.Visibility = Visibility.Collapsed
' Map.refMachGroupPanelVM.SetMachGroupPanelVisibility(False) ' MachGroupPanel.Visibility = Visibility.Collapsed
End Sub
Private Sub UserControl_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+54 -91
View File
@@ -4,6 +4,7 @@ Imports System.IO
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtWPFLib5.EgtFloating
Public Class ProjectVM
Inherits TabViewModel
@@ -57,12 +58,11 @@ Public Class ProjectVM
End Get
End Property
#End Region
#Region "EGTUILIB FIELDS"
Private m_bCPlaneTypePos As Boolean
Private m_bCPlaneTypePos As Boolean
' Variabile per implementazione eventi
Private m_InputText As String
@@ -244,14 +244,14 @@ Public Class ProjectVM
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
End If
' Se altrimenti manca il collegamento con la chiave di rete
' Se altrimenti manca il collegamento con la chiave di rete
ElseIf IniFile.m_nKeyLevel = -9 Then
EgtOutLog("Missing Link with Net Dongle")
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
Dim sTitle As String = EgtMsg(10101)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
' Altrimenti manca la licenza
' Altrimenti manca la licenza
Else
EgtOutLog("Problems with Licence")
' Box di avviso licenza con problemi : sKeyInfo \n "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
@@ -294,16 +294,23 @@ Public Class ProjectVM
Private Sub PreInitializeScene()
' imposto colore di default
m_ProjectScene.SetDefaultMaterial(OptionModule.m_DefMaterialColor)
Dim DefColor As New Color3d(0, 0, 0)
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
m_ProjectScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
m_ProjectScene.SetViewBackground(OptionModule.m_TopSceneBackground, OptionModule.m_BotSceneBackground)
' imposto colori di evidenziazione
Dim BackTopColor As New Color3d(192, 192, 192)
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto spessore linee
Dim nLineWidth As Integer = 1
nLineWidth = GetPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
m_ProjectScene.SetLineWidth(nLineWidth)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
m_ProjectScene.SetMarkMaterial(MarkColor)
Dim Mark2Color As New Color3d(255, 64, 64)
GetPrivateProfileColor(S_SCENE, K_MARK2, Mark2Color)
m_ProjectScene.SetMark2Material(Mark2Color)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
@@ -338,7 +345,6 @@ Public Class ProjectVM
End If
End If
m_Controller.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
m_Controller.SetAdvImpTolerance(OptionModule.m_dAdvImpTolerance)
m_Controller.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS)
' imposto unità di misura per interfaccia utente
IniFile.m_bMmUnits = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
@@ -360,21 +366,27 @@ Public Class ProjectVM
' modo di visualizzazione
Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
Map.refShowPanelVM.ShowModeState(nShowMode)
' imposto spessore curve
EgtSetLineAttribs(OptionModule.GetLineWidth())
' visualizzazione direzione curve
Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0)
Map.refShowPanelVM.ShowCurveDir(nShowCurveDir)
' qualità di visualizzazione delle superfici
OptionModule.SetShowSurfQuality( False)
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' tipo visualizzazione per Zmap
EgtSetShowZmap( OptionModule.m_nShowZmapType, False)
Dim nShowZmap As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(nShowZmap, False)
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' stile corrente delle quotature
EgtSetCurrDimensionStyle(OptionModule.m_dExtLineLen, OptionModule.m_dArrowLen, OptionModule.m_dTextDist,
OptionModule.m_nLenIsMM, OptionModule.m_nDecDigit, OptionModule.m_sFont, OptionModule.m_dTextHeight)
OptionModule.m_dExtLineLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_EXTLINELEN, 5)
OptionModule.m_dArrowLen = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_ARROWLEN, 5)
OptionModule.m_dTextDist = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTDIST, 2)
OptionModule.m_nLenIsMM = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_LENISMM, 2)
OptionModule.m_nDecDigit = GetPrivateProfileInt(S_DIMENSIONSTYLE, K_DECDIGIT, -2)
OptionModule.m_sFont = "" : GetPrivateProfileStringUtf8(S_DIMENSIONSTYLE, K_DIMFONT, "ModernPropS.Nfe", m_sFont)
OptionModule.m_dTextHeight = GetPrivateProfileDouble(S_DIMENSIONSTYLE, K_TEXTHEIGHT, 2)
EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' lettura da ini della variabile che abilita i gruppi di lavorazione
IniFile.m_bMachiningGroup = (GetPrivateProfileInt(S_MACH, K_MACHININGGROUP, 0) <> 0)
Map.refTopCommandBarVM.DrawMode_IsChecked()
@@ -390,8 +402,6 @@ Public Class ProjectVM
' Imposto default per import
m_Controller.SetScaleForDxfImport(OptionModule.m_dDxfScaleFactor)
m_Controller.SetScaleForStlImport(OptionModule.m_dStlScaleFactor)
m_Controller.SetScaleForOffImport(OptionModule.m_dOffScaleFactor)
m_Controller.SetScaleForPlyImport(OptionModule.m_dPlyScaleFactor)
m_Controller.SetScaleForImageImport(OptionModule.m_dImgScaleFactor)
' Imposto default per export
m_Controller.SetDefaultForDxfExport(OptionModule.m_nExportDxfFlag)
@@ -417,7 +427,7 @@ Public Class ProjectVM
Dim nFlag As Integer = 1
If Environment.GetCommandLineArgs.Count() > 4 Then Integer.TryParse(Environment.GetCommandLineArgs(4), nFlag)
' Modalità cieco con valori 0, 3 e 4
Return (nFlag <> 0 And nFlag <> 3 And nFlag <> 4 And nFlag <> 8)
Return (nFlag <> 0 And nFlag <> 3 And nFlag <> 4)
End If
If sExt = ".ddf" And Environment.GetCommandLineArgs.Count() > 2 Then
' Flag
@@ -473,7 +483,7 @@ Public Class ProjectVM
End If
' Esecuzione
bOk = ExecBeam(sFile, sMachine, nFlag, True)
' altrimenti pareti
' altrimenti pareti
Else
' Verifica abilitazione elaborazione pareti
If Not VerifyWall(sFile, sMachine, nFlag) Then
@@ -487,12 +497,12 @@ Public Class ProjectVM
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se richiesta visualizzazione DB utensili
' Altrimenti se richiesta visualizzazione DB utensili
ElseIf nFlag = 11 And bOk Then
MyMachinePanelVM.ToolDb()
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se richiesta visualizzazione DB lavorazioni
' Altrimenti se richiesta visualizzazione DB lavorazioni
ElseIf nFlag = 12 And bOk Then
MyMachinePanelVM.MachDb()
If bBeam Then
@@ -502,7 +512,7 @@ Public Class ProjectVM
End If
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se errore
' Altrimenti se errore
ElseIf Not bOk Then
EgtZoom(ZM.ALL)
End If
@@ -526,13 +536,7 @@ Public Class ProjectVM
' Esecuzione
OpenDoorFile(sFile, bNcGen, bExit, nProbing)
' Se richiesta uscita immediata
If bExit Then
Map.refMainWindowVM.CloseApplicationCmd()
End If
' Se applicate lavorazioni, vado in modalità Lavora
If EgtGetCurrMachGroup() <> GDB_ID.NULL Then
Map.refTopCommandBarVM.SetMachiningMode()
End If
If bExit Then Map.refMainWindowVM.CloseApplicationCmd()
Return
End If
' Se file tol, gestione aggiornamento dei dati degli utensili
@@ -581,7 +585,7 @@ Public Class ProjectVM
bOk = ExecWall(sFile, sMachine, nFlag, False)
End If
' Se richiesta uscita immediata
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Or nFlag = 8 Then
If nFlag = 0 Or nFlag = 3 Or nFlag = 4 Then
Map.refMachinePanelVM.SaveCurrentMachine()
Map.refMainWindowVM.CloseApplicationCmd()
' Altrimenti se errore
@@ -600,7 +604,7 @@ Public Class ProjectVM
Select Case nFileType
Case FT.NGE, FT.NFE
Return m_Controller.OpenProject(sFile, False)
Case FT.DXF, FT.STL, FT._3MF, FT._3DM, FT.OFF, FT.PLY, FT.OBJ, FT.CNC, FT.CSF, FT.BTL, FT.BTLX, FT.IMG, FT.PNT, FT.IGES, FT.STEP_, FT.ACIS, FT.PARASOLID, FT.JT, FT.VRML, FT.C3D
Case FT.DXF, FT.STL, FT._3MF, FT._3DM, FT.OBJ, FT.CNC, FT.CSF, FT.BTL, FT.BTLX, FT.IMG, FT.PNT, FT.IGES, FT.STEP_, FT.ACIS, FT.PARASOLID, FT.JT, FT.VRML, FT.C3D
Return m_Controller.ImportProject(sFile, False)
Case FT.TSC, FT.LUA
Return m_Controller.Exec(sFile, False)
@@ -613,6 +617,7 @@ Public Class ProjectVM
' Formato descrizione porte
If Path.GetExtension(sFile).ToLower() = ".ddf" Then
nErr = ExecDoors(m_ProjectScene, sFile, bNcGen, bBatch, nProbing)
'CreateDoors(sFile, bNcGen, bBatch, nProbing)
Map.refProjectVM.EmitTitle()
Return True
End If
@@ -1094,8 +1099,8 @@ Public Class ProjectVM
Select Case m_SceneSelType
Case SceneSelTypeOpt.FIXTURE
Dim nFixtureId As Integer = EgtGetParent(EgtGetParent(nId))
'Dim sName As String = ""
'EgtGetName(EgtGetParent(nId), sName)
Dim sName As String = ""
EgtGetName(EgtGetParent(nId), sName)
If EgtVerifyFixture(nFixtureId) Then
m_SelType = DispositionUtility.SelType.FIXTURE
' Se già selezionato
@@ -1113,12 +1118,14 @@ Public Class ProjectVM
EgtGetPlaneSnapPoint(e.Location, Vector3d.Z_AX, TableRef.z, ptCurr)
DispositionUtility.VtHookFinder(nFixtureId, ptCurr)
Exit While
ElseIf DispositionUtility.VerifyTableAxis( nFixtureId) Then
m_SelType = DispositionUtility.SelType.BARS
m_nIdToSel = nFixtureId
' Drag possibile
m_bDrag = True
Exit While
ElseIf sName.Contains(DispositionUtility.MOBILE) Then
Dim sInfo As String = ""
If EgtGetInfo(EgtGetParent(nId), "MDir", sInfo) Then
m_SelType = DispositionUtility.SelType.BARS
m_nIdToSel = EgtGetParent(nId)
' Drag possibile
m_bDrag = True
End If
End If
Case SceneSelTypeOpt.RAWPART, SceneSelTypeOpt.RAWPARTWITHFIXTURE
Dim nRawPartId As Integer = EgtGetParent(nId)
@@ -1180,6 +1187,7 @@ Public Class ProjectVM
vtMove.z = 0
' Muovo gli oggetti selezionati se consentito
DispositionUtility.MoveRawPartPartAndFixture(nMoveId, vtMove, m_SelType, ptCurr)
'EgtSaveFile("c:\Temp\ProveMovimentoVentose\Prova1.nge", NGE.BIN)
EgtDraw()
' Aggiorno il punto precedente
m_ptPrev = ptCurr
@@ -1211,7 +1219,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
@@ -1311,23 +1319,10 @@ Public Class ProjectVM
(EgtGetType(nId) = GDB_TY.SRF_MESH Or EgtGetType(nId) = GDB_TY.SRF_FRGN) Then
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
Else
m_Controller.MouseSelectedObj(nId, False)
If bLast Then
If EgtIsSelectedObj(nId) Then
' Selezione layer in albero
Map.refManageLayerExpanderVM.UpdateObjInObjTreeNoMark(nId)
Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(nId)
Map.refManageLayerExpanderVM.UpdateObjTree()
End If
EgtDraw()
End If
m_Controller.MouseSelectedObj(nId, bLast)
End If
End Sub
Private Sub OnMouseSelectedColor(ByVal sender As Object, ByVal nId As Integer) Handles m_ProjectScene.OnMouseSelectedColor
m_Controller.MouseSelectedColor(nId)
End Sub
Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer) Handles m_ProjectScene.OnMouseSelectedPart
m_Controller.MouseSelectedPart(nId)
End Sub
@@ -1395,13 +1390,8 @@ Public Class ProjectVM
If nFac <> -1 Then
' Visualizzo la normale e il contorno della faccia
Analyze.CreateAnalyzeGroup()
Analyze.CreateFacetNormal(nId, nFac)
Analyze.CreateNormal(nId, nFac)
Analyze.CreateFacetLoops(nId, nFac)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Analyze.CreateTriaLoop(nId, nSub)
End If
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
Dim vtN As Vector3d
@@ -1413,31 +1403,6 @@ Public Class ProjectVM
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
sOut &= ", Triangle " + nSub.ToString()
End If
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
' Se Regione, visualizzo dati parte toccata
ElseIf EgtGetType(nId) = GDB_TY.SRF_FRGN Then
Dim nChk As Integer = nSub
If nChk >= 0 AndAlso nChk < EgtSurfFrChunkCount(nId) Then
' Visualizzo la normale e il contorno della parte
Analyze.CreateAnalyzeGroup()
Analyze.CreateChunkNormal(nId, nChk)
Analyze.CreateChunkLoops(nId, nChk)
' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d
Dim vtN As Vector3d
EgtSurfFrChunkCenter(nId, nChk, If(m_bCPlaneTypePos, GDB_ID.GRID, GDB_ID.ROOT), ptC, vtN)
Dim dLen, dPhi, dTheta As Double
vtN.ToSpherical(dLen, dTheta, dPhi)
' Emetto info sulla barra di stato
Dim sOut As String = "Chunk " + nChk.ToString() +
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If
End If
@@ -1561,8 +1526,6 @@ Public Class ProjectVM
nFlag = GetPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
ElseIf nType = FT.BTL Or nType = FT.BTLX Then
nFlag = GetPrivateProfileInt(S_IMPORT, K_BTLFLAG, EIB_FL.NONE)
ElseIf nType = FT._3MF Then
nFlag = GetPrivateProfileInt(S_IMPORT, K_3MFFLAG, EI3_FL.NONE)
ElseIf nType = FT.OBJ Or nType = FT.IGES Or nType = FT.STEP_ Or nType = FT.ACIS Or
nType = FT.PARASOLID Or nType = FT.JT Or nType = FT.VRML Or nType = FT.C3D Then
nFlag = GetPrivateProfileInt(S_IMPORT, K_ADVFLAG, 0)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

+1 -1
View File
@@ -11,7 +11,7 @@
m_SetUpDbVM = SetUpDbVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpDbVM.OnCloseWindow
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpDbVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
+2 -2
View File
@@ -10,7 +10,7 @@ Public Class SetUpDbVM
Private Const SETUP_FILEEXTENSION As String = ".stu"
Friend Event OnCloseWindow(bDialogResult As Boolean)
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_SetUpList As New ObservableCollection(Of String)
Public ReadOnly Property SetUpList As ObservableCollection(Of String)
@@ -263,7 +263,7 @@ Public Class SetUpDbVM
Return
End Select
End If
RaiseEvent OnCloseWindow(True)
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Close
+3 -9
View File
@@ -1,7 +1,6 @@
<EgtFloating:EgtFloatingPanel x:Class="BeamPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding BeamPanel_Visibility}">
@@ -11,18 +10,13 @@
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
+7 -4
View File
@@ -1,11 +1,14 @@
Public Class BeamPanelVM
Imports System.IO
Imports EgtUILib
Public Class BeamPanelVM
Inherits VMBase
Friend Const BEAM_PROCESS As String = "Beam\Process.lua"
Friend Const BEAM_MACHININGS As String = "BeamMachinings"
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
@@ -29,7 +32,7 @@
If IniFile.IsActiveBeam() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_BEAM, K_BEAMBUTTON & BtnIndex, IniFile.m_sBeamDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
+3 -9
View File
@@ -1,7 +1,6 @@
<EgtFloating:EgtFloatingPanel x:Class="BeamWallPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding BeamWallPanel_Visibility}">
@@ -11,18 +10,13 @@
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
+7 -4
View File
@@ -1,8 +1,11 @@
Public Class BeamWallPanelVM
Imports System.IO
Imports EgtUILib
Public Class BeamWallPanelVM
Inherits VMBase
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
@@ -27,7 +30,7 @@
GetPrivateProfileString(S_BEAMWALL, K_BEAMWALLBASEDIR, "", m_sBeamWallDirPath)
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_BEAMWALL, K_BEAMWALLBUTTON & BtnIndex, IniFile.m_sBeamWallDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
+2 -2
View File
@@ -60,8 +60,8 @@ Module Wall
Map.refTopCommandBarVM.SetMachiningMode()
' Se simulazione
If bOk And nFlag = 2 Then
' Se da TS3 e non pezzo da Vista, impedisco di fare altro
If bBtl AndAlso sFile.IndexOf( "Part_", StringComparison.InvariantCulture) = -1 Then
' Se da TS3 impedisco di fare altro
If bBtl Then
Map.refSimulationExpanderVM.bOnlySimulation = True
End If
' Vado in simulazione
+3 -9
View File
@@ -1,7 +1,6 @@
<EgtFloating:EgtFloatingPanel x:Class="WallPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding WallPanel_Visibility}">
@@ -11,18 +10,13 @@
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl.ItemTemplate>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
+7 -4
View File
@@ -1,10 +1,13 @@
Public Class WallPanelVM
Imports System.IO
Imports EgtUILib
Public Class WallPanelVM
Inherits VMBase
Friend Const WALL_MACHININGS As String = "WallMachinings"
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Private m_ButtonList As New List(Of ButtonItem)
Public ReadOnly Property ButtonList As List(Of ButtonItem)
Get
Return m_ButtonList
End Get
@@ -28,7 +31,7 @@
If IniFile.IsActiveWall() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
Dim CurrBtn As ButtonItem = Nothing
While GetPrivateProfileButton(S_WALL, K_WALLBUTTON & BtnIndex, IniFile.m_sWallDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
+242 -270
View File
@@ -139,265 +139,254 @@
<TabControl Grid.Row="1" Margin="5,0,5,5" SelectionChanged="TabControl_SelectionChanged">
<TabItem Header="Association Table">
<TabItem.Content>
<Grid>
<FrameworkElement x:Name="dummyElement" Visibility="Collapsed"/>
<DataGrid Name="AssociationDataGrid"
ItemsSource="{Binding Path=SelectedItem.AssociationList,
ElementName=TablesListBox}"
EgtCAM5:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding SelectedItem.SelectedAssociations,
ElementName=TablesListBox}"
IsSynchronizedWithCurrentItem="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Extended"
PreviewMouseDown="DataGrid_PreviewMouseDown"
PreviewMouseUp="DataGrid_PreviewMouseUp"
PreviewMouseMove="DataGrid_PreviewMouseMove"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
VirtualizingStackPanel.IsVirtualizing="False">
<Interactivity:Interaction.Behaviors>
<EgtCAM5:ScrollIntoViewForDataGrid/>
</Interactivity:Interaction.Behaviors>
<DataGrid.InputBindings>
<KeyBinding Key="F3" Modifiers="Control" Command="{Binding SearchNextCommand}"/>
<KeyBinding Key="F3" Modifiers="Shift" Command="{Binding SearchPreviousCommand}"/>
</DataGrid.InputBindings>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
</Style.Resources>
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<EventSetter Event="PreviewMouseDown" Handler="LeftTableMouseDown"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsValidForSearch}" Value="True">
<Setter Property="Background" Value="{StaticResource EgaltechGreen}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGrid Name="AssociationDataGrid"
ItemsSource="{Binding Path=SelectedItem.AssociationList,
ElementName=TablesListBox}"
SelectedItem="{Binding Path=SelectedItem.SelectedAssociation,
ElementName=TablesListBox,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
IsSynchronizedWithCurrentItem="False"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
VirtualizingStackPanel.IsVirtualizing="False">
<Interactivity:Interaction.Behaviors>
<EgtCAM5:ScrollIntoViewForDataGrid/>
</Interactivity:Interaction.Behaviors>
<DataGrid.InputBindings>
<KeyBinding Key="F3" Modifiers="Control" Command="{Binding SearchNextCommand}"/>
<KeyBinding Key="F3" Modifiers="Shift" Command="{Binding SearchPreviousCommand}"/>
</DataGrid.InputBindings>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="{x:Static SystemColors.HighlightTextColor}"/>
</Style.Resources>
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<EventSetter Event="PreviewMouseDown" Handler="LeftTableMouseDown"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsValidForSearch}" Value="True">
<Setter Property="Background" Value="{StaticResource EgaltechGreen}"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<!--Colonna On-->
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding OnPar}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna On-->
<DataGridCheckBoxColumn Width="Auto" Binding="{Binding OnPar}">
<DataGridCheckBoxColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OnHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridCheckBoxColumn.Header>
</DataGridCheckBoxColumn>
<!--Colonna Name-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GeomNameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Name-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GeomNameHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=NamesList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Operation-->
<DataGridTemplateColumn Width="0.75*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OperationHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Oper,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=OperationsList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Oper,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Operation-->
<DataGridTemplateColumn Width="0.75*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.OperationHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Oper,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=OperationsList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Oper,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machine Id-->
<DataGridTemplateColumn Width="38">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MIdHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Source={x:Reference TablesListBox}, Path=SelectedItem.MachIdList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machine Id-->
<DataGridTemplateColumn Width="38">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MIdHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Source={x:Reference TablesListBox}, Path=SelectedItem.MachIdList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Shift-->
<DataGridTemplateColumn Width="38">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShiftHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Shift,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=ShiftList,Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Shift,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Shift-->
<DataGridTemplateColumn Width="38">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShiftHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Shift,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=ShiftList,Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Shift,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machining-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machining-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=Mach, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningUpType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachUpType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachUpType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningUpType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachUpType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachUpType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machining Up-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachUpHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachUpList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machining Up-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachUpHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachUpList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=MachUp,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningDownType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachDownType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachDownType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna MachiningDownType-->
<DataGridTemplateColumn Width="0.5*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachTypeHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding SelectedMachDownType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachTypeList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
DisplayMemberPath="TypeName"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=SelectedMachDownType.TypeName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Colonna Machining Down-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachDownHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachDownList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Link"
Binding="{Binding Path=Link}"
Foreground="Black"
IsReadOnly="True"
Visibility="{Binding Path=DataContext.Link_Visibility, Source={x:Reference dummyElement}}"/>
</DataGrid.Columns>
<!--Colonna Machining Down-->
<DataGridTemplateColumn Width="1*">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MachDownHdr,RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox IsEditable="False"
SelectedItem="{Binding MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding Path=MachDownList, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ToolTip="{Binding Path=MachDw,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</DataGrid>
</TabItem.Content>
</TabItem>
@@ -559,18 +548,6 @@
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition >
<ColumnDefinition.Style>
<Style TargetType="{x:Type ColumnDefinition}">
<Setter Property="Width" Value="1*"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Visibility, ElementName=LinkBtn}" Value="Collapsed">
<Setter Property="Width" Value="Auto"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ColumnDefinition.Style>
</ColumnDefinition>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
@@ -617,25 +594,20 @@
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding MoveRow_IsEnabled}"
Grid.Column="4"/>
<Button x:Name="LinkBtn" Content="Link" Command="{Binding LinkCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding Link_IsEnabled}"
Visibility="{Binding Link_Visibility}"
Grid.Column="5"/>
<Button Content="Group" Command="{Binding GroupCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding Group_IsEnabled}"
Grid.Column="6"/>
Grid.Column="5"/>
<Button Content="Position" Command="{Binding PositionCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
IsEnabled="{Binding Position_IsEnabled}"
Grid.Column="7"/>
Grid.Column="6"/>
<Button Content="{Binding AddMachBtn}" Command="{Binding AddMachCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="8"/>
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="7"/>
<Button Content="{Binding RemoveMachBtn}" Command="{Binding RemoveMachCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="9"/>
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
Grid.Column="8"/>
</Grid>
</Grid>
-28
View File
@@ -1,7 +1,6 @@
Imports System.Windows
Imports System.Windows.Controls.Primitives
Imports EgtWPFLib5
Imports EgtUILib
Public Class MTableDbV
@@ -156,31 +155,4 @@ Public Class MTableDbV
WinPosFromWindowToIni(Me, S_DOORS, K_MTABLEWINPLACE)
End Sub
Public Sub DataGrid_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If e.ChangedButton = MouseButton.Left Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
e.Handled = True
End If
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control AndAlso TypeOf sender Is DataGrid AndAlso DirectCast(sender, DataGrid).SelectedItems.Count >= 2 Then
e.Handled = True
End If
End If
End Sub
Public Sub DataGrid_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
End Sub
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
Dim Element As Object = e.OriginalSource
While Not IsNothing(Element) AndAlso Not TypeOf Element Is ScrollBar
Element = VisualTreeHelper.GetParent(CType(Element, DependencyObject))
End While
' verifico che non sia ScrollBar, di modo che questa continui a funzionare, ma non possa selezionare piu' righe trascinando
If IsNothing(Element) OrElse Not TypeOf Element Is ScrollBar Then
e.Handled = True
End If
End Sub
End Class
+10 -100
View File
@@ -1,9 +1,7 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Text.RegularExpressions
Imports System.Windows.Forms.LinkLabel
Imports EgtUILib
Imports EgtWPFLib5
@@ -158,24 +156,6 @@ Public Class MTableDbVM
End Set
End Property
Private m_Link_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Link_Visibility As Visibility
Get
Return m_Link_Visibility
End Get
End Property
Private m_Link_IsEnabled As Boolean
Public Property Link_IsEnabled As Boolean
Get
Return m_Link_IsEnabled
End Get
Set(value As Boolean)
m_Link_IsEnabled = value
NotifyPropertyChanged(NameOf(Link_IsEnabled))
End Set
End Property
#Region "Messages"
Public ReadOnly Property Title As String
@@ -379,7 +359,6 @@ Public Class MTableDbVM
Private m_cmdMoveRowDown As ICommand
Private m_cmdGroup As ICommand
Private m_cmdPosition As ICommand
Private m_cmdLink As ICommand
Private m_cmdCloseMTableWindow As ICommand
#Region "CONSTRUCTOR"
@@ -406,9 +385,6 @@ Public Class MTableDbVM
' Altrimenti recupero macchina corrente all'apertura della finestra per poterla ripristinare alla fine
EgtGetCurrMachineName(m_sPreviousActiveMachine)
End If
' leggo abilitazione link
m_Link_Visibility = If(GetMainPrivateProfileInt(S_DOORS, K_OPTIMIZEMACHFORLINE, 0) = 1, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(Link_Visibility))
' Azzero indice per nome tabella di default
MTableListBoxItem.NewMTableIndex = 0
' Creo liste operazioni e proprietà
@@ -428,29 +404,17 @@ Public Class MTableDbVM
If EgtVerifyMachinesDir() AndAlso Not bActiveMTableFound AndAlso m_TablesList.Count > 0 Then
m_TablesList(0).IsSelected = True
If Not m_TablesList(0).IsSelected Then
m_TablesList.RemoveAt(0)
Return
End If
m_TablesList.RemoveAt( 0)
return
End If
m_TablesList(0).SelMachine = m_TablesList(0).ActiveMachinesList(0)
End If
For Each Table In TablesList
AddHandler Table.SelectedAssociations.CollectionChanged, AddressOf SelectedAssociations_CollectionChanged
Next
End Sub
#End Region
#Region "METHODS"
Private Sub SelectedAssociations_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
For Each Table In TablesList
If Table.IsSelected Then
AddRemoveRow_IsEnabled = Table.SelectedAssociations.Count = 1
Link_IsEnabled = Table.SelectedAssociations.Count = 2
End If
Next
End Sub
Private Sub UpdateTables()
m_TablesList.Clear()
' se trovo la cartella carico la lista di tabelle
@@ -1256,7 +1220,7 @@ Public Class MTableDbVM
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If Not IsNothing(SelectedMTable) AndAlso Not IsNothing(SelectedMTable.SelectedAssociation) Then
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
Dim NewEmptyRow As MTableAssociationGridBoxItem = New MTableAssociationGridBoxItem(False, String.Empty, 1, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, 0, SelectedMTable.ActiveMachinesList, SelectedMTable.AssociationList)
Dim NewEmptyRow As MTableAssociationGridBoxItem = New MTableAssociationGridBoxItem(False, String.Empty, 1, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, SelectedMTable.ActiveMachinesList, SelectedMTable.AssociationList)
SelectedMTable.AssociationList.Insert(SelectedIndex + 1, NewEmptyRow)
SelectedMTable.SelectedAssociation = NewEmptyRow
SelectedMTable.NotifyPropertyChanged("SelectedAssociation")
@@ -1355,21 +1319,10 @@ Public Class MTableDbVM
' Left table Movement
Public Sub LeftTableMoveRowUp(SelectedMTable As MTableListBoxItem)
If SelectedMTable.SelectedAssociations.Count < 2 Then
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex >= 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex - 1)
End If
ElseIf SelectedMTable.SelectedAssociations.Count > 2 Then
Return
Else
Dim MoveIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociations(0))
Dim DestinationIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociations(1))
If DestinationIndex >= 0 Then
SelectedMTable.AssociationList.Move(MoveIndex, If(MoveIndex > DestinationIndex, DestinationIndex, Math.Max(0, DestinationIndex - 1)))
End If
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex >= 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex - 1)
End If
End Sub
Public Sub RightTableMoveRowUp(SelectedMTable As MTableListBoxItem)
@@ -1619,19 +1572,9 @@ Public Class MTableDbVM
' Spostamento sulla tabella delle associazioni
Public Sub LeftTableMoveRowDown(SelectedMTable As MTableListBoxItem)
If SelectedMTable.SelectedAssociations.Count < 2 Then
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex < SelectedMTable.AssociationList.Count - 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex + 1)
End If
ElseIf SelectedMTable.SelectedAssociations.Count > 2 Then
Return
Else
Dim MoveIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociations(0))
Dim DestinationIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociations(1))
If DestinationIndex < SelectedMTable.AssociationList.Count Then
SelectedMTable.AssociationList.Move(MoveIndex, If(MoveIndex > DestinationIndex, DestinationIndex + 1, DestinationIndex))
End If
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
If SelectedIndex < SelectedMTable.AssociationList.Count - 1 Then
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex + 1)
End If
End Sub
@@ -1643,39 +1586,6 @@ Public Class MTableDbVM
#End Region ' MoveRowDownCommand
#Region "Link"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property LinkCommand As ICommand
Get
If m_cmdLink Is Nothing Then
m_cmdLink = New Command(AddressOf Link)
End If
Return m_cmdLink
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Link(param As Object)
Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
If IsNothing(SelectedMTable) OrElse SelectedMTable.SelectedAssociations.Count <> 2 Then Return
'If (SelectedMTable.SelectedAssociations(0).nLink = 0 AndAlso SelectedMTable.SelectedAssociations(1).nLink <> 0) OrElse (SelectedMTable.SelectedAssociations(0).nLink <> 0 AndAlso SelectedMTable.SelectedAssociations(1).nLink = 0) Then Return
If SelectedMTable.SelectedAssociations(0).nLink = 0 AndAlso SelectedMTable.SelectedAssociations(1).nLink = 0 Then
Dim nNewIndex As Integer = SelectedMTable.AssociationList.Max(Function(x) x.nLink) + 1
SelectedMTable.SelectedAssociations(0).SetLink(nNewIndex)
SelectedMTable.SelectedAssociations(1).SetLink(-nNewIndex)
ElseIf SelectedMTable.SelectedAssociations(0).nLink = Math.Abs(SelectedMTable.SelectedAssociations(1).nLink) OrElse SelectedMTable.SelectedAssociations(1).nLink = Math.Abs(SelectedMTable.SelectedAssociations(0).nLink) Then
SelectedMTable.SelectedAssociations(0).SetLink(0)
SelectedMTable.SelectedAssociations(1).SetLink(0)
End If
End Sub
#End Region ' MoveRowDownCommand
#Region "GroupCommand"
''' <summary>
+8 -60
View File
@@ -5,7 +5,6 @@ Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtCAM5.MachineModel
Imports System.Collections.Specialized
Public Class MTableListBoxItem
Inherits VMBase
@@ -149,30 +148,10 @@ Public Class MTableListBoxItem
Private m_SelectedAssociation As MTableAssociationGridBoxItem
Public Property SelectedAssociation As MTableAssociationGridBoxItem
Get
Return m_SelectedAssociations(0)
Return m_SelectedAssociation
End Get
Set(value As MTableAssociationGridBoxItem)
Dim bFound As Boolean = False
For ItemIndex = m_SelectedAssociations.Count - 1 To 0 Step -1
If m_SelectedAssociations(ItemIndex) Is value Then
bFound = True
Else
m_SelectedAssociations.RemoveAt(ItemIndex)
End If
If Not bFound Then
m_SelectedAssociations.Add(value)
End If
Next
End Set
End Property
Private m_SelectedAssociations As New ObservableCollection(Of MTableAssociationGridBoxItem)
Public Property SelectedAssociations As ObservableCollection(Of MTableAssociationGridBoxItem)
Get
Return m_SelectedAssociations
End Get
Set(value As ObservableCollection(Of MTableAssociationGridBoxItem))
m_SelectedAssociations = value
m_SelectedAssociation = value
End Set
End Property
@@ -190,11 +169,6 @@ Public Class MTableListBoxItem
Sub New(sTableName As String, sTableNamePath As String)
TableName = sTableName
m_TableNamePath = sTableNamePath
AddHandler m_SelectedAssociations.CollectionChanged, AddressOf SelectedAssociations_CollectionChanged
End Sub
Private Sub SelectedAssociations_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
End Sub
Private Function ReadMTableFile() As Boolean
@@ -202,7 +176,7 @@ Public Class MTableListBoxItem
SharedMachIndex += 1
ActiveMachinesList.Add(New MTableMachineListBoxItem(String.Empty, False, False, SharedMachIndex))
m_MachIdList.Add(SharedMachIndex)
AssociationList.Add(New MTableAssociationGridBoxItem(False, String.Empty, Nothing, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, 0, ActiveMachinesList, m_AssociationList))
AssociationList.Add(New MTableAssociationGridBoxItem(False, String.Empty, Nothing, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, ActiveMachinesList, m_AssociationList))
Return True
End If
' resetto indici macchine impostati in tabella
@@ -862,7 +836,7 @@ Public Class MTableAssociationGridBoxItem
If Not IsNothing(m_SelectedMachType) Then
m_RefMachItem = ManageOrderedMachining(Mach, nOldMachId, RefMachItem)
If String.IsNullOrWhiteSpace(m_Mach) Then NotifyPropertyChanged("Mach")
End If
End If
If Not IsNothing(m_SelectedMachUpType) Then
m_RefMachUpItem = ManageOrderedMachining(MachUp, nOldMachId, RefMachUpItem)
If String.IsNullOrWhiteSpace(m_MachUp) Then NotifyPropertyChanged("MachUp")
@@ -1100,33 +1074,8 @@ Public Class MTableAssociationGridBoxItem
End Set
End Property
Private m_Link As Integer
Public Property Link As String
Get
Return m_Link.ToString()
End Get
Set(value As String)
Dim nValue As Integer = 0
If Integer.TryParse(value, nValue) Then
m_IsModified = True
m_Link = nValue
Else
NotifyPropertyChanged(NameOf(Link))
End If
End Set
End Property
Public ReadOnly Property nLink As Integer
Get
Return m_Link
End Get
End Property
Public Sub SetLink(value As Integer)
m_Link = value
NotifyPropertyChanged(NameOf(Link))
End Sub
Sub New(bOn As Boolean, sName As String, nMachId As Integer, nShift As Integer, sOper As String,
RefMachItem As MTableMachiningGridBoxItem, sMach As String, RefMachUpItem As MTableMachiningGridBoxItem, sMachUp As String, RefMachDwItem As MTableMachiningGridBoxItem, sMachDw As String, nLink As Integer,
RefMachItem As MTableMachiningGridBoxItem, sMach As String, RefMachUpItem As MTableMachiningGridBoxItem, sMachUp As String, RefMachDwItem As MTableMachiningGridBoxItem, sMachDw As String,
ByRef ActiveMachinesList As ObservableCollection(Of MTableMachineListBoxItem), ByRef AssociationList As ObservableCollection(Of MTableAssociationGridBoxItem))
OnPar = bOn
@@ -1169,7 +1118,7 @@ Public Class MTableAssociationGridBoxItem
' Assegno l'operazione
Oper = sOper
' dall'MId recupero la macchina a cui si riferisce questa associazione e la imposto come corrente
If Not IsNothing(m_ActiveMachinesList(m_MachId - 1).SelectedMachine) Then
If not IsNothing(m_ActiveMachinesList(m_MachId - 1).SelectedMachine) Then
EgtSetCurrMachine(m_ActiveMachinesList(m_MachId - 1).SelectedMachine.Name)
' Imposto MachType selezionato cercando il tipo delle lavorazioni
If EgtMdbSetCurrMachining(sMach) Then
@@ -1242,7 +1191,6 @@ Public Class MTableAssociationGridBoxItem
m_RefMachDwItem = RefMachDwItem
End If
End If
m_Link = nLink
m_IsModified = False
End Sub
@@ -1259,7 +1207,7 @@ Public Class MTableAssociationGridBoxItem
End If
Next
End If
' Se il nuovo valore è valido
' Se il nuovo valore è valido
Else
' Se non esiste già il rispettivo item nella lista lavorazioni ordinata lo creo
If IsNothing(RefMachItem) Then
@@ -1275,7 +1223,7 @@ Public Class MTableAssociationGridBoxItem
m_ActiveMachinesList(MachIndex).MachiningList.Insert(0, RefMachItem)
End If
Next
' altrimenti lo aggiorno con la nuova lavorazione
' altrimenti lo aggiorno con la nuova lavorazione
Else
RefMachItem.Machining = Mach
End If
+3 -8
View File
@@ -26,7 +26,6 @@ Module TableUtility
Private Const MACHDW As String = "MachDw"
Private Const MACHID As String = "MachId"
Private Const SHIFT As String = "Shift"
Private Const LINK As String = "Link"
Private Const PROPERTYTABLE As String = "PropertyTable"
Private Const OPER As String = "Oper"
Private Const GROUP As String = "Group"
@@ -94,7 +93,6 @@ Module TableUtility
Dim nMachId As Integer = 1
Dim nShift As Integer = 0
Dim sOper As String = String.Empty
Dim nLink As Integer = 0
If Not String.IsNullOrEmpty(sName) Then
Dim sOn As String = SearchKey(FileContent(LineIndex), ONCONST)
If Not String.IsNullOrEmpty(sOn) Then
@@ -168,9 +166,7 @@ Module TableUtility
End If
End If
Next
Dim sLink As String = SearchKey(FileContent(LineIndex), LINK)
Integer.TryParse(sLink, nLink)
Table.AssociationList.Add(New MTableAssociationGridBoxItem(bOn, sName, nMachId, nShift, sOper, MachItem, sMach, MachUpItem, sMachUp, MachDwItem, sMachDw, nLink, Table.ActiveMachinesList, Table.AssociationList))
Table.AssociationList.Add(New MTableAssociationGridBoxItem(bOn, sName, nMachId, nShift, sOper, MachItem, sMach, MachUpItem, sMachUp, MachDwItem, sMachDw, Table.ActiveMachinesList, Table.AssociationList))
End If
End If
If bPropertyTable Then
@@ -241,7 +237,7 @@ Module TableUtility
End If
' se nessuna lavorazione, ne aggiungo una vuota
If Table.AssociationList.Count = 0 Then
Table.AssociationList.Add(New MTableAssociationGridBoxItem(False, String.Empty, 0, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, 0, Table.ActiveMachinesList, Table.AssociationList))
Table.AssociationList.Add(New MTableAssociationGridBoxItem(False, String.Empty, 0, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Table.ActiveMachinesList, Table.AssociationList))
End If
Return True
End Function
@@ -480,8 +476,7 @@ Module TableUtility
", MachUp = '" & SelectedTable.AssociationList(Index).MachUp & "'", String.Empty) &
If(Not String.IsNullOrEmpty(SelectedTable.AssociationList(Index).MachDw), ", MachDwOrd = '" & SelectedTable.AssociationList(Index).RefMachDwItem.RWGroupId & "'" &
", MachDwJoin = '" & If(SelectedTable.AssociationList(Index).RefMachDwItem.Join, 1, 0) & "'" &
", MachDw = '" & SelectedTable.AssociationList(Index).MachDw & "'", String.Empty) &
If(Not String.IsNullOrEmpty(SelectedTable.AssociationList(Index).Link), ", Link = '" & SelectedTable.AssociationList(Index).Link & "'", String.Empty) & " }"
", MachDw = '" & SelectedTable.AssociationList(Index).MachDw & "'", String.Empty) & " }"
If Index < SelectedTable.AssociationList.Count - 1 Then
CurrentLine &= " ,"
End If
@@ -1,28 +0,0 @@
<EgtFloating:EgtFloatingPanel x:Class="ReversePostPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding ReversePostPanel_Visibility}">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
@@ -1,3 +0,0 @@
Public Class ReversePostPanelV
End Class
-37
View File
@@ -1,37 +0,0 @@
Public Class ReversePostPanelVM
Inherits VMBase
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Get
Return m_ButtonList
End Get
End Property
Private m_ReversePostPanel_Visibility As Visibility
Public ReadOnly Property ReversePostPanel_Visibility As Visibility
Get
Return m_ReversePostPanel_Visibility
End Get
End Property
Friend Sub SetReversePostPanelVisibility(bValue As Boolean)
m_ReversePostPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(ReversePostPanel_Visibility))
End Sub
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefReversePostPanelVM(Me)
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveReversePost() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
While GetPrivateProfileButton(S_REVERSEPOST, K_REVERSEPOSTBUTTON & BtnIndex, IniFile.m_sReversePostDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
End Class
-28
View File
@@ -1,28 +0,0 @@
<EgtFloating:EgtFloatingPanel x:Class="TrimmingPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding TrimmingPanel_Visibility}">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
-3
View File
@@ -1,3 +0,0 @@
Public Class TrimmingPanelV
End Class
-37
View File
@@ -1,37 +0,0 @@
Public Class TrimmingPanelVM
Inherits VMBase
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Get
Return m_ButtonList
End Get
End Property
Private m_TrimmingPanel_Visibility As Visibility
Public ReadOnly Property TrimmingPanel_Visibility As Visibility
Get
Return m_TrimmingPanel_Visibility
End Get
End Property
Friend Sub SetTrimmingPanelVisibility(bValue As Boolean)
m_TrimmingPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(TrimmingPanel_Visibility))
End Sub
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefTrimmingPanelVM(Me)
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveTrimming() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
While GetPrivateProfileButton(S_TRIMMING, K_TRIMMINGBUTTON & BtnIndex, IniFile.m_sTrimmingDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
End Class
-28
View File
@@ -1,28 +0,0 @@
<EgtFloating:EgtFloatingPanel x:Class="WindowPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Visibility="{Binding WindowPanel_Visibility}">
<ItemsControl ItemsSource="{Binding ButtonList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type local:ButtonItem}">
<Button ToolTip="{Binding ToolTip}" Command="{Binding LuaExecCommand}" Style="{StaticResource DrawPanelButton}">
<Image Source="{Binding ImagePath}"/>
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:SeparatorItem}">
<Border Style="{StaticResource Trimming_Border}">
<Border Style="{StaticResource Separator_Border}"/>
</Border>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</EgtFloating:EgtFloatingPanel>
-3
View File
@@ -1,3 +0,0 @@
Public Class WindowPanelV
End Class
-37
View File
@@ -1,37 +0,0 @@
Public Class WindowPanelVM
Inherits VMBase
Private m_ButtonList As New List(Of ButtonListItem)
Public ReadOnly Property ButtonList As List(Of ButtonListItem)
Get
Return m_ButtonList
End Get
End Property
Private m_WindowPanel_Visibility As Visibility
Public ReadOnly Property WindowPanel_Visibility As Visibility
Get
Return m_WindowPanel_Visibility
End Get
End Property
Friend Sub SetWindowPanelVisibility(bValue As Boolean)
m_WindowPanel_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(WindowPanel_Visibility))
End Sub
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefWindowPanelVM(Me)
' Se attivo, inizializzo i bottoni leggendoli da file ini
If IniFile.IsActiveWindow() Then
' Inizializzo i bottoni leggendoli da file ini
Dim BtnIndex As Integer = 1
Dim CurrBtn As ButtonListItem = Nothing
While GetPrivateProfileButton(S_WINDOW, K_WINDOWBUTTON & BtnIndex, IniFile.m_sWindowDirPath, CurrBtn)
m_ButtonList.Add(CurrBtn)
BtnIndex += 1
End While
End If
End Sub
End Class

Some files were not shown because too many files have changed in this diff Show More