Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c8bf133113 |
@@ -123,6 +123,40 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllStartCurv() 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)
|
||||
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||
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)
|
||||
EgtRemoveInfo(nIdLayerOutLoop, "Start")
|
||||
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||
End While
|
||||
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)
|
||||
While nIdMy <> GDB_ID.NULL
|
||||
Dim nValInfo As Integer = 1
|
||||
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
|
||||
If nValInfo = 0 Then Return False
|
||||
End If
|
||||
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function RemoveFinalEmptyPhases() As Boolean
|
||||
Dim nOpeId As Integer = EgtGetLastOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
|
||||
@@ -250,7 +250,8 @@ Public Class MyMachGroupPanelVM
|
||||
LoadSlabsList(sSlabNameDB)
|
||||
|
||||
' imposto la visibilità dei comandi per il waterjet
|
||||
OmagOFFICEMap.refNestingTabVM.Set_SplitCurvWJ_Visibility()
|
||||
OmagOFFICEMap.refNestingTabVM.Set_WJ_Cmd_Visibility()
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -137,18 +137,23 @@
|
||||
|
||||
</Border>
|
||||
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding InsertPartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding InsertPartCommand}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<Button Content="{Binding StorePartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding StorePartCommand}"
|
||||
Margin="2.5,0,0,0"/>
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding InsertPartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding InsertPartCommand}"
|
||||
Margin="0,0,2.5,0"/>
|
||||
<Button Content="{Binding StorePartMsg}" Grid.Column="1"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding StorePartCommand}"
|
||||
Margin="2.5,0,0,0"/>
|
||||
<!--<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||
Visibility="{Binding StartCurvWJ_Visibility}"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bStartCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>-->
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
|
||||
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
|
||||
<Button Content="{Binding RemovePartMsg}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"
|
||||
Command="{Binding RemovePartCommand}"
|
||||
@@ -158,13 +163,23 @@
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bDragRectangle}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||
<!--<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"/>
|
||||
Margin="2.5,0,2.5,0"/>-->
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Grid.Column="0" Columns="2" Margin="0,0,0,5" Visibility="{Binding WJ_Cmd_Visibility}">
|
||||
<ToggleButton Content="{Binding SplitCurvWJMsg}" Grid.Column="2"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bSplitCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
<ToggleButton Content="{Binding StartCurvWJMsg}" Grid.Column="2"
|
||||
Style="{StaticResource OptionPanel_ToggleButton}"
|
||||
IsChecked="{Binding bStartCurvWJ}"
|
||||
Margin="2.5,0,2.5,0"/>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Columns="2" Margin="0,0,0,5">
|
||||
<Button Content="{Binding SelectAllMsg}"
|
||||
|
||||
@@ -194,6 +194,12 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property StartCurvWJMsg As String
|
||||
Get
|
||||
Return "Start"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property SelectAllMsg As String
|
||||
Get
|
||||
Return EgtMsg(MSG_NESTPAGEUC + 4)
|
||||
@@ -864,7 +870,11 @@ Public Class NestingTabVM
|
||||
Set(value As Boolean)
|
||||
m_bDragRectangle = value
|
||||
m_bSplitCurvWJ = False
|
||||
ResetSplitCurvWJParam(True)
|
||||
m_bStartCurvWJ = False
|
||||
ResetStartCurvWJParam(True)
|
||||
NotifyPropertyChanged("bSplitCurvWJ")
|
||||
NotifyPropertyChanged("bStartCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -875,7 +885,7 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "WATERJET"
|
||||
#Region "WATERJET SPLIT CURVE"
|
||||
|
||||
' 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)
|
||||
@@ -1034,11 +1044,14 @@ Public Class NestingTabVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub ResetSplitCurvWJParam()
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
Public Sub ResetSplitCurvWJParam(Optional bAllParam As Boolean = True)
|
||||
If bAllParam Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
End If
|
||||
m_nIdSelectedSideWJ = GDB_ID.NULL
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' WaterJet Section and StartPoint
|
||||
@@ -1050,31 +1063,136 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bSplitCurvWJ = value
|
||||
If Not m_bSplitCurvWJ Then
|
||||
' resetto i parametri di selezione dei lati
|
||||
ResetSplitCurvWJParam(True)
|
||||
End If
|
||||
m_bDragRectangle = False
|
||||
m_bStartCurvWJ = False
|
||||
ResetStartCurvWJParam(True)
|
||||
NotifyPropertyChanged("bDragRectangle")
|
||||
NotifyPropertyChanged("bStartCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SplitCurvWJ_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property SplitCurvWJ_Visibility As Visibility
|
||||
Private m_WJ_Cmd_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property WJ_Cmd_Visibility As Visibility
|
||||
Get
|
||||
Return m_SplitCurvWJ_Visibility
|
||||
Return m_WJ_Cmd_Visibility
|
||||
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()
|
||||
Public Sub Set_WJ_Cmd_Visibility()
|
||||
' gestisco la visualizzazione del comando ON_OFF (per i tagli waterjet)
|
||||
If CurrentMachine.WaterJettingActive Then
|
||||
m_SplitCurvWJ_Visibility = Visibility.Visible
|
||||
m_CountColumn += 1
|
||||
m_WJ_Cmd_Visibility = Visibility.Visible
|
||||
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
|
||||
m_WJ_Cmd_Visibility = Visibility.Collapsed
|
||||
End If
|
||||
NotifyPropertyChanged("WJ_Cmd_Visibility")
|
||||
End Sub
|
||||
|
||||
#Region "WATERJET START POINT"
|
||||
|
||||
' funzione per la selezione del punto di inizio tagli waterjet (percorso chiuso)
|
||||
Private Sub OnMyMouseDownSceneStartCurv(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_bStartCurvWJ Then
|
||||
Return
|
||||
End If
|
||||
|
||||
' Acquisisco punto da disegno
|
||||
Dim ptStartCurv As New Point3d
|
||||
EgtUnProjectPoint(e.Location, ptStartCurv)
|
||||
' Aggiusto Z punto acquisito (è in globale)
|
||||
Dim ptRawMax As New Point3d
|
||||
Dim ptRawMin As New Point3d
|
||||
If GetRawBox(ptRawMin, ptRawMax) Then
|
||||
ptStartCurv.z = ptRawMax.z
|
||||
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
|
||||
' verifico che il contorno sia chiuso, altrimenti esco
|
||||
If Not VerifyOutLoopIsClosed(nIdParent) Then
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (0)", MSG_TYPE.WARNING)
|
||||
Exit While
|
||||
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_n_S 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 <> EgtGetGroupObjs(nIdParent) Then
|
||||
EgtSetInfo(nIdParent, "Start", ptStartCurv)
|
||||
' 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)
|
||||
m_nIdSelectedWaterJet = nIdWJ
|
||||
EgtSetMark(nIdWJ)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
Else
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (1)", MSG_TYPE.WARNING)
|
||||
Exit While
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
Return
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Private m_bStartCurvWJ As Boolean
|
||||
Public Property bStartCurvWJ As Boolean
|
||||
Get
|
||||
Return m_bStartCurvWJ
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bStartCurvWJ = value
|
||||
If Not m_bStartCurvWJ Then
|
||||
ResetStartCurvWJParam(True)
|
||||
End If
|
||||
NotifyPropertyChanged("SplitCurvWJ_Visibility")
|
||||
NotifyPropertyChanged("CountColumn")
|
||||
m_bDragRectangle = False
|
||||
m_bSplitCurvWJ = False
|
||||
ResetSplitCurvWJParam(True)
|
||||
NotifyPropertyChanged("bDragRectangle")
|
||||
NotifyPropertyChanged("bSplitCurvWJ")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Sub ResetStartCurvWJParam(Optional bAllParam As Boolean = True)
|
||||
If bAllParam Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
End If
|
||||
m_nIdSelectedSideWJ = GDB_ID.NULL
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
@@ -1663,6 +1781,8 @@ Public Class NestingTabVM
|
||||
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
||||
' cancello tutti i tagli di separazione
|
||||
ResetAllSplitCurv()
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' Cancello tutte le lavorazioni
|
||||
CamAuto.EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni piane
|
||||
@@ -1765,6 +1885,11 @@ Public Class NestingTabVM
|
||||
OnMyMouseDownSceneSplitCurv(sender, e)
|
||||
Return
|
||||
End If
|
||||
' se in modalità punto inizio curve WaterJet
|
||||
If m_bStartCurvWJ Then
|
||||
OnMyMouseDownSceneStartCurv(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Per default no drag
|
||||
m_bDrag = False
|
||||
@@ -1951,9 +2076,14 @@ Public Class NestingTabVM
|
||||
' 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()
|
||||
' ResetSplitCurvWJParam(False)
|
||||
Return
|
||||
End If
|
||||
If m_bStartCurvWJ Then
|
||||
' ResetStartCurvWJParam(False)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se movimento con sola verifica finale
|
||||
|
||||
Reference in New Issue
Block a user