diff --git a/ConstIni.vb b/ConstIni.vb index d165b77..89b19da 100644 --- a/ConstIni.vb +++ b/ConstIni.vb @@ -206,5 +206,13 @@ Module ConstIni Public Const K_FG_TOTSLAB As String = "TotSlab" Public Const K_FG_PIECETYPE As String = "PieceType" + Public Const S_DIRECTCUTS As String = "DirectCuts" + Public Const K_DC_SING_DEPTH As String = "SingDepth" + Public Const K_DC_SING_LENGTH As String = "SingLength" + Public Const K_DC_SING_ANGH As String = "SingAngH" + Public Const K_DC_SING_ANGV As String = "SingAngV" + Public Const K_DC_SING_OFFSET As String = "SingOffset" + Public Const K_DC_SING_POSX As String = "SingPosX" + Public Const K_DC_SING_POSY As String = "SingPosY" End Module diff --git a/FlatteningCut.xaml.vb b/FlatteningCut.xaml.vb index 3a27d62..df19a30 100644 --- a/FlatteningCut.xaml.vb +++ b/FlatteningCut.xaml.vb @@ -548,6 +548,8 @@ Public Class FlatteningCut ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) + ' lancio eventuale lua post-trasmissione + m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ExecSentProgScript() End If #End If End Sub diff --git a/GridCut.xaml.vb b/GridCut.xaml.vb index 31f440d..78fce1c 100644 --- a/GridCut.xaml.vb +++ b/GridCut.xaml.vb @@ -474,6 +474,8 @@ Public Class GridCut ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) + ' lancio eventuale lua post-trasmissione + m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ExecSentProgScript() End If #End If End Sub diff --git a/MultipleCut.xaml.vb b/MultipleCut.xaml.vb index d3668da..ac1f45f 100644 --- a/MultipleCut.xaml.vb +++ b/MultipleCut.xaml.vb @@ -501,6 +501,8 @@ Public Class MultipleCut ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) + ' lancio eventuale lua post-trasmissione + m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ExecSentProgScript() End If #End If End Sub diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 0985718..674b108 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectMgrUC.xaml.vb b/ProjectMgrUC.xaml.vb index 6a5d4a8..3d52a3d 100644 --- a/ProjectMgrUC.xaml.vb +++ b/ProjectMgrUC.xaml.vb @@ -624,7 +624,7 @@ Public Class ProjectMgrUC m_CurrProjPage.ClearMessage() End Sub - Private Function ExecSentProgScript() As Boolean + Friend Function ExecSentProgScript() As Boolean ' Verifico esistenza script Dim sLuaPath As String = m_MainWindow.m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua" If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True diff --git a/SawTestUC.xaml.vb b/SawTestUC.xaml.vb index 07b584f..6e1285b 100644 --- a/SawTestUC.xaml.vb +++ b/SawTestUC.xaml.vb @@ -423,6 +423,8 @@ Public Class SawTestUC ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) + ' lancio eventuale lua post-trasmissione + m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ExecSentProgScript() End If #End If End Sub diff --git a/SideAngle.vb b/SideAngle.vb index 5ea3d8d..6e3e082 100644 --- a/SideAngle.vb +++ b/SideAngle.vb @@ -147,19 +147,19 @@ Module SideAngle Dim bSH As Boolean = EgtGetInfo(LineId, INFO_HEEL, dSideHeel) If Math.Abs(dSideAngle) > EPS_ANG_SMALL Or ( bSA2 And Not bSH) Then ' Creo testo con angolo di inclinazione - Dim sText As String = DoubleToString(dSideAngle, 1) & "°" + Dim sText As String = DoubleToString(dSideAngle, 2) & "°" ' Se presente tallone, lo indico If bSH then If dSideHeel > 10 * EPS_SMALL Then If dSideAngle > 0 Then - sText = sText & "; " & LenToString(dSideHeel, 1) + sText = sText & "; " & LenToString(dSideHeel, 2) Else - sText = LenToString(dSideHeel, 1) & "; " & sText + sText = LenToString(dSideHeel, 2) & "; " & sText End If End If ' se altrimenti presente secondo angolo, lo indico ElseIf bSA2 then - sText = DoubleToString(dSideAngle2, 1) & "°" & "; " & sText + sText = DoubleToString(dSideAngle2, 2) & "°" & "; " & sText End If AddTextToLine(sText, TextLayId, LineId, 15, dBBoxRad, False, True) End If diff --git a/SideAngleUc.xaml.vb b/SideAngleUc.xaml.vb index 140352b..f3510bd 100644 --- a/SideAngleUc.xaml.vb +++ b/SideAngleUc.xaml.vb @@ -424,8 +424,8 @@ Public Class SideAngleUC If m_Mode = ModeOpt.SIDEANGLE Then ' Per ogni entità, creo testo con nome e angolo di inclinazione For Each Entity In m_SideAngleEntityList - Dim sText As String = Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°" - If Entity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(Entity.dSideHeel, 1) + Dim sText As String = Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 2) & "°" + If Entity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(Entity.dSideHeel, 2) SideAngle.AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True) Next ' Altrimenti modalità gocciolatoio @@ -486,8 +486,8 @@ Public Class SideAngleUC EgtGetName(CurrLine, sEntityName) m_SideAngleEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, dSideHeelVal)) ' Creo testo con angolo di inclinazione ed eventuale tallone - Dim sText As String = sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°" - If dSideHeelVal > 10 * EPS_SMALL Then sText += "; " & LenToString(dSideHeelVal, 1) + Dim sText As String = sEntityName & " = " & DoubleToString(dSideAngleVal, 2) & "°" + If dSideHeelVal > 10 * EPS_SMALL Then sText += "; " & LenToString(dSideHeelVal, 2) SideAngle.AddTextToLine(sText, TextLayer, CurrLine, 20, dBBoxRad, True) End Sub @@ -577,7 +577,7 @@ Public Class SideAngleUC ' Assegno colore e attributi nCrvId = EgtGetFirstInGroup(DripLayer) While nCrvId <> GDB_ID.NULL - EgtSetColor(nCrvId, New Color3d(255, 165, 0)) + EgtSetColor(nCrvId, COL_MCH_DRIPCUT()) EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth) If m_dDripShort > EPS_SMALL Then EgtSetInfo(nCrvId, INFO_STRICT, "1") nCrvId = EgtGetNext(nCrvId) diff --git a/SingleCutUC.xaml.vb b/SingleCutUC.xaml.vb index 6da7bd0..85dcea7 100644 --- a/SingleCutUC.xaml.vb +++ b/SingleCutUC.xaml.vb @@ -55,7 +55,7 @@ Public Class SingleCutUC m_PointsModeArray(PT_MODE.DRAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 25) ' la associo alla combobox PointModeCmBx.ItemsSource = m_PointsModeArray - ' assegno messaggi + ' Assegno messaggi Point1Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 10) Point2Btn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 11) DepthTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 13) @@ -65,6 +65,14 @@ Public Class SingleCutUC OffsetTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 28) SimulBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 1) OkBtn.Content = EgtMsg(MSG_DIRECTCUTPAGEUC + 30) + ' Carico i dati dell'ultimo taglio + m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile()) + m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile()) + m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile()) + m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile()) + m_dOffset = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_OFFSET, m_dOffset, m_MainWindow.GetIniFile()) + m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile()) + m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile()) End Sub Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded @@ -83,6 +91,11 @@ Public Class SingleCutUC EgtDraw() Return End If + ' Disabilito registrazione progetto modificato + EgtDisableModified() + ' Creo layer temporaneo per crocette + m_nTempLay = EgtCreateGroup(GDB_ID.ROOT) + EgtSetLevel(m_nTempLay, GDB_LV.TEMP) ' Origine tavola m_bRawOk = True If Not EgtGetTableRef(1, m_ptTabOri) Then @@ -97,17 +110,19 @@ Public Class SingleCutUC ' Reset punto acquisito m_bPointP1Ok = False m_bPointP2Ok = False - ' Inizializzo primo punto acquisito dal disegno come centro del grezzo - GetRawCenter(m_ptPrev) + ' Inizializzo primo punto acquisito dal disegno + m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG()) + m_ptPrev.z = m_ptRawMax.z + ' Disegno crocetta che indica il punto acquisito + CreateCross(m_nTempLay, m_ptPrev) ' Imposto modalità di acquisizione punti PointModeCmBx.SelectedIndex = PT_MODE.DRAW SetCoordVisibility(True) ShowCoord() - ' Assegno parametri di lavorazione già definiti + ' Assegno parametri di lavorazione DepthTxBx.Text = LenToString(m_dDepth, 1) LenghtTxBx.Text = LenToString(m_dLen, 1) OffsetTxBx.Text = LenToString(m_dOffset, 1) - ' Inizializzo valori non ancora definiti DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2) SideAngleTxBx.Text = DoubleToString(m_dAngV, 2) ' Reset taglio e disabilito bottone esecuzione @@ -117,14 +132,20 @@ Public Class SingleCutUC Point2Btn.IsEnabled = False ' Deseleziono bottone primo punto Point1Btn.IsChecked = False - ' Disabilito registrazione progetto modificato - EgtDisableModified() - ' Creo layer temporaneo per crocette - m_nTempLay = EgtCreateGroup(GDB_ID.ROOT) - EgtSetLevel(m_nTempLay, GDB_LV.TEMP) + ' Aggiorno visualizzazione + EgtDraw() End Sub Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded + ' Salvo i dati correnti + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString( m_dAngV, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_OFFSET, DoubleToString( m_dOffset, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile()) + WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString( m_ptTipP1.y, 2), m_MainWindow.GetIniFile()) + ' Se non vado in simulazione If Not m_bSimul Then ' Dichiaro sottopagina da non riattivare m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut @@ -496,6 +517,8 @@ Public Class SingleCutUC ' copio il progetto corrente come progetto in lavorazione Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge" My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True) + ' lancio eventuale lua post-trasmissione + m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ExecSentProgScript() End If #End If End Sub diff --git a/SplitAuto.vb b/SplitAuto.vb index 1bc72eb..9186084 100644 --- a/SplitAuto.vb +++ b/SplitAuto.vb @@ -99,6 +99,15 @@ Public Module SplitAuto Mach.m_bStartAll = False Mach.m_bEndAll = False End If + ' Waterjet + ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then + Mach.m_nInterf = FMI_TYPE.NONE + ' recupero l'angolo di fianco + EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) + Mach.m_bCanStartAll = False + Mach.m_bCanEndAll = False + Mach.m_bStartAll = False + Mach.m_bEndAll = False ' Forature e fresature Else Mach.m_nInterf = FMI_TYPE.NONE diff --git a/SplitPageUC.xaml.vb b/SplitPageUC.xaml.vb index 5715621..9853dd4 100644 --- a/SplitPageUC.xaml.vb +++ b/SplitPageUC.xaml.vb @@ -136,7 +136,7 @@ Public Class SplitPageUC If Math.Abs(Mach.m_dSideAng) < EPS_ANG_SMALL Then sText = EgtMsg(90791) & " " & i.ToString() Else - sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 1) & "°" + sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled))