OmagCUT :
- in nesting aggiunto allineamento automatico dopo collisione (se abilitato) sia in drag sia con pulsanti - step di rotazione da INI come step di traslazione - all'uscita della simulazione cancello eventuale messaggio relativo.
This commit is contained in:
@@ -87,6 +87,7 @@ Module ConstIni
|
||||
Public Const S_NEST As String = "Nest"
|
||||
Public Const K_DIRECT As String = "Direct"
|
||||
Public Const K_STEP As String = "Step"
|
||||
Public Const K_ANGSTEP As String = "AngStep"
|
||||
Public Const K_REDUCEDCUT As String = "ReducedCut"
|
||||
Public Const K_RESTRADIUS As String = "RestRadius"
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ Public Class CurrentProjectPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub CurrentProjectPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
ClearErrorMessage()
|
||||
ClearMessage()
|
||||
If m_bFirst Then
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
@@ -466,7 +466,7 @@ Public Class CurrentProjectPageUC
|
||||
EgtOutLog(sMessage)
|
||||
End Sub
|
||||
|
||||
Friend Sub ClearErrorMessage()
|
||||
Friend Sub ClearMessage()
|
||||
OutMessageBrd.Background = Brushes.Transparent
|
||||
OutMessageBrd.Visibility = Windows.Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
+1
-1
@@ -717,7 +717,7 @@ Class MainWindow
|
||||
End If
|
||||
' Se già visualizzato errore, lo nascondo
|
||||
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
||||
m_CurrentProjectPageUC.ClearErrorMessage()
|
||||
m_CurrentProjectPageUC.ClearMessage()
|
||||
End If
|
||||
' Impedisce di clickare fuori dal NumericKeyboard finchè questo è aperto
|
||||
If Not m_NumericKeyboardWD Is Nothing Then
|
||||
|
||||
+4
-4
@@ -79,11 +79,11 @@
|
||||
<Image Source="Resources/CounterClockwiseRotate.png" Width="64" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="AllignPiecesBtn" Grid.Column="1" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
|
||||
<Image Source="Resources/AllignPieces.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<ToggleButton Name="AlignPiecesBtn" Grid.Column="1" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||
<Image Source="Resources/AlignPieces.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</ToggleButton>
|
||||
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
|
||||
<Image Source="Resources/ClockwiseRotate.png" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
|
||||
+35
-1
@@ -25,7 +25,7 @@ Public Class NestPageUC
|
||||
Private m_dStep As Double = 0
|
||||
Private m_dMaxStep As Double = 0
|
||||
Private m_bMaximizeMove As Boolean = False
|
||||
Private m_dAngStep As Double = 90
|
||||
Private m_dAngStep As Double = 0
|
||||
Private m_bReducedCut As Boolean = False
|
||||
' Dati per Drag
|
||||
Private m_nRestRadius As Integer = 3
|
||||
@@ -34,6 +34,7 @@ Public Class NestPageUC
|
||||
Private m_bDragging As Boolean = False
|
||||
Private m_locPrev As System.Drawing.Point
|
||||
Private m_ptPrev As Point3d
|
||||
Private m_bAlign As Boolean = False
|
||||
|
||||
|
||||
Private Sub NestPage_Initialized(sender As Object, e As EventArgs)
|
||||
@@ -65,6 +66,7 @@ Public Class NestPageUC
|
||||
m_dStep = GetPrivateProfileDouble(S_NEST, K_STEP, 10, m_MainWindow.GetIniFile())
|
||||
StepMoveTxBx.Text = DoubleToString(m_dStep, 3)
|
||||
m_dMaxStep = Math.Max(m_ptRawMax.x - m_ptRawMin.x, m_ptRawMax.y - m_ptRawMin.y)
|
||||
m_dAngStep = GetPrivateProfileDouble(S_NEST, K_ANGSTEP, 15, m_MainWindow.GetIniFile())
|
||||
RotationAngleTxBx.Text = DoubleToString(m_dAngStep, 2)
|
||||
m_bReducedCut = GetPrivateProfileInt(S_NEST, K_REDUCEDCUT, 0, m_MainWindow.GetIniFile())
|
||||
m_nRestRadius = GetPrivateProfileInt(S_NEST, K_RESTRADIUS, 3, m_MainWindow.GetIniFile())
|
||||
@@ -171,6 +173,11 @@ Public Class NestPageUC
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
End If
|
||||
' se abilitato allineamento, lo provo
|
||||
If m_bAlign Then
|
||||
EgtAlignSelectedPartClusterOnCollision(m_bReducedCut, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
' Aggiorno il punto precedente
|
||||
@@ -207,6 +214,11 @@ Public Class NestPageUC
|
||||
Dim dStep As Double = IIf(m_bMaximizeMove, m_dMaxStep, m_dStep)
|
||||
EgtMoveSelectedPartCluster(m_bReducedCut, New Vector3d(0, dStep, 0), m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
' se abilitato allineamento, lo provo
|
||||
If m_bAlign Then
|
||||
EgtAlignSelectedPartClusterOnCollision(m_bReducedCut, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -214,6 +226,11 @@ Public Class NestPageUC
|
||||
Dim dStep As Double = IIf(m_bMaximizeMove, m_dMaxStep, m_dStep)
|
||||
EgtMoveSelectedPartCluster(m_bReducedCut, New Vector3d(0, -dStep, 0), m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
' se abilitato allineamento, lo provo
|
||||
If m_bAlign Then
|
||||
EgtAlignSelectedPartClusterOnCollision(m_bReducedCut, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -221,6 +238,11 @@ Public Class NestPageUC
|
||||
Dim dStep As Double = IIf(m_bMaximizeMove, m_dMaxStep, m_dStep)
|
||||
EgtMoveSelectedPartCluster(m_bReducedCut, New Vector3d(dStep, 0, 0), m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
' se abilitato allineamento, lo provo
|
||||
If m_bAlign Then
|
||||
EgtAlignSelectedPartClusterOnCollision(m_bReducedCut, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -228,6 +250,11 @@ Public Class NestPageUC
|
||||
Dim dStep As Double = IIf(m_bMaximizeMove, m_dMaxStep, m_dStep)
|
||||
EgtMoveSelectedPartCluster(m_bReducedCut, New Vector3d(-dStep, 0, 0), m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
' se abilitato allineamento, lo provo
|
||||
If m_bAlign Then
|
||||
EgtAlignSelectedPartClusterOnCollision(m_bReducedCut, m_ptRawMin.x + m_dKerf, m_ptRawMin.y + m_dKerf,
|
||||
m_ptRawMax.x - m_dKerf, m_ptRawMax.y - m_dKerf)
|
||||
End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -434,4 +461,11 @@ Public Class NestPageUC
|
||||
m_bActive = False
|
||||
End Sub
|
||||
|
||||
Private Sub AlignPiecesBtn_Click(sender As Object, e As RoutedEventArgs) Handles AlignPiecesBtn.Click
|
||||
If AlignPiecesBtn.IsChecked() Then
|
||||
m_bAlign = True
|
||||
Else
|
||||
m_bAlign = False
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
+1
-1
@@ -507,7 +507,7 @@
|
||||
<Resource Include="Resources\EgtCalculator\DeleteArrow.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\AllignPieces.png" />
|
||||
<Resource Include="Resources\AlignPieces.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\EgtMsgBox\Image.png" />
|
||||
|
||||
@@ -446,6 +446,18 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_RightGrayYellowIconToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource OmagCut_ToggleButton}">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
<Setter Property="Background" Value="{StaticResource OmagCut_RightGradientGray}"/>
|
||||
<Setter Property="FontSize" Value="{StaticResource FontSize_UpperCaseCharacter}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="ToggleButton.Background" Value="{StaticResource OmagCut_Blue}" />
|
||||
<Setter Property="ToggleButton.Foreground" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--TreeView-->
|
||||
|
||||
@@ -350,7 +350,7 @@ Public Class RawPartPageUC
|
||||
Dim ptRef As New Point3d(m_RawOffsX - m_RawKerf, m_RawOffsY - m_RawKerf, m_CurrProjPage.m_dAddTable)
|
||||
If EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) Then
|
||||
OkBtn.IsEnabled = True
|
||||
m_CurrProjPage.ClearErrorMessage()
|
||||
m_CurrProjPage.ClearMessage()
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
m_CurrProjPage.SetErrorMessage("Errore nella posizione o dimensione del grezzo")
|
||||
@@ -440,7 +440,7 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMaxLen = m_TableLength - m_RawOffsX - m_RawKerf
|
||||
If dLength <= dMaxLen Then
|
||||
m_CurrProjPage.ClearErrorMessage()
|
||||
m_CurrProjPage.ClearMessage()
|
||||
m_RawLength = dLength
|
||||
UpdateRawPart()
|
||||
Else
|
||||
@@ -456,7 +456,7 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
Dim dMaxWidth = m_TableWidth - m_RawOffsY - m_RawKerf
|
||||
If dWidth <= dMaxWidth Then
|
||||
m_CurrProjPage.ClearErrorMessage()
|
||||
m_CurrProjPage.ClearMessage()
|
||||
m_RawWidth = dWidth
|
||||
UpdateRawPart()
|
||||
Else
|
||||
@@ -471,7 +471,7 @@ Public Class RawPartPageUC
|
||||
Return
|
||||
End If
|
||||
If dHeight > -EPS_ZERO Then
|
||||
m_CurrProjPage.ClearErrorMessage()
|
||||
m_CurrProjPage.ClearMessage()
|
||||
If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then
|
||||
m_RawHeight = dHeight
|
||||
UpdateRawPart(True)
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -251,6 +251,8 @@ Public Class SimulationPageUC
|
||||
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
||||
' Mi assicuro di terminare la simulazione
|
||||
ResetSimulation()
|
||||
' Cancello eventuali messaggi
|
||||
m_CurrProjPage.ClearMessage()
|
||||
' Imposto vista 2D
|
||||
EgtSetView(VT.TOP, False)
|
||||
EgtZoom(ZM.ALL)
|
||||
|
||||
Reference in New Issue
Block a user