diff --git a/AlarmsPageUC.xaml b/AlarmsPageUC.xaml index 5c3c810..d17d44a 100644 --- a/AlarmsPageUC.xaml +++ b/AlarmsPageUC.xaml @@ -33,7 +33,10 @@ - + + + + @@ -98,9 +101,26 @@ - + + + + + + + + + + + - diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb index 3d4598a..62d1425 100644 --- a/AlarmsPageUC.xaml.vb +++ b/AlarmsPageUC.xaml.vb @@ -32,6 +32,8 @@ Public Class AlarmsPageUC CurrDrillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 3) CurrMillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 4) SafeZTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 5) + CutExtraLenTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 6) + AngleCutExtraLenTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 7) End Sub @@ -113,8 +115,11 @@ Public Class AlarmsPageUC ' Leggo distanza di sicurezza Dim dSafeZ As Double = 0 EgtMdbGetSafeZ(dSafeZ) - SafeZTxBx.Text = dSafeZ + SafeZTxBx.Text = LenToString(dSafeZ, 2) + ' Leggo tagli ridotti per interferenza in nesting + CompleteCutsChBx.IsChecked = + (GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0) End Sub Private Sub AuxiliaryToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryToolCmBx.SelectionChanged @@ -200,6 +205,22 @@ Public Class AlarmsPageUC End Sub + Private Sub SafeZTxBx_EgtClosed(sender As Object, e As EventArgs) Handles SafeZTxBx.EgtClosed + Dim dSafeZ As Double = 0 + StringToLen(SafeZTxBx.Text, dSafeZ) + EgtMdbSetSafeZ(dSafeZ) + EgtMdbSave() + End Sub + + Private Sub CompleteCutsChBx_Click(sender As Object, e As RoutedEventArgs) Handles CompleteCutsChBx.Click + If CompleteCutsChBx.IsChecked() Then + WritePrivateProfileString(S_MACH_NEST, K_MACH_REDUCEDCUT, "0", m_MainWindow.GetMachIniFile()) + Else + WritePrivateProfileString(S_MACH_NEST, K_MACH_REDUCEDCUT, "1", m_MainWindow.GetMachIniFile()) + End If + End Sub + + Friend Sub NcError() If m_CN.sz_NC_error_messages.Count > 0 Then NCErrorMessages.Text = m_CN.sz_NC_error_messages(0) @@ -231,11 +252,4 @@ Public Class AlarmsPageUC End Sub - Private Sub SafeZTxBx_EgtClosed(sender As Object, e As EventArgs) Handles SafeZTxBx.EgtClosed - Dim dSafeZ As Double = 0 - StringToDouble(SafeZTxBx.Text, dSafeZ) - EgtMdbSetSafeZ(dSafeZ) - EgtMdbSave() - End Sub - End Class diff --git a/ConstIni.vb b/ConstIni.vb index 0457528..e806685 100644 --- a/ConstIni.vb +++ b/ConstIni.vb @@ -21,6 +21,7 @@ Module ConstIni Public Const K_MESSAGESDIR As String = "MessagesDir" Public Const K_MESSAGES As String = "Messages" Public Const K_WINPLACE As String = "WinPlace" + Public Const K_MMUNITS As String = "MmUnits" Public Const K_MAXPROJ As String = "MaxProj" Public Const K_LASTPROJ As String = "LastProj" Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj" @@ -60,7 +61,6 @@ Module ConstIni Public Const K_SHOWTRIAADV As String = "ShowTriaAdv" Public Const K_ZOOMWIN As String = "ZoomWin" Public Const K_DISTLINE As String = "DistLine" - Public Const K_MMUNITS As String = "MmUnits" Public Const S_GRID As String = "Grid" Public Const K_SHOWGRID As String = "ShowGrid" @@ -88,7 +88,6 @@ Module ConstIni 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" Public Const K_SNAPDIST As String = "SnapDist" diff --git a/ConstMachIni.vb b/ConstMachIni.vb index 9bb7ce8..df38e40 100644 --- a/ConstMachIni.vb +++ b/ConstMachIni.vb @@ -48,6 +48,9 @@ Public Const K_SAWING As String = "Sawing" Public Const K_MILLING As String = "Milling" + Public Const S_MACH_NEST As String = "Nest" + Public Const K_MACH_REDUCEDCUT As String = "ReducedCut" + Public Const S_MACHBUTTONS As String = "MachButtons" Public Const K_BUTTON As String = "Button" diff --git a/CurrentProjectPageUC.xaml.vb b/CurrentProjectPageUC.xaml.vb index 05e0aba..0c6732d 100644 --- a/CurrentProjectPageUC.xaml.vb +++ b/CurrentProjectPageUC.xaml.vb @@ -201,7 +201,7 @@ Public Class CurrentProjectPageUC m_nRawId = GDB_ID.NULL m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() m_dRawHeight = 0 - HeightTxBx.Text = DoubleToString(m_dRawHeight, 2) + HeightTxBx.Text = LenToString(m_dRawHeight, 2) ' Dichiaro progetto non modificato EgtResetModified() Return True @@ -246,7 +246,7 @@ Public Class CurrentProjectPageUC m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() ' aggiorno spessore grezzo m_dRawHeight = m_MainWindow.m_RawPartPage.GetRawHeight() - HeightTxBx.Text = DoubleToString(m_dRawHeight, 2) + HeightTxBx.Text = LenToString(m_dRawHeight, 2) ' Dichiaro progetto non modificato EgtResetModified() Return True @@ -369,6 +369,10 @@ Public Class CurrentProjectPageUC End If End Function + Friend Sub UpdateHeightTxBx() + HeightTxBx.Text = LenToString(m_dRawHeight, 2) + End Sub + ' Gestione fotografia della lastra Friend Function LoadPhoto(ByVal sPath As String) As Boolean diff --git a/DrawPageUC.xaml.vb b/DrawPageUC.xaml.vb index fe762cf..fc871da 100644 --- a/DrawPageUC.xaml.vb +++ b/DrawPageUC.xaml.vb @@ -248,7 +248,7 @@ Public Class DrawPageUC Next For i As Integer = 1 To nShow Dim j As Integer = nHide + i - GetNameEdit(j).Text = m_CVars(i - 1).m_sName + GetNameEdit(j).Text = m_CVars(i - 1).m_sName GetNameEdit(j).Visibility = Windows.Visibility.Visible GetValueEdit(j).Text = m_CVars(i - 1).ToString() GetValueEdit(j).Visibility = Windows.Visibility.Visible diff --git a/GridCut.xaml.vb b/GridCut.xaml.vb index 27e4f24..3c58cbd 100644 --- a/GridCut.xaml.vb +++ b/GridCut.xaml.vb @@ -57,7 +57,7 @@ Public Class GridCut ' Reset punto acquisito m_bPointP1Ok = False ' Assegno parametri di lavorazione già definiti - DepthTxBx.Text = DoubleToString(m_dDepth, 1) + DepthTxBx.Text = LenToString(m_dDepth, 1) ' Origine tavola m_bRawOk = True If Not EgtGetTableRef(1, m_ptTabOri) Then @@ -163,8 +163,8 @@ Public Class GridCut EgtSetAxisPos(sR1, dR1) EgtSetAxisPos(sR2, dR2) ' Visualizzo quote - Dim sSawTip As String = "X" & DoubleToString(m_ptTipP1.x, 0) & " Y" & DoubleToString(m_ptTipP1.y, 0) & - " Z" & DoubleToString(m_ptTipP1.z, 0) & " C" & DoubleToString(dR1, 0) & + Dim sSawTip As String = "X" & LenToString(m_ptTipP1.x, 0) & " Y" & LenToString(m_ptTipP1.y, 0) & + " Z" & LenToString(m_ptTipP1.z, 0) & " C" & DoubleToString(dR1, 0) & " B" & DoubleToString(dR2, 0) 'SawTipTxBl.Text = sSawTip ' Assegno angoli @@ -250,8 +250,8 @@ Public Class GridCut EgtSetAxisPos(sR1, dR1) EgtSetAxisPos(sR2, dR2) ' Visualizzo quote - Dim sSawTip As String = "X" & DoubleToString(m_ptTipP2.x, 0) & " Y" & DoubleToString(m_ptTipP2.y, 0) & - " Z" & DoubleToString(m_ptTipP2.z, 0) & " C" & DoubleToString(dR1, 0) & + Dim sSawTip As String = "X" & LenToString(m_ptTipP2.x, 0) & " Y" & LenToString(m_ptTipP2.y, 0) & + " Z" & LenToString(m_ptTipP2.z, 0) & " C" & DoubleToString(dR1, 0) & " B" & DoubleToString(dR2, 0) 'SawTipTxBl.Text = sSawTip ' Assegno angolo verticale da direzione utensile @@ -267,7 +267,7 @@ Public Class GridCut Dim dAngOrizzDeg As Double vtDiff.ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg) If dLen > EPS_SMALL Then - 'LenghtTxBx.Text = DoubleToString(dLen, 1) + 'LenghtTxBx.Text = LenToString(dLen, 1) m_dAngO = dAngOrizzDeg DirectionTxBx.Text = DoubleToString(dAngOrizzDeg, 2) Create2PointsGridCut() @@ -286,7 +286,7 @@ Public Class GridCut ' Verifico che l'affondamento impostato non sia superiore a quello massimo Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH Dim dDepth As Double = 0 - StringToDouble(DepthTxBx.Text, dDepth) + StringToLen(DepthTxBx.Text, dDepth) If dDepth < 0 Then m_dDepth = 0 ElseIf dDepth > dMaxDepth Then @@ -294,27 +294,12 @@ Public Class GridCut Else m_dDepth = dDepth End If - DepthTxBx.Text = DoubleToString(m_dDepth, 2) + DepthTxBx.Text = LenToString(m_dDepth, 2) ' Disegno il taglio CreateGridCut() EgtDraw() End Sub - 'Private Sub LenghtTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LenghtTxBx.EgtClosed - ' ' Verifico che la lunghezza del taglio impostata non sia inferiore a quella minima - ' Dim dLenght As Double = 0 - ' StringToDouble(LenghtTxBx.Text, dLenght) - ' If dLenght < MIN_CUT_LEN Then - ' m_dLen = MIN_CUT_LEN - ' Else - ' m_dLen = dLenght - ' End If - ' LenghtTxBx.Text = DoubleToString(m_dLen, 2) - ' ' Disegno il taglio - ' CreateGridCut() - ' EgtDraw() - 'End Sub - Private Sub DirectionTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DirectionTxBx.EgtClosed ' Assegno il nuovo valore di direzione Dim dDirection As Double = 0 @@ -378,7 +363,7 @@ Public Class GridCut Return False End If ' Spessore grezzo - Dim dRawHeight As Integer = m_ptRawMax.z - m_ptRawMin.z + Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z ' Rimuovo eventuale vecchio pezzo per taglio diretto EraseDirectCutPart() ' Disattivo eventuali lavorazioni presenti @@ -417,7 +402,7 @@ Public Class GridCut Return False End If ' Spessore grezzo - Dim dRawHeight As Integer = m_ptRawMax.z - m_ptRawMin.z + Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z ' Rimuovo eventuale vecchio pezzo per taglio diretto EraseDirectCutPart() ' Disattivo eventuali lavorazioni presenti @@ -464,11 +449,11 @@ Public Class GridCut 'Recupero dati da interfaccia Dim dDimPzX As Double Dim nNumPzX As Integer - StringToDouble(DimPzXTxBx.Text, dDimPzX) + StringToLen(DimPzXTxBx.Text, dDimPzX) StringToDouble(NumPzXTxBx.Text, nNumPzX) Dim dDimPzY As Double Dim nNumPzY As Integer - StringToDouble(DimPzYTxBx.Text, dDimPzY) + StringToLen(DimPzYTxBx.Text, dDimPzY) StringToDouble(NumPzYTxBx.Text, nNumPzY) ' Definisco vettore di spostamento Dim vtDelta As Vector3d @@ -479,8 +464,8 @@ Public Class GridCut Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX) ' Imposto affondamento e angolo di fianco sul taglio - EgtSetInfo(nCutParaId, "Depth", m_dDepth) - EgtSetInfo(nCutParaId, "SideAng", m_dAngV) + EgtSetInfo(nCutParaId, "Depth", DoubleToString(m_dDepth, 3)) + EgtSetInfo(nCutParaId, "SideAng", DoubleToString(m_dAngV, 3)) ' Calcolo vettore di spostamento vtDelta = Vector3d.FromPolar((dDimPzY + dThick), m_dAngO) ' Ruoto il vettore di traslazione @@ -503,8 +488,8 @@ Public Class GridCut EgtInvertCurve(nCutPerpId) End If ' Imposto affondamento e angolo di fianco sul taglio - EgtSetInfo(nCutPerpId, "Depth", m_dDepth) - EgtSetInfo(nCutPerpId, "SideAng", m_dAngV) + EgtSetInfo(nCutPerpId, "Depth", DoubleToString(m_dDepth, 3)) + EgtSetInfo(nCutPerpId, "SideAng", DoubleToString(m_dAngV, 3)) ' Calcolo secondo vettore di spostamento vtDelta = Vector3d.FromPolar((dDimPzX + dThick), m_dAngO) For Index As Integer = 1 To nNumPzX diff --git a/Keyboard.xaml b/Keyboard.xaml deleted file mode 100644 index 179dd3f..0000000 --- a/Keyboard.xaml +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -