Compare commits

...

4 Commits

Author SHA1 Message Date
NicolaP c8bf133113 Gestione comando StartPoint lavorazioni waterjet 2022-05-25 18:21:57 +02:00
NicolaP faba640eee Gestione comando per separazione lavorazione WaterJet 2022-05-25 15:19:22 +02:00
NicolaP 80f4dc6b83 Merge branch 'master' into develop 2022-05-02 11:12:34 +02:00
DarioS 8f5ef91890 OmagOFFICE 2.4e1 :
- controlli vari.
2022-05-02 10:29:43 +02:00
11 changed files with 575 additions and 139 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ Module ConstIni
Public Const K_TEXTCOLOR As String = "TextColor"
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAGRETTANGLE As String = "DragRectangle"
Public Const K_DRAGRECTANGLE As String = "DragRectangle"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
+62
View File
@@ -95,6 +95,68 @@ 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 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
+1 -1
View File
@@ -583,7 +583,7 @@ Module VacuumCups
Return bVacOk
End Function
Private Function GetPluggerFromCameras(sCups) As Integer
Private Function GetPluggerFromCameras(sCups() As String) As Integer
Dim nCountPlunger As Integer = 1
Dim bPlugger1 As Boolean = False
Dim bPlugger2 As Boolean = False
+2 -1
View File
@@ -984,7 +984,8 @@ Friend Module VeinMatching
' Esporto il file come immagine
EgtSetCurrentContext(m_nVeinCtx)
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
bOk = bOk AndAlso EgtGetImage(EgtGetShowMode(), New Color3d(255, 255, 255), New Color3d(255, 255, 255),
bOk = bOk AndAlso EgtGetImage(DirectCast( EgtGetShowMode(), EgtInterface.SM),
New Color3d(255, 255, 255), New Color3d(255, 255, 255),
m_nImgWidth, m_nImgHeight, sFilePath)
' Ripristino il contesto originale
EgtSetCurrentContext(nMainCtx)
+2 -2
View File
@@ -195,8 +195,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2402, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2402, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2405, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2405, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.4.1")>
<Assembly: AssemblyFileVersion("2.4.4.1")>
<Assembly: AssemblyVersion("2.4.5.1")>
<Assembly: AssemblyFileVersion("2.4.5.1")>
+5 -1
View File
@@ -111,7 +111,7 @@ Public Class MyMachGroupPanelVM
Dim nTabInd As Integer = 1
Dim nTabCnt As Integer = CamAuto.GetTableCount()
If nTabCnt > 1 And nTabCnt <= 3 Then
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(nTabCnt))
Dim dlg As New SelectTableWindowV(Application.Current.MainWindow, New SelectTableWindowVM(DirectCast(nTabCnt, SelectTableWindowVM.TableNumOpt)))
dlg.ShowDialog()
nTabInd = dlg.m_SelTable
End If
@@ -248,6 +248,10 @@ 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_WJ_Cmd_Visibility()
Return True
End Function
+34 -19
View File
@@ -137,34 +137,49 @@
</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>
<Grid Margin="0,0,-2.5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<UniformGrid Grid.Column="0" Columns="{Binding CountColumn}" Margin="0,0,0,5">
<Button Content="{Binding RemovePartMsg}"
Grid.ColumnSpan="{Binding DragRettangle_Cl_Span}"
Style="{StaticResource OptionPanel_TextButton}"
Command="{Binding RemovePartCommand}"
Margin="0,0,2.5,0"/>
<ToggleButton Content="{Binding DragRettangleMsg}" Grid.Column="1"
Visibility="{Binding DragRettangle_Visibility}"
<ToggleButton Content="{Binding DragRectangleMsg}" Grid.Column="1"
Visibility="{Binding DragRectangle_Visibility}"
Style="{StaticResource OptionPanel_ToggleButton}"
IsChecked="{Binding bDragRettangle}"
IsChecked="{Binding bDragRectangle}"
Margin="2.5,0,2.5,0"/>
</Grid>
<!--<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>
<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}"
+463 -109
View File
@@ -36,16 +36,19 @@ Public Class NestingTabVM
Private m_bCsvData As Boolean = False
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedCurvRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextTopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedFlatSurfRettangle As Integer = GDB_ID.NULL
Private m_SideListRettangle(4) As Integer
Private m_nIdSelectedOutLoopRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedRegionRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedSawRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedCurvRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextTopRectangle As Integer = GDB_ID.NULL
Private m_nIdSelectedFlatSurfRectangle As Integer = GDB_ID.NULL
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
@@ -152,6 +155,13 @@ 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
@@ -172,12 +182,24 @@ Public Class NestingTabVM
End Get
End Property
Public ReadOnly Property DragRettangleMsg As String
Public ReadOnly Property DragRectangleMsg As String
Get
Return "Drag Rectangle"
End Get
End Property
Public ReadOnly Property SplitCurvWJMsg As String
Get
Return "Split"
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)
@@ -198,7 +220,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
@@ -228,13 +250,14 @@ Public Class NestingTabVM
#Region "CONSTRUCTOR"
Sub New()
If (GetMainPrivateProfileInt(S_NEST, K_DRAGRETTANGLE, 1) <> 0) Then
m_DragRettangle_Visibility = Visibility.Visible
If GetMainPrivateProfileInt(S_NEST, K_DRAGRECTANGLE, 1) <> 0 Then
m_DragRectangle_Visibility = Visibility.Visible
m_CountColumn += 1
Else
m_DragRettangle_Visibility = Visibility.Collapsed
m_DragRectangle_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged("DragRettangle_Visibility")
NotifyPropertyChanged("DragRettangle_Cl_Span")
NotifyPropertyChanged("DragRectangle_Visibility")
NotifyPropertyChanged("CountColumn")
' Creo riferimento a questa classe in OmagOFFICEMap
OmagOFFICEMap.SetRefNestingTabVM(Me)
End Sub
@@ -551,14 +574,12 @@ Public Class NestingTabVM
Return True
End Function
#Region "DRAG RETTANGLE"
#Region "DRAG RECTANGLE"
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
Private Sub OnMyMouseDownSceneSelSideRettangle(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 Then
Return
End If
Private Sub OnMyMouseDownSceneSelSideRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Si può selezionare solo con il tasto sinistro
If e.Button <> Windows.Forms.MouseButtons.Left Then Return
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
@@ -574,8 +595,8 @@ Public Class NestingTabVM
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
' -------------------------------- INIZIO VERIFICHE --------------------------------
m_nIdSelectedOutLoopRettangle = nIdParent
If Not IsRettangle(m_SideListRettangle) Then
m_nIdSelectedOutLoopRectangle = nIdParent
If Not IsRectangle(m_SideListRectangle) Then
'm_CurrProjPage.ClearMessage()
'm_CurrProjPage.SetWarningMessage("Non è un rettangolo (0)")
Return
@@ -599,26 +620,26 @@ Public Class NestingTabVM
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
' -------------------------------- FINE VERIFICHE --------------------------------
If Not EgtGetGroupObjs(nIdSaw) Then
m_nIdSelectedSawRettangle = nIdSaw
m_nIdSelectedCurvRettangle = nIdMy
If EgtGetGroupObjs(nIdSaw) <> 0 Then
m_nIdSelectedSawRectangle = nIdSaw
m_nIdSelectedCurvRectangle = nIdMy
m_nIdSelectedRegionRettangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
' recupero i testi cintenuti nel layer Region
If m_nIdSelectedRegionRettangle <> GDB_ID.NULL Then
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRettangle)
m_nIdSelectedRegionRectangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
' recupero i testi contenuti nel layer Region
If m_nIdSelectedRegionRectangle <> GDB_ID.NULL Then
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRectangle)
While nCurrId <> GDB_ID.NULL
If EgtGetType(nCurrId) = GDB_TY.EXT_TEXT Then
Dim sVal As String = String.Empty
EgtTextGetContent(nCurrId, sVal)
If sVal = "*TOP*" Then
m_nIdSelectedTextTopRettangle = nCurrId
m_nIdSelectedTextTopRectangle = nCurrId
Else
m_nIdSelectedTextRettangle = nCurrId
m_sTextContent = GetMyRettangleText(sVal)
m_nIdSelectedTextRectangle = nCurrId
m_sTextContent = GetMyRectangleText(sVal)
End If
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
m_nIdSelectedFlatSurfRettangle = nCurrId
m_nIdSelectedFlatSurfRectangle = nCurrId
End If
nCurrId = EgtGetNext(nCurrId)
End While
@@ -631,15 +652,15 @@ Public Class NestingTabVM
Exit While
End If
End If
' se le'elemto corrente non è una linea
' se l'elemento corrente non è una linea
End If
' se le'elemto corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
' se l'elemento corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
' restituisce il valore del Text ripulito dalle dimensioni
Private Function GetMyRettangleText(sTextPz As String) As String
Private Function GetMyRectangleText(sTextPz As String) As String
' da DrawPageUC.xaml.vb/MultipleInsert
Dim sText As String = String.Empty
If sTextPz.Contains("<br/>") Then
@@ -650,56 +671,57 @@ Public Class NestingTabVM
If sTextPz.Contains(" ") Then
Dim sInfo() As String = sTextPz.Split(" "c)
If sInfo.Count > 3 Then
Return sText = sInfo(0) & " " & sInfo(1) & " "
sText = sInfo(0) & " " & sInfo(1) & " "
Return sText
End If
End If
Return sText
End Function
' verifico che la figura selezionata sia realmente un rettangolo
Private Function IsRettangle(ByRef IdSideList() As Integer) As Boolean
Private Function IsRectangle(ByRef IdSideList() As Integer) As Boolean
' creo una lista con i lati del rettangolo
Dim nCounter As Integer = 0
' recupero i lati dal leyer "OutLoop"
Dim IdSideRettangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRettangle)
While IdSideRettangle <> GDB_ID.NULL And nCounter < 4
Dim IdSideRectangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRectangle)
While IdSideRectangle <> GDB_ID.NULL And nCounter < 4
Dim sVal As String = String.Empty
Dim dPrevAng As Double = 0
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
EgtGetInfo(IdSideRectangle, "PrevAng", sVal)
StringToDouble(sVal, dPrevAng)
Dim dNextAng As Double = 0
EgtGetInfo(IdSideRettangle, "NextAng", sVal)
EgtGetInfo(IdSideRectangle, "NextAng", sVal)
StringToDouble(sVal, dNextAng)
' se gli angoli non sono retti allora esco senza caricare il lato corrente
If Math.Abs(dPrevAng - 90) > EPS_ANG_SMALL OrElse Math.Abs(dNextAng - 90) > EPS_ANG_SMALL Then
Exit While
End If
IdSideList(nCounter) = IdSideRettangle
IdSideList(nCounter) = IdSideRectangle
nCounter += 1
IdSideRettangle = EgtGetNext(IdSideRettangle)
IdSideRectangle = EgtGetNext(IdSideRectangle)
End While
' verifico che siano solo quattro lati
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
If IdSideRectangle = GDB_ID.NULL And nCounter = 4 Then
' solo se la figura ha 4 lati ortogonali
Return True
End If
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
' la figura presenta più/meno di 4 lati
Return False
End Function
' recupero le informazioni correnti per sapere se la figura è mdificabile
Private Function GetRettangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
Private Function GetRectangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
' determino la direzione del lato selezionato
Dim vtDirSelectedCurv As New Vector3d
EgtStartVector(m_nIdSelectedCurvRettangle, GDB_ID.ROOT, vtDirSelectedCurv)
EgtStartVector(m_nIdSelectedCurvRectangle, GDB_ID.ROOT, vtDirSelectedCurv)
' recupero il lato successivo a quello selezionato
Dim Index As Integer = 0
Dim Len As Double = 0
For Ind As Integer = 0 To 3
If m_SideListRettangle(Ind) = m_nIdSelectedCurvRettangle Then
If m_SideListRectangle(Ind) = m_nIdSelectedCurvRectangle Then
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
If Ind = 0 Then
Index = 3
@@ -709,8 +731,8 @@ Public Class NestingTabVM
End If
Next
' recupero la dimensione del lato
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
EgtCurveLength(m_SideListRectangle(Index), MaxLen)
EgtCurveLength(m_nIdSelectedCurvRectangle, MinLen)
' verifico che il lato selezionato sia il maggiore
If MinLen > MaxLen Then Return Nothing
@@ -718,11 +740,11 @@ Public Class NestingTabVM
' determimo il versore dal lato appena calcolato
Dim vtDir As New Vector3d
EgtStartVector(m_SideListRettangle(Index), GDB_ID.ROOT, vtDir)
EgtStartVector(m_SideListRectangle(Index), GDB_ID.ROOT, vtDir)
vtDir.Normalize()
Dim dProjectionBaseX As Double = vtDir * Vector3d.X_AX
Dim ptFixed As New Point3d
EgtStartPoint(m_SideListRettangle(Index), GDB_ID.ROOT, ptFixed)
EgtStartPoint(m_SideListRectangle(Index), GDB_ID.ROOT, ptFixed)
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
vtPerp.Rotate(Vector3d.Z_AX, 90)
@@ -735,7 +757,7 @@ Public Class NestingTabVM
End Function
' funzione chiamata da OnMyMouseMoveScene: gestisce la modifica lungo una dimensione del rettangolo selezionato
Private Sub OnMyMouseMoveSawRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
Private Sub OnMyMouseMoveSawRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Se drag non abilitato o già in esecuzione, esco
If Not m_bDrag Or m_bDragging Then Return
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
@@ -753,7 +775,7 @@ Public Class NestingTabVM
Dim MaxLen As Double = 0
Dim MinLen As Double = 0
' recupero info sul rettangolo selezionato
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
Dim vtDir As Vector3d = GetRectangleInfoScale(frFixed, MaxLen, MinLen)
If vtDir.Equals(Vector3d.NULL) Then
Return
End If
@@ -774,34 +796,34 @@ Public Class NestingTabVM
' Modifico dimensione figura
If Math.Abs(dScalefactor) > EPS_SMALL * EPS_SMALL Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, vtMove * 0.5, GDB_ID.ROOT)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5, GDB_ID.ROOT)
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRectangle, vtMove * 0.5, GDB_RT.GLOB)
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRectangle, vtMove * 0.5, GDB_RT.GLOB)
End If
End If
' verifico che il il lato maggiore rimanga semore il lato maggiore
Dim bRettangleCorrect As Boolean = False
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRettangleCorrect = True
Dim bRectangleCorrect As Boolean = False
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRectangleCorrect = True
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
EnableReferenceRegion(False)
' se la modifica genera un errore allora ripristino la figura prima della defomrazione
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRettangle), True) Or Not bRettangleCorrect Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRectangle), True) Or Not bRectangleCorrect Then
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, -vtMove * 0.5, GDB_ID.ROOT)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5, GDB_ID.ROOT)
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRectangle, -vtMove * 0.5, GDB_RT.GLOB)
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRectangle, -vtMove * 0.5, GDB_RT.GLOB)
End If
End If
@@ -813,20 +835,20 @@ Public Class NestingTabVM
End Sub
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
Public Sub ResetDragRettangleParam()
Public Sub ResetDragRectangleParam()
' deseleziono l'elemento corrente
EgtDeselectObj(m_nIdSelectedSawRettangle)
EgtDeselectObj(m_nIdSelectedCurvRettangle)
EgtResetMark(m_nIdSelectedSawRettangle)
EgtDeselectObj(m_nIdSelectedSawRectangle)
EgtDeselectObj(m_nIdSelectedCurvRectangle)
EgtResetMark(m_nIdSelectedSawRectangle)
' resetto gli indici
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
m_nIdSelectedRegionRettangle = GDB_ID.NULL
m_nIdSelectedSawRettangle = GDB_ID.NULL
m_nIdSelectedCurvRettangle = GDB_ID.NULL
m_nIdSelectedTextRettangle = GDB_ID.NULL
m_nIdSelectedTextTopRettangle = GDB_ID.NULL
m_nIdSelectedFlatSurfRettangle = GDB_ID.NULL
m_SideListRettangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
m_nIdSelectedRegionRectangle = GDB_ID.NULL
m_nIdSelectedSawRectangle = GDB_ID.NULL
m_nIdSelectedCurvRectangle = GDB_ID.NULL
m_nIdSelectedTextRectangle = GDB_ID.NULL
m_nIdSelectedTextTopRectangle = GDB_ID.NULL
m_nIdSelectedFlatSurfRectangle = GDB_ID.NULL
m_SideListRectangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
m_sTextContent = String.Empty
' disattivo il drag
m_bDrag = False
@@ -840,32 +862,338 @@ Public Class NestingTabVM
#End Region ' METHODS
Private m_bDragRettangle As Boolean
Public Property bDragRettangle As Boolean
Private m_bDragRectangle As Boolean
Public Property bDragRectangle As Boolean
Get
Return m_bDragRettangle
Return m_bDragRectangle
End Get
Set(value As Boolean)
m_bDragRettangle = value
m_bDragRectangle = value
m_bSplitCurvWJ = False
ResetSplitCurvWJParam(True)
m_bStartCurvWJ = False
ResetStartCurvWJParam(True)
NotifyPropertyChanged("bSplitCurvWJ")
NotifyPropertyChanged("bStartCurvWJ")
End Set
End Property
Private m_DragRettangle_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property DragRettangle_Visibility As Visibility
Private m_DragRectangle_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property DragRectangle_Visibility As Visibility
Get
Return m_DragRettangle_Visibility
Return m_DragRectangle_Visibility
End Get
End Property
Public ReadOnly Property DragRettangle_Cl_Span As Integer
Get
If m_DragRettangle_Visibility = Visibility.Visible Then
Return 1
#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)
' 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
Return 2
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(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
Private m_bSplitCurvWJ As Boolean
Public Property bSplitCurvWJ As Boolean
Get
Return m_bSplitCurvWJ
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_WJ_Cmd_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property WJ_Cmd_Visibility As Visibility
Get
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_WJ_Cmd_Visibility()
' gestisco la visualizzazione del comando ON_OFF (per i tagli waterjet)
If CurrentMachine.WaterJettingActive Then
m_WJ_Cmd_Visibility = Visibility.Visible
Else
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
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"
@@ -1451,6 +1779,10 @@ Public Class NestingTabVM
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
' Cancello eventuali messaggi
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
@@ -1513,8 +1845,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
@@ -1537,17 +1869,28 @@ Public Class NestingTabVM
#Region "EVENTS"
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bDragRettangle Then
OnMyMouseDownSceneSelSideRettangle(sender, e)
' se in modalità DragRectangle (deformazione delle componenti rettangolari)
If m_bDragRectangle Then
OnMyMouseDownSceneSelSideRectangle(sender, e)
' Dati per drag (abilito il Drag)
m_locPrev = e.Location
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRectangle <> GDB_ID.NULL
m_bDragToStart = m_bDrag
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
m_vtTotMove = Vector3d.NULL()
Return
End If
' se in modalità separazione curve WaterJet
If m_bSplitCurvWJ Then
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
' Verifico se selezionato indicativo di pezzo
@@ -1570,7 +1913,7 @@ Public Class NestingTabVM
If NameLayer = INFO_COUNTERLY Then
Dim sText As String = String.Empty
If EgtTextGetContent(nId, sText) Then
Dim sItems() As String = sText.Split("#")
Dim sItems() As String = sText.Split("#"c)
If sItems.Count > 1 Then
m_nCurrNubrOfParts = 0
If StringToInt(sItems(1), m_nCurrNubrOfParts) Then
@@ -1611,7 +1954,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
@@ -1619,8 +1962,8 @@ Public Class NestingTabVM
End If
' se devo muovere un lato del rettangolo
If m_bDragRettangle Then
OnMyMouseMoveSawRettangle(sender, e)
If m_bDragRectangle Then
OnMyMouseMoveSawRectangle(sender, e)
Return
End If
@@ -1725,11 +2068,22 @@ Public Class NestingTabVM
End Sub
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
If m_bDragRettangle Then
If m_bDragRectangle Then
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
ResetDragRettangleParam()
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(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
+1 -1
View File
@@ -71,7 +71,7 @@ Public Class OptionWindowVM
OmagOFFICEMap.refRawPartTabVM.Refresh(PrevMeasureUnit)
OmagOFFICEMap.refNestingTabVM.Refresh(PrevMeasureUnit)
OmagOFFICEMap.refMoveRawModeVM.Refresh(PrevMeasureUnit)
OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
If Not IsNothing(OmagOFFICEMap.refSimulTabVM.MySimul) Then OmagOFFICEMap.refSimulTabVM.MySimul.Refresh(PrevMeasureUnit)
End If
End Set
End Property
+2 -2
View File
@@ -128,9 +128,9 @@ Public Class TopCommandBarVM
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Friend Sub NewCmd(Optional bUseDefaults As Boolean = False)
Friend Sub NewCmd()
OmagOFFICEMap.refSceneHostVM.NewProject()
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(bUseDefaults)
OmagOFFICEMap.refMachGroupPanelVM.InitMachGroupList(False)
End Sub
#End Region ' NewCommand