diff --git a/EgtStoneLib/CamAuto.vb b/EgtStoneLib/CamAuto.vb
index bbe6d52..4eec3ba 100644
--- a/EgtStoneLib/CamAuto.vb
+++ b/EgtStoneLib/CamAuto.vb
@@ -149,6 +149,14 @@ Friend Module CamAuto
Return bOk
End Function
+ Friend Function ResetAllBridges() As Boolean
+ Dim bOk As Boolean = True
+ Dim nMachGroup As Integer = EgtGetCurrMachGroup()
+ Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
+ bOk = EgtErase(nBridgesGroup)
+ Return bOk
+ End Function
+
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer) As Boolean
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
diff --git a/EgtStoneLib/ConstMach.vb b/EgtStoneLib/ConstMach.vb
index 4fe8834..08507db 100644
--- a/EgtStoneLib/ConstMach.vb
+++ b/EgtStoneLib/ConstMach.vb
@@ -158,6 +158,8 @@ Module ConstMach
Public Const NAME_UNDERDRILL As String = "UnderDrill"
' Nome layer preview
Public Const NAME_PREVIEW As String = "PV"
+ Public Const NAME_BRIDGES As String = "Bridges"
+ Public Const NAME_BRIDGESLINE As String = "BridgeLine"
' Info in layer contorno interno per FiloTop
Public Const INFO_FILOTOP As String = "FiloTop"
Public Const INFO_ROUNDOFF As String = "RoundOff"
diff --git a/EgtStoneLib/CurrentMachine.vb b/EgtStoneLib/CurrentMachine.vb
index c95557d..1efb345 100644
--- a/EgtStoneLib/CurrentMachine.vb
+++ b/EgtStoneLib/CurrentMachine.vb
@@ -1415,6 +1415,16 @@ Friend Property sCurrMillNoTip As String
OmagOFFICEMap.refMachinePanelVM.NotifyPropertyChanged(NameOf(OmagOFFICEMap.refMachinePanelVM.WjDb_Visibility))
End Sub
+ ' recupro dalla lista delle macchine l'oggetto associato al nome indicato
+ Public Sub GetMachineClass(sMachineName As String)
+ For Each Item In OmagOFFICEMap.refMachinePanelVM.MachineList
+ If Item.Name = sMachineName Then
+ OmagOFFICEMap.refMachinePanelVM.SelectedMachine = Item
+ Exit For
+ End If
+ Next
+ End Sub
+
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
Dim TempCurrMat As Material = CurrMat
' Svuoto l'attuale lista di materiali e delle qualità
diff --git a/MachinePanel/MyMachinePanelVM.vb b/MachinePanel/MyMachinePanelVM.vb
index 959b536..0c8e8be 100644
--- a/MachinePanel/MyMachinePanelVM.vb
+++ b/MachinePanel/MyMachinePanelVM.vb
@@ -95,16 +95,19 @@ Public Class MyMachinePanelVM
OmagOFFICEMap.SetRefMachinePanelVM(Me)
' recupero cartella radice delle macchine
m_sMachinesRoot = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
- ' Carica macchine da cartella delle macchine
- Machine.MachineListInit(m_sMachinesRoot, MachineList)
- ' Inizializzo valori visibilità parametri Db utensili e lavorazioni
- OmagOFFICETMDbParamVisibility.Init()
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
+ Public Sub Init( sMchRoots As String)
+ ' procedo ad inizializzare la classe → carico la lista "MachineList" che visualizzo per l'inserimento di nuovi MachGroup
+ Machine.MachineListInit(sMchRoots, MachineList)
+ ' Inizializzo valori visibilità parametri Db utensili e lavorazioni
+ OmagOFFICETMDbParamVisibility.Init()
+ End Sub
+
'''
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb
index cd6d1c4..62af047 100644
--- a/MainWindow/MainWindowM.vb
+++ b/MainWindow/MainWindowM.vb
@@ -86,13 +86,29 @@ Public Class MainWindowM
Return m_sTempDir
End Get
End Property
+
+ '------------------INIZIO Gestione elenco direttori macchine ------------------
+
+ Private m_sMachinesRootList As New List(Of String)
+ Friend ReadOnly Property sMachinesRootList As List(Of String)
+ Get
+ Return m_sMachinesRootList
+ End Get
+ End Property
+
+ '------------------FINE Gestione elenco direttori macchine ------------------
+
Private m_sMachinesRoot As String
- Friend ReadOnly Property sMachinesRoot As String
+ Friend Property sMachinesRoot As String
Get
Return m_sMachinesRoot
End Get
+ Set(value As String)
+ m_sMachinesRoot = value
+ End Set
End Property
Private m_sToolMakersDir As String
+
Friend ReadOnly Property sToolMakersDir As String
Get
Return m_sToolMakersDir
@@ -172,6 +188,16 @@ Public Class MainWindowM
If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
End If
+ ' Carico elenco dei direttori macchina
+ If Not String.IsNullOrEmpty(m_sMachinesRoot) Then m_sMachinesRootList.Add(m_sMachinesRoot)
+ Dim nIndexDir As Integer = 1
+ Dim sCurrMachineDir As String = String.Empty
+ While GetMainPrivateProfileString(S_MACH, K_MACHINESDIR & nIndexDir.ToString, "", sCurrMachineDir) <> 0
+ If VerifyMachineIsUnique(sCurrMachineDir) Then
+ m_sMachinesRootList.Add(sCurrMachineDir)
+ End If
+ nIndexDir += 1
+ End While
' Impostazione direttorio per toolmakers
If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
@@ -279,6 +305,16 @@ Public Class MainWindowM
EgtPHOTOLib.MainData.SetKey(sIdKey)
End Sub
+ ' verifico che il nome da inserire non esista già in elenco
+ Private Function VerifyMachineIsUnique(sMachDir As String) As Boolean
+ For Each sDir As String In m_sMachinesRootList
+ If sDir.ToLower.Trim = sMachDir.ToLower.Trim Then
+ Return False
+ End If
+ Next
+ Return True
+ End Function
+
Private Sub ManageInstance()
Dim bCreated As Boolean
Try
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index bd8943d..7f7623c 100644
--- a/My Project/AssemblyInfo.vb
+++ b/My Project/AssemblyInfo.vb
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/MyMachGroupPanel/MyMachGroupPanelVM.vb b/MyMachGroupPanel/MyMachGroupPanelVM.vb
index 9ba82b1..5aad441 100644
--- a/MyMachGroupPanel/MyMachGroupPanelVM.vb
+++ b/MyMachGroupPanel/MyMachGroupPanelVM.vb
@@ -33,19 +33,21 @@ Public Class MyMachGroupPanelVM
Sub New()
MyBase.New()
- ' Recupero la macchina di default
- Dim sDefaultMachine As String = String.Empty
- GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
' Creo riferimento a questa classe in OmagOFFICEMap
OmagOFFICEMap.SetRefMachGroupPanelVM(Me)
- InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(),
- sDefaultMachine, BASE_MACH_GROUP & "1")
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
+ Public Sub Init()
+ ' Recupero la macchina di default
+ Dim sDefaultMachine As String = String.Empty
+ GetMainPrivateProfileString(S_MACH, K_CURRMACH, "", sDefaultMachine)
+ InitMachGroupPanel(True, OmagOFFICEMap.refMachinePanelVM.MachineList.ToList(), sDefaultMachine, BASE_MACH_GROUP & "1")
+ End Sub
+
Public Overrides Sub AddMachGroup()
If NewMachGroup() Then
' creo oggetto gruppo creato
@@ -99,6 +101,8 @@ Public Class MyMachGroupPanelVM
' Salvo macchina del gruppo come nuovo default
Dim sCurrMachName As String = String.Empty
EgtGetCurrMachineName(sCurrMachName)
+ CurrentMachine.GetMachineClass(sCurrMachName)
+ OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
' Ricarico la macchina corrente
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sCurrMachName,
@@ -152,6 +156,8 @@ Public Class MyMachGroupPanelVM
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
' Imposto vista solo tavola
EgtSetMachineLook(MCH_LOOK.TAB)
+ CurrentMachine.GetMachineClass(SelectedMachGroup.Machine)
+ OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
' Ricarico la macchina corrente
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, SelectedMachGroup.Machine,
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
diff --git a/MySceneHost/MySceneHostVM.vb b/MySceneHost/MySceneHostVM.vb
index ff08e90..bcb8748 100644
--- a/MySceneHost/MySceneHostVM.vb
+++ b/MySceneHost/MySceneHostVM.vb
@@ -33,8 +33,13 @@ Public Class MySceneHostVM
' Recupero e imposto handle finestra principale
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd)
+ ' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
+ Dim sMchRoots As String = GetMachineBaseDirs()
' inizializzo gestore lavorazioni
- EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
+ EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
+ ' inizializzo gestione più macchine
+ OmagOFFICEMap.refMachinePanelVM.Init(sMchRoots)
+ OmagOFFICEMap.refMachGroupPanelVM.Init()
Return
End If
' Problemi
@@ -157,6 +162,18 @@ Public Class MySceneHostVM
MainScene.SetStatusNull()
End Sub
+ Private Function GetMachineBaseDirs() As String
+ ' Trasformo l'elenco dei direttori radice macchina in una stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
+ Dim sMchRoots As String = ""
+ For Each MachDir In OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRootList
+ sMchRoots &= MachDir & "|"
+ Next
+ ' rimuovo dalla stringa l'ultimo carattere "|" inserito
+ sMchRoots = sMchRoots.Remove(sMchRoots.Length - 1, 1)
+ If String.IsNullOrEmpty( sMchRoots) Then sMchRoots = OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot
+ Return sMchRoots
+ End Function
+
#End Region ' METHODS
#Region "ProjectManager"
@@ -240,7 +257,9 @@ Public Class MySceneHostVM
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
Dim nCurrCtx As Integer = EgtGetCurrentContext()
Dim nCtx As Integer = EgtInitContext()
- EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
+ ' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
+ Dim sMchRoots As String = GetMachineBaseDirs()
+ EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
' Per ogni gruppo di lavoro
For Each nMchGrpId As Integer In vMchGrps
' Carico il progetto
@@ -314,6 +333,8 @@ Public Class MySceneHostVM
Dim sMachine As String = String.Empty
EgtGetInfo(nMchGrpId, "Machine", sMachine)
If Not String.IsNullOrEmpty(sMachine) Then
+ CurrentMachine.GetMachineClass(sMachine)
+ OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, sMachine,
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ENABLE_MILL),
@@ -347,6 +368,8 @@ Public Class MySceneHostVM
' Salvo il file
If Not EgtSaveFile(sFileDest, NGE.CMPTEXT) Then bOk = False
Next
+ CurrentMachine.GetMachineClass(CurrentSelectedMachGroup)
+ OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot = Path.GetDirectoryName(OmagOFFICEMap.refMachinePanelVM.SelectedMachine.DirPath)
' reimposto la macchina corrente
InitCurrentMachine(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, CurrentSelectedMachGroup,
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.PRODUCTION_LINE),
@@ -404,7 +427,9 @@ Public Class MySceneHostVM
' Creo un contesto separato con gestore lavorazioni per poter spezzettare il progetto
Dim nCurrCtx As Integer = EgtGetCurrentContext()
Dim nCtx As Integer = EgtInitContext()
- EgtInitMachMgr(OmagOFFICEMap.refMainWindowVM.MainWindowM.sMachinesRoot, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
+ ' Recupero l'elenco dei direttori radice macchina come stringa del tipo "..\Dir1\Example01|..\Dir2\|Example02"
+ Dim sMchRoots As String = GetMachineBaseDirs()
+ EgtInitMachMgr(sMchRoots, OmagOFFICEMap.refMainWindowVM.MainWindowM.sToolMakersDir)
' Per ogni gruppo di lavoro
For Each nMchGrpId As Integer In vMchGrps
' Carico il progetto
@@ -797,6 +822,7 @@ Public Class MySceneHostVM
Case OptionPanelVM.Tabs.NESTING
OmagOFFICEMap.refNestingTabVM.OnKeyDownScene(sender, e)
Case OptionPanelVM.Tabs.MACHINING
+ OmagOFFICEMap.refSplitModeVM.OnKeyDownScene(sender, e)
Case OptionPanelVM.Tabs.SIMUL
End Select
End Sub
diff --git a/OptionPanel/MachiningTab/SplitModeV.xaml b/OptionPanel/MachiningTab/SplitModeV.xaml
index 99c4c99..ddbcfe3 100644
--- a/OptionPanel/MachiningTab/SplitModeV.xaml
+++ b/OptionPanel/MachiningTab/SplitModeV.xaml
@@ -69,23 +69,38 @@
-
-
+
+
+
+
+
-
-
+
+
+
+
@@ -138,23 +153,25 @@
-
+
+
+ Style="{StaticResource OptionPanel_TextWrapButton}"
+ Command="{Binding AllOutEndCommand}"
+ Visibility="{Binding AllOutEndBtnVisibility}"
+ Margin="2.5,0,2.5,0"/>
+
-
+
diff --git a/OptionPanel/MachiningTab/SplitModeVM.vb b/OptionPanel/MachiningTab/SplitModeVM.vb
index 11912cb..939bfa6 100644
--- a/OptionPanel/MachiningTab/SplitModeVM.vb
+++ b/OptionPanel/MachiningTab/SplitModeVM.vb
@@ -25,6 +25,20 @@ Public Class SplitModeVM
' verifico che le lavorazioni selezionate siano omogenee (con lo stesso utensile)
Private m_bAreHomogeneous As Boolean = False
+ ' Id tagli WJ per generazione ponticelli tra due percorsi
+ Private m_nIdSelectedPartWJ_Srt As Integer = GDB_ID.NULL
+ Private m_nIdSelectedSideWJ_Srt As Integer = GDB_ID.NULL
+ Private m_nIdSelectedWaterJet_Srt As Integer = GDB_ID.NULL
+ Private m_nIdSelectedPartWJ_End As Integer = GDB_ID.NULL
+ Private m_nIdSelectedSideWJ_End As Integer = GDB_ID.NULL
+ Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL
+ ' Id gruppo Bridges (Nuovo da versione 30/08/2022)
+ Private m_nIdBridgesGroup As Integer = GDB_ID.NULL
+ 'Private m_nIdBridgeLineGroup As Integer = GDB_ID.NULL
+ Private m_nIdBridge As Integer = GDB_ID.NULL
+ Private m_ptSrtBridge As New Point3d
+ Private m_ptEndBridge As New Point3d
+
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Drag
@@ -230,6 +244,52 @@ Public Class SplitModeVM
End Set
End Property
+ Private m_BridgeBtnVisibility As Visibility = Visibility.Hidden
+ Public Property BridgeBtnVisibility As Visibility
+ Get
+ Return m_BridgeBtnVisibility
+ End Get
+ Set(value As Visibility)
+ m_BridgeBtnVisibility = value
+ NotifyPropertyChanged(NameOf(BridgeBtnVisibility))
+ End Set
+ End Property
+
+ Private m_BridgeDeleteBtnVisibility As Visibility = Visibility.Hidden
+ Public Property BridgeDeleteBtnVisibility As Visibility
+ Get
+ Return m_BridgeDeleteBtnVisibility
+ End Get
+ Set(value As Visibility)
+ m_BridgeDeleteBtnVisibility = value
+ NotifyPropertyChanged(NameOf(BridgeDeleteBtnVisibility))
+ End Set
+ End Property
+
+ Private m_BridgeBtn_IsChecked As Boolean = False
+ Public Property BridgeBtn_IsChecked As Boolean
+ Get
+ Return m_BridgeBtn_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_BridgeBtn_IsChecked = value
+ BridgeIsChecked()
+ NotifyPropertyChanged(NameOf(BridgeBtn_IsChecked))
+ End Set
+ End Property
+
+ Private m_BridgeDeleteBtn_IsChecked As Boolean = False
+ Public Property BridgeDeleteBtn_IsChecked As Boolean
+ Get
+ Return m_BridgeDeleteBtn_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_BridgeDeleteBtn_IsChecked = value
+ BridgeDeleteIsChecked()
+ NotifyPropertyChanged(NameOf(BridgeDeleteBtn_IsChecked))
+ End Set
+ End Property
+
#Region "Messages"
Public ReadOnly Property OnOffMsg As String
@@ -340,6 +400,18 @@ Public Class SplitModeVM
End Get
End Property
+ Public ReadOnly Property BridgeMsg As String
+ Get
+ Return "Bridge"
+ End Get
+ End Property
+
+ Public ReadOnly Property BridgeDeleteMsg As String
+ Get
+ Return "Delete Bridge"
+ End Get
+ End Property
+
#End Region ' Messages
' Definizione comandi
@@ -379,6 +451,11 @@ Public Class SplitModeVM
Friend Function InitSplitRaw() As Boolean
m_bActive = True
+ ' aggiorno la visualizzazione dei comandi per generare i bridge
+ m_BridgeBtn_IsChecked = False
+ NotifyPropertyChanged(NameOf(BridgeBtn_IsChecked))
+ m_BridgeDeleteBtn_IsChecked = False
+ NotifyPropertyChanged(NameOf(BridgeDeleteBtn_IsChecked))
'm_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_nDragInd = -1
m_nDragType = 0
@@ -445,6 +522,9 @@ Public Class SplitModeVM
Friend Function ExitSplitRaw(Optional bTrueExit As Boolean = True) As Boolean
m_bActive = False
+ ' eventualmente interrompo la creazione dei ponticelli
+ DeselectWJBridgesPart()
+
' Rimuovo evidenziazione e numeri
RemoveMarkAndNumbers()
' Ripristino colori lavorazioni
@@ -796,6 +876,21 @@ Public Class SplitModeVM
AllReduceBtnVisibility = Visibility.Visible
End If
+ ' gestione bottone per generazione ponticelli
+ If Type = MCH_OY.WATERJETTING Then
+ ' siccome la stessa posizione è occupata da due comandi sovrapposti
+ If CutBtnVisibility = Visibility.Hidden Then
+ BridgeBtnVisibility = Visibility.Visible
+ BridgeDeleteBtnVisibility = Visibility.Visible
+ Else
+ BridgeBtnVisibility = Visibility.Hidden
+ BridgeDeleteBtnVisibility = Visibility.Hidden
+ End If
+ Else
+ BridgeBtnVisibility = Visibility.Hidden
+ BridgeDeleteBtnVisibility = Visibility.Hidden
+ End If
+
End Sub
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
@@ -1060,6 +1155,45 @@ Public Class SplitModeVM
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_EAL, dOrigUsal)
End Sub
+ Private Sub BridgeIsChecked()
+ ' eventualmente spengo il comando per eliminare i ponticelli
+ If m_BridgeDeleteBtn_IsChecked Then
+ m_BridgeDeleteBtn_IsChecked = False
+ NotifyPropertyChanged(NameOf(BridgeDeleteBtn_IsChecked))
+ End If
+ ' se deseleziono resetto tutte le variabili
+ If Not m_BridgeBtn_IsChecked Then
+ ' se sono in fase di creazione di un ponticello interrompo
+ DeselectWJBridgesPart()
+ Return
+ End If
+ ' recuoero il gruppo di lavorazione corrente
+ Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
+ ' creo il gruppo per i ponticelli
+ Dim sNameGroup As String = NAME_BRIDGES
+ Dim nId As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
+ If nId <> GDB_ID.NULL Then
+ m_nIdBridgesGroup = nId
+ End If
+ ' se non lo trovo allora lo creo
+ If nId = GDB_ID.NULL Then
+ m_nIdBridgesGroup = EgtCreateGroup(nIdCurrMachGroup)
+ EgtSetName(m_nIdBridgesGroup, NAME_BRIDGES)
+ End If
+ End Sub
+
+ Private Sub BridgeDeleteIsChecked()
+ ' eventualmente spengo il comando per inserire i ponticelli
+ If m_BridgeBtn_IsChecked Then
+ m_BridgeBtn_IsChecked = False
+ NotifyPropertyChanged(NameOf(BridgeBtn_IsChecked))
+ End If
+
+ If Not m_BridgeDeleteBtn_IsChecked Then
+ DeselectWJBridgesPart()
+ End If
+ End Sub
+
#End Region ' METHODS
#Region "COMMANDS"
@@ -2159,8 +2293,6 @@ Public Class SplitModeVM
#Region "InvertCommand"
-#End Region ' InvertComman
-
Public ReadOnly Property InvertCommand As ICommand
Get
If m_cmdInvert Is Nothing Then
@@ -2217,10 +2349,187 @@ Public Class SplitModeVM
Next
End Sub
+#End Region ' InvertComman
+
#End Region ' COMMANDS
#Region "EVENTS"
+#Region "BRIDGE"
+
+ Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
+ ByVal IsFirst As Boolean,
+ ByRef m_nIdSelectedSideWJ As Integer,
+ ByRef m_nIdSelectedWaterJet As Integer,
+ ByRef nIdParentPart As Integer)
+
+ ' Acquisisco punto da disegno
+ Dim CurrPoint As New Point3d
+ EgtUnProjectPoint(e.Location, CurrPoint)
+
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelWin(False, True, False, False, False)
+ Dim nSelMy As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
+ Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
+ While nIdMy <> GDB_ID.NULL
+ Dim sLayer As String = String.Empty
+ ' layer di origine
+ Dim nIdParent As Integer = EgtGetParent(nIdMy)
+ ' recupero il nome del Layer
+ EgtGetName(nIdParent, sLayer)
+ ' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
+ If sLayer = NAME_OUTLOOP Then
+ If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
+ If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
+ EgtDeselectObj(m_nIdSelectedSideWJ)
+ End If
+ ' recupero il gruppo della lavorazione associata
+ nIdParentPart = EgtGetParent(nIdParent)
+ Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
+ ' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
+ Dim ListGroup As List(Of Integer) = OmagOFFICEMap.refNestingTabVM.ResearchGropuWJ(nIdParent, nIdPV)
+ ' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
+ Dim ListGroupSaw As List(Of Integer) = OmagOFFICEMap.refNestingTabVM.ResearchGropuSaw(nIdParent, nIdPV)
+ ' se non esiste almeno 1 Preview di tipo WaterJet
+ If ListGroup.Count > 0 Then
+ m_nIdSelectedSideWJ = nIdMy
+ ' recupero l'indice del PreView che deve essere acceso per indicare la selezione
+ ListGroup = OmagOFFICEMap.refNestingTabVM.ResearchGropuWJ(nIdParent, nIdPV)
+ Dim nIdWJ As Integer = OmagOFFICEMap.refNestingTabVM.GetPVIdFromIdSide(ListGroup, nIdMy)
+ OmagOFFICEMap.refNestingTabVM.GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
+ ' recupero il punto più vicino alla curva passata
+ If IsFirst Then
+ EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge)
+ Else
+ ' prima di confermare verifico che non ci siano interferenze
+ EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptEndBridge)
+ EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
+ If VerifyInterference(m_nIdBridge) Then
+ OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
+ EgtSetInfo(m_nIdBridge, "PartStart", m_nIdSelectedPartWJ_Srt)
+ EgtSetInfo(m_nIdBridge, "PartEnd", m_nIdSelectedPartWJ_End)
+ EgtSetInfo(m_nIdBridge, "Ph", EgtGetCurrPhase())
+ ' Ricalcolo tutte le lavorazioni
+ Dim nWarn As Integer = 0
+ ResetAllMachinings(nWarn)
+ Else
+ ' attendo la selezione di un punto valido
+ m_nIdSelectedSideWJ = GDB_ID.NULL
+ m_nIdSelectedWaterJet = GDB_ID.NULL
+ nIdParentPart = GDB_ID.NULL
+ OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
+ OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Bridge intersects part", 3, MSG_TYPE.ERROR_)
+ Return
+ End If
+ End If
+ m_nIdSelectedWaterJet = nIdWJ
+ ' salvo il valore del PreView evidenziato
+ EgtSetMark(nIdParentPart)
+ ' EgtSetMark(nIdWJ)
+ EgtSelectObj(nIdMy)
+ EgtDraw()
+ Exit While
+ End If
+ End If
+ End If
+ nIdMy = EgtGetNextObjInSelWin()
+ End While
+ End Sub
+
+ Private Sub OnMyMouseDownSceneBridgesDelete(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Acquisisco punto da disegno
+ Dim CurrPoint As New Point3d
+ EgtUnProjectPoint(e.Location, CurrPoint)
+
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelWin(False, True, False, False, False)
+ Dim nSelMy As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
+ Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
+ While nIdMy <> GDB_ID.NULL
+ Dim sGroupName As String = String.Empty
+ Dim sSelName As String = String.Empty
+ ' gruppo di appartenenza
+ Dim nIdParent As Integer = EgtGetParent(nIdMy)
+ ' recupero il nome del gruppo di appartenenza
+ EgtGetName(nIdParent, sGroupName)
+ ' recupero il nome dell'oggetto selezionato
+ EgtGetName(nIdMy, sSelName)
+ If sGroupName.Contains(NAME_BRIDGES) AndAlso sSelName.Contains(NAME_BRIDGESLINE) Then
+ EgtErase(nIdMy)
+ EgtDraw()
+ ' Ricalcolo tutte le lavorazioni
+ Dim nWarn As Integer = 0
+ ResetAllMachinings(nWarn)
+ Return
+ End If
+ nIdMy = EgtGetNextObjInSelWin()
+ End While
+ End Sub
+
+ Private Sub OnMyMouseMoveSceneBridges(ptCurr As Point3d)
+ ptCurr.z = m_ptSrtBridge.z
+ ' rappresento il egmento
+ If m_nIdBridge = GDB_ID.NULL Then
+ m_nIdBridge = EgtCreateLine(m_nIdBridgesGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB)
+ ' assegno un nome alla linea
+ EgtSetName(m_nIdBridge, NAME_BRIDGESLINE)
+ End If
+ EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB)
+ EgtDraw()
+ End Sub
+
+ Private Function VerifyInterference(nIdBridge As Integer) As Boolean
+ ' prima di procedere alla verifica accorco il segmento (solo per sicurezza) 10 * EPS_SMALL
+ Dim dLen As Double
+ EgtCurveLength(nIdBridge, dLen)
+ If dLen > 21 AndAlso Not EgtCurveIsClosed(nIdBridge) Then
+ EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
+ EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
+ End If
+ ' EgtSaveFile("c:\EgtData\OmagOFFICE\Temp\Bridge.nge", NGE.BIN)
+ Dim nIdPart As Integer = GDB_ID.NULL
+ nIdPart = EgtGetFirstPartInRawPart(GetCurrentRaw())
+ While nIdPart <> GDB_ID.NULL
+ Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_REGION)
+ Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
+ While nIdSurf <> GDB_ID.NULL
+ If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
+ ' se la linea bridge interseca la superficie allora restitusco false
+ If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
+ EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
+ Return False
+ End If
+ Exit While
+ End If
+ End While
+ nIdPart = EgtGetNextPartInRawPart(nIdPart)
+ End While
+ Return True
+ End Function
+
+ Private Sub DeselectWJBridgesPart()
+ ' se in fase di definzione di un ponticello lo elimino
+ If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
+ EgtErase(EgtGetParent(m_nIdBridge))
+ End If
+ m_nIdBridge = GDB_ID.NULL
+ EgtResetMark(m_nIdSelectedPartWJ_Srt)
+ m_nIdSelectedPartWJ_Srt = GDB_ID.NULL
+ EgtDeselectObj(m_nIdSelectedSideWJ_Srt)
+ m_nIdSelectedSideWJ_Srt = GDB_ID.NULL
+ m_nIdSelectedWaterJet_Srt = GDB_ID.NULL
+ EgtResetMark(m_nIdSelectedPartWJ_End)
+ m_nIdSelectedPartWJ_End = GDB_ID.NULL
+ EgtDeselectObj(m_nIdSelectedSideWJ_End)
+ m_nIdSelectedSideWJ_End = GDB_ID.NULL
+ m_nIdSelectedWaterJet_End = GDB_ID.NULL
+ EgtDraw()
+ End Sub
+
+#End Region ' Bridge
+
Friend Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse OmagOFFICEMap.refMachiningTabVM.IsShow Then Return
@@ -2229,6 +2538,27 @@ Public Class SplitModeVM
Not OmagOFFICEMap.refSceneHostVM.MainScene.IsStatusNull() Then
Return
End If
+
+ ' definizione dei ponticelli
+ If m_BridgeBtn_IsChecked Then
+ If m_nIdSelectedPartWJ_Srt = GDB_ID.NULL Then
+ OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
+ Else
+ OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
+ End If
+ ' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
+ If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
+ DeselectWJBridgesPart()
+ End If
+ Return
+ End If
+
+ ' eliminazione dei ponticelli
+ If m_BridgeDeleteBtn_IsChecked Then
+ OnMyMouseDownSceneBridgesDelete(sender, e)
+ Return
+ End If
+
' Reset drag
m_nDragInd = -1
m_nDragType = 0
@@ -2317,13 +2647,22 @@ Public Class SplitModeVM
Friend Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse OmagOFFICEMap.refMachiningTabVM.IsShow Then Return
+ ' Ricavo il punto corrente in coordinate mondo
+ Dim ptCurr As Point3d
+ EgtUnProjectPoint(e.Location, ptCurr)
+
+ ' definizione dei ponticelli
+ If m_BridgeBtn_IsChecked Then
+ If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL Then
+ OnMyMouseMoveSceneBridges(ptCurr)
+ End If
+ Return
+ End If
+
' Se drag non abilitato o in corso
If m_nDragInd = -1L Or m_bDragging Then Return
m_bDragging = True
Dim nOperId As Integer = m_MachiningList(m_nDragInd).m_nId
- ' Ricavo il punto corrente in coordinate mondo
- Dim ptCurr As Point3d
- EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento e la variazione di lunghezza
Dim vtMove As Vector3d = ptCurr - m_ptDragPrev
Dim dDelta = vtMove * m_MachiningList(m_nDragInd).m_vtDir
@@ -2412,6 +2751,12 @@ Public Class SplitModeVM
End If
End Sub
+ Friend Sub OnKeyDownScene(sender As Object, e As System.Windows.Forms.KeyEventArgs)
+ ' Con CANC cancello i pezzi selezionati
+ If (e.KeyData = System.Windows.Forms.Keys.Delete Or e.KeyData = System.Windows.Forms.Keys.Escape) And (m_BridgeBtn_IsChecked Or m_BridgeDeleteBtn_IsChecked) Then
+ DeselectWJBridgesPart()
+ End If
+ End Sub
#End Region ' EVENTS
'-----------------------------------------------------------------------------------------------
diff --git a/OptionPanel/NestingTab/NestingTabVM.vb b/OptionPanel/NestingTab/NestingTabVM.vb
index 009fb23..dab520f 100644
--- a/OptionPanel/NestingTab/NestingTabVM.vb
+++ b/OptionPanel/NestingTab/NestingTabVM.vb
@@ -1871,6 +1871,8 @@ Public Class NestingTabVM
ResetAllSplitCurv()
' cancello tutti i punti di inizio (Waterjet)
ResetAllStartCurv()
+ ' cancello tutti i ponticelli disegnati
+ ResetAllBridges()
' Cancello tutte le lavorazioni
CamAuto.EraseMachinings(GDB_ID.NULL)
' Reinserisco tutte le lavorazioni piane
@@ -2155,6 +2157,8 @@ Public Class NestingTabVM
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
+ ' se è stato eseguito il Drag allora cancello tutti i ponticelli
+ ResetAllBridges()
End Sub
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb
index f583bec..a5c1823 100644
--- a/SideEntityControl/SideEntityControlVM.vb
+++ b/SideEntityControl/SideEntityControlVM.vb
@@ -789,18 +789,22 @@ Public Class SideEntityControlVM
If m_CallingWindow = CallingWindowOpt.DXFIMPORT Or m_CallingWindow = CallingWindowOpt.COMPO Then
If m_Mode = ModeOpt.SIDEANGLE Then
For Each Entity In m_SideEntityList
- If DirectCast(Entity, SideAngleEntity).dSideAngle <> 0 Then
- Dim nI As Integer = 0
- StringToInt(Entity.sEntityName.Substring(1), nI)
- CheckSide(nI)
+ If TypeOf Entity Is SideAngleEntity Then
+ If DirectCast(Entity, SideAngleEntity).dSideAngle <> 0 Then
+ Dim nI As Integer = 0
+ StringToInt(Entity.sEntityName.Substring(1), nI)
+ CheckSide(nI)
+ End If
End If
Next
Else
For Each Entity In m_SideEntityList
- If DirectCast(Entity, DripEntity).bHaveDrip Then
- Dim nI As Integer = 0
- StringToInt(Entity.sEntityName.Substring(1), nI)
- CheckSide(nI)
+ If TypeOf Entity Is DripEntity Then
+ If DirectCast(Entity, DripEntity).bHaveDrip Then
+ Dim nI As Integer = 0
+ StringToInt(Entity.sEntityName.Substring(1), nI)
+ CheckSide(nI)
+ End If
End If
Next
End If
diff --git a/Utility/OmagOFFICEDictionary.xaml b/Utility/OmagOFFICEDictionary.xaml
index e4502d4..d457c8e 100644
--- a/Utility/OmagOFFICEDictionary.xaml
+++ b/Utility/OmagOFFICEDictionary.xaml
@@ -223,7 +223,11 @@
-
+
+