Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eec592c782 | |||
| dc6c075508 | |||
| 2735c66b11 | |||
| bc22e32821 | |||
| 5624f05ad6 | |||
| 0c68d8c142 | |||
| e2480dcf1d | |||
| cc63f278c6 | |||
| 54360bbccf | |||
| c71d7c84f7 | |||
| 9e9aad2eed | |||
| a2a1b83888 | |||
| f44ae792c6 | |||
| 4692bd0308 | |||
| 2e863c0ce2 | |||
| 1735e281e5 | |||
| 125e7346d4 | |||
| bd3cdf7ea0 | |||
| d90a49248f | |||
| 3833b7c7c5 | |||
| 89b063b92f | |||
| df26bef2aa | |||
| 5cddbffb45 | |||
| 2daa33ba91 | |||
| f83e8294bc | |||
| 1dfc46e6ce | |||
| d7df513bf7 | |||
| 8aac3ea989 | |||
| a514a70b5b | |||
| cf86b93725 | |||
| fef104b371 | |||
| afe756aada | |||
| 7954077676 | |||
| 60673cd9e3 | |||
| 9d62cf6b99 | |||
| 6e2c4d8b35 | |||
| d8bff8ac9e | |||
| 0926456513 | |||
| bf424a49e1 | |||
| be4bc812da | |||
| ce18ea3ade | |||
| 931c96a587 |
@@ -41,25 +41,6 @@ Public Class TreeViewItemBase
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isExpanded) Then
|
||||
m_isExpanded = value
|
||||
If Not Map.refProjectVM.bSelObjOnScene Then
|
||||
Dim m_onldObjTreeOldId As Integer = Map.refManageLayerExpanderVM.m_nObjTreeOldId
|
||||
If Not m_isExpanded Then
|
||||
Else
|
||||
For Each Item As LayerTreeViewItem In Map.refManageLayerExpanderVM.LayerList
|
||||
For Each LayerItem As LayerTreeViewItem In Item.Items
|
||||
If m_isExpanded = LayerItem.m_isExpanded Then
|
||||
If m_onldObjTreeOldId = LayerItem.Id Then
|
||||
Map.refProjectVM.SetLastInteger(LayerItem.Id)
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.DESELECTPARTLAYEROBJ)
|
||||
Else
|
||||
Map.refManageLayerExpanderVM.SelectIdInObjTree(LayerItem.Id)
|
||||
'Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
NotifyPropertyChanged("IsExpanded")
|
||||
End If
|
||||
End Set
|
||||
|
||||
@@ -105,11 +105,15 @@ 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"
|
||||
@@ -155,6 +159,7 @@ 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_GUNSTOCK As String = "GunStock"
|
||||
Public Const K_GUNSTOCKENABLE As String = "GsEnable"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Public Interface IListItemConverter
|
||||
Function Convert(ByVal masterListItem As Object) As Object
|
||||
Function ConvertBack(ByVal targetListItem As Object) As Object
|
||||
End Interface
|
||||
@@ -0,0 +1,80 @@
|
||||
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
|
||||
@@ -0,0 +1,163 @@
|
||||
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
|
||||
@@ -161,6 +161,9 @@
|
||||
<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="LeftTray\LeftTrayV.xaml.vb">
|
||||
<DependentUpon>LeftTrayV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -1035,6 +1038,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\DrawPanel\StmMoveVertex.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TreeView\LampSel.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtCAM5\EgtCAM5R32.exe
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
Imports System.IO
|
||||
Imports EgtCAM5.MyMachinePanelVM
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Windows.Forms.AxHost
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -98,20 +97,23 @@ 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 = EgtGetLastMachGroup()
|
||||
nGroupId = EgtGetCurrMachGroup()
|
||||
If nGroupId = GDB_ID.NULL Then
|
||||
nGroupId = EgtGetFirstMachGroup()
|
||||
End If
|
||||
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
|
||||
|
||||
+17
-11
@@ -385,8 +385,8 @@ Public Class MainWindowVM
|
||||
EgtSetLockId(sLockId)
|
||||
End If
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2609, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2609, 1, IniFile.m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(3279, 2703, 1, IniFile.m_nKeyLevel) And
|
||||
EgtGetKeyOptions(3279, 2703, 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,6 @@ Public Class MainWindowVM
|
||||
GetPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
|
||||
GetPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", OptionModule.m_sFontText)
|
||||
EgtSetFont(sNfeDir, OptionModule.m_sFontText)
|
||||
' Imposto direttorio ausiliario per import/gestione BTL
|
||||
Dim sBtlAuxDir As String = String.Empty
|
||||
GetPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
|
||||
EgtSetBtlAuxDir(sBtlAuxDir)
|
||||
' Imposto direttorio libreria per export ThreeJs
|
||||
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)
|
||||
@@ -437,6 +429,14 @@ Public Class MainWindowVM
|
||||
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)
|
||||
Dim sBtlAuxDir As String = String.Empty
|
||||
GetPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
|
||||
EgtSetBtlAuxDir(sBtlAuxDir)
|
||||
' Imposto direttorio libreria per export ThreeJs
|
||||
Dim sThreeJSLibDir As String = String.Empty
|
||||
GetPrivateProfileString(S_EXPORT, K_THREEJSLIBDIR, "", sThreeJSLibDir)
|
||||
EgtSetThreeJSLibDir(sThreeJSLibDir)
|
||||
' Imposto direttorio temporaneo a EgtInterface
|
||||
EgtSetTempDir(m_sTempDir)
|
||||
' Imposto IniFile a EgtInterface
|
||||
@@ -597,10 +597,16 @@ 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
|
||||
Map.refMachiningParameterExpanderVM.FocusSlider()
|
||||
Dim nStep As Integer = If( e.Key = Key.Right OrElse e.Key = Key.Up, 1, -1)
|
||||
Dim nStep As Integer = If(e.Key = Key.Right OrElse e.Key = Key.Up, 1, -1)
|
||||
Map.refMachiningParameterExpanderVM.SetSliderValue(nStep)
|
||||
e.Handled = True
|
||||
End If
|
||||
|
||||
@@ -30,7 +30,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtCAM5")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2016-2025 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("2.6.9.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.9.1")>
|
||||
<Assembly: AssemblyVersion("2.7.3.2")>
|
||||
<Assembly: AssemblyFileVersion("2.7.3.2")>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="Txt" Text="{Binding TextBox,UpdateSourceTrigger=PropertyChanged}"
|
||||
PreviewKeyDown="TextBox_PreviewKeyDown" Height="Auto"
|
||||
Visibility="{Binding TextVisibility}" Margin="5,0,5,5" >
|
||||
Visibility="{Binding TextVisibility}" Margin="5,0,5,5">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DoneCommand}"/>
|
||||
<KeyBinding Key="S" Modifiers="Control" Command="{Binding ShowCommand}"/>
|
||||
@@ -34,49 +34,54 @@
|
||||
<Button Grid.Column="1"
|
||||
Content="+"
|
||||
Command="{Binding ShowInfoItemCommand}"
|
||||
Visibility="Collapsed"
|
||||
Visibility="{Binding ShowInfoItemVisibility}"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="5,-1,5,0"
|
||||
VerticalAlignment="Top"/>
|
||||
<!--Visibility="{Binding ShowInfoItemVisibility}"-->
|
||||
</Grid>
|
||||
<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"/>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding InfoList}"
|
||||
Visibility="{Binding InfoVisibility}"
|
||||
Margin="5,5,0,10">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Key}"
|
||||
Width="70"
|
||||
Margin="0,6,-15,0"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Valour, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,5,5,10">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DoneInfoCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<Button Grid.Column="2"
|
||||
Content="-"
|
||||
Command="{Binding RemoveInfoItemCommand}"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="5,-2,5,5"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
MaxHeight="190"
|
||||
Margin="2,5,0,10">
|
||||
<ItemsControl ItemsSource="{Binding InfoList}"
|
||||
Visibility="{Binding InfoVisibility}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding Key}"
|
||||
ToolTip="{Binding Key}"
|
||||
Width="70"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,6,0,0"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Valour, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="8,5,2,10">
|
||||
<TextBox.InputBindings>
|
||||
<KeyBinding Key="Enter" Command="{Binding DoneInfoCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<Button Grid.Column="2"
|
||||
Content="-"
|
||||
Command="{Binding RemoveInfoItemCommand}"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="2,-2,4,5"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Margin="5,0,5,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Public Class InputExpanderV
|
||||
|
||||
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.Enter And Keyboard.Modifiers = ModifierKeys.Shift Then
|
||||
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
|
||||
Txt.AppendText(Environment.NewLine)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports MS.Internal
|
||||
|
||||
Public Class InputExpanderVM
|
||||
Inherits ViewModelBase
|
||||
@@ -20,7 +19,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of InfoItem))
|
||||
m_tmpInfoList = value
|
||||
OnPropertyChanged("tmpInfoList")
|
||||
OnPropertyChanged(NameOf(tmpInfoList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -32,7 +31,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsExpanded = value
|
||||
OnPropertyChanged("IsExpanded")
|
||||
OnPropertyChanged(NameOf(IsExpanded))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -43,7 +42,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsEnabled = value
|
||||
OnPropertyChanged("IsEnabled")
|
||||
OnPropertyChanged(NameOf(IsEnabled))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -54,7 +53,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Title = value
|
||||
OnPropertyChanged("Title")
|
||||
OnPropertyChanged(NameOf(Title))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -66,7 +65,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_TextBlock = value
|
||||
OnPropertyChanged("TextBlock")
|
||||
OnPropertyChanged(NameOf(TextBlock))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -79,7 +78,7 @@ Public Class InputExpanderVM
|
||||
Set(value As String)
|
||||
m_TextBox = value
|
||||
Map.refProjectVM.NotifyInputText(value)
|
||||
OnPropertyChanged("TextBox")
|
||||
OnPropertyChanged(NameOf(TextBox))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -91,7 +90,7 @@ Public Class InputExpanderVM
|
||||
Set(value As Visibility)
|
||||
If value <> m_TextVisibility Then
|
||||
m_TextVisibility = value
|
||||
OnPropertyChanged("TextVisibility")
|
||||
OnPropertyChanged(NameOf(TextVisibility))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -103,7 +102,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_FocusTextBox = value
|
||||
OnPropertyChanged("FocusTextBox")
|
||||
OnPropertyChanged(NameOf(FocusTextBox))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -115,7 +114,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_CheckBoxText = value
|
||||
OnPropertyChanged("CheckBoxText")
|
||||
OnPropertyChanged(NameOf(CheckBoxText))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -128,7 +127,7 @@ Public Class InputExpanderVM
|
||||
If value <> m_IsChecked Then
|
||||
Map.refProjectVM.SetLastBoolean(value)
|
||||
m_IsChecked = value
|
||||
OnPropertyChanged("IsChecked")
|
||||
OnPropertyChanged(NameOf(IsChecked))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -141,7 +140,7 @@ Public Class InputExpanderVM
|
||||
Set(value As Visibility)
|
||||
If value <> m_CheckVisibility Then
|
||||
m_CheckVisibility = value
|
||||
OnPropertyChanged("CheckVisibility")
|
||||
OnPropertyChanged(NameOf(CheckVisibility))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -154,7 +153,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of String))
|
||||
m_ComboItemsList = value
|
||||
OnPropertyChanged("ComboItemsList")
|
||||
OnPropertyChanged(NameOf(ComboItemsList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -168,11 +167,11 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of InfoItem))
|
||||
m_InfoList = value
|
||||
OnPropertyChanged("InfoList")
|
||||
OnPropertyChanged(NameOf(InfoList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ComboSelectedIndex As Integer
|
||||
Private m_ComboSelectedIndex As Integer = GDB_ID.NULL
|
||||
Public Property ComboSelectedIndex As Integer
|
||||
Get
|
||||
Return m_ComboSelectedIndex
|
||||
@@ -187,7 +186,7 @@ Public Class InputExpanderVM
|
||||
' Controllo se la info è contenuta nella lista ComboItemsList
|
||||
If ComboItemsList.Contains(tmpInfoList(m_ComboSelectedIndex).sKey) Then
|
||||
' Aggiungo la info alla lista per visualizzarla
|
||||
InfoList.Add(New InfoItem(tmpInfoList(m_ComboSelectedIndex).nId, tmpInfoList(m_ComboSelectedIndex).sKey, m_tmpInfoList(m_ComboSelectedIndex).sValour))
|
||||
InfoList.Add(New InfoItem(tmpInfoList(m_ComboSelectedIndex).nId, tmpInfoList(m_ComboSelectedIndex).sKey, tmpInfoList(m_ComboSelectedIndex).sValour))
|
||||
' Nascondo la combobox
|
||||
ComboVisibility = Visibility.Collapsed
|
||||
' Rimuovo la info dalla ComboItemsList
|
||||
@@ -196,9 +195,12 @@ Public Class InputExpanderVM
|
||||
' Rimuovo la info dalla tmpInfoList
|
||||
tmpInfoList.Remove(tmpInfoList(tmpComboSelectedIndex))
|
||||
End If
|
||||
OnPropertyChanged("ComboSelectedIndex")
|
||||
OnPropertyChanged("ComboItemsList")
|
||||
OnPropertyChanged("InfoList")
|
||||
' Rendo invisibile il pulsante per attivare la combo
|
||||
If ComboItemsList.Count <= 0 Then ShowInfoItemVisibility = Visibility.Collapsed
|
||||
m_ComboSelectedIndex = GDB_ID.NULL
|
||||
OnPropertyChanged(NameOf(ComboSelectedIndex))
|
||||
OnPropertyChanged(NameOf(ComboItemsList))
|
||||
OnPropertyChanged(NameOf(InfoList))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -210,7 +212,7 @@ Public Class InputExpanderVM
|
||||
Set(value As Visibility)
|
||||
If value <> m_ComboVisibility Then
|
||||
m_ComboVisibility = value
|
||||
OnPropertyChanged("ComboVisibility")
|
||||
OnPropertyChanged(NameOf(ComboVisibility))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -223,7 +225,7 @@ Public Class InputExpanderVM
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_ShowBtnVisibility = value
|
||||
OnPropertyChanged("ShowBtnVisibility")
|
||||
OnPropertyChanged(NameOf(ShowBtnVisibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -238,7 +240,7 @@ Public Class InputExpanderVM
|
||||
Set(value As Visibility)
|
||||
If value <> m_ShowInfoItemVisibility Then
|
||||
m_ShowInfoItemVisibility = value
|
||||
OnPropertyChanged("ShowInfoItemVisibility")
|
||||
OnPropertyChanged(NameOf(ShowInfoItemVisibility))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -254,7 +256,7 @@ Public Class InputExpanderVM
|
||||
Set(value As Visibility)
|
||||
If value <> m_InfoVisibility Then
|
||||
m_InfoVisibility = value
|
||||
OnPropertyChanged("InfoVisibility")
|
||||
OnPropertyChanged(NameOf(InfoVisibility))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -350,7 +352,9 @@ Public Class InputExpanderVM
|
||||
m_TextBox &= vbCrLf & (Item.Key & "=" & Item.Valour).Trim() & vbCrLf
|
||||
Next
|
||||
End If
|
||||
Map.refProjectVM.Done(m_TextBox)
|
||||
' Rimuovo eventuali spazi
|
||||
Dim tmpTextBox As String = m_TextBox.Replace(" ", "")
|
||||
Map.refProjectVM.Done(tmpTextBox)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@@ -400,8 +404,6 @@ Public Class InputExpanderVM
|
||||
If Title = EgtMsg(5359).ToUpper() Then
|
||||
' Metto tmpbShow a false
|
||||
m_tmpbShow = False
|
||||
' Rendo visibile il pulsante che mostra la lista delle info
|
||||
ShowInfoItemVisibility = Visibility.Visible
|
||||
' Rendo visibile la lista delle info selezionate
|
||||
InfoVisibility = Visibility.Visible
|
||||
' Pulisco la lista tmpInfoList
|
||||
@@ -410,8 +412,10 @@ Public Class InputExpanderVM
|
||||
InfoList.Clear()
|
||||
' Pulisco la lista ComboItemsList
|
||||
ComboItemsList.Clear()
|
||||
' Popolo la lista ComboItemsList
|
||||
ComboInfo()
|
||||
' Popolo la lista InfoList
|
||||
GetInfoList()
|
||||
' Rendo visibile il pulsante che mostra la lista delle info
|
||||
ShowInfoItemVisibility = If(m_ComboItemsList.Count > 0, Visibility.Visible, Visibility.Collapsed)
|
||||
End If
|
||||
End If
|
||||
If PrepareInputBoxParam.sCheckLabel <> "" Then
|
||||
@@ -490,22 +494,20 @@ Public Class InputExpanderVM
|
||||
ComboItemsList.Add(InfoItem.sKey)
|
||||
' Riaggiungo la info eliminata
|
||||
tmpInfoList.Add(InfoItem)
|
||||
' Rendo visibile il pulsante per attivare la combo
|
||||
ShowInfoItemVisibility = Visibility.Visible
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che popola la lista ComboItemsList
|
||||
''' </summary>
|
||||
Private Sub ComboInfo()
|
||||
'''''''''''''''''''''''''''''' Recuperare funzione egtgetallinfo quando sarà pronta
|
||||
Dim val As Integer
|
||||
If Not m_tmpbShow Then
|
||||
For Ind As Integer = 0 To 6
|
||||
val += Ind
|
||||
tmpInfoList.Add(New InfoItem(Ind, "A" & +Ind, val.ToString()))
|
||||
Next
|
||||
|
||||
For Each InfoItem As InfoItem In tmpInfoList
|
||||
ComboItemsList.Add(InfoItem.sKey)
|
||||
Private Sub GetInfoList()
|
||||
Dim tmpInfoList As String() = Nothing
|
||||
Dim sKeyVal() As String = Nothing
|
||||
Dim Index As Integer = 0
|
||||
EgtGetAllInfo(Map.refManageLayerExpanderVM.m_nObjTreeOldId, tmpInfoList)
|
||||
If Not IsNothing(tmpInfoList) Then
|
||||
For Each ItemInfo As String In tmpInfoList
|
||||
sKeyVal = ItemInfo.Trim().Split(New Char() {"="c})
|
||||
InfoList.Add(New InfoItem(Index, sKeyVal(0), sKeyVal(1)))
|
||||
Index += 1
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -74,12 +74,12 @@ Public Class LayerTreeViewItem
|
||||
m_bOnOff = value
|
||||
' se abilitato, eseguo operazione
|
||||
If m_SendCmd Then
|
||||
Map.refProjectVM.SetLastInteger(Id)
|
||||
If value Then
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.SHOW)
|
||||
EgtSetStatus(Id, GDB_ST.ON_)
|
||||
Else
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.HIDE)
|
||||
EgtSetStatus(Id, GDB_ST.OFF)
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
Dim bOnOffGroup As Boolean = ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift) AndAlso Items.Count > 0
|
||||
If bOnOffGroup Then
|
||||
@@ -103,6 +103,7 @@ Public Class LayerTreeViewItem
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
Map.refProjectVM.EmitTitle()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<Button Content="{Binding ColorMsg}" Command="{Binding LayerColorCommand}" Height="30"/>
|
||||
</UniformGrid>
|
||||
|
||||
<TreeView x:Name="LayerTreeView" MinHeight="150" MaxHeight="250"
|
||||
<TreeView x:Name="LayerTreeView" MinHeight="300" MaxHeight="400"
|
||||
ItemsSource="{Binding Path=LayerList}"
|
||||
VirtualizingStackPanel.IsVirtualizing = "True"
|
||||
VirtualizingStackPanel.VirtualizationMode = "Recycling">
|
||||
|
||||
@@ -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
|
||||
SelectIdInObjTree(EgtGetCurrLayer(), False)
|
||||
SelectIdInObjTreeNoMark(EgtGetCurrLayer())
|
||||
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
|
||||
SelectIdInObjTree(EgtGetCurrLayer(), False)
|
||||
SelectIdInObjTreeNoMark(EgtGetCurrLayer())
|
||||
End Sub
|
||||
|
||||
#End Region ' NewLayerCommand
|
||||
@@ -492,7 +492,7 @@ Public Class ManageLayerExpanderVM
|
||||
Map.refProjectVM.SetLastInteger(RightClickedTreeItemId)
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.DELETE)
|
||||
' Seleziono prossimo
|
||||
SelectIdInObjTree(nNewId, False)
|
||||
SelectIdInObjTreeNoMark(nNewId)
|
||||
End Sub
|
||||
|
||||
#End Region ' DeleteCommand
|
||||
@@ -533,11 +533,13 @@ Public Class ManageLayerExpanderVM
|
||||
Private m_bEnableUpdateObjInObjTree As Boolean = True
|
||||
|
||||
Friend Sub SelectIdInObjTreeNoMark(nId As Integer)
|
||||
SelectIdInObjTree(nId, False)
|
||||
LayerTreeViewItem.m_MarkOnSel = False
|
||||
MySelectIdInObjTree(nId)
|
||||
LayerTreeViewItem.m_MarkOnSel = True
|
||||
End Sub
|
||||
|
||||
Friend Sub SelectIdInObjTree(nId As Integer)
|
||||
SelectIdInObjTree(nId, True)
|
||||
MySelectIdInObjTree(nId)
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateObjTreeOldId(ObjTreeOldId As Integer)
|
||||
@@ -581,7 +583,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 SelectIdInObjTree(nOldId, True) Then
|
||||
If Not MySelectIdInObjTree(nOldId) Then
|
||||
Map.refInfoExpanderVM.SetInfoBox(String.Empty)
|
||||
End If
|
||||
m_bEnableUpdateObjInObjTree = True
|
||||
@@ -803,14 +805,11 @@ Public Class ManageLayerExpanderVM
|
||||
Return nOldId
|
||||
End Function
|
||||
|
||||
Private Function SelectIdInObjTree(nId As Integer, bMark As Boolean) As Boolean
|
||||
Private Function MySelectIdInObjTree(nId As Integer) 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
|
||||
|
||||
+2
-1
@@ -273,7 +273,7 @@ Public Class DispositionParameterExpanderVM
|
||||
End If
|
||||
Select Case m_ActiveObject
|
||||
Case ObjectType.RAWPART
|
||||
' Abilito la selezione delle Fixture
|
||||
' Abilito la selezione dei Grezzi
|
||||
Map.refProjectVM.SceneSelType = SceneSelTypeOpt.RAWPART
|
||||
Case ObjectType.FIXTURE
|
||||
' Abilito la selezione delle Fixture
|
||||
@@ -281,6 +281,7 @@ Public Class DispositionParameterExpanderVM
|
||||
End Select
|
||||
Map.refRawPartOptionVM.SetMoveWithFixture(False)
|
||||
Map.refFixtureParametersVM.UpdateFixtureTypeList()
|
||||
DispositionUtility.InitHookData()
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
+660
-371
File diff suppressed because it is too large
Load Diff
+204
-144
@@ -5,8 +5,6 @@ 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
|
||||
@@ -64,8 +62,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
|
||||
@@ -78,6 +76,7 @@ Public Class FixtureParametersVM
|
||||
|
||||
Friend Sub UpdateFixtureTypeList()
|
||||
m_FixtureTypeList = New ObservableCollection(Of FixtureListItem)(FixtureType.ReadFixtureTypeFromMachIni())
|
||||
UpdateFixtureCount()
|
||||
OnPropertyChanged("FixtureTypeList")
|
||||
End Sub
|
||||
|
||||
@@ -122,27 +121,36 @@ Public Class FixtureParametersVM
|
||||
OnPropertyChanged("FixtureErrorMsg")
|
||||
Return
|
||||
End If
|
||||
' dimensioni tavola
|
||||
Dim vtTabDim As Vector3d = ptTableMax - ptTableMin
|
||||
' calcolo il centro della tavola
|
||||
Dim ptTableMid As New Point3d((ptTableMax.x - ptTableMin.x) / 2, (ptTableMax.y - ptTableMin.y) / 2, (ptTableMax.z - ptTableMin.z) / 2)
|
||||
Dim ptTableMid As Point3d = Point3d.ORIG() + 0.5 * vtTabDim
|
||||
' posiziono il nuovo sottopezzo al centro della tavola
|
||||
Dim nAddedFixtureId As Integer = EgtAddFixture(SelectedFixture.Name, ptTableMid, 0, 0)
|
||||
Dim nAddedFixtureId As Integer = EgtAddFixture(SelectedFixture.Name, ptTableMid, 0, 20)
|
||||
If nAddedFixtureId = GDB_ID.NULL Then
|
||||
m_FixtureErrorMsg = "Impossibile posizionare la ventosa sulla tavola"
|
||||
OnPropertyChanged("FixtureErrorMsg")
|
||||
Return
|
||||
End If
|
||||
' verifico se la ventosa ha punti di hook da ancorare
|
||||
' Se la ventosa ha punti di hook da ancorare
|
||||
If IsFixtureWithHook(nAddedFixtureId) Then
|
||||
If Not PositionFixtureOnNearestHook(nAddedFixtureId) Then
|
||||
' non ci sono punti liberi, quindi rimuovo la ventosa e segnalo
|
||||
EgtRemoveFixture(nAddedFixtureId)
|
||||
MessageBox.Show("No free hook point!", "ERROR")
|
||||
Return
|
||||
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
|
||||
End If
|
||||
' altrimenti ventosa con movimento continuo
|
||||
Else
|
||||
' se non ha punti di ancoraggio
|
||||
' verifico se è in una posizione valida
|
||||
If Not DispositionUtility.VerifyFixturePosition(nAddedFixtureId, New Vector3d) Then
|
||||
' 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
|
||||
@@ -157,76 +165,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
|
||||
' 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
|
||||
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
|
||||
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)
|
||||
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
|
||||
|
||||
@@ -239,9 +247,7 @@ Public Class FixtureParametersVM
|
||||
' leggo tipo
|
||||
Dim sType As String = ""
|
||||
EgtGetInfo(nFixtHookId, DispositionUtility.TYPE, sType)
|
||||
If sType.Equals(DispositionUtility.FREE) Then
|
||||
Return False
|
||||
ElseIf sType.Equals(DispositionUtility.POINT) Then
|
||||
If sType.Equals(DispositionUtility.POINT) Then
|
||||
Return True
|
||||
ElseIf sType.Equals(DispositionUtility.LINE) Then
|
||||
Return True
|
||||
@@ -250,7 +256,7 @@ Public Class FixtureParametersVM
|
||||
End If
|
||||
End Function
|
||||
|
||||
' Funzione che aggancia la ventosa al più vicino hook libero
|
||||
' Funzione che cerca un hook libero adatto alla ventosa e se trovato la posiziona
|
||||
Friend Shared Function PositionFixtureOnNearestHook(nFixtureId As Integer) As Boolean
|
||||
' cerco punto hook sulla ventosa
|
||||
Dim nFixtSolidId As Integer = EgtGetFirstNameInGroup(nFixtureId, SOLID)
|
||||
@@ -262,26 +268,21 @@ Public Class FixtureParametersVM
|
||||
Dim nFixtHookType As DispositionUtility.HOOKTYPE = DispositionUtility.HOOKTYPE.FREE
|
||||
Dim sType As String = ""
|
||||
EgtGetInfo(nFixtHookId, DispositionUtility.TYPE, sType)
|
||||
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
|
||||
If 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)
|
||||
' cerco id tavola
|
||||
' Recupero Id tavola corrente
|
||||
Dim sTableName As String = ""
|
||||
EgtGetTableName(sTableName)
|
||||
Dim nTableId As Integer = EgtGetTableId(sTableName)
|
||||
' cerco hook su tavola macchina
|
||||
' *** Cerco hook su tavola ***
|
||||
Dim nTableSolidId As Integer = EgtGetFirstNameInGroup(nTableId, SOLID)
|
||||
Dim nCurrHookId As Integer = EgtGetFirstNameInGroup(nTableSolidId, DispositionUtility.HOOK)
|
||||
' Punto di hook a cui spostare la ventosa
|
||||
@@ -293,33 +294,23 @@ Public Class FixtureParametersVM
|
||||
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
|
||||
' verifico se è in una posizione valida
|
||||
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
|
||||
EgtSetInfo(nCurrHookId, used, nFixtureId)
|
||||
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
|
||||
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
|
||||
Else
|
||||
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
|
||||
End If
|
||||
EgtSetFixtureLink( nFixtureId, "")
|
||||
Return True
|
||||
Else
|
||||
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
|
||||
End If
|
||||
End If
|
||||
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
|
||||
End While
|
||||
' cerco hook su barra fissa
|
||||
' *** Cerco hook su barre fisse ***
|
||||
Dim nTableFixedId As Integer = EgtGetFirstNameInGroup(nTableId, DispositionUtility.FIXED)
|
||||
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 nTableFixedId <> GDB_ID.NULL
|
||||
nCurrHookId = EgtGetFirstNameInGroup(nTableFixedId, DispositionUtility.HOOK)
|
||||
While nCurrHookId <> GDB_ID.NULL
|
||||
' se punto di aggancio valido
|
||||
If HookAnalyzer(nCurrHookId, nFixtHookType, nFixtHookClass, ptFixtHook, ptCurrHook) Then
|
||||
@@ -327,46 +318,114 @@ Public Class FixtureParametersVM
|
||||
EgtMoveFixture(nFixtureId, ptCurrHook - ptFixtHook)
|
||||
' verifico se è in una posizione valida
|
||||
If DispositionUtility.VerifyFixturePosition(nFixtureId, New Vector3d) Then
|
||||
EgtSetInfo(nCurrHookId, USED, nFixtureId)
|
||||
If nFixtHookType = DispositionUtility.HOOKTYPE.POINT then
|
||||
DispositionUtility.SetHookUsed( nCurrHookId, nFixtureId)
|
||||
Else
|
||||
DispositionUtility.AddHookUsed( nCurrHookId, nFixtureId)
|
||||
End If
|
||||
EgtSetFixtureLink( nFixtureId, "")
|
||||
Return True
|
||||
Else
|
||||
EgtStartPoint(nFixtHookId, GDB_ID.ROOT, ptFixtHook)
|
||||
End If
|
||||
End If
|
||||
nCurrHookId = EgtGetNextName(nCurrHookId, DispositionUtility.HOOK)
|
||||
End While
|
||||
nMobileInd += 1
|
||||
nMobile = EgtGetFirstNameInGroup(nTableId, DispositionUtility.MOBILE & nMobileInd)
|
||||
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)
|
||||
End While
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' 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
|
||||
' 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
|
||||
Dim nTableHookType As GDB_TY = EgtGetType(nCurrHookId)
|
||||
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
|
||||
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
|
||||
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
|
||||
@@ -396,6 +455,7 @@ 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)
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+31
-1
@@ -117,7 +117,7 @@ Public Class RawPartOptionVM
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Point. This method is invoked by the DoneCommand.
|
||||
''' Execute NewRawPart. This method is invoked by the DoneCommand.
|
||||
''' </summary>
|
||||
Public Sub NewRawPart()
|
||||
DispositionUtility.ShowParts()
|
||||
@@ -127,6 +127,36 @@ 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
|
||||
+42
-18
@@ -5,26 +5,25 @@ Public Class DispositionOpListBoxItem
|
||||
|
||||
Public Property StatusAll As Boolean?
|
||||
Get
|
||||
' Recupero gli indici delle operazioni della Disposizione corrente
|
||||
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).Status
|
||||
For OpInDispIndex = 1 To OpIndexes.Count - 1
|
||||
If DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(OpInDispIndex)), MachiningOpListBoxItem).Status <> bTemp Then Return Nothing
|
||||
Next
|
||||
Return bTemp
|
||||
' Ottieni gli indici delle operazioni e calcola il valore aggregato
|
||||
Return GetUnifiedStatus(Function(item) item.Status)
|
||||
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(StatusAll))
|
||||
Return
|
||||
End If
|
||||
For Each OpInDispIndex In OpIndexes
|
||||
DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpInDispIndex), MachiningOpListBoxItem).Status = If(IsNothing(value), False, CBool(value))
|
||||
Next
|
||||
' Aggiorna lo stato delle operazioni
|
||||
UpdateAllStatus(value, Sub(item, val) item.Status = CBool(val))
|
||||
NotifyPropertyChanged(NameOf(StatusAll))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property OnOffAll As Boolean?
|
||||
Get
|
||||
' Ottieni gli indici delle operazioni e calcola il valore aggregato
|
||||
Return GetUnifiedStatus(Function(item) item.OnOff)
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
' Aggiorna lo stato delle operazioni
|
||||
UpdateAllStatus(value, Sub(item, val) item.OnOff = val)
|
||||
NotifyPropertyChanged(NameOf(OnOffAll))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -53,6 +52,7 @@ Public Class DispositionOpListBoxItem
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
' Inserisco in una lista gli indici delle operazioni della Disposizione (a partire dunque dall'indice trovato)
|
||||
Dim OpIndexes As New List(Of Integer)()
|
||||
Dim OpIndex As Integer = DispIndex + 1
|
||||
@@ -64,4 +64,28 @@ Public Class DispositionOpListBoxItem
|
||||
Return OpIndexes
|
||||
End Function
|
||||
|
||||
' Metodo per calcolare il valore aggregato (Checked/Unchecked/Indeterminate)
|
||||
Private Function GetUnifiedStatus(getStatus As Func(Of MachiningOpListBoxItem, Boolean?)) As Boolean?
|
||||
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
|
||||
If OpIndexes.Count = 0 Then Return False
|
||||
|
||||
Dim firstStatus = getStatus(DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(OpIndexes(0)), MachiningOpListBoxItem))
|
||||
For Each index In OpIndexes.Skip(1)
|
||||
Dim currentStatus = getStatus(DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(index), MachiningOpListBoxItem))
|
||||
If currentStatus <> firstStatus Then Return Nothing
|
||||
Next
|
||||
Return firstStatus
|
||||
End Function
|
||||
|
||||
' Metodo per aggiornare lo stato di tutte le operazioni
|
||||
Private Sub UpdateAllStatus(value As Boolean?, updateStatus As Action(Of MachiningOpListBoxItem, Boolean?))
|
||||
Dim OpIndexes As List(Of Integer) = GetOpIndexes()
|
||||
If OpIndexes.Count = 0 Then Return
|
||||
|
||||
For Each index In OpIndexes
|
||||
Dim item = DirectCast(Map.refOperationsListExpanderVM.OperationList.Item(index), MachiningOpListBoxItem)
|
||||
updateStatus(item, If(IsNothing(value), False, CBool(value)))
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+68
-8
@@ -1,6 +1,4 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MachiningOpListBoxItem
|
||||
Inherits OperationListBoxItem
|
||||
@@ -28,11 +26,29 @@ Public Class MachiningOpListBoxItem
|
||||
End If
|
||||
OpIndex += 1
|
||||
Next
|
||||
|
||||
' Se Operazione selezionata metto la lampadina in stato false
|
||||
For Each tmpItem As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
|
||||
If tmpItem.Id = Id Then
|
||||
If tmpItem.OnOff Then
|
||||
EgtSetStatus(tmpItem.Id, GDB_ST.OFF)
|
||||
tmpItem.m_bThreeState = False
|
||||
tmpItem.OnOff = False
|
||||
Exit For
|
||||
Else
|
||||
EgtSetStatus(tmpItem.Id, GDB_ST.ON_)
|
||||
tmpItem.OnOff = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
' Notifico StatusAll per calcolare lo stato della CheckBox della Disposizione
|
||||
Map.refOperationsListExpanderVM.OperationList(DispIndex).NotifyPropertyChanged(NameOf(DispositionOpListBoxItem.StatusAll))
|
||||
EgtSetOperationMode(Id, m_Status)
|
||||
EgtDraw()
|
||||
End If
|
||||
Map.refProjectVM.EmitTitle()
|
||||
NotifyPropertyChanged(NameOf(Status))
|
||||
End If
|
||||
End Set
|
||||
@@ -101,10 +117,10 @@ Public Class MachiningOpListBoxItem
|
||||
RaiseEvent m_ModifyNameGetFocus()
|
||||
' se esco da modifica
|
||||
End If
|
||||
NotifyPropertyChanged("ModifiedName")
|
||||
NotifyPropertyChanged("Name")
|
||||
NotifyPropertyChanged("Name_Visibility")
|
||||
NotifyPropertyChanged("ModifyName_Visibility")
|
||||
NotifyPropertyChanged(NameOf(ModifiedName))
|
||||
NotifyPropertyChanged(NameOf(Name))
|
||||
NotifyPropertyChanged(NameOf(Name_Visibility))
|
||||
NotifyPropertyChanged(NameOf(ModifyName_Visibility))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -126,6 +142,35 @@ Public Class MachiningOpListBoxItem
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public m_bThreeState As Boolean = False
|
||||
Private m_bOnOff As Boolean? = True
|
||||
Public Property OnOff As Boolean?
|
||||
Get
|
||||
Return m_bOnOff
|
||||
End Get
|
||||
Set(value As Boolean?)
|
||||
' Controllo se la lampadina è messa in stato Nothing e value e false
|
||||
m_bOnOff = If(m_bThreeState AndAlso Not value, True, value)
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
EgtDisableModified()
|
||||
' se abilitato, eseguo operazione
|
||||
Dim status As Integer = GDB_ST.OFF
|
||||
' Controllo se lo stato della lampadina è true o nullo
|
||||
If m_bOnOff OrElse IsNothing(m_bOnOff) Then
|
||||
status = GDB_ST.ON_
|
||||
End If
|
||||
' Modifica lo stato della checkbox all delle lampadine
|
||||
ModifyStatusLamp()
|
||||
' Setto lo stato della lampadina
|
||||
EgtSetStatus(Id, status)
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
|
||||
m_bThreeState = False
|
||||
Map.refProjectVM.EmitTitle()
|
||||
NotifyPropertyChanged(NameOf(OnOff))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdModifyNameEnter As ICommand
|
||||
Private m_cmdModifyNameEsc As ICommand
|
||||
@@ -177,6 +222,21 @@ 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"
|
||||
@@ -211,7 +271,7 @@ Public Class MachiningOpListBoxItem
|
||||
m_CloseModifyLostFocus = False
|
||||
MessageBox.Show(EgtMsg(MSG_OPERATION + 22), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
m_IsActive_ModifyName = True
|
||||
NotifyPropertyChanged("ModifyName_Visibility")
|
||||
NotifyPropertyChanged(NameOf(ModifyName_Visibility))
|
||||
m_Spy = True
|
||||
Return
|
||||
End If
|
||||
|
||||
+22
-5
@@ -36,7 +36,7 @@ Public Class OperationListBoxItem
|
||||
Set(value As Boolean)
|
||||
If Not IsNothing(value) Then
|
||||
|
||||
Dim indexes As List(Of OperationListBoxItem) = New List(Of OperationListBoxItem)
|
||||
Dim indexes As New List(Of OperationListBoxItem)
|
||||
Dim Count As Integer = 0
|
||||
For Each OperationListBoxItem In Map.refOperationsListExpanderVM.OperationList
|
||||
If OperationListBoxItem.IsSelected And OperationListBoxItem.Id <> m_Id Then
|
||||
@@ -45,6 +45,23 @@ Public Class OperationListBoxItem
|
||||
End If
|
||||
Next
|
||||
|
||||
' Se Operazione selezionata metto la lampadina in stato Nothing
|
||||
For Each tmpItem As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
|
||||
If tmpItem.Id = Id Then
|
||||
If IsNothing(tmpItem.OnOff) Then
|
||||
EgtSetStatus(tmpItem.Id, GDB_ST.OFF)
|
||||
tmpItem.m_bThreeState = False
|
||||
tmpItem.OnOff = False
|
||||
Exit For
|
||||
ElseIf Not tmpitem.OnOff AndAlso Not m_IsSelected Then
|
||||
EgtSetStatus(tmpItem.Id, GDB_ST.SEL)
|
||||
tmpItem.OnOff = Nothing
|
||||
tmpItem.m_bThreeState = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
If indexes.Count > 0 Then
|
||||
If EgtGetOperationPhase(Id) <> EgtGetOperationPhase(indexes(0).Id) Then
|
||||
Return
|
||||
@@ -72,9 +89,9 @@ Public Class OperationListBoxItem
|
||||
|
||||
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveUp_IsEnabled")
|
||||
Map.refOperationsListExpanderVM.OnPropertyChanged("MoveDown_IsEnabled")
|
||||
NotifyPropertyChanged("IsSelected")
|
||||
NotifyPropertyChanged(NameOf(IsSelected))
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
|
||||
Return
|
||||
End If
|
||||
' Imposto la fase di lavorazione corrente
|
||||
@@ -124,7 +141,7 @@ Public Class OperationListBoxItem
|
||||
Map.refMachiningTreeExpanderVM.nSelectedOperationId = Me.Id
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
|
||||
End If
|
||||
' Resetto valori slider
|
||||
If Not IsNothing(Map.refMachiningParameterExpanderVM) Then
|
||||
@@ -136,7 +153,7 @@ Public Class OperationListBoxItem
|
||||
Map.refOperationsListExpanderVM.OnPropertyChanged("DuplicateCmd_IsEnabled")
|
||||
Map.refOperationsListExpanderVM.OnPropertyChanged("MachToDb_IsEnabled")
|
||||
Map.refOperationsListExpanderVM.OnPropertyChanged("Rename_IsEnabled")
|
||||
NotifyPropertyChanged("IsSelected")
|
||||
NotifyPropertyChanged(NameOf(IsSelected))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
+25
-17
@@ -1,10 +1,10 @@
|
||||
<UserControl x:Class="OperationsListExpanderV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:EgtCAM5="clr-namespace:EgtCAM5"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
|
||||
|
||||
<StackPanel Name="OperationsListExpanderViewStackPanel" IsEnabled="{Binding OpersListViewIsEnabled}">
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
|
||||
<DataTemplate.Resources>
|
||||
<Style x:Key="LayoutRoot" TargetType="Grid">
|
||||
<!--<Style.Triggers>
|
||||
--><!--these are the triggers that make the code cursor jump from box 1 to box 2 to box 3.--><!--
|
||||
<DataTrigger Binding="{Binding ElementName=Box, Path=Visibility}" Value="Visible">
|
||||
<!--<Style.Triggers>-->
|
||||
<!--these are the triggers that make the code cursor jump from box 1 to box 2 to box 3.-->
|
||||
<!--<DataTrigger Binding="{Binding ElementName=Box, Path=Visibility}" Value="Visible">
|
||||
<Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=Box}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>-->
|
||||
@@ -38,11 +38,12 @@
|
||||
<Border Background="Transparent">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
</Border.InputBindings>
|
||||
<Grid Style="{StaticResource LayoutRoot}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -50,9 +51,13 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<CheckBox IsChecked="{Binding Status}" Margin="0,0,5,0"/>
|
||||
<Image Source="{Binding Image}" Height="15" Margin="0,0,5,0"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}"
|
||||
<!--<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"/>-->
|
||||
<CheckBox Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="1"
|
||||
IsChecked="{Binding OnOff}" Height="15" Width="15" Margin="0,0,5,0"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding Name}"
|
||||
Visibility="{Binding Name_Visibility}" Margin="0,0,5,0"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
|
||||
<TextBox Grid.Column="2" Text="{Binding ModifiedName, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="150"
|
||||
x:Name="Box"
|
||||
Visibility="{Binding ModifyName_Visibility}" Margin="0,0,5,0">
|
||||
@@ -63,7 +68,7 @@
|
||||
<KeyBinding Key="Escape" Command="{Binding ModifyNameEscCommand}"/>
|
||||
</TextBox.InputBindings>
|
||||
</TextBox>
|
||||
<TextBlock Grid.Column="2" Text="{Binding Info}"/>
|
||||
<TextBlock Grid.Column="3" Text="{Binding Info}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
@@ -71,14 +76,17 @@
|
||||
<Border CornerRadius="1" Background="{StaticResource EgaltechBlue3}">
|
||||
<Border.InputBindings>
|
||||
<MouseBinding MouseAction="LeftDoubleClick"
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
Command="{Binding DataContext.OperationListDoubleClickCommand, RelativeSource={RelativeSource AncestorType={x:Type EgtCAM5:OperationsListExpanderV}}}"
|
||||
CommandParameter="{Binding Id}"/>
|
||||
</Border.InputBindings>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding StatusAll}" VerticalAlignment="Center" Margin="0,0,5,0"/>
|
||||
<CheckBox IsChecked="{Binding OnOffAll}" Style="{StaticResource EgtCAM5_LampToggleButton}" Height="15" Width="15" 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"/>
|
||||
FontSize="15" FontWeight="SemiBold"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
+194
-55
@@ -84,6 +84,7 @@ 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
|
||||
@@ -111,6 +112,37 @@ 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
|
||||
@@ -258,7 +290,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
|
||||
@@ -329,10 +361,11 @@ Public Class OperationsListExpanderVM
|
||||
' Aggiungo la nuova fase
|
||||
Dim nPhase As Integer = EgtAddPhase()
|
||||
Dim nDispId As Integer = EgtGetPhaseDisposition(nPhase)
|
||||
' Confermo grezzi e bloccaggi sopra salvati
|
||||
' Confermo grezzi, movimenti assi di disposizione 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
|
||||
@@ -433,8 +466,10 @@ Public Class OperationsListExpanderVM
|
||||
|
||||
If EgtGetOperationMode(selOperation.Id) Then
|
||||
Map.refOperationParametersExpanderVM.ParametersIsExpanded = True
|
||||
Map.refMachiningParameterExpanderVM.SetSliderScale( EgtGetPreviewMachiningToolStepCount())
|
||||
Map.refMachiningParameterExpanderVM.ResetSliderValue()
|
||||
If EgtGetOperationType(selOperation.Id) <> MCH_OY.DISP Then
|
||||
Map.refMachiningParameterExpanderVM.SetSliderScale(EgtGetPreviewMachiningToolStepCount())
|
||||
Map.refMachiningParameterExpanderVM.ResetSliderValue()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -459,55 +494,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
|
||||
@@ -534,52 +569,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
|
||||
@@ -605,6 +640,8 @@ 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
|
||||
@@ -614,6 +651,7 @@ 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
|
||||
@@ -621,6 +659,9 @@ 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
|
||||
@@ -996,7 +1037,9 @@ 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
|
||||
@@ -1009,9 +1052,14 @@ 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)
|
||||
OperationList.Add(New MachiningOpListBoxItem(Id, OpStatus, OpName, OpType, OpTool, 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)
|
||||
ElseIf IsValidDispositionType(OpType) Then
|
||||
OpStatus = True
|
||||
OpTool = String.Empty
|
||||
@@ -1253,7 +1301,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
|
||||
@@ -1263,6 +1311,97 @@ 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"
|
||||
|
||||
' Id dell'operazione
|
||||
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
|
||||
|
||||
' Stato della lampadina: vero, falso e nullo
|
||||
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"
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che salva gli stati di tutte le lampadine delle operazioni
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function LoadStatusLamp() As ObservableCollection(Of StatusLamp)
|
||||
' Utilizzo di LINQ per creare la lista in modo più conciso, carico gli stati delle lampadine per tenerli salvati
|
||||
Return New ObservableCollection(Of StatusLamp)(Map.refOperationsListExpanderVM.tmpOperationList.Select(Function(ItemOp) New StatusLamp(ItemOp.Id, ItemOp.OnOff)))
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Funzione che aggiorna lo stato delle lampadine delle operazioni
|
||||
''' </summary>
|
||||
Public Sub UpdateStatusLamp()
|
||||
' Verifica che tmpOperationList non sia nulla
|
||||
If IsNothing(Map.refOperationsListExpanderVM.tmpOperationList) Then Return
|
||||
|
||||
Dim tmpStatusLamp As StatusLamp
|
||||
For Each ItemOp As MachiningOpListBoxItem In Map.refOperationsListExpanderVM.tmpOperationList
|
||||
' Recuero lo stato della lampadina
|
||||
tmpStatusLamp = Map.refOperationsListExpanderVM.StatusLampList.FirstOrDefault(Function(x) x.nId = ItemOp.Id)
|
||||
' Controllo se lo stato della lampadina è falso nella lista StatusLampList
|
||||
If Not tmpStatusLamp.bStatusLamp Then
|
||||
' Rimetto lo stato della lampadina a falso nella OperationList
|
||||
EgtSetStatus(ItemOp.Id, GDB_ST.OFF)
|
||||
ItemOp.OnOff = False
|
||||
' Controllo se lo stato della lampadina è nullo nella lista StatusLampList
|
||||
ElseIf IsNothing(tmpStatusLamp.bStatusLamp) Then
|
||||
' Rimetto lo stato della lampadina a nullo nella OperationList
|
||||
EgtSetStatus(ItemOp.Id, GDB_ST.SEL)
|
||||
ItemOp.OnOff = Nothing
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Class
|
||||
@@ -1,5 +1,4 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -18,6 +17,9 @@ 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
|
||||
@@ -348,8 +350,10 @@ Public Class SimulationExpanderVM
|
||||
End If
|
||||
' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
|
||||
UpdateMachView()
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
' Aggiorno visualizzazione (solo se interfaccia non minimizzata, per aumentare velocità)
|
||||
If Application.Current.MainWindow.WindowState <> WindowState.Minimized Then
|
||||
EgtDraw()
|
||||
End If
|
||||
' Aggiorno dati CNC
|
||||
If nShowDataCounter = 5 Or GetSimulationStatus() = MCH_SIM_ST.UI_PAUSE Or GetSimulationStatus() = MCH_SIM_ST.UI_STOP Then
|
||||
ShowCncData()
|
||||
|
||||
@@ -23,7 +23,10 @@ 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
|
||||
@@ -117,7 +120,10 @@ Friend Module OptionModule
|
||||
' 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)
|
||||
|
||||
@@ -136,6 +136,9 @@
|
||||
</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*"/>
|
||||
@@ -147,10 +150,12 @@
|
||||
<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}"/>
|
||||
@@ -159,12 +164,12 @@
|
||||
<ComboBox Grid.Row="1" Grid.Column="1"
|
||||
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
|
||||
Margin="10,0,0,5"/>
|
||||
Margin="10,5,0,5"/>
|
||||
<TextBox Grid.Row="1" Grid.Column="2"
|
||||
Text="{Binding DxfScaleFactor}" Height="25"
|
||||
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
Margin="10,5,0,5"/>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="1"
|
||||
@@ -177,17 +182,47 @@
|
||||
VerticalContentAlignment="Center"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0"
|
||||
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
|
||||
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"
|
||||
ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
|
||||
Margin="10,0,0,5"/>
|
||||
<TextBox Grid.Row="3" Grid.Column="2"
|
||||
<TextBox Grid.Row="5" 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}">
|
||||
|
||||
@@ -65,6 +65,20 @@ Public Class OptionWindowVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ScaleOffList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)})
|
||||
Public ReadOnly Property ScaleOffList As List(Of String)
|
||||
Get
|
||||
Return m_ScaleOffList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ScalePlyList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)})
|
||||
Public ReadOnly Property ScalePlyList As List(Of String)
|
||||
Get
|
||||
Return m_ScalePlyList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_ScaleImageList As List(Of String) = New List(Of String)({"mm", "inch", EgtMsg(MSG_OPTIONPAGE + 46)})
|
||||
Public ReadOnly Property ScaleImageList As List(Of String)
|
||||
Get
|
||||
@@ -346,6 +360,36 @@ Public Class OptionWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property OffScaleFactor As String
|
||||
Get
|
||||
Return LenToString(OptionModule.m_dOffScaleFactor, 5)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If StringToLen(value, dVal) AndAlso dVal > 0 Then
|
||||
OptionModule.m_dOffScaleFactor = dVal
|
||||
WritePrivateProfileString(S_IMPORT, K_OFFSCALE, DoubleToString(OptionModule.m_dOffScaleFactor, 5))
|
||||
Map.refProjectVM.GetController().SetScaleForOffImport(OptionModule.m_dOffScaleFactor)
|
||||
NotifyPropertyChanged("OffScaleFactor")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property PlyScaleFactor As String
|
||||
Get
|
||||
Return LenToString(OptionModule.m_dPlyScaleFactor, 5)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If StringToLen(value, dVal) AndAlso dVal > 0 Then
|
||||
OptionModule.m_dPlyScaleFactor = dVal
|
||||
WritePrivateProfileString(S_IMPORT, K_PLYSCALE, DoubleToString(OptionModule.m_dPlyScaleFactor, 5))
|
||||
Map.refProjectVM.GetController().SetScaleForPLyImport(OptionModule.m_dPlyScaleFactor)
|
||||
NotifyPropertyChanged("PlyScaleFactor")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ImageScaleFactor As String
|
||||
Get
|
||||
Return LenToString(OptionModule.m_dImgScaleFactor, 5)
|
||||
@@ -361,6 +405,20 @@ Public Class OptionWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property AdvImpTolerance As String
|
||||
Get
|
||||
Return LenToString(OptionModule.m_dAdvImpTolerance, 5)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dVal As Double = 0
|
||||
If StringToLen(value, dVal) AndAlso dVal > 0 Then
|
||||
OptionModule.m_dAdvImpTolerance = dVal
|
||||
Map.refProjectVM.GetController.SetAdvImpTolerance(OptionModule.m_dAdvImpTolerance)
|
||||
WritePrivateProfileString(S_IMPORT, K_ADVTOLER, DoubleToString(OptionModule.m_dAdvImpTolerance, 5))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ImageWidth As String
|
||||
Get
|
||||
Return OptionModule.m_nImgWidth.ToString()
|
||||
@@ -515,6 +573,28 @@ Public Class OptionWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_OffScaleEnable As Boolean = False
|
||||
Public Property OffScaleEnable As Boolean
|
||||
Get
|
||||
Return m_OffScaleEnable
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_OffScaleEnable = value
|
||||
NotifyPropertyChanged("OffScaleEnable")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_PlyScaleEnable As Boolean = False
|
||||
Public Property PlyScaleEnable As Boolean
|
||||
Get
|
||||
Return m_PlyScaleEnable
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_PlyScaleEnable = value
|
||||
NotifyPropertyChanged("PlyScaleEnable")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ImageScaleEnable As Boolean = False
|
||||
Public Property ImageScaleEnable As Boolean
|
||||
Get
|
||||
@@ -576,6 +656,56 @@ Public Class OptionWindowVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelectedOffScale As String
|
||||
Get
|
||||
If Math.Abs(OptionModule.m_dOffScaleFactor - ONEMM) < EPS_SMALL * 10 Then
|
||||
Return ScaleOffList(ScaleOffList.IndexOf("mm"))
|
||||
ElseIf Math.Abs(OptionModule.m_dOffScaleFactor - ONEINCH) < EPS_SMALL * 10 Then
|
||||
Return ScaleOffList(ScaleOffList.IndexOf("inch"))
|
||||
Else
|
||||
OffScaleEnable = True
|
||||
Return ScaleOffList(ScaleOffList.IndexOf(EgtMsg(MSG_OPTIONPAGE + 46)))
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value = "mm" Then
|
||||
OffScaleFactor = LenToString(ONEMM, 3)
|
||||
OffScaleEnable = False
|
||||
ElseIf value = "inch" Then
|
||||
OffScaleFactor = LenToString(ONEINCH, 4)
|
||||
OffScaleEnable = False
|
||||
Else
|
||||
OffScaleFactor = LenToString(OptionModule.m_dOffScaleFactor, 4)
|
||||
OffScaleEnable = True
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelectedPlyScale As String
|
||||
Get
|
||||
If Math.Abs(OptionModule.m_dPlyScaleFactor - ONEMM) < EPS_SMALL * 10 Then
|
||||
Return ScalePlyList(ScalePlyList.IndexOf("mm"))
|
||||
ElseIf Math.Abs(OptionModule.m_dPlyScaleFactor - ONEINCH) < EPS_SMALL * 10 Then
|
||||
Return ScalePlyList(ScalePlyList.IndexOf("inch"))
|
||||
Else
|
||||
PlyScaleEnable = True
|
||||
Return ScalePlyList(ScalePlyList.IndexOf(EgtMsg(MSG_OPTIONPAGE + 46)))
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
If value = "mm" Then
|
||||
PlyScaleFactor = LenToString(ONEMM, 3)
|
||||
PlyScaleEnable = False
|
||||
ElseIf value = "inch" Then
|
||||
PlyScaleFactor = LenToString(ONEINCH, 4)
|
||||
PLyScaleEnable = False
|
||||
Else
|
||||
PLyScaleFactor = LenToString(OptionModule.m_dPlyScaleFactor, 4)
|
||||
PLyScaleEnable = True
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property SelectedImageScale As String
|
||||
Get
|
||||
If Math.Abs(OptionModule.m_dImgScaleFactor - ONEMM) < EPS_SMALL * 10 Then
|
||||
@@ -808,28 +938,42 @@ Public Class OptionWindowVM
|
||||
|
||||
Public ReadOnly Property ImportMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_OPTIONPAGE + 19)
|
||||
Return EgtMsg(6519) ' Import
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property DxfScaleFactorMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_OPTIONPAGE + 20)
|
||||
Return EgtMsg(6520) ' DXF
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property StlScaleFactorMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_OPTIONPAGE + 21)
|
||||
Return EgtMsg(6521) ' STL
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property OffScaleFactorMsg As String
|
||||
Get
|
||||
Return EgtMsg(6561) ' OFF
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PlyScaleFactorMsg As String
|
||||
Get
|
||||
Return EgtMsg(6563) ' PLY
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property ImageScaleFactorMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_OPTIONPAGE + 22)
|
||||
Return EgtMsg(6522) ' Immagini
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property AdvImpToleranceMsg As String
|
||||
Get
|
||||
Return EgtMsg(6562) ' Tolleranza di importazione
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ExportMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_OPTIONPAGE + 23)
|
||||
Return EgtMsg(6523) ' Export
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property UnitScaleMsg As String
|
||||
@@ -1256,7 +1400,7 @@ Public Class OptionWindowVM
|
||||
' L'aggiornamento della macchina "{0}" non è riuscito.
|
||||
Dim sKo As String = String.Format(EgtMsg(MSG_OPTIONPAGE + 35), sMachName)
|
||||
EgtOutLog(sKo)
|
||||
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
|
||||
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End Try
|
||||
End If
|
||||
|
||||
+31
-36
@@ -4,7 +4,6 @@ Imports System.IO
|
||||
Imports System.Globalization
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports System.Windows.Forms.AxHost
|
||||
|
||||
Public Class ProjectVM
|
||||
Inherits TabViewModel
|
||||
@@ -67,7 +66,6 @@ Public Class ProjectVM
|
||||
|
||||
' Variabile per implementazione eventi
|
||||
Private m_InputText As String
|
||||
Friend bSelObjOnScene As Boolean = False
|
||||
|
||||
#End Region
|
||||
|
||||
@@ -350,6 +348,7 @@ 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)
|
||||
@@ -407,6 +406,8 @@ 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)
|
||||
@@ -541,7 +542,13 @@ Public Class ProjectVM
|
||||
' Esecuzione
|
||||
OpenDoorFile(sFile, bNcGen, bExit, nProbing)
|
||||
' Se richiesta uscita immediata
|
||||
If bExit Then Map.refMainWindowVM.CloseApplicationCmd()
|
||||
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
|
||||
Return
|
||||
End If
|
||||
' Se file tol, gestione aggiornamento dei dati degli utensili
|
||||
@@ -609,7 +616,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.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.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
|
||||
Return m_Controller.ImportProject(sFile, False)
|
||||
Case FT.TSC, FT.LUA
|
||||
Return m_Controller.Exec(sFile, False)
|
||||
@@ -622,7 +629,6 @@ 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
|
||||
@@ -1104,8 +1110,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
|
||||
@@ -1123,14 +1129,12 @@ Public Class ProjectVM
|
||||
EgtGetPlaneSnapPoint(e.Location, Vector3d.Z_AX, TableRef.z, ptCurr)
|
||||
DispositionUtility.VtHookFinder(nFixtureId, ptCurr)
|
||||
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
|
||||
ElseIf DispositionUtility.VerifyTableAxis( nFixtureId) Then
|
||||
m_SelType = DispositionUtility.SelType.BARS
|
||||
m_nIdToSel = nFixtureId
|
||||
' Drag possibile
|
||||
m_bDrag = True
|
||||
Exit While
|
||||
End If
|
||||
Case SceneSelTypeOpt.RAWPART, SceneSelTypeOpt.RAWPARTWITHFIXTURE
|
||||
Dim nRawPartId As Integer = EgtGetParent(nId)
|
||||
@@ -1192,7 +1196,6 @@ 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
|
||||
@@ -1224,7 +1227,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
|
||||
@@ -1323,27 +1326,17 @@ Public Class ProjectVM
|
||||
ElseIf IniFile.m_ProjectMode = ProjectModeOpt.MACHINING And m_SceneSelType = SceneSelTypeOpt.MACHINING And
|
||||
(EgtGetType(nId) = GDB_TY.SRF_MESH Or EgtGetType(nId) = GDB_TY.SRF_FRGN) Then
|
||||
If Not EgtIsSelectedObj(nId) Then m_Controller.MouseSelectedObj(nId, bLast)
|
||||
ElseIf Not Keyboard.IsKeyDown(Key.LeftShift) Then
|
||||
m_Controller.MouseSelectedObj(nId, False)
|
||||
If EgtIsSelectedObj(nId) Then
|
||||
' Selezione layer in albero
|
||||
Map.refManageLayerExpanderVM.UpdateObjInObjTreeNoMark(nId)
|
||||
Map.refManageLayerExpanderVM.SelectIdInObjTreeNoMark(nId)
|
||||
Map.refManageLayerExpanderVM.UpdateObjTree()
|
||||
End If
|
||||
EgtDraw()
|
||||
Else
|
||||
m_Controller.MouseSelectedObj(nId, bLast)
|
||||
' Recupero primo layer selezionato
|
||||
Dim nFirstSelId As Integer = EgtGetFirstSelectedObj()
|
||||
' Se viene selezionato un layer diverso deseleziono il layer precedente
|
||||
If nFirstSelId <> nId Then
|
||||
SetLastInteger(nFirstSelId)
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.DESELECTPARTLAYEROBJ)
|
||||
End If
|
||||
' Selezione layer in albero
|
||||
bSelObjOnScene = True
|
||||
Map.refManageLayerExpanderVM.UpdateObjInObjTree(nId)
|
||||
Map.refManageLayerExpanderVM.SelectIdInObjTree(nId)
|
||||
Map.refManageLayerExpanderVM.UpdateObjTree()
|
||||
Map.refProjectVM.ExecuteCommand(Controller.CMD.SETCURRPARTLAYER)
|
||||
|
||||
' Cancello geometria e info di eventuale precedente analisi
|
||||
Analyze.ClearAnalyzeGroup()
|
||||
Map.refStatusBarVM.NotifyStatusOutput("")
|
||||
EgtDraw()
|
||||
bSelObjOnScene = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1571,6 +1564,8 @@ 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
|
||||
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.
|
After Width: | Height: | Size: 757 B |
+270
-242
@@ -139,254 +139,265 @@
|
||||
<TabControl Grid.Row="1" Margin="5,0,5,5" SelectionChanged="TabControl_SelectionChanged">
|
||||
<TabItem Header="Association Table">
|
||||
<TabItem.Content>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<!--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>
|
||||
</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>
|
||||
<DataGridTextColumn Header="Link"
|
||||
Binding="{Binding Path=Link}"
|
||||
Foreground="Black"
|
||||
IsReadOnly="True"
|
||||
Visibility="{Binding Path=DataContext.Link_Visibility, Source={x:Reference dummyElement}}"/>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
|
||||
@@ -548,6 +559,18 @@
|
||||
<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*"/>
|
||||
@@ -594,20 +617,25 @@
|
||||
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="5"/>
|
||||
Grid.Column="6"/>
|
||||
<Button Content="Position" Command="{Binding PositionCommand}"
|
||||
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
|
||||
IsEnabled="{Binding Position_IsEnabled}"
|
||||
Grid.Column="6"/>
|
||||
Grid.Column="7"/>
|
||||
<Button Content="{Binding AddMachBtn}" Command="{Binding AddMachCommand}"
|
||||
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
|
||||
Grid.Column="7"/>
|
||||
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
|
||||
Grid.Column="8"/>
|
||||
<Button Content="{Binding RemoveMachBtn}" Command="{Binding RemoveMachCommand}"
|
||||
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
|
||||
Grid.Column="8"/>
|
||||
CommandParameter="{Binding Path=SelectedItem, ElementName=TablesListBox}"
|
||||
Grid.Column="9"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MTableDbV
|
||||
|
||||
@@ -155,4 +156,31 @@ 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(Element)
|
||||
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
|
||||
|
||||
+100
-10
@@ -1,7 +1,9 @@
|
||||
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
|
||||
|
||||
@@ -156,6 +158,24 @@ 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
|
||||
@@ -359,6 +379,7 @@ 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"
|
||||
@@ -385,6 +406,9 @@ 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à
|
||||
@@ -404,17 +428,29 @@ 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
|
||||
@@ -1220,7 +1256,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, 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, 0, SelectedMTable.ActiveMachinesList, SelectedMTable.AssociationList)
|
||||
SelectedMTable.AssociationList.Insert(SelectedIndex + 1, NewEmptyRow)
|
||||
SelectedMTable.SelectedAssociation = NewEmptyRow
|
||||
SelectedMTable.NotifyPropertyChanged("SelectedAssociation")
|
||||
@@ -1319,10 +1355,21 @@ Public Class MTableDbVM
|
||||
|
||||
' Left table Movement
|
||||
Public Sub LeftTableMoveRowUp(SelectedMTable As MTableListBoxItem)
|
||||
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
|
||||
If SelectedIndex >= 1 Then
|
||||
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex - 1)
|
||||
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
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub RightTableMoveRowUp(SelectedMTable As MTableListBoxItem)
|
||||
@@ -1572,9 +1619,19 @@ Public Class MTableDbVM
|
||||
|
||||
' Spostamento sulla tabella delle associazioni
|
||||
Public Sub LeftTableMoveRowDown(SelectedMTable As MTableListBoxItem)
|
||||
Dim SelectedIndex As Integer = SelectedMTable.AssociationList.IndexOf(SelectedMTable.SelectedAssociation)
|
||||
If SelectedIndex < SelectedMTable.AssociationList.Count - 1 Then
|
||||
SelectedMTable.AssociationList.Move(SelectedIndex, SelectedIndex + 1)
|
||||
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
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1586,6 +1643,39 @@ 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>
|
||||
|
||||
@@ -5,6 +5,7 @@ Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtCAM5.MachineModel
|
||||
Imports System.Collections.Specialized
|
||||
|
||||
Public Class MTableListBoxItem
|
||||
Inherits VMBase
|
||||
@@ -148,10 +149,30 @@ Public Class MTableListBoxItem
|
||||
Private m_SelectedAssociation As MTableAssociationGridBoxItem
|
||||
Public Property SelectedAssociation As MTableAssociationGridBoxItem
|
||||
Get
|
||||
Return m_SelectedAssociation
|
||||
Return m_SelectedAssociations(0)
|
||||
End Get
|
||||
Set(value As MTableAssociationGridBoxItem)
|
||||
m_SelectedAssociation = value
|
||||
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
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -169,6 +190,11 @@ 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
|
||||
@@ -176,7 +202,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, ActiveMachinesList, m_AssociationList))
|
||||
AssociationList.Add(New MTableAssociationGridBoxItem(False, String.Empty, Nothing, 0, String.Empty, Nothing, String.Empty, Nothing, String.Empty, Nothing, String.Empty, 0, ActiveMachinesList, m_AssociationList))
|
||||
Return True
|
||||
End If
|
||||
' resetto indici macchine impostati in tabella
|
||||
@@ -836,7 +862,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")
|
||||
@@ -1074,8 +1100,33 @@ 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,
|
||||
RefMachItem As MTableMachiningGridBoxItem, sMach As String, RefMachUpItem As MTableMachiningGridBoxItem, sMachUp As String, RefMachDwItem As MTableMachiningGridBoxItem, sMachDw As String, nLink As Integer,
|
||||
ByRef ActiveMachinesList As ObservableCollection(Of MTableMachineListBoxItem), ByRef AssociationList As ObservableCollection(Of MTableAssociationGridBoxItem))
|
||||
|
||||
OnPar = bOn
|
||||
@@ -1118,7 +1169,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
|
||||
@@ -1191,6 +1242,7 @@ Public Class MTableAssociationGridBoxItem
|
||||
m_RefMachDwItem = RefMachDwItem
|
||||
End If
|
||||
End If
|
||||
m_Link = nLink
|
||||
m_IsModified = False
|
||||
End Sub
|
||||
|
||||
@@ -1207,7 +1259,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
|
||||
@@ -1223,7 +1275,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
|
||||
|
||||
@@ -26,6 +26,7 @@ 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"
|
||||
@@ -93,6 +94,7 @@ 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
|
||||
@@ -166,7 +168,9 @@ Module TableUtility
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Table.AssociationList.Add(New MTableAssociationGridBoxItem(bOn, sName, nMachId, nShift, sOper, MachItem, sMach, MachUpItem, sMachUp, MachDwItem, sMachDw, Table.ActiveMachinesList, Table.AssociationList))
|
||||
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))
|
||||
End If
|
||||
End If
|
||||
If bPropertyTable Then
|
||||
@@ -237,7 +241,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, 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, 0, Table.ActiveMachinesList, Table.AssociationList))
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
@@ -476,7 +480,8 @@ 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) & " }"
|
||||
", MachDw = '" & SelectedTable.AssociationList(Index).MachDw & "'", String.Empty) &
|
||||
If(Not String.IsNullOrEmpty(SelectedTable.AssociationList(Index).Link), ", Link = '" & SelectedTable.AssociationList(Index).Link & "'", String.Empty) & " }"
|
||||
If Index < SelectedTable.AssociationList.Count - 1 Then
|
||||
CurrentLine &= " ,"
|
||||
End If
|
||||
|
||||
@@ -219,8 +219,12 @@ Public Class TopCommandBarVM
|
||||
Dim bAllowEmpty As Boolean = (Keyboard.IsKeyDown(Key.LeftShift) OrElse Keyboard.IsKeyDown(Key.RightShift))
|
||||
' Cerco di preimpostare come corrente la macchina opportuna
|
||||
If Not bAllowEmpty AndAlso EgtGetSelectedObjCount() = 0 AndAlso EgtGetMachGroupCount() > 0 Then
|
||||
Dim nMchGrpId As Integer = EgtGetCurrMachGroup()
|
||||
If nMchGrpId = GDB_ID.NULL Then
|
||||
nMchGrpId = EgtGetFirstMachGroup()
|
||||
End If
|
||||
Dim sMachineName As String = ""
|
||||
if EgtGetMachGroupMachineName( EgtGetLastMachGroup(), sMachineName) Then
|
||||
If EgtGetMachGroupMachineName(nMchGrpId, sMachineName) Then
|
||||
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachinesList.FirstOrDefault(Function(x) x.Name = sMachineName)
|
||||
End If
|
||||
End If
|
||||
@@ -232,7 +236,7 @@ Public Class TopCommandBarVM
|
||||
If EgtGetCurrMachGroup() = GDB_ID.NULL Then
|
||||
ExecExitMachScript()
|
||||
EgtDraw()
|
||||
' altrimenti, aggiusto...
|
||||
' altrimenti, aggiusto...
|
||||
Else
|
||||
' se parametri di una lavorazione aperti, disattivo database utensili, lavorazioni e setup
|
||||
Dim bIsEnabled As Boolean = Not IsNothing(Map.refOperationParametersExpanderVM) AndAlso Not Map.refOperationParametersExpanderVM.ParametersIsExpanded
|
||||
@@ -241,7 +245,7 @@ Public Class TopCommandBarVM
|
||||
If Not IsNothing(Map.refDoorPanelVM) Then Map.refDoorPanelVM.MTableIsEnabled(bIsEnabled)
|
||||
If Not IsNothing(Map.refSpecialPanelVM) Then Map.refSpecialPanelVM.SpecialPanelIsEnabled(bIsEnabled)
|
||||
End If
|
||||
Else
|
||||
Else
|
||||
' Deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' Pulisco lista e geometria faccette di superfici di lavorazione corrente
|
||||
|
||||
@@ -667,13 +667,17 @@
|
||||
<Image.Style>
|
||||
<Style>
|
||||
<Setter Property="Image.Source"
|
||||
Value="/Resources/TreeView/LampOff.png" />
|
||||
Value="/Resources/TreeView/LampOff.png" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsChecked,
|
||||
RelativeSource={RelativeSource AncestorType=
|
||||
{x:Type ToggleButton}}}" Value="True">
|
||||
RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}" Value="True">
|
||||
<Setter Property="Image.Source"
|
||||
Value="/Resources/TreeView/LampOn.png" />
|
||||
Value="/Resources/TreeView/LampOn.png" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsChecked,
|
||||
RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}" Value="{x:Null}">
|
||||
<Setter Property="Image.Source"
|
||||
Value="/Resources/TreeView/LampSel.png" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
@@ -38,16 +38,16 @@ Public Module MachineModel
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_CHISELING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.CHISELING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 9)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.WATERJETTING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 12)})
|
||||
End If
|
||||
If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFROUGHING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SURFROUGHING, .TypeName = EgtMsg(31212)})
|
||||
End If
|
||||
If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFFINISHING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.SURFFINISHING, .TypeName = EgtMsg(31211)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.WATERJETTING, .TypeName = EgtMsg(MSG_MACHININGSDBPAGE + 12)})
|
||||
End If
|
||||
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMILLING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
If IniFile.IsKeyEnabledAdvancedMachining() AndAlso EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_5AXMILLING, 0, m_sCurrMachIniFilePath) <> 0 Then
|
||||
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.TypeId = MCH_MY.FIVEAXISMILLING, .TypeName = EgtMsg(31213)})
|
||||
End If
|
||||
Return ActiveMachiningsFamiliesList.ToArray
|
||||
|
||||
Reference in New Issue
Block a user