Compare commits

..

1 Commits

Author SHA1 Message Date
NicolaP abc304e25c Verifica interferenze tra grezzi in fase di split 2022-05-02 14:28:08 +02:00
6 changed files with 121 additions and 283 deletions
-28
View File
@@ -95,34 +95,6 @@ Friend Module CamAuto
Return True
End Function
Friend Function ResetAllSplitCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, "JoinEntity")
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, "JoinEntity")
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
Friend Function RemoveFinalEmptyPhases() As Boolean
Dim nOpeId As Integer = EgtGetLastOperation()
While nOpeId <> GDB_ID.NULL
-3
View File
@@ -248,9 +248,6 @@ Public Class MyMachGroupPanelVM
' aggiungo alla lista delle lastre correnti/orig
Dim sSlabNameDB As String = GetSlabName()
LoadSlabsList(sSlabNameDB)
' imposto la visibilità dei comandi per il waterjet
OmagOFFICEMap.refNestingTabVM.Set_SplitCurvWJ_Visibility()
Return True
End Function
+12 -5
View File
@@ -224,13 +224,17 @@ Public Class MachiningTabVM
End Property
Public Sub Prev(ByVal param As Object)
Dim bOk As Boolean = True
' Dichiaro solo visualizzazione
m_bIsShow = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
Else
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
' verifico collisione dei pezzi in fase di scarico
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
End If
' se trovata interferenza tra grezzi (dopo movimentazione) esco
If Not bOk Then Return
' Torno alla fase precedente
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
' Si va sempre in Split
@@ -255,19 +259,22 @@ Public Class MachiningTabVM
End Property
Public Sub NextCmd(ByVal param As Object)
Dim bOk As Boolean = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
MachiningMode = MachiningModeOpt.MOVERAWPART
AutoVisibility = Visibility.Hidden
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
Else
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
' se verificata una interferenza allora esco
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
If Not bOk Then Return
MachiningMode = MachiningModeOpt.SPLIT
AutoVisibility = Visibility.Visible
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
End If
' Aggiorno possibilità di uscire
ManageExit()
' Se non ci sono interferenze tra i grezzi -> aggiorno possibilità di uscire
If bOk Then ManageExit()
End Sub
#End Region ' NextCommand
+92 -5
View File
@@ -17,6 +17,7 @@ Public Class MoveRawModeVM
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL ' identificativo pezzo correntemente attaccato alle ventose
Private m_dMoveStep As Double
Public Property MoveStep As String
@@ -108,6 +109,17 @@ Public Class MoveRawModeVM
#Region "METHODS"
Friend Function InitMoveRaw() As Boolean
'' verifico che il pezzo sia depositabile
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' ' mantengo la selezione del pezzo
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
' EgtDraw()
' ' non cambio pagina
' Return False
'End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Recupero i tagli allungati prima definiti
@@ -158,14 +170,14 @@ Public Class MoveRawModeVM
' Distanza iniziale
m_dCurrDist = 0
End If
' Non dovrebbe mai accadere, ma inizializzo con default
' Non dovrebbe mai accadere, ma inizializzo con default
Else
m_vtDir = Vector3d.Y_AX()
m_ptMid = Point3d.ORIG()
m_dOrigDist = 0
m_dCurrDist = 0
End If
' Altrimenti movimento con ventose
' Altrimenti movimento con ventose
Else
m_bRemovedRaw = False
m_bRawWithCups = False
@@ -182,7 +194,7 @@ Public Class MoveRawModeVM
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
LRArrowVisibility = Visibility.Hidden
RotationVisibility = Visibility.Hidden
' Altrimenti per movimento con ventose
' Altrimenti per movimento con ventose
Else
LRArrowVisibility = Visibility.Visible
RotationVisibility = If(CurrentMachine.bRawSplMovRotate, Visibility.Visible, Visibility.Hidden)
@@ -195,6 +207,17 @@ Public Class MoveRawModeVM
End Function
Friend Function ExitMoveRaw() As Boolean
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
' non cambio pagina
Return False
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Se movimento con ventose
@@ -351,6 +374,39 @@ Public Class MoveRawModeVM
Return bOk
End Function
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
EgtSetName(m_nTempId, "RawTemp")
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
Dim nCurrPhase As Integer = EgtGetCurrPhase()
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
Dim nIdRaw As Integer = EgtGetFirstRawPart()
' ciclo su tutti i grezzi per veririficare eventuali collisioni
While nIdRaw <> GDB_ID.NULL
' verifico la fase del grezzo
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
' recupero il contorno del pezzo
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
If EgtExistsObj(nIdRawFlatRegion) Then
EgtErase(m_nTempId)
' esiste una intersezione delle superfici
Return True
End If
End If
End If
nIdRaw = EgtGetNextRawPart(nIdRaw)
End While
EgtErase(m_nTempId)
Return False
End Function
#End Region ' METHODS
#Region "COMMANDS"
@@ -685,12 +741,34 @@ Public Class MoveRawModeVM
' Se trovato il grezzo
If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
EgtGetStatus(nId, nStat)
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' Se con ventose, le nascondo
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
Else
' Se con ventose, le nascondo
If Not OmagOFFICEMap.refMachiningTabVM.ByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
' verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
' esco dal ciclo, prima devo depositare correttamente il pezzo
Exit While
End If
' salvo l'indice del pezzo correntemente attaccato alle ventose
m_CurrRawOnVacuum = nId
EgtDeselectAll()
EgtSetStatus(nId, GDB_ST.SEL)
' Se con ventose, le posiziono sul grezzo
@@ -736,6 +814,15 @@ Public Class MoveRawModeVM
End If
nId = EgtGetNextObjInSelWin()
End While
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
EgtDraw()
End If
End Sub
#End Region ' EVENTS
+7 -7
View File
@@ -148,8 +148,13 @@
Margin="2.5,0,0,0"/>
</UniformGrid>
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
<Grid Margin="0,0,-2.5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="{Binding RemovePartMsg}"
Grid.ColumnSpan="{Binding DragRectangle_Cl_Span}"
Style="{StaticResource OptionPanel_TextButton}"
Command="{Binding RemovePartCommand}"
Margin="0,0,2.5,0"/>
@@ -158,12 +163,7 @@
Style="{StaticResource OptionPanel_ToggleButton}"
IsChecked="{Binding bDragRectangle}"
Margin="2.5,0,2.5,0"/>
<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
Visibility="{Binding SplitCurvWJ_Visibility}"
Style="{StaticResource OptionPanel_ToggleButton}"
IsChecked="{Binding bSplitCurvWJ}"
Margin="2.5,0,2.5,0"/>
</UniformGrid>
</Grid>
<UniformGrid Columns="2" Margin="0,0,0,5">
+10 -235
View File
@@ -46,9 +46,6 @@ Public Class NestingTabVM
Private m_SideListRectangle(4) As Integer
Private m_sTextContent As String = String.Empty
' Id dei lato WJ da separare tramite comando ON_OFF
Private m_nIdSelectedSideWJ As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet As Integer = GDB_ID.NULL
Private m_CsvImportWindow As CsvWindowV
Friend ReadOnly Property CsvImportWindow As CsvWindowV
@@ -155,13 +152,6 @@ Public Class NestingTabVM
End Set
End Property
Private m_CountColumn As Integer = 1
Public ReadOnly Property CountColumn As Integer
Get
Return m_CountColumn
End Get
End Property
#Region "Messages"
Public ReadOnly Property InsertPartMsg As String
@@ -188,12 +178,6 @@ Public Class NestingTabVM
End Get
End Property
Public ReadOnly Property SplitCurvWJMsg As String
Get
Return "Split"
End Get
End Property
Public ReadOnly Property SelectAllMsg As String
Get
Return EgtMsg(MSG_NESTPAGEUC + 4)
@@ -214,7 +198,7 @@ Public Class NestingTabVM
Public ReadOnly Property CsvDataMsg As String
Get
Return EgtMsg(90398) 'Dati Csv
Return EgtMsg( 90398) 'Dati Csv
End Get
End Property
@@ -246,12 +230,11 @@ Public Class NestingTabVM
Sub New()
If GetMainPrivateProfileInt(S_NEST, K_DRAGRECTANGLE, 1) <> 0 Then
m_DragRectangle_Visibility = Visibility.Visible
m_CountColumn += 1
Else
m_DragRectangle_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged("DragRectangle_Visibility")
NotifyPropertyChanged("CountColumn")
NotifyPropertyChanged("DragRectangle_Cl_Span")
' Creo riferimento a questa classe in OmagOFFICEMap
OmagOFFICEMap.SetRefNestingTabVM(Me)
End Sub
@@ -863,8 +846,6 @@ Public Class NestingTabVM
End Get
Set(value As Boolean)
m_bDragRectangle = value
m_bSplitCurvWJ = False
NotifyPropertyChanged("bSplitCurvWJ")
End Set
End Property
@@ -875,207 +856,15 @@ Public Class NestingTabVM
End Get
End Property
#Region "WATERJET"
' funzione per la selezione dei lati su cui operare la separazione del tagli waterjet
Private Sub OnMyMouseDownSceneSplitCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_bSplitCurvWJ Then
Return
End If
' Se esiste un elemento selezionato
EgtResetMark(m_nIdSelectedWaterJet)
' 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
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
' se non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then
m_nIdSelectedSideWJ = nIdMy
Dim nValInfo As Integer = 1
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
If nValInfo = 1 Then
' separo il taglio
EgtSetInfo(nIdMy, "JoinEntity", 0)
Else
' unisco il taglio
EgtSetInfo(nIdMy, "JoinEntity", 1)
End If
Else
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
EgtSetInfo(nIdMy, "JoinEntity", 0)
End If
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' salvo il valore del PreView evidenziato
m_nIdSelectedWaterJet = nIdWJ
EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
Return
End Sub
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
Dim ListOfGroupPV As New List(Of Integer)
Dim nIdGroup As Integer = GDB_ID.NULL
Dim nIdMy As Integer = GDB_ID.NULL
' recupero il primo lato dall'elenco dei lati della figura
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
While nIdMy <> GDB_ID.NULL
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
End If
nIdMy = EgtGetNext(nIdMy)
End While
Return ListOfGroupPV
End Function
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
Dim IdWaterjetPV As Integer = GDB_ID.NULL
For Each nIdItem As Integer In ListGroup
Dim sName As String = String.Empty
If EgtGetName(nIdItem, sName) Then
If sName.Contains(nIdMy.ToString) Then
IdWaterjetPV = nIdItem
Exit For
End If
End If
Next
Return IdWaterjetPV
End Function
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
Dim nCount As Integer = 0
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJNext, "JoinEntity", nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJNext = EgtGetNext(nIdWJNext)
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJPrev, "JoinEntity", nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
Public Sub ResetSplitCurvWJParam()
EgtDeselectObj(m_nIdSelectedSideWJ)
EgtResetMark(m_nIdSelectedWaterJet)
m_nIdSelectedSideWJ = GDB_ID.NULL
m_nIdSelectedWaterJet = GDB_ID.NULL
End Sub
#End Region ' WaterJet Section and StartPoint
Private m_bSplitCurvWJ As Boolean
Public Property bSplitCurvWJ As Boolean
Public ReadOnly Property DragRectangle_Cl_Span As Integer
Get
Return m_bSplitCurvWJ
End Get
Set(value As Boolean)
m_bSplitCurvWJ = value
m_bDragRectangle = False
NotifyPropertyChanged("bDragRectangle")
End Set
End Property
Private m_SplitCurvWJ_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property SplitCurvWJ_Visibility As Visibility
Get
Return m_SplitCurvWJ_Visibility
If m_DragRectangle_Visibility = Visibility.Visible Then
Return 1
End If
Return 2
End Get
End Property
' in funzione della macchinata attiva predispone la visualizzazione del bottone SplitCurv (abilitato solo per WaterJet Machine)
Public Sub Set_SplitCurvWJ_Visibility()
' gestisco la visualizzazione del comando ON_OFF (per i tagli waterjet)
If CurrentMachine.WaterJettingActive Then
m_SplitCurvWJ_Visibility = Visibility.Visible
m_CountColumn += 1
Else
' verifico se in precedenza fosse stato attivo il comando
If m_SplitCurvWJ_Visibility = Visibility.Visible Then m_CountColumn -= 1
m_SplitCurvWJ_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged("SplitCurvWJ_Visibility")
NotifyPropertyChanged("CountColumn")
End Sub
#Region "COMMANDS"
@@ -1661,8 +1450,6 @@ Public Class NestingTabVM
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
' Cancello eventuali messaggi
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
' cancello tutti i tagli di separazione
ResetAllSplitCurv()
' Cancello tutte le lavorazioni
CamAuto.EraseMachinings(GDB_ID.NULL)
' Reinserisco tutte le lavorazioni piane
@@ -1725,8 +1512,8 @@ Public Class NestingTabVM
EgtTextGetContent( nTextId, sText)
Dim nPos As Integer = sText.IndexOf( sCsvName)
Dim sNewText As String
If nPos <0 Then
sNewText= sNewName & "<br/>" & sText
If nPos < 0 Then
sNewText = sNewName & "<br/>" & sText
Else
sNewText = sText.Remove( nPos, sCsvName.Length()).Insert( nPos, sNewName)
End If
@@ -1760,12 +1547,6 @@ Public Class NestingTabVM
m_vtTotMove = Vector3d.NULL()
Return
End If
' se in modalità separazione curve WaterJet
If m_bSplitCurvWJ Then
OnMyMouseDownSceneSplitCurv(sender, e)
Return
End If
' Per default no drag
m_bDrag = False
' Verifico se selezionato indicativo di pezzo
@@ -1829,7 +1610,7 @@ Public Class NestingTabVM
If Not m_bDrag Or m_bDragging Then Return
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
If m_bDragToStart Then
If Math.Abs(e.Location.X - m_locPrev.X) <m_nRestRadius And
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return
End If
@@ -1948,12 +1729,6 @@ Public Class NestingTabVM
ResetDragRectangleParam()
Return
End If
' verifico che sia attivo il comando di modifica tagli waterjet
If m_bSplitCurvWJ Then
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
ResetSplitCurvWJParam()
Return
End If
' Se eseguito drag
If Not m_bDragToStart Then
' Se movimento con sola verifica finale