Compare commits

...

75 Commits

Author SHA1 Message Date
Nicola Pievani ab8051275b Aggiornamento versione 2025-05-06 16:08:30 +02:00
Nicola Pievani 18edeb5ee0 Merge branch 'master' into Features/Set_Machining 2025-05-06 16:02:58 +02:00
Nicola Pievani 471ba49732 Gestione speciale tagli inclinati e cambio lama 2025-05-06 16:02:38 +02:00
Nicola Pievani fd6e15be1e Migliorata gestione uscita simulazione 2025-04-18 13:00:27 +02:00
Nicola Pievani a2bb9e250c Correzione uscita dalla seconda pagina dei tagli diretti 2025-04-08 14:50:30 +02:00
Nicola Pievani 2673d51008 Merge commit '1d5cce387f5490da659622b259ebba41287839a0' 2025-04-04 12:44:34 +02:00
Nicola Pievani 1d5cce387f Ottiimizzata disposizione pezzi DXF in parcheggio 2025-04-04 12:44:10 +02:00
Nicola Pievani 07e5756793 Merge branch 'master' into develop 2025-04-04 11:34:23 +02:00
Nicola Pievani e5e80e9a55 Correzione/miglioramento gestione offset spostamento 2025-04-02 16:09:35 +02:00
Nicola Pievani 233a63b95b Correzione avvio gestione simulazione 2025-04-02 14:49:36 +02:00
Nicola Pievani cd0388b970 Merge commit '135be5f104c891b92201b98e3855117851ed42d5' into develop 2025-03-26 11:26:41 +01:00
Nicola Pievani 135be5f104 Modifica lettura Feed per controllo FANUC 2025-03-24 19:14:54 +01:00
Nicola Pievani 2f116ba3fe Gestione più di un riferimento del grezzo 2025-03-24 15:01:43 +01:00
Nicola Pievani 96ee5b5172 Correzione gestione lama test 2025-03-19 18:32:45 +01:00
Nicola Pievani b1367d543f Merge branch 'develop' into Features/Set_Machining 2025-03-18 18:12:21 +01:00
Nicola Pievani 484f7eb410 Merge branch 'develop' 2025-03-13 17:58:13 +01:00
Nicola Pievani c1eb839fe8 Nascondo le pareti dell'area sicura quando esco dal grezzo 2025-03-13 17:58:01 +01:00
Nicola Pievani f3b1d80de7 Merge branch 'master' into develop 2025-03-13 11:18:49 +01:00
Nicola Pievani 14b4897575 Migliorata gestione movimento grezzo nell'area sicura 2025-03-12 17:29:04 +01:00
Nicola Pievani 213a66d916 Migliorata gestione grezzo per tagli OverZ 2025-03-12 14:45:19 +01:00
Nicola Pievani c9c7aeafae Gestione Warning da CamAuto 2025-03-11 12:09:26 +01:00
Nicola Pievani 07d54499b7 Correzione gestione cambio modo da pagina Grezzo 2025-03-10 17:58:42 +01:00
Nicola Pievani 9f266f1c56 Correzione gestione comando Manual da pagina tagli diretti 2025-03-10 16:13:36 +01:00
Nicola Pievani 0362f77f23 Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egaltech/OmagCUT into Features/Set_Machining 2025-03-10 14:47:03 +01:00
Nicola Pievani fd28e2f971 Creazione file setup per programmi OFFICE e CAM5 della macchina corrente 2025-03-10 14:46:54 +01:00
Demetrio Cassarino 31264a20a0 -recuperati messagi da file messages 2025-03-07 16:28:30 +01:00
Nicola Pievani bee2c44ba7 Aggiunto un commento all'avvio della simulazione 2025-03-07 16:01:51 +01:00
Demetrio Cassarino 65652f468c -aggiunto colore lavorazione in ChangeWD 2025-03-06 16:16:11 +01:00
Demetrio Cassarino 2236eb12c7 -aggiunto tasto destro su lista apertura ChangeWD 2025-03-06 12:38:51 +01:00
Demetrio Cassarino e48837836b Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egalware-cadcam/interfacce/OmagCUT into Features/Set_Machining 2025-03-06 11:35:18 +01:00
Demetrio Cassarino d05fe9c6b2 -aggiunto messaggio di errore
-aggiunto tooltip
2025-03-06 11:34:40 +01:00
Nicola Pievani 8c8a26b692 Pulizia codice 2025-03-06 10:24:45 +01:00
Nicola Pievani 0b1a39704c Riordinate alcune funzioni 2025-03-05 15:39:35 +01:00
Nicola Pievani 8d1b1adaa9 Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egaltech/OmagCUT into Features/Set_Machining 2025-03-05 11:39:27 +01:00
Nicola Pievani eb881155d9 Migliorata gestione colorazione lavorazione 2025-03-05 11:39:07 +01:00
Demetrio Cassarino 8c0d5a651d Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egalware-cadcam/interfacce/OmagCUT into Features/Set_Machining 2025-03-05 11:38:11 +01:00
Demetrio Cassarino 10655893e4 -introdotto gestione visibilità rettangolo colore lavorazione 2025-03-05 11:38:09 +01:00
Nicola Pievani ec1af67d5b Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egaltech/OmagCUT into Features/Set_Machining 2025-03-05 10:27:55 +01:00
Nicola Pievani e103aa753f Aggiorno il valore di numerazione del taglio 2025-03-05 10:27:50 +01:00
Demetrio Cassarino ecacf89e93 -gestione visibilità pulsante colore lavorazioni 2025-03-05 10:07:08 +01:00
Demetrio Cassarino 7e5b813df1 -gestione pulsante color visibilità 2025-03-05 10:01:11 +01:00
Demetrio Cassarino 108048b559 Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egalware-cadcam/interfacce/OmagCUT into Features/Set_Machining 2025-03-05 09:38:24 +01:00
Demetrio Cassarino 0086345f64 -cambio label con rettangolo per lavorazioni 2025-03-05 09:38:22 +01:00
Nicola Pievani a5cc976810 Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egaltech/OmagCUT into Features/Set_Machining 2025-03-04 17:18:17 +01:00
Nicola Pievani 5bdc4c46bc Gestione colore da lama lavorazioni 2025-03-04 17:18:00 +01:00
Demetrio Cassarino 6e8154d29a -piccola modifica a MachiningLsBx 2025-03-04 17:10:22 +01:00
Demetrio Cassarino c8614fe52d -aggiunto label colore lavorazione 2025-03-04 16:54:25 +01:00
Demetrio Cassarino f420926e3e Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egalware-cadcam/interfacce/OmagCUT into Features/Set_Machining 2025-03-04 15:52:57 +01:00
Demetrio Cassarino 794c5da9e6 -sistemata grafica grid machining 2025-03-04 15:52:54 +01:00
Nicola Pievani 9d58cec30e Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egaltech/OmagCUT into Features/Set_Machining 2025-03-04 15:47:28 +01:00
Nicola Pievani e54c5f006e Migliorate alcune funzioni 2025-03-04 15:47:07 +01:00
Demetrio Cassarino 4a0a398e9f -funzione per la visualizzazione delle lavorazioni 2025-03-04 15:30:25 +01:00
Demetrio Cassarino 778219da1e -gestione colore lavorazione tooldb 2025-03-04 12:28:05 +01:00
Demetrio Cassarino 4ac506fbf0 Merge branch 'Features/Set_Machining' of https://gitlab.steamware.net/egalware-cadcam/interfacce/OmagCUT into Features/Set_Machining 2025-03-04 11:20:50 +01:00
Demetrio Cassarino 9616e211e5 -aggiunto seleziona colore lavorazione 2025-03-04 11:20:46 +01:00
Nicola Pievani 61b16af746 Lettura colore lavorazione da SystemNotes 2025-03-04 11:19:42 +01:00
Nicola Pievani 7d010be835 Prima gestione cambio lavorazione in Splitting 2025-03-04 09:44:18 +01:00
Nicola Pievani 48e523ce26 Merge commit 'a73b45d23ec23ddf0120a92ec35d85440229ffd0' 2025-02-24 15:33:53 +01:00
Nicola Pievani a73b45d23e Nuova gestione interasse cornici 2025-02-24 15:33:09 +01:00
Nicola Pievani 8ea607611c Gestione attesa per scatto fotografia (EnableGoHome) 2025-02-17 15:01:33 +01:00
Nicola Pievani bdf0971c20 Gestione apertura/salvataggio porgetti con multiparcheggio 2025-02-17 13:10:30 +01:00
Nicola Pievani 7d77297695 Merge branch 'develop' 2025-02-13 11:10:48 +01:00
Nicola Pievani bdcdcaecf0 Gestione sfondo dinamico PopUp viste 2025-02-12 17:51:09 +01:00
Nicola Pievani 44011c5775 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/OmagCUT into develop 2025-02-12 17:39:10 +01:00
Nicola Pievani cba095188e Migliorata gestione parcheggi in fase creazione nuovo progetto 2025-02-12 17:37:54 +01:00
Demetrio Cassarino ebedccf46a Aggiunto popup viste 2025-02-12 12:33:18 +01:00
Nicola Pievani 8bd7d9e3fa Merge branch 'develop' 2025-02-06 16:14:46 +01:00
Nicola Pievani 8dfa932bd7 Gestione SQUARING con lama 2025-02-06 16:13:33 +01:00
Nicola Pievani 5422e905e7 Aggiornamento lista materiali da DB waterjet 2025-02-06 15:59:03 +01:00
Nicola Pievani da396cc82e Merge branch 'Features/Read_C_Step' into develop 2025-02-06 15:01:08 +01:00
Nicola Pievani da8e7a9e42 Aggiornamento logo 2.7 2025-02-06 15:00:57 +01:00
Nicola Pievani d8cbe1a2c6 Aggiunto comando diretto per selezione modalità Manual 2025-02-03 11:23:40 +01:00
Nicola Pievani 79c2c17d6b Gestione taglio speciali per pezzi oltre il limite corsa in Z 2025-01-31 17:37:05 +01:00
Nicola Pievani ccb8945a4f Lettura posizione asse C da variabile PLC 2025-01-22 15:07:12 +01:00
Nicola Pievani 842ab19e8b Merge commit '5cfc72be27681812199b9ba326f0b285d6d93906' into develop 2025-01-17 16:55:55 +01:00
64 changed files with 3996 additions and 1649 deletions
+174 -40
View File
@@ -1,5 +1,6 @@
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib5
Friend Module CamAuto
@@ -22,11 +23,51 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Add")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(91017))
End If
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
Return bOk
End Function
Friend Function AddSawMachining(nOperId As Integer, ByRef nNewOperation As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
Dim nErr As Integer = 999
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateSawing")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaGetGlobIntVar("CAM.NEW_OPERATION", nNewOperation)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
End If
Return bOk
End Function
Friend Function ChangePvColor(nOperId As Integer, colCut As Color3d)
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
Dim nErr As Integer = 999
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
bOk = bOk AndAlso EgtLuaExecLine("CAM.ChangePvColor( " & nOperId.ToString & ",Color3d(" & colCut.R.ToString & "," & colCut.G.ToString & "," & colCut.B.ToString & "))")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
End If
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
Return bOk
End Function
@@ -40,9 +81,12 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJet")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
@@ -60,9 +104,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJets")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
@@ -76,9 +122,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Erase")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart()
@@ -94,9 +142,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.InvertVerticalCut")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
@@ -122,6 +172,63 @@ Friend Module CamAuto
Return True
End Function
Friend Function RestoreDef_Machinig(Optional bOnlySideAng As Boolean = True)
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
Dim bApplySawingTilted As Boolean = m_MainWindow.m_CurrentMachine.bApplySawingTilted
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop dei pezzi nel grezzo
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop dei pezzi in parcheggio
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng)
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
' ripristina la lavorazone indicata di default per i tagli inclinati
Private Sub SetResetDef_Machining(nEntId As Integer, sSawingTilted As String, bApplySawingTilted As Boolean, bOnlySideAng As Boolean)
While nEntId <> GDB_ID.NULL
Dim sInfoSIdeAng As String = String.Empty
EgtGetInfo(nEntId, INFO_SIDE_ANGLE, sInfoSIdeAng)
' Se è un'entità associata ad una lavorazione inclinata
If Not String.IsNullOrEmpty(sInfoSIdeAng) Then
If bApplySawingTilted Then
' forzo la lavorazione inclinata
If String.IsNullOrEmpty(sSawingTilted) Then
' ma se non esiste nessuna lavorezione specifica applico qualla standard
EgtRemoveInfo(nEntId, DEF_MACHINING)
Else
' Applico quella specificata
EgtSetInfo(nEntId, DEF_MACHINING, sSawingTilted)
End If
Else
' Rimuovo la lavorazione e applico quella standard
EgtRemoveInfo(nEntId, DEF_MACHINING)
End If
ElseIf Not bOnlySideAng Then
Dim sInfo As String = String.Empty
EgtGetInfo(nEntId, DEF_MACHINING, sInfo)
If Not String.IsNullOrEmpty(sInfo) Then
' se esiste una lavorazione specificata allora la rimuovo
EgtRemoveInfo(nEntId, DEF_MACHINING)
End If
End If
nEntId = EgtGetNext(nEntId)
End While
End Sub
Friend Function ResetAllSplitCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
@@ -291,9 +398,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateAllTp")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
@@ -307,9 +416,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Sort")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
@@ -324,9 +435,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.SpecApplyDisp")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
If ResetOrderMachiningFlag Then
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
@@ -342,7 +455,7 @@ Friend Module CamAuto
EgtGetGroupObjs(EgtGetFirstNameInGroup(nPartId, NAME_UNDERDRILL)) = 0 Then
Return True
End If
' Se tutti i pezzi
' Se tutti i pezzi
Else
' Salvo fase attualmente corrente
Dim nOriPhase As Integer = EgtGetCurrPhase()
@@ -469,6 +582,7 @@ Friend Module CamAuto
Return EgtRemoveOperationHome(nId)
End Function
' Verifico che per tutte le lavorazioni sia attrezzato l'utensile
Friend Function VerifySetup(ByRef sMissingTools As String) As Boolean
Dim bOk As Boolean = True
Dim bIsMultiCut = (EgtGetHeadId("H101") <> GDB_ID.NULL)
@@ -483,9 +597,9 @@ Friend Module CamAuto
Dim sTool2 As String = String.Empty
EgtGetMachiningParam(MCH_MP.TUUID, sTuuid)
EgtTdbGetToolFromUUID(sTuuid, sTool)
If String.IsNullOrWhiteSpace( sTool) Then
If String.IsNullOrWhiteSpace(sTool) Then
Dim sMchTool As String = ""
EgtGetMachiningParam( MCH_MP.TOOL, sMchTool)
EgtGetMachiningParam(MCH_MP.TOOL, sMchTool)
bOk = False
If sMissingTools.IndexOf(sMchTool) = -1 Then
sMissingTools = sMissingTools & sMchTool & ", "
@@ -498,8 +612,24 @@ Friend Module CamAuto
End If
sTool2 = sTool & "-2"
End If
If String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0 AndAlso
( String.IsNullOrWhiteSpace( sTool2) OrElse String.Compare(sTool2, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0) AndAlso
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
Dim bOnHolder As Boolean = False
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If sTool = ToolPosition.sTool Then
bOnHolder = True
Exit For
End If
End If
Next
If Not bOnHolder Then
bOk = False
If sMissingTools.IndexOf(sTool) = -1 Then
sMissingTools = sMissingTools & sTool & ", "
End If
End If
ElseIf String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0 AndAlso
(String.IsNullOrWhiteSpace(sTool2) OrElse String.Compare(sTool2, m_MainWindow.m_CurrentMachine.sCurrSaw) <> 0) AndAlso
String.Compare(sTool, m_MainWindow.m_CurrentMachine.sCurrDripSaw) <> 0 Then
bOk = False
If sMissingTools.IndexOf(sTool) = -1 Then
@@ -537,6 +667,8 @@ Friend Module CamAuto
End If
nId = EgtGetNextOperation(nId)
End While
Dim index As Integer = sMissingTools.LastIndexOf(","c)
sMissingTools = If(index >= 0, sMissingTools.Remove(index, 1), sMissingTools)
Return bOk
End Function
@@ -566,7 +698,7 @@ Friend Module CamAuto
Dim LocalListOperId As New List(Of Integer)
While nOperId <> GDB_ID.NULL
' verifico sia una lavorazione valida di taglio con lama
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
If IsValidMachining(nOperId) And EgtGetOperationType(nOperId) = MCH_OY.SAWING Then
' verifica interferenza
Dim nFlag As Integer = FMI_TYPE.NONE
If Not VerifyComposedMachining(nOperId, nFlag) Then
@@ -581,7 +713,7 @@ Friend Module CamAuto
LocalListOperId.Add(nOperId)
'AddWaterJetMachining(nOperId, nWarn)
End If
End If
End If
End If
nOperId = EgtGetNextOperation(nOperId)
End While
@@ -689,8 +821,8 @@ Friend Module CamAuto
If nOriLeadIn <> MCH_SAW_LI.STRICT Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.STRICT)
Dim dUserAddLen As Double = 0
EgtGetInfo( nMchId, INFO_MCH_USER_SAL, dUserAddLen)
EgtRemoveInfo( nMchId, INFO_MCH_USER_SAL)
EgtGetInfo(nMchId, INFO_MCH_USER_SAL, dUserAddLen)
EgtRemoveInfo(nMchId, INFO_MCH_USER_SAL)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen - dUserAddLen - dSafeLen)
@@ -709,8 +841,8 @@ Friend Module CamAuto
If nOriLeadOut <> MCH_SAW_LO.STRICT Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.STRICT)
Dim dUserAddLen As Double = 0
EgtGetInfo( nMchId, INFO_MCH_USER_EAL, dUserAddLen)
EgtRemoveInfo( nMchId, INFO_MCH_USER_EAL)
EgtGetInfo(nMchId, INFO_MCH_USER_EAL, dUserAddLen)
EgtRemoveInfo(nMchId, INFO_MCH_USER_EAL)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen - dUserAddLen - dSafeLen)
@@ -867,9 +999,9 @@ Friend Module CamAuto
Friend Function RemoveAllExitPreCuts() As Boolean
Dim nOperId As Integer = EgtGetFirstOperation()
While nOperId <> GDB_ID.NULL
Dim nNextOperId As Integer = EgtGetNextOperation( nOperId)
If EgtGetType( nOperId) <> MCH_OY.DISP AndAlso EgtExistsInfo(nOperId, INFO_MCH_EPC) Then
EgtRemoveOperation( nOperId)
Dim nNextOperId As Integer = EgtGetNextOperation(nOperId)
If EgtGetType(nOperId) <> MCH_OY.DISP AndAlso EgtExistsInfo(nOperId, INFO_MCH_EPC) Then
EgtRemoveOperation(nOperId)
End If
nOperId = nNextOperId
End While
@@ -879,6 +1011,7 @@ Friend Module CamAuto
Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean
Dim sMaterial As String = m_MainWindow.m_CurrentMachine.CurrMat.sName
Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing
Dim sSawTiltedMch As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling
Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
@@ -897,6 +1030,7 @@ Friend Module CamAuto
Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial)
EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch)
EgtLuaSetGlobStringVar("CAM.SAWTILTEDMCH", sSawTiltedMch)
EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch)
EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch)
EgtLuaSetGlobStringVar("CAM.POCKETMCH", sPocketMch)
@@ -1056,13 +1190,13 @@ Friend Module CamAuto
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
' Se non ci sono pezzi, esco
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPart1Id = GDB_ID.NULL Then Return True
' Verifico se cornice curva
Dim nDir As Integer = 0
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
Dim bSwap As Boolean = ( nDir = 0)
Dim bCurved As Boolean = ( nDir >= 2)
Dim bSwap As Boolean = (nDir = 0)
Dim bCurved As Boolean = (nDir >= 2)
' Recupero la lavorazione corrente di sgrossatura con lama
Dim sCurrSawRoughing = m_MainWindow.m_CurrentMachine.sCurrSawRoughing
If String.IsNullOrEmpty(sCurrSawRoughing) Then Return True
@@ -1089,8 +1223,8 @@ Friend Module CamAuto
' Imposto la geometria
EgtSetMachiningGeometry(vId)
' Imposto trim iniziale e finale
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
' Se cornice curva, imposto SCC
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
' Applico la lavorazione
@@ -1105,13 +1239,13 @@ Friend Module CamAuto
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
' Se non ci sono pezzi, esco
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPart1Id = GDB_ID.NULL Then Return True
' Verifico se cornice curva
Dim nDir As Integer = 0
EgtGetInfo( nPart1Id, INFO_FRAME_DIR, nDir)
Dim bSwap As Boolean = ( nDir = 0)
Dim bCurved As Boolean = ( nDir >= 2)
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
Dim bSwap As Boolean = (nDir = 0)
Dim bCurved As Boolean = (nDir >= 2)
' Recupero la lavorazione corrente di finitura con lama
Dim sCurrSawFinishing = m_MainWindow.m_CurrentMachine.sCurrSawFinishing
If String.IsNullOrEmpty(sCurrSawFinishing) Then Return True
@@ -1148,8 +1282,8 @@ Friend Module CamAuto
' Imposto la geometria
EgtSetMachiningGeometry(vId)
' Imposto trim iniziale e finale
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
' Se cornice curva, imposto SCC
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
' Applico la lavorazione
@@ -1164,13 +1298,13 @@ Friend Module CamAuto
Dim nRawId As Integer = GetCurrentRaw()
If nRawId = GDB_ID.NULL Then Return False
' Se non ci sono pezzi, esco
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart( nRawId)
Dim nPart1Id As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPart1Id = GDB_ID.NULL Then Return True
' Verifico se cornice curva
Dim nDir As Integer = 0
EgtGetInfo(nPart1Id, INFO_FRAME_DIR, nDir)
Dim bSwap As Boolean = ( nDir = 0)
Dim bCurved As Boolean = ( nDir >= 2)
Dim bSwap As Boolean = (nDir = 0)
Dim bCurved As Boolean = (nDir >= 2)
' Recupero la lavorazione corrente di spatolatura con lama
Dim sCurrSawSideFinishing = m_MainWindow.m_CurrentMachine.sCurrSawSideFinishing
If String.IsNullOrEmpty(sCurrSawSideFinishing) Then Return True
@@ -1191,8 +1325,8 @@ Friend Module CamAuto
' Imposto la geometria
EgtSetMachiningGeometry(vId)
' Imposto trim iniziale e finale
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If( bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If( bSwap, -dTrimStart, -dTrimEnd))
EgtSetMachiningParam(MCH_MP.STARTADDLEN, If(bSwap, -dTrimEnd, -dTrimStart))
EgtSetMachiningParam(MCH_MP.ENDADDLEN, If(bSwap, -dTrimStart, -dTrimEnd))
' Se cornice curva, imposto SCC
If bCurved Then EgtSetMachiningParam(MCH_MP.SOLCHOICETYPE, MCH_SCC.ADIR_NEAR)
' Applico la lavorazione
@@ -1331,14 +1465,14 @@ Friend Module CamAuto
dStartDist = dEndDist
dEndDist = dTemp
End If
' altrimenti
' altrimenti
Else
Dim vtSide As Vector3d
' Se faccia non limitata da altre o sopra la limitante
If bFree Then
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_DOWN)
vtSide = Vector3d.Z_AX()
' altrimenti è stata trovata una faccia adiacente limitante
' altrimenti è stata trovata una faccia adiacente limitante
Else
If vtAdjN.x > 10 * EPS_SMALL Then
EgtSetMachiningParam(MCH_MP.FACEUSE, MCH_MIL_FU.ORTUP_LEFT)
+92
View File
@@ -0,0 +1,92 @@
<Window x:Class="ChangeToolWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="ChooseTool" Height="382.6" Width="426.6" WindowStyle="None"
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Grid.Column="1" Grid.Row="0" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
<!--TextAlignment="Center"
FontSize="20"
VerticalAlignment="Center"-->
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.7*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="MACHINING" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
<TextBlock Grid.Column="1" Text="TOOL" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
<TextBlock Grid.Column="2" Text="TC" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
</Grid>
<ListBox Name="SetUpToolListBox" Grid.Column="1" Grid.Row="2"
ItemsSource="{Binding ItemList}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth, ElementName=SetUpToolListBox}" Margin="0,0,-40,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.6*"/>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.005*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Machining}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
<TextBlock Grid.Column="1" Text="{Binding ToolName}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
<TextBlock Grid.Column="2" Text="{Binding ToolPos}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
<Rectangle Grid.Column="2" Style="{DynamicResource Rect_SplitPage}"/>
<Grid.ToolTip>
<StackPanel>
<TextBlock Text="{Binding Machining}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
<TextBlock Text="{Binding ToolName}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
<TextBlock Text="{Binding ToolPos}" Style="{StaticResource OmagCut_ListBoxTextBlock}"/>
</StackPanel>
</Grid.ToolTip>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Name="ErrorTxBl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_ErrorTextBlock}"/>
<Grid Grid.Column="1" Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+376
View File
@@ -0,0 +1,376 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class ChangeToolWD
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_SetUpMachiningList As New ObservableCollection(Of ItemMachining)
Sub New(Owner As Window)
Me.Owner = Owner
InitializeComponent()
End Sub
' Parametri della lama impostata correntemente in macchina
Private m_DefaultSaw_Name As String = String.Empty
Private m_DefaultSaw_Diam As Double = 0
Private m_DefaultSaw_Thick As Double = 0
Private m_DefaultSaw_Exists As Boolean = False
' Il nome della lavorazione restituito dalla selezione
Private m_NewSawing As String = String.Empty
Public ReadOnly Property NewSawing As String
Get
Return m_NewSawing
End Get
End Property
' Il colore della lavorazione
Private m_EgtColor As New Color3d
Public ReadOnly Property EgtColor As Color3d
Get
Return m_EgtColor
End Get
End Property
' Il nome della posizione sulla rulliera
Private m_TCPos As String = String.Empty
Public ReadOnly Property TCPos As String
Get
Return m_TCPos
End Get
End Property
' Nome della lavorazione corrente
Private m_CurrSawing As String = String.Empty
Public Property CurrSawing As String
Get
Return m_CurrSawing
End Get
Set(value As String)
m_CurrSawing = value
End Set
End Property
Private Sub GetDiamAndThickDefaultSaw()
m_DefaultSaw_Name = m_MainWindow.m_CurrentMachine.sCurrSaw
If EgtTdbSetCurrTool(m_DefaultSaw_Name) Then
' Diametro lama lavorazione
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_DefaultSaw_Diam)
' Spessore lama corrente
EgtTdbGetCurrToolParam(MCH_TP.THICK, m_DefaultSaw_Thick)
m_DefaultSaw_Exists = True
End If
End Sub
Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Posizione finestra
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
' Definizione del collegamento tra ItemList e ListBox1
SetUpToolListBox.ItemsSource = m_SetUpMachiningList
' 90378=Seleziona lavorazione
FilePathTxBl.Text = EgtMsg(90378)
End Sub
Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
If String.IsNullOrEmpty(m_CurrSawing) Then
m_CurrSawing = m_MainWindow.m_CurrentMachine.sCurrSawing
End If
' carico elenco degli utensili impostati attualmente in macchina (anche il laser!)
LoadSetUpMachining()
' ricerco la lavorazione corrente
Dim Item As ItemMachining = m_SetUpMachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing)
Dim Index As Integer = m_SetUpMachiningList.IndexOf(Item)
If Index < 0 Then
' Imposto lavorazione di default
EgtMdbSetCurrMachining(m_CurrSawing)
Dim sTool As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sTool)
' ⚠️ Utensile {0} non attrezzato
ErrorTxBl.Text = String.Format(EgtMsg(90377), sTool)
Index = 0
End If
' se presente seleziono il primo elemento
If m_SetUpMachiningList.Count > 0 Then
SetUpToolListBox.SelectedItem = m_SetUpMachiningList(Index)
OkBtn.IsEnabled = True
Else
OkBtn.IsEnabled = False
End If
End Sub
#Region "SET UP MACHINING"
' Creo le liste da mostrare nella lista
Private Function LoadSetUpMachining() As Boolean
Dim sNameTool As String = String.Empty
Dim nType As Integer = 0
Dim sHeadTool As String = String.Empty
Dim nExitTool As Integer = 0
' Imposto il contesto corrente
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Recupero la lista di tutte le lavorazioni di lama
Dim local_Sawing As TreeViewItem.CathegoryItem = GetAllSwaing()
' Se non ci sono lavorazioni di lama allora esco
If IsNothing(local_Sawing) Then Return False
' Ripulisco la lista degli utensili
m_SetUpMachiningList.Clear()
CreateSawingList(local_Sawing)
Return True
End Function
' Creo la lista delle delle lavorazioni di lama da proporre
Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem)
' Recupero le info della lama montata di default
GetDiamAndThickDefaultSaw()
' recupero la prima lavorazione
For Each Item As TreeViewItem.CustomItem In SawingFam.Items
Dim sNameTool As String = String.Empty
' Imposto la lavorazione corrente
EgtMdbSetCurrMachining(Item.Name)
' Recupero il nome dell'utensile della lavorazione
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool)
If Not String.IsNullOrEmpty(sNameTool) And VerifyCurrSawTollerance(sNameTool) Then
' Verifico che sia montata su un portautensile
EgtTdbSetCurrTool(sNameTool)
Dim sTCPos As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
If Not String.IsNullOrEmpty(sTCPos) Then
' Cerco nel porta utensili automaitico
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If sNameTool = ToolPosition.sTool Then
' Verifico che il materiale e lo spessore
If VerifyCurrMachiningMaterial() Then
m_SetUpMachiningList.Add(New ItemMachining(Item.Name, sNameTool, sTCPos, Utility.GetColorPV()))
End If
Exit For
End If
End If
Next
End If
End If
Next
' reimposto la lavorazione di lama e la lama impostate in macchina
EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing)
End Sub
' verifico l'utensile corrente (impostato nella funzione chiamante) se può lavorare il grezzo corrente
Private Function VerifyCurrMachiningMaterial() As Boolean
Dim m_MaterialsList As New ObservableCollection(Of MachiningMaterial)
For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName, Material.SubId))
Else
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName))
End If
Next
Dim ToolString As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString)
If ToolString <> String.Empty Then
Dim sItems() = ToolString.Split(";".ToCharArray)
Dim Index As Integer = 0
For Each Material As MachiningMaterial In m_MaterialsList
Dim Param() As String = sItems(Index).Split(",".ToCharArray)
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
Dim nParId As Integer = 0
Dim nSubParId As Integer = 0
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
If StringToInt(SubParam(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId AndAlso SubParam.Count > 1 AndAlso
StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then
StringToDouble(Param(1), Material.dMinThickness)
StringToDouble(Param(2), Material.dMaxThickness)
Material.VerifyIfActive()
Else
Material.VerifyIfActive()
End If
Else
If StringToInt(Param(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId Then
StringToDouble(Param(1), Material.dMinThickness)
StringToDouble(Param(2), Material.dMaxThickness)
Material.VerifyIfActive()
If m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight > Material.dMinThickness And m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight < Material.dMaxThickness Then
Return True
End If
End If
End If
Index += 1
Next
End If
Return False
End Function
' verifico l'utensile corrente (impostato nella funzione chiamante) se ha le stesse dimensioni della lama di default
Private Function VerifyCurrSawTollerance(sNameTool As String) As Boolean
If m_DefaultSaw_Exists Then
If EgtTdbSetCurrTool(sNameTool) Then
' Diametro nuova lama
Dim NewDiam As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.DIAM, NewDiam)
' Spessore lama
Dim NewThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, NewThick)
' Verifico che la nuova lama possa essere applicata: diametro minore, uguale spessore
Dim Delta_Diam As Double = NewDiam - m_DefaultSaw_Diam
Dim Delta_Thick As Double = Math.Abs(NewThick - m_DefaultSaw_Thick)
If Delta_Diam < EPS_SMALL And Delta_Thick < EPS_SMALL Then
Return True
Else
EgtOutLog(String.Format("New saw {0} can not repalce the current {1}; Delta_Diam={2}, |Delta_Thick|={3} ", sNameTool, m_DefaultSaw_Name, Delta_Diam, Delta_Thick))
End If
Else
EgtOutLog("Impossible to find in tooldb SAW: " & sNameTool)
End If
Else
If String.IsNullOrEmpty(m_DefaultSaw_Name) Then
EgtOutLog("There is no currsaw setted in machine!")
Else
EgtOutLog("Impossible to find in tooldb currsaw setted in machine: " & m_DefaultSaw_Name)
End If
End If
Return False
End Function
' Restituisce tutto l'elenco delle lavorazioni disponibili in macchina
Private Function GetAllSwaing() As TreeViewItem.CathegoryItem
Dim sFName As String = EgtMsg(MSG_MACHININGSDBPAGEUC + 31)
Dim nFType As Integer = MCH_MY.SAWING
If Not m_MainWindow.m_CurrentMachine.bSawing Then Return Nothing
' Inserisco categoria ed eventuali elementi
Dim MachiningCathegory As New TreeViewItem.CathegoryItem(sFName, nFType)
Dim MachiningName As String = String.Empty
If EgtMdbGetFirstMachining(nFType, MachiningName) Then
MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType))
While EgtMdbGetNextMachining(nFType, MachiningName)
MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType))
End While
End If
Return MachiningCathegory
End Function
#End Region ' Set up machinining
Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp
' Disabilito Ok
OkBtn.IsEnabled = False
' Recupero item selezionato
If SetUpToolListBox.SelectedItems.Count() = 0 Then
Return
End If
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
' A seconda del tipo
OkBtn.IsEnabled = True
End Sub
Private Sub SetUpToolListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SetUpToolListBox.SelectionChanged
' Disabilito Ok
OkBtn.IsEnabled = False
' Recupero item selezionato
If SetUpToolListBox.SelectedItems.Count() = 0 Then
Return
Else
m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining
m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor
m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos
OkBtn.IsEnabled = True
End If
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
DialogResult = True
End Sub
End Class
Public Class ItemMachining
Private m_ToolPos As String = String.Empty
Private m_ToolName As String = String.Empty
Private m_Machining As String = String.Empty
Private m_ToolExit As Integer = 1
Private m_ToolType As Integer = -1
Private m_PrintFootToolColor As New Color3d(0, 255, 0, 100)
Private m_cSawColor As SolidColorBrush
' Posizione porta utensile
Public Property ToolPos As String
Get
Return m_ToolPos
End Get
Set(value As String)
m_ToolPos = value
End Set
End Property
' Nome utensile
Public Property ToolName As String
Get
Return m_ToolName
End Get
Set(value As String)
m_ToolName = value
End Set
End Property
' Nome della lavorazione
Public Property Machining As String
Get
Return m_Machining
End Get
Set(value As String)
m_Machining = value
End Set
End Property
Public Property ToolExit As Integer
Get
Return m_ToolExit
End Get
Set(value As Integer)
m_ToolExit = value
End Set
End Property
Public Property ToolType As Integer
Get
Return m_ToolType
End Get
Set(value As Integer)
m_ToolType = value
End Set
End Property
Public Property PrintFootToolColor As Color3d
Get
Return m_PrintFootToolColor
End Get
Set(value As Color3d)
m_PrintFootToolColor = value
End Set
End Property
Public Property SawColor As SolidColorBrush
Get
Return m_cSawColor
End Get
Set(value As SolidColorBrush)
m_cSawColor = value
End Set
End Property
Sub New(sMachining As String, sToolName As String, sToolPos As String, cColor As Color3d)
m_Machining = sMachining
m_ToolPos = sToolPos
m_ToolName = sToolName
m_PrintFootToolColor = cColor
m_cSawColor = New SolidColorBrush(Color.FromRgb(m_PrintFootToolColor.R, m_PrintFootToolColor.G, m_PrintFootToolColor.B))
End Sub
End Class
+30
View File
@@ -74,6 +74,12 @@ Public Class ChooseTestToolWD
End If
Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig
Case CurrentMachine.MountedToolConfigs.SAW
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then
' Imposto la lama
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
End If
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then
@@ -136,6 +142,30 @@ Public Class ChooseTestToolWD
End If
Next
Return True
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
sNameTool = ToolChangerPos.sTool
If Not String.IsNullOrEmpty(sNameTool) Then
' Imposto la lama
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
End If
End If
Next
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
sNameTool = ToolChangerPos.sTool
If Not String.IsNullOrEmpty(sNameTool) Then
' Imposto la lama
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
End If
End If
Next
Return True
Case Else
Return False
End Select
+9 -1
View File
@@ -133,9 +133,17 @@ Public Class MoveRawPartPage
EgtDraw()
' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
' Carico il valore ci
Dim ExtraStep As Double = GetPrivateProfileDouble(S_RAWMOVE, K_EXTRASTEP, 1, m_MainWindow.GetIniFile())
' Ricavo la lunghezza del baffo di taglio
m_dStep = SplitAuto.MaxCuttingMustache(m_dStep)
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+1"
If ExtraStep < EPS_SMALL Then
StepMoveTxBx.Text = LenToString(m_dStep, 1)
Else
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+" & LenToString(ExtraStep, 1)
' Aggiorno il valore sommando l'extra
m_dStep = m_dStep + ExtraStep
End If
m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile())
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
' Se movimento manuale perpendicolare
+1 -1
View File
@@ -157,7 +157,7 @@
<Image Source="{DynamicResource Deseleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="ParkIndBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
<Image Name="ParkIndImg" Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
+64 -19
View File
@@ -149,15 +149,27 @@ Public Class NestPageUC
UG0.Columns = nColumnIn_UG0
' Gestione dei comandi di parcheggio e selezione (UniformGrid2)
'...
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
EgtOutLog("Button 'EnableDXFPark' is not enable, check in file *.ini program.")
ParkIndBtn.Visibility = Visibility.Collapsed
UG2.Columns = 2
End If
End Sub
Dim ImageConverter As New ImageSourceConverter
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
m_bActive = True
LoadParams()
Dim ListparkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListparkInd)
If ListparkInd.Count > 2 Then ParkIndBtn.IsChecked = True
Dim nCpuntParkInd As Integer = UpdateImageParkInd()
If nCpuntParkInd > 2 Then
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("There are " & (nCpuntParkInd - 1).ToString & " park in project.")
EgtOutLog("WARNONG: Enable button 'EnableDXFPark' in file *.ini program.")
End If
ParkIndBtn.IsChecked = True
End If
ParkIndBtn_Click()
EgtZoom(ZM.ALL)
End Sub
@@ -230,21 +242,21 @@ Public Class NestPageUC
m_nCountSpot = 0
m_nCountSpotCUT = 0
End If
EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString)
'EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString)
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
If m_nCountSpot < 1 Then
UG0_Reg.IsEnabled = False
UG1_Reg.IsEnabled = False
EgtOutLog(" Abilito comandi gestione SPOT")
'EgtOutLog(" Abilito comandi gestione SPOT")
Else
UG0_Reg.IsEnabled = True
UG1_Reg.IsEnabled = True
EgtOutLog(" Disabilito comandi gestione SPOT")
'EgtOutLog(" Disabilito comandi gestione SPOT")
End If
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
If m_nCountSpotCUT < 1 Then
InsertSpotRegistration()
EgtOutLog(" Creo SPOT_CUT")
'EgtOutLog(" Creo SPOT_CUT")
End If
' Se necessario riabilito impostazione modificato
@@ -2810,9 +2822,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
' Aggiorno vista
EgtZoom(ZM.ALL)
' Aggiorno la lista dei parcheggi
If ParkIndBtn.IsChecked Then
m_SelParkInd.UpdateList()
End If
ReloadListParkInd()
End Sub
' ripulisco la lista dei pezzi in parcheggio
@@ -2844,20 +2854,22 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return False
End Function
Friend Function StoreOnePartDXF(nId As Integer, X As Double, Y As Double) As Boolean
Const STORE_LARGH As Double = 6000
Friend Function StoreOnePartDXF(nId As Integer, DimX As Double, DimY As Double, MaxPt As Point3d) As Boolean
'Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20 + 40 + 20
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
'Const STORE_OFFS As Double = 20 + 40 + 20
'Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
'Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
' Recupero box tavola
Dim b3Tab As New BBox3d
If Not EgtGetTableArea(1, b3Tab) Then
b3Tab.Add(New Point3d(0, 0, 0))
b3Tab.Add(New Point3d(-3600, -2600, 0))
End If
Dim vt As New Vector3d(b3Tab.Min.x, b3Tab.Min.y - Y - STORE_DIST, b3Tab.Min.z)
Dim Offs_y As Double = b3Tab.Min.y - MaxPt.y - STORE_DIST
Dim Offs_x As Double = b3Tab.Min.x - (MaxPt.x - DimX) + (b3Tab.DimX - DimX) / 2
Dim vt As New Vector3d(Offs_x, Offs_y, b3Tab.Min.z)
EgtMove(nId, vt, GDB_RT.GLOB)
' Recupero il centro del pezzo in parcheggio e lo salvo
Dim ptCenter As Point3d
@@ -2985,8 +2997,39 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
If ParkIndBtn.IsChecked Then
m_SelParkInd.UpdateList()
End If
UpdateImageParkInd()
End Sub
' Aggiorna immagine e restituisce il numero di parcheggi (+1) disponibili (+1 perchè conto anche il comando All_Off)
Private Function UpdateImageParkInd() As Integer
' Carcico la lista dei parcheggi
Dim ListparkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListparkInd)
Dim nCount As Integer = ListparkInd.Count
' Se il comando è abilitato allora provvedo ad aggiornare l'immagine
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Parking.png"
If nCount > 1 Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Busy.png"
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Empty.png"
End If
ParkIndImg.Source = ImageConverter.ConvertFromString(s)
Else
' Se il comando non è abilitato allora provvedo a selezionare il primo parcheggio
Dim CurrparkInd As ParkInd = SelParkIndWD.GetCurrentParkIndSelected()
If Not IsNothing(CurrparkInd) Then
SelParkIndWD.SetStatusPartInParkInd(CurrparkInd, True)
Else
If nCount > 1 Then
ListparkInd(1).Status = GDB_ST.ON_
SelParkIndWD.SetStatusPartInParkInd(ListparkInd(1), True)
End If
End If
End If
Return nCount
End Function
Private Sub DeleteBridgeAssociated(nMyId As Integer)
' verifico se esistono dei ponticelli associati al pezzo indicato
' recuoero il gruppo di lavorazione corrente
@@ -3107,17 +3150,18 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
End Sub
Private Sub ParkIndBtn_Click() Handles ParkIndBtn.Click
If ParkIndBtn.Visibility = Visibility.Collapsed Then
Return
End If
If ParkIndBtn.IsChecked Then
If IsNothing(m_SelParkInd) Then
m_SelParkInd = New SelParkIndWD(m_MainWindow)
End If
'm_SelParkInd.Show()
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Add(m_SelParkInd)
Else
If Not IsNothing(m_SelParkInd) Then
'm_SelParkInd.Close()
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Remove(m_SelParkInd)
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
m_SelParkInd = Nothing
@@ -3130,6 +3174,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
If Not IsNothing(m_SelParkInd) Then
m_SelParkInd.UpdateList()
End If
UpdateImageParkInd()
End Sub
+63 -12
View File
@@ -6,13 +6,27 @@ Imports EgtUILib
Imports OmagCUT.NestPageUC
Public Class SelParkIndWD
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_ParkIndList As New List(Of ParkInd)
Private m_nCtx As Integer = -1
Public Const nIndAllOff As Integer = 999
Sub New(Owner As Window)
Public Shared sActualProj As String = String.Empty
Private m_ParkIndList As New List(Of ParkInd)
Public Property ParkIndList As List(Of ParkInd)
Get
Return m_ParkIndList
End Get
Set(value As List(Of ParkInd))
m_ParkIndList = value
End Set
End Property
Sub New(Owner As Window, Optional nCtx As Integer = -1)
'Me.Owner = Owner
InitializeComponent()
If nCtx > -1 Then m_nCtx = nCtx
End Sub
Public Sub Me_Laoded() Handles Me.Loaded
@@ -24,7 +38,7 @@ Public Class SelParkIndWD
Public Sub UpdateList()
' Carico lista dei pezzi
LoadParkInd(m_ParkIndList)
LoadParkInd(m_ParkIndList, m_nCtx)
ParkIndListBox.ItemsSource = m_ParkIndList
UpdateDefaultSelection()
' Forzo l'aggiornamento della grafica
@@ -82,19 +96,19 @@ Public Class SelParkIndWD
End While
' Assegno lo stato del parcheggio a tutti i pezzi i parcheggio
If bFound Then
SetStatusPartInParkInd(localParkInd)
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
Else
' Significa che i pezzi sono tutti in macchina: quindi i pezzi sono (SICURAMENTE?) accesi
Dim OppositStat As Integer = If(localParkInd.Status = GDB_ST.ON_, GDB_ST.OFF, GDB_ST.ON_)
localParkInd.Status = OppositStat
SetStatusPartInParkInd(localParkInd)
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
End If
' Se accendo un parcheggio procedo a spegnere tutto gli atri
If localParkInd.Status = GDB_ST.ON_ Then
For Each ItemParkInd As ParkInd In m_ParkIndList
If localParkInd.Ind <> ItemParkInd.Ind Then
ItemParkInd.Status = GDB_ST.OFF
SetStatusPartInParkInd(ItemParkInd)
SetStatusPartInParkInd(ItemParkInd, True, m_nCtx)
End If
Next
End If
@@ -104,11 +118,12 @@ Public Class SelParkIndWD
#Region "METODI SHARED per gestione della lista parcheggi"
' Restituisce il primo indice di parcheggio libero
Public Shared Function NewParkInd() As Integer
Public Shared Function NewParkInd(Optional nCtx As Integer = -1) As Integer
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim LastParkInd As Integer = 0
Dim nRawId As Integer = GetCurrentRaw()
@@ -144,12 +159,13 @@ Public Class SelParkIndWD
End Function
' Gestisce lo stato dei pezzi associati al parcheggio indicato
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True)
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True, Optional nCtx As Integer = -1)
If IsNothing(localParkInd) Then Return
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
@@ -182,7 +198,7 @@ Public Class SelParkIndWD
End Sub
' Restituuisce la lista dei parcheggi del progetto corrente
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd))
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd), Optional nCtx As Integer = -1)
If IsNothing(P_List) Then Return
P_List.Clear()
P_List.Add(New ParkInd(nIndAllOff, "All off", 0))
@@ -190,6 +206,7 @@ Public Class SelParkIndWD
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
@@ -210,7 +227,7 @@ Public Class SelParkIndWD
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
@@ -235,7 +252,7 @@ Public Class SelParkIndWD
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
@@ -273,9 +290,43 @@ Public Class SelParkIndWD
Public Shared Function GetPathCurrProj() As String
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sParkPath As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
If Not String.IsNullOrEmpty(sActualProj) Then
Dim sDir As String = System.IO.Path.GetDirectoryName(sActualProj)
Dim sFile As String = System.IO.Path.GetFileNameWithoutExtension(sActualProj)
sParkPath = sDir & "\" & sFile & "_ParkInd_"
End If
Return sParkPath
End Function
Public Shared Sub CopyImgSvg(sNewFileName As String, Optional nCtx As Integer = -1)
If sNewFileName.EndsWith(".nge") Then
sNewFileName = sNewFileName.Remove(sNewFileName.Length - 4, 4) & "_ParkInd_"
End If
Dim Extension As String = ".svg"
If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
Dim ListParkInd As New List(Of ParkInd)
' ricarico la lista
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
'SelParkIndWD.sActualProj = Path.GetFileNameWithoutExtension(sPath)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
Try
Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
If MainWindow.m_bShowSVGParkInd Then
WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
Else
If System.IO.File.Exists(sNewFile) Then
System.IO.File.Delete(sNewFile)
End If
System.IO.File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
End If
Catch ex As Exception
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
End Try
End If
Next
End Sub
#End Region ' Metodi Shared
End Class
@@ -338,7 +389,7 @@ Public Class ParkInd
End Set
End Property
Private m_nPartInPark As Integer = 0
Private m_nPartInPark As Integer = GDB_ST.ON_
Public Property nPartInPark As Integer
Get
Return m_nPartInPark
+296 -142
View File
@@ -1,6 +1,4 @@
Imports System.Net
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtUILib
Public Module SplitAuto
@@ -51,151 +49,296 @@ Public Module SplitAuto
While nOperId <> GDB_ID.NULL
' verifico sia una lavorazione valida della fase corrente
If IsValidMachining(nOperId) And EgtGetOperationPhase(nOperId) = nCurrPhase Then
' se appartiene ad un grezzo attivo la inserisco in lista
If IsMachiningInActiveRaw(nOperId) Then
Dim Mach As New SplitMach
Mach.m_nEntId = GDB_ID.NULL
' identificativo
Mach.m_nId = nOperId
' eventuali lavorazioni inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId As String In sItems
Dim nId As Integer = 0
StringToInt(sId, nId)
If nId > 0 Then Mach.m_vOthId.Add(nId)
Next
End If
' tipo
Mach.m_nType = EgtGetOperationType(nOperId)
' layer di origine
EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
' se taglio con lama
If Mach.m_nType = MCH_OY.SAWING Then
' verifica interferenza
If Mach.m_sLay = NAME_OUTLOOP Then
EgtVerifyMachining(nOperId, Mach.m_nInterf)
For Each nId As Integer In Mach.m_vOthId
Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
EgtVerifyMachining(nId, nRes)
Mach.m_nInterf = Mach.m_nInterf Or nRes
Next
Else
Mach.m_nInterf = FMI_TYPE.NONE
End If
' la imposto come lavorazione corrente
EgtSetCurrMachining(nOperId)
' inversione
EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
' recupero l'angolo di fianco
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
Dim dStartAddLen As Double = -10
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
Dim dEndAddLen As Double = -10
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
Mach.m_bIsLine = True
Mach.m_dPrevAng = 0
Mach.m_dNextAng = 0
Mach.m_dStartFreeLen = FREELEN_INF + 1
Mach.m_dEndFreeLen = FREELEN_INF + 1
Dim nEntId, nSub As Integer
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
Mach.m_nEntId = nEntId
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
End If
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
Dim Mach As New SplitMach
If CreateMach(Mach, nOperId) Then MachSplitList.Add(Mach)
'' se appartiene ad un grezzo attivo la inserisco in lista
'If IsMachiningInActiveRaw(nOperId) Then
' Dim Mach As New SplitMach
' Mach.m_nEntId = GDB_ID.NULL
' ' identificativo
' Mach.m_nId = nOperId
' ' eventuali lavorazioni inglobate
' Dim sInfo As String = String.Empty
' If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
' Dim sItems() As String = sInfo.Split(",".ToCharArray)
' For Each sId As String In sItems
' Dim nId As Integer = 0
' StringToInt(sId, nId)
' If nId > 0 Then Mach.m_vOthId.Add(nId)
' Next
' End If
' ' tipo
' Mach.m_nType = EgtGetOperationType(nOperId)
' ' layer di origine
' EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
' ' se taglio con lama
' If Mach.m_nType = MCH_OY.SAWING Then
' ' verifica interferenza
' If Mach.m_sLay = NAME_OUTLOOP Then
' EgtVerifyMachining(nOperId, Mach.m_nInterf)
' For Each nId As Integer In Mach.m_vOthId
' Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
' EgtVerifyMachining(nId, nRes)
' Mach.m_nInterf = Mach.m_nInterf Or nRes
' Next
' Else
' Mach.m_nInterf = FMI_TYPE.NONE
' End If
' ' la imposto come lavorazione corrente
' EgtSetCurrMachining(nOperId)
' ' inversione
' EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
' ' recupero l'angolo di fianco
' EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
' ' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
' Dim dStartAddLen As Double = -10
' EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
' Dim dEndAddLen As Double = -10
' EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
' ' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
' Mach.m_bIsLine = True
' Mach.m_dPrevAng = 0
' Mach.m_dNextAng = 0
' Mach.m_dStartFreeLen = FREELEN_INF + 1
' Mach.m_dEndFreeLen = FREELEN_INF + 1
' Dim nEntId, nSub As Integer
' If EgtGetMachiningGeometry(0, nEntId, nSub) Then
' ' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
' If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
' Mach.m_bEnableInvert = GetEnableInvert(nEntId)
' EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
' If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
' Mach.m_nEntId = nEntId
' EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
' End If
' ' verifico se trasformabile in un taglio di separazione (almeno da un lato)
' If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
' Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
' Dim bIn As Boolean = False
' Dim bOut As Boolean = False
' CanExtendSides(Mach, bIn, bOut)
' Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
' Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
' If nRes = 0 Then
' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
' End If
' ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
' Mach.m_sLay = NAME_OUTLOOP And
' (Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
' Dim bIn As Boolean = False
' Dim bOut As Boolean = False
' CanExtendSides(Mach, bIn, bOut)
' ' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
' Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
' Mach.m_nInterf <> FMI_TYPE.LI
' ' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
' Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
' Mach.m_nInterf <> FMI_TYPE.LO
' If nRes = 0 Then
' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
' End If
' End If
' ' se trasformabile in taglio di separazione, verifico se lo è
' If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
' EgtSetCurrMachining(nOperId)
' Dim nLiType As Integer
' EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
' Dim nLoType As Integer
' EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
' Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
' Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
' Else
' 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
' Mach.m_dSideAng = 0
' Mach.m_bCanStartAll = False
' Mach.m_bCanEndAll = False
' Mach.m_bStartAll = False
' Mach.m_bEndAll = False
' End If
' ' abilitazione
' Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
' ' pausa
' Mach.m_bPause = GetPause(nOperId)
' ' inserisco in lista
' MachSplitList.Add(Mach)
' ' altrimenti la disattivo
'Else
' EgtSetOperationMode(nOperId, False)
'End If
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
Mach.m_nInterf <> FMI_TYPE.LI
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
Mach.m_nInterf <> FMI_TYPE.LO
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
End If
' se trasformabile in taglio di separazione, verifico se lo è
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
EgtSetCurrMachining(nOperId)
Dim nLiType As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
Dim nLoType As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
Else
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
Mach.m_dSideAng = 0
Mach.m_bCanStartAll = False
Mach.m_bCanEndAll = False
Mach.m_bStartAll = False
Mach.m_bEndAll = False
End If
' abilitazione
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
' pausa
Mach.m_bPause = GetPause(nOperId)
' inserisco in lista
MachSplitList.Add(Mach)
' altrimenti la disattivo
Else
EgtSetOperationMode(nOperId, False)
End If
End If
nOperId = EgtGetNextOperation(nOperId)
End While
Return True
End Function
Friend Function CreateMach(ByRef Mach As SplitMach, nOperId As Integer) As Boolean
Dim bOk As Boolean = True
' se appartiene ad un grezzo attivo la inserisco in lista
If IsMachiningInActiveRaw(nOperId) Then
Mach.m_nEntId = GDB_ID.NULL
' identificativo
Mach.m_nId = nOperId
' eventuali lavorazioni inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId As String In sItems
Dim nId As Integer = 0
StringToInt(sId, nId)
If nId > 0 Then Mach.m_vOthId.Add(nId)
Next
End If
' tipo
Mach.m_nType = EgtGetOperationType(nOperId)
' layer di origine
EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay)
' se taglio con lama
If Mach.m_nType = MCH_OY.SAWING Then
' verifica interferenza
If Mach.m_sLay = NAME_OUTLOOP Then
EgtVerifyMachining(nOperId, Mach.m_nInterf)
For Each nId As Integer In Mach.m_vOthId
Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO
EgtVerifyMachining(nId, nRes)
Mach.m_nInterf = Mach.m_nInterf Or nRes
Next
Else
Mach.m_nInterf = FMI_TYPE.NONE
End If
' la imposto come lavorazione corrente
EgtSetCurrMachining(nOperId)
' inversione
EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert)
' recupero l'angolo di fianco
EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng)
' recupero allungamento iniziale e finale (negativi vicino ad angoli interni)
Dim dStartAddLen As Double = -10
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
Dim dEndAddLen As Double = -10
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale
Mach.m_bIsLine = True
Mach.m_dPrevAng = 0
Mach.m_dNextAng = 0
Mach.m_dStartFreeLen = FREELEN_INF + 1
Mach.m_dEndFreeLen = FREELEN_INF + 1
Dim nEntId, nSub As Integer
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
Mach.m_nEntId = nEntId
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
End If
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And (Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
Mach.m_nInterf <> FMI_TYPE.LI
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
Mach.m_nInterf <> FMI_TYPE.LO
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
End If
' se trasformabile in taglio di separazione, verifico se lo è
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
EgtSetCurrMachining(nOperId)
Dim nLiType As Integer
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType)
Dim nLoType As Integer
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType)
Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT)
Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT_CENT Or nLoType = MCH_SAW_LO.EXT_OUT)
Else
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
Mach.m_dSideAng = 0
Mach.m_bCanStartAll = False
Mach.m_bCanEndAll = False
Mach.m_bStartAll = False
Mach.m_bEndAll = False
End If
' abilitazione
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
' pausa
Mach.m_bPause = GetPause(nOperId)
Else
' altrimenti la disattivo
EgtSetOperationMode(nOperId, False)
bOk = False
End If
Return bOk
End Function
Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean
If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then
' Posso estendere SOLO l'uscita
@@ -283,8 +426,19 @@ Public Module SplitAuto
ElseIf Math.Abs(dSideAng) > EPS_ANG_SMALL Then
colCut = COL_MCH_CUT_ANG()
Else
colCut = COL_MCH_CUT()
' Se macchina con cambio utensile di lama
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
m_MainWindow.m_CadCutPageUC.m_SplitPage.GetCurrSawingandSaw(nOperId, sSawing, sSaw)
' Setto l'utensile corrente
EgtTdbSetCurrTool(sSaw)
' recupero il colore della lavorazione direttamente dall'utensile
colCut = Utility.GetColorPV()
Else
colCut = COL_MCH_CUT()
End If
End If
For Each nId In vCutId
EgtSetColor(nId, colCut)
Next
+57 -32
View File
@@ -1,10 +1,10 @@
<UserControl x:Class="SplitPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized">
<!-- Definizione della SplitPage -->
<Grid Name="SplitPageGrid" >
@@ -64,24 +64,49 @@
</Grid.RowDefinitions>
<ListBox Name="MachiningLsBx" Grid.Row="1"
SelectionMode="Extended">
SelectionMode="Extended">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding bIsActive}" Value="False">
<Setter Property="TextDecorations" Value="Strikethrough"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding bIsActive}" Value="True">
<Setter Property="Foreground" Value="Black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Grid Width="210">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.8*"/>
<ColumnDefinition Width="1.2*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Name}">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding bIsActive}" Value="False">
<Setter Property="TextDecorations" Value="Strikethrough"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding bIsActive}" Value="True">
<Setter Property="Foreground" Value="Black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Grid.Column="1" Text="{Binding TCPos}">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding bIsActive}" Value="False">
<Setter Property="TextDecorations" Value="Strikethrough"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding bIsActive}" Value="True">
<Setter Property="Foreground" Value="Black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<Rectangle Grid.Column="2"
Visibility="{Binding MachiningTCPosVisibility}"
Style="{DynamicResource Rect_SplitPage}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
@@ -100,14 +125,14 @@
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
Height="25" Width="25">
<Image Name="LayNbArrImg"
HorizontalAlignment="Center"
VerticalAlignment="Center" Stretch="Uniform"/>
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
Height="25" Width="25">
<Image Name="LayNbArrImg"
HorizontalAlignment="Center"
VerticalAlignment="Center" Stretch="Uniform"/>
</ToggleButton>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
@@ -138,7 +163,7 @@
<Button Name="CutBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
@@ -152,17 +177,17 @@
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<!--solo per macchine con lavorazioni Waterjet-->
<!--solo per macchine con lavorazioni Waterjet-->
<Button Name="QualityWJBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource QualityWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesDeleteWJBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliDeleteWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</Grid>
+209 -6
View File
@@ -1,6 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.Drawing
Imports EgtUILib
Public Class SplitPageUC
@@ -206,28 +205,54 @@ Public Class SplitPageUC
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, MCH_OY.SAWING))
AddItemToList(i, Mach, sText, MCH_OY.SAWING)
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
Dim sText As String = EgtMsg(90792) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING))
AddItemToList(i, Mach, sText, MCH_OY.DRILLING)
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
Dim sText As String = EgtMsg(90793) & " " & i.ToString()
If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText)
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING))
AddItemToList(i, Mach, sText, MCH_OY.MILLING)
ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura
Dim sText As String = EgtMsg(90796) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING))
AddItemToList(i, Mach, sText, MCH_OY.POCKETING)
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet
Dim sText As String = EgtMsg(90797) & " " & i.ToString()
If Mach.m_bPause Then AddPauseText(sText)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING))
AddItemToList(i, Mach, sText, MCH_OY.WATERJETTING)
End If
Next
End Sub
Private Sub AddItemToList(i As Integer, Mach As SplitMach, sText As String, nMach As Integer)
Dim sTCPos As String = String.Empty
' Visualizzo la posizione utensile solo se configurata
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
Dim sSawing As String = String.Empty, sSaw As String = String.Empty
GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw)
' Verifico che sia montata su un portautensile
EgtTdbSetCurrTool(sSaw)
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
End If
' Se TCPos non trovato
If String.IsNullOrEmpty(sTCPos) Then
' Inserisco solo nome lavorazione
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach))
Else
' altrimenti se esiste una lama impostata nell'if sopra
Dim sawColor As Color3d = Utility.GetColorPV()
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B)
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach, sTCPos, New SolidColorBrush(tmpSawColor)))
End If
End Sub
#Region "BRIDGE"
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
@@ -470,6 +495,39 @@ Public Class SplitPageUC
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
If e.Button = Windows.Forms.MouseButtons.Right And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
Dim nCurrCtx As Integer = EgtGetCurrentContext()
Dim nSel1 As Integer = GDB_ID.NULL
Dim nPvId As Integer = GDB_ID.NULL
Dim nMchId As Integer = GDB_ID.NULL
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel1)
Dim nId1 As Integer = EgtGetFirstObjInSelWin()
While nId1 <> GDB_ID.NULL
' Verifico sia un attacco o uscita di taglio con lama
Dim nType As Integer = 0
Dim sName As String = ""
EgtGetName(nId1, sName)
nPvId = EgtGetParent(EgtGetParent(nId1))
nMchId = GDB_ID.NULL
If String.Compare(sName, NAME_PV_PRECUT) = 0 Or String.Compare(sName, NAME_PV_POSTCUT) = 0 Or String.Compare(sName, NAME_PV_CUT) = 0 Then
If EgtGetInfo(nPvId, "MId", nMchId) Then
Exit While
End If
End If
nId1 = EgtGetNextObjInSelWin()
End While
If nMchId = GDB_ID.NULL Then
GetCurrSelection()
Return
End If
ChangeMachinig(nMchId)
GetCurrSelection()
Return
End If
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
@@ -489,6 +547,7 @@ Public Class SplitPageUC
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
DeselectWJBridgesPart()
End If
GetCurrSelection()
Return
End If
@@ -497,6 +556,7 @@ Public Class SplitPageUC
OnMyMouseDownSceneBridgesDelete(sender, e)
' aggiorno la visualizzazione delle lavorazioni e la lista
RefreshMachList()
GetCurrSelection()
Return
End If
@@ -584,6 +644,88 @@ Public Class SplitPageUC
End If
MachiningLsBx.SelectedIndex = -1
End If
GetCurrSelection()
End Sub
Private Sub ChangeMachinig(nMchId As Integer)
' Imposto la lavorazione corrente
Dim sSawing As String = String.Empty
Dim EntId As Integer = GDB_ID.NULL
Dim SubEntId As Integer = GDB_ID.NULL
EgtSetCurrMachining(nMchId)
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return
' Recupero il nome della lavorazione
EgtGetInfo(EntId, DEF_MACHINING, sSawing)
' Apro pagina di selezione della lavorazione
Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow)
' Imposto nome lavorazione corrente
m_ChangeToolPage.CurrSawing = sSawing
' apro la finestra per la selezione delle lavorazioni
m_ChangeToolPage.ShowDialog()
' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto
If m_ChangeToolPage.DialogResult Then
EgtSetInfo(EntId, DEF_MACHINING, m_ChangeToolPage.NewSawing)
Dim Index As Integer = 0
For Index = 0 To m_MachiningList.Count() - 1
If m_MachiningList(Index).m_nId = nMchId Then
Exit For
End If
Next
Dim nNewMchId As Integer = -1
CamAuto.AddSawMachining(nMchId, nNewMchId)
' Elimino la numerazione e la freccia
EgtErase(m_MachiningList(Index).m_nArrId)
EgtErase(m_MachiningList(Index).m_nNbrId)
Dim Mach As New SplitMach
' Sostituisco la vecchia lavorazione con la nuova
If SplitAuto.CreateMach(Mach, nNewMchId) Then
' Assegno la lavorazione alla lista
m_MachiningList(Index) = Mach
' Riassegno la numerazione
NumberDirectionMachining(Index)
m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos
' Recupero il colore della lavorazione
Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor
Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B)
m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor)
m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible
EgtDraw()
End If
End If
End Sub
Public Sub GetCurrSawingandSaw(ByVal nMchId As Integer, ByRef sSawing As String, ByRef sNameTool As String)
Dim EntId As Integer = GDB_ID.NULL
Dim SubEntId As Integer = GDB_ID.NULL
EgtSetCurrMachining(nMchId)
If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return
' Eventualmente recupero il nome della lavorazione
EgtGetInfo(EntId, DEF_MACHINING, sSawing)
If String.IsNullOrEmpty(sSawing) Then sSawing = m_MainWindow.m_CurrentMachine.sCurrSawing
' Imposto la lavorazione corrente
EgtMdbSetCurrMachining(sSawing)
' Recupero il nome dell'utensile della lavorazione
EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool)
End Sub
' Dato l'id della lavorazione nel grezzo colora il taglio del colore assegnato
Public Sub ColorsCut(nOperId As Integer, EgtCol As Color3d)
' Recupero la lavorazione
Dim nPVRawId As Integer = EgtGetFirstNameInGroup(nOperId, "PV")
Dim nPVPartId As Integer = GDB_ID.NULL
EgtGetInfo(nPVRawId, "PvId", nPVPartId)
Dim nId2 As Integer = EgtGetFirstInGroup(EgtGetFirstInGroup(nPVPartId))
Dim sName As String = ""
EgtGetName(nId2, sName)
While nId2 <> GDB_ID.NULL
If String.Compare(sName, NAME_PV_CUT) = 0 Then
EgtSetColor(nId2, EgtCol)
Exit While
End If
nId2 = EgtGetNext(nId2)
End While
End Sub
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
@@ -764,6 +906,15 @@ Public Class SplitPageUC
OnOffCut()
End Sub
Private Sub MachiningLsBx_MouseRightButtonDown(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.PreviewMouseRightButtonDown
' se disabilitata la modifica allora esco
If m_bShow Then Return
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
Dim Index As Integer = MachiningLsBx.SelectedIndex
If Index = -1 Then Return
ChangeMachinig(m_MachiningList(Index).m_nId)
End Sub
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
MoveItem(-1)
End Sub
@@ -2666,6 +2817,10 @@ Public Class SplitPageUC
Private m_sName As String
Private m_bIsActive As Boolean
Private m_nType As Integer
' Posizione porta utensile (parametro non obbligatorio)
Private m_sTCPos As String = ""
Private m_cSawColor As SolidColorBrush
Private m_bMachiningTCPosVisibility As Visibility = Visibility.Hidden
Private m_IsSelected As Boolean
@@ -2690,6 +2845,31 @@ Public Class SplitPageUC
End Set
End Property
'!!!!!!!!!!!!!!!!!!!!
Public Property TCPos As String
Get
Return m_sTCPos
End Get
Set(value As String)
If value <> m_sTCPos Then
m_sTCPos = value
NotifyPropertyChanged("TCPos")
End If
End Set
End Property
'!!!!!!!!!!!!!!!!!!!!
Public Property SawColor As SolidColorBrush
Get
Return m_cSawColor
End Get
Set(value As SolidColorBrush)
m_cSawColor = value
NotifyPropertyChanged("SawColor")
End Set
End Property
Public Property bIsActive As Boolean
Get
Return m_bIsActive
@@ -2720,11 +2900,34 @@ Public Class SplitPageUC
End Set
End Property
Public Property MachiningTCPosVisibility As Visibility
Get
Return m_bMachiningTCPosVisibility
End Get
Set(value As Visibility)
If value <> m_bMachiningTCPosVisibility Then
m_bMachiningTCPosVisibility = value
NotifyPropertyChanged("MachiningTCPosVisibility")
End If
End Set
End Property
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer)
Me.m_sName = Name
Me.m_nInd = Ind
Me.m_bIsActive = bIsActive
Me.m_nType = nType
Me.m_bMachiningTCPosVisibility = Visibility.Hidden
End Sub
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String, cSawColor As SolidColorBrush)
Me.m_sName = Name
Me.m_nInd = Ind
Me.m_bIsActive = bIsActive
Me.m_nType = nType
Me.m_sTCPos = sTCPos
Me.m_cSawColor = cSawColor
Me.m_bMachiningTCPosVisibility = Visibility.Visible
End Sub
Public Sub NotifyPropertyChanged(propName As String)
+2
View File
@@ -324,6 +324,8 @@ Module ConstGen
Public Const INFO_START As String = "Start"
' Nome dei tagli diretti inseriti in fase di Splitting
Public Const SPLIT_CUT As String = "SplitCut"
' Forzo specifica lavorazione
Public Const DEF_MACHINING As String = "Def_Machining"
' Nome di pezzo che è una cornice
Public Const NAME_FRAME As String = "Frame"
+5
View File
@@ -90,6 +90,7 @@ Module ConstIni
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine"
Public Const K_ORTOGRAPHIC As String = "OrtoGraphic"
Public Const S_ALZFRONT As String = "Alz&Front"
Public Const K_ALZFRONT As String = "Alz&Front"
@@ -211,6 +212,7 @@ Module ConstIni
Public Const K_OFFSXY As String = "OffsXY"
Public Const K_OFFSYY As String = "OffsYY"
Public Const K_OFFSXINTERY As String = "OffsYInterY"
Public Const K_OFFSXINTERYSAWTH As String = "OffsYInterYSawTh"
Public Const K_STARTTRIM As String = "StartTrim"
Public Const K_ENDTRIM As String = "EndTrim"
Public Const K_OTHERSIDE As String = "OtherSide"
@@ -235,10 +237,13 @@ Module ConstIni
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
Public Const K_REFTAB As String = "RefTab"
Public Const K_CURRENTREFTAB As String = "CurrRefTab"
Public Const S_RAWMOVE As String = "RawMove"
Public Const K_RAWSTEP As String = "Step"
Public Const K_EXTRASTEP As String = "ExtraStep"
Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular"
+5
View File
@@ -32,6 +32,7 @@
Public Const K_A10ID As String = "A10Id"
Public Const K_DELTA_C As String = "DeltaC"
Public Const K_ININCHES As String = "InInches"
Public Const K_CPOS As String = "CPos"
Public Const S_NCSIEMENS As String = "NcSiemens"
Public Const K_COMM_NAME As String = "CommName"
@@ -185,6 +186,7 @@
Public Const K_CAMERA_DIRECT_CMD As String = "CameraDirectCmd"
Public Const K_CAMERA_STATE_VAR As String = "CameraStateVar"
Public Const K_ENABELE_GOHOME_FOR_PHOTO As String = "EnableGoHomeForPhoto"
Public Const K_PENDIG_TIME_FOR_PHOTO As String = "PendigTimeForPhoto"
Public Const S_TOOLS As String = "Tools"
Public Const K_DRILLBIT As String = "Drillbit"
@@ -311,6 +313,7 @@
Public Const S_MACH_MACH As String = "Mach"
Public Const K_CURRSAW As String = "CurrSaw"
Public Const K_CURRSAWTILTED As String = "CurrSawTilted"
Public Const K_CURRDRILL As String = "CurrDrill"
Public Const K_CURRMILL As String = "CurrMill"
Public Const K_CURRMILLNOTIP As String = "CurrMillNoTip"
@@ -318,6 +321,8 @@
Public Const K_CURRDRIPDRILL As String = "CurrDripDrill"
Public Const K_CURRWATERJET As String = "CurrWaterJet"
Public Const K_CURRSAWING As String = "CurrSawing"
Public Const K_CURRSAWINGTILTED As String = "CurrSawingTilted"
Public Const K_APPLYSAWINGTILTED As String = "ApplySawingTilted"
Public Const K_CURRDRILLING As String = "CurrDrilling"
Public Const K_CURRMILLING As String = "CurrMilling"
Public Const K_CURRPOCKETING As String = "CurrPocketing"
-1
View File
@@ -53,7 +53,6 @@ Public Class ControlsDirectCutUC
FlatteningCut
Polishing
CopyTemplate
SawTest
SingleCutAuto
SingleDrill
Squaring
+1 -1
View File
@@ -482,7 +482,7 @@ Public Class DirectCutPageUC
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
' Imposto modalità manuale della macchina
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
Dim nResult As Short = m_MainWindow.m_DirectCutPageUC.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
End Sub
+7 -3
View File
@@ -350,6 +350,7 @@ Public Class SquaringUC
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(If(nType = MCH_TY.SAW_STD, MCH_TP.THICK, MCH_TP.DIAM), dThick)
EgtOutLog("Curr tool type in use for squaring: " & If(nType = MCH_TY.SAW_STD, "SAW_STD", "NOT 'SAW_STD'"))
' Ricalcolo lo spessore in base all'inclinazione
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
@@ -367,9 +368,12 @@ Public Class SquaringUC
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
' Imposto affondamento e angolo di fianco sul taglio (solo se non lama STD)
If Not nType = MCH_TY.SAW_STD Then
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
EgtOutLog("Curr tool in use is not of type SAW_STD: Depth is limited to raw thickness")
End If
' Allungo la geometria
EgtExtendCurveStartByLen(nCutParaId, m_dOffsetSquaring + m_dExtraLength)
EgtExtendCurveEndByLen(nCutParaId, m_dOffsetSquaring + +m_dExtraLength)
+2 -4
View File
@@ -1174,7 +1174,6 @@ Public Class DrawPageUC
If m_ActiveComponentPage = Pages.CompoDimension And m_bInternalCompo Then Return
' Se errore esco
If Not m_bDrawOk Then Return
' Nome pezzo
Dim sPartName As String = PartNameTxBx.Text
' Leggo numero di pezzi da inserire
@@ -1186,6 +1185,8 @@ Public Class DrawPageUC
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
' Attivo il parcheggio dei pezzi Draw (per il corretto posizionamento nella scena)
ActivateParkIndZero()
Dim bExitPage As Boolean = GetPrivateProfileInt(S_GENERAL, K_QUITDRAWPAGE, 1, m_MainWindow.GetIniFile) <> 0
' Se Shift premuto eseguo il contrario
If Keyboard.Modifiers And ModifierKeys.Shift Then
@@ -1206,9 +1207,6 @@ Public Class DrawPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
' Attivo il parcheggio dei pezzi Draw
ActivateParkIndZero()
Else
m_SceneButtons.MeasureBtn.IsChecked = False
DrawPage_Unloaded(sender, e)
+4 -3
View File
@@ -1074,8 +1074,9 @@ Public Class ImportPageUC
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
Dim x As Double = GlobBBox.DimX
Dim Y As Double = GlobBBox.DimY
Dim DimX As Double = GlobBBox.DimX
Dim DimY As Double = GlobBBox.DimY
Dim BBoxMaxPt As Point3d = GlobBBox.Max
' Ciclo sui pezzi inseriti
nId = nFirstId
@@ -1114,7 +1115,7 @@ Public Class ImportPageUC
' Inserisco in parcheggio
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Mantengo la posizione relativa tra i pezzi
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, x, Y)
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, DimX, DimY, BBoxMaxPt)
Else
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
End If
+4
View File
@@ -226,6 +226,10 @@ Module SideAngle
EgtSetInfo(EntId, INFO_SIDE_ANGLE, dAng)
EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng)
EgtSetInfo(EntId, INFO_HEEL, dHeel)
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
If Not String.IsNullOrEmpty(sSawingTilted) Then
EgtSetInfo(EntId, DEF_MACHINING, sSawingTilted)
End If
End If
End If
End If
+6 -1
View File
@@ -1303,10 +1303,15 @@ Public Class SideAngleUC
If dSideAngle <> 0 Then
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
' Cancello inclinazione nell'apposito campo info
Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted
If Not String.IsNullOrEmpty(sSawingTilted) Then
EgtSetInfo(CurrEntity.nGeomId, DEF_MACHINING, sSawingTilted)
End If
' Cancello inclinazione nell'apposito campo info
Else
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
EgtRemoveInfo(CurrEntity.nGeomId, DEF_MACHINING)
End If
' Aggiorno lista entità con nuova inclinazione
CurrEntity.dSideAngle = dSideAngle
+13 -4
View File
@@ -123,10 +123,19 @@
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="OffsXInteryTxBl" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<CheckBox Name="UseInteraxisChBx" Grid.Row="7" Grid.Column="1" Height="30" Width="40" HorizontalAlignment="Right"
Margin="-20,0,0,0"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}" IsEnabled="{Binding ElementName=UseInteraxisChBx, Path=IsChecked}"/>
</Grid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
+33 -4
View File
@@ -54,6 +54,8 @@ Public Class FrameCutPageUC
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
Dim bOffsYInterYSawTh As Boolean = False
UseInteraxisChBx.IsChecked = (GetPrivateProfileInt(S_FRAME, K_OFFSXINTERYSAWTH, 0, m_MainWindow.GetIniFile()) <> 1)
' Imposto i messaggi letti dal file dei messaggi
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
@@ -73,6 +75,17 @@ Public Class FrameCutPageUC
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
Dim sItems As String() = sChBxToolTip.Split("£")
For Index As Integer = 0 To sItems.Count - 1
If Index = 0 Then
sChBxToolTip = sItems(Index).Trim
Else
sChBxToolTip &= vbCrLf & sItems(Index).Trim
End If
Next
UseInteraxisChBx.ToolTip = sChBxToolTip
End Sub
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -280,7 +293,7 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed, UseInteraxisChBx.Click
' Forzo aggiornamento grezzo nella pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
' Parcheggio pezzi presenti nel grezzo
@@ -312,6 +325,11 @@ Public Class FrameCutPageUC
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
End If
Dim sUseInteraxis As String = "1"
If UseInteraxisChBx.IsChecked Then
sUseInteraxis = "0"
End If
WritePrivateProfileString(S_FRAME, K_OFFSXINTERYSAWTH, sUseInteraxis, m_MainWindow.GetIniFile())
End Sub
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
@@ -963,11 +981,22 @@ Public Class FrameCutPageUC
StringToLen(OffsXInteryTxBx.Text, dOffsXIntery)
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
If dOffsXIntery <= dSawThick Then
dMinDist = dSawThick + 5 * EPS_SMALL
If UseInteraxisChBx.IsChecked Then
If dOffsXIntery < 0 Then
dMinDist = 5 * EPS_SMALL
OffsXInteryTxBx.Text = "0"
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
End If
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
dMinDist = dSawThick + 5 * EPS_SMALL
End If
'If dOffsXIntery <= dSawThick Then
' dMinDist = dSawThick + 5 * EPS_SMALL
' EgtOutLog("WARNINGS: Saw tickness is more width then interaxis")
'Else
' dMinDist = dOffsXIntery + 5 * EPS_SMALL
'End If
Else
EgtOutLog("Not found current saw for frames mindist")
dMinDist = dOffsXIntery
+537 -517
View File
File diff suppressed because it is too large Load Diff
+108 -2
View File
@@ -57,6 +57,7 @@ Public Class AlarmsPageUC
' Imposto i messaggi letti dal file dei messaggi
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
CurrSawTiltedTxBl.Text = EgtMsg(91049) ' Current saw tilted
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
CurrDrillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 3)
CurrCupWheelTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 20)
@@ -120,6 +121,7 @@ Public Class AlarmsPageUC
CfrPercTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 48) ' Riduzione %
MachiningsGpBx.Header = EgtMsg(MSG_ALARMS2PAGEUC + 1) ' Lavorazioni
CurrSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 2) ' Taglio lama
CurrSawingTiltedTxBl.Text = EgtMsg(91050) ' Taglio inclinato
CurrDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 3) ' Foratura
CurrMillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 4) ' Fresatura
CurrPocketingTxBl.Text = EgtMsg(91069) ' Svuotatura
@@ -159,7 +161,7 @@ Public Class AlarmsPageUC
HolesGpBx.Visibility = Windows.Visibility.Hidden
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
'Non faccio alcunchè
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
'Da implementare
End Select
@@ -292,6 +294,59 @@ Public Class AlarmsPageUC
' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio
SetUpBtn.Visibility = Windows.Visibility.Visible
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
' Aggiorno la lista delle lame con quelle montate sul portautensile automatico
Dim m_SawOnHolderList As New ObservableCollection(Of String)
Dim bOnHolder As Boolean = False
For Each sNameTool As String In m_SawList
If Not String.IsNullOrEmpty(sNameTool) Then
' Verifico che sia montata su un portautensile
EgtTdbSetCurrTool(sNameTool)
Dim sTCPos As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
If Not String.IsNullOrEmpty(sTCPos) Then
' Cerco nel porta utensili automaitico
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If sNameTool = ToolPosition.sTool Then
m_SawOnHolderList.Add(sNameTool)
' Se il nome dell'utensile è lo stesso di quello impostato nella combo allora lo setto
If sNameTool = m_CurrentMachine.sCurrSaw Then
bOnHolder = True
End If
Exit For
End If
End If
Next
End If
End If
Next
m_SawList = m_SawOnHolderList
CurrSawCmBx.ItemsSource = m_SawList
If bOnHolder Then
' reimposto la lavorazione di lama e la lama impostate in macchina
EgtTdbSetCurrTool(m_CurrentMachine.sCurrSaw)
' Seleziono lama corrente
CurrSawCmBx.SelectedItem = m_CurrentMachine.sCurrSaw
Else
m_CurrentMachine.sCurrSawing = ""
End If
CurrSawTiltedCmBx.ItemsSource = m_SawList
If m_SawList.IndexOf(m_CurrentMachine.sCurrSawTilted) > -1 Then
' Seleziono lama corrente
CurrSawTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawTilted
Else
m_CurrentMachine.sCurrSawingTilted = ""
End If
' attivo la selezione della lama per il taglio in inlinato
CurrSawTiltedTxBl.Visibility = Visibility.Visible
CurrSawTiltedCmBx.Visibility = Visibility.Visible
' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio
SetUpBtn.Visibility = Windows.Visibility.Visible
End Select
' aggiorno le TextBlock con le lavorazioni correnti
@@ -441,6 +496,21 @@ Public Class AlarmsPageUC
CurrSawingTxBl.Visibility = Windows.Visibility.Hidden
CurrSawingTxBx.Visibility = Windows.Visibility.Hidden
End If
If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then
If Not m_CurrentMachine.bApplySawingTilted Then
CurrSawingTiltedTxBx.Foreground = Brushes.Gray
CurrSawingTiltedTxBx.TextDecorations = TextDecorations.Strikethrough
Else
CurrSawingTiltedTxBx.Foreground = Brushes.White
CurrSawingTiltedTxBx.TextDecorations = Nothing
End If
CurrSawingTiltedTxBx.Text = m_CurrentMachine.sCurrSawingTilted
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible
CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Visible
Else
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden
CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Hidden
End If
If m_CurrentMachine.sCurrDrilling <> String.Empty Then
CurrDrillingTxBx.Text = m_CurrentMachine.sCurrDrilling
CurrDrillingTxBl.Visibility = Windows.Visibility.Visible
@@ -641,6 +711,42 @@ Public Class AlarmsPageUC
RefreschMachining()
End Sub
' -- SAW TILTED --
Private Sub CurrSawTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawTiltedCmBx.SelectionChanged
If IsNothing(CurrSawTiltedCmBx.SelectedItem) Then Return
' Assegno
m_CurrentMachine.sCurrSawTilted = CurrSawTiltedCmBx.SelectedItem.ToString()
' Se nuova lama incompatibile con lavorazione di taglio corrente, resetto quest'ultima
Dim sMchTuuid As String = String.Empty
Dim sMchTool As String = String.Empty
If Not EgtMdbSetCurrMachining(m_CurrentMachine.sCurrSawingTilted) Or
Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sMchTuuid) Or
Not EgtTdbGetToolFromUUID(sMchTuuid, sMchTool) Or
String.Compare(sMchTool, m_CurrentMachine.sCurrSawTilted, True) <> 0 Then
m_CurrentMachine.sCurrSawingTilted = String.Empty
End If
' Dim sVal As String = String.Empty
' Dim dVal As Double = 0
' If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevLength(dVal)
' End If
' If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevPerc(dVal)
' End If
'
' ' Leggo parametri per variazione feed in tagli aggiornati in funzione della lama
' CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
' CfrPercTxBx.Text = DoubleToString(m_CurrentMachine.dFsevPerc, 0)
' Aggiorno utensili per lavoro in corso
m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
' aggiorno la lista delle lavorazioni
RefreschMachining()
End Sub
' -- DRILL --
Private Sub CurrDrillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillCmBx.SelectionChanged
If IsNothing(CurrDrillCmBx.SelectedItem) Then Return
@@ -1375,7 +1481,7 @@ Public Class AlarmsPageUC
Select Case m_CurrentMachine.MountedToolConfig
Case CurrentMachine.MountedToolConfigs.SAW
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
If ChooseTool.ShowDialog Then
Return ChooseTool.GetSelectedTool
+12
View File
@@ -76,6 +76,18 @@ Public Class ChooseToolWD
End If
Next
Return True
Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
End If
Next
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
End If
Next
Return True
Case Else
Return False
End Select
+66 -12
View File
@@ -107,6 +107,7 @@ Public Class CurrentMachine
' Variabili che contengono il nome degli utensili disponibili per tipo
Private m_sCurrSaw As String = String.Empty
Private m_sCurrSawTilted As String = String.Empty
Private m_sCurrDrill As String = String.Empty
Private m_sCurrMill As String = String.Empty
Private m_sCurrMillNoTip As String = String.Empty
@@ -116,6 +117,8 @@ Public Class CurrentMachine
' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
Private m_sCurrSawing As String = String.Empty
Private m_sCurrSawingTilted As String = String.Empty
Private m_bApplySawingTilted As Boolean = False
Private m_sCurrDrilling As String = String.Empty
Private m_sCurrMilling As String = String.Empty
Private m_sCurrPocketing As String = String.Empty
@@ -193,6 +196,7 @@ Public Class CurrentMachine
SAWANDAUXTOOL = 1
MANUALTOOLCHANGER = 2
TOOLCHANGER = 3
TOOLCHANGERWITHSAW = 4
End Enum
' Massimo numero di utensili su Tc
@@ -204,6 +208,9 @@ Public Class CurrentMachine
' Massima profondità lavorabile nei tagli diretti
Private m_MaxTabDepth As Double = 10.0
' Massima altezza lavorabile con lama grande
Private m_dHighPieceZ As Double = 200.0
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
Friend ReadOnly Property MaxTabDepth As Double
Get
@@ -570,6 +577,18 @@ Public Class CurrentMachine
End Set
End Property
Friend Property sCurrSawTilted As String
Get
Return m_sCurrSawTilted
End Get
Set(value As String)
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, value, sMachIniFile) Then
m_sCurrSawTilted = value
' m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
End If
End Set
End Property
Friend Property sCurrDrill As String
Get
Return m_sCurrDrill
@@ -644,18 +663,32 @@ Public Class CurrentMachine
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
m_sCurrSawing = value
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
'' aggiorno il file ini della macchina con i valori correnti della lavorazione
'Dim sVal As String = String.Empty
'Dim dVal As Double = m_dFsevLength
'If GetUserNote("FsevLength", sVal, m_sCurrSawing, False) Then
' StringToDouble(sVal, dVal)
' SetFsevLength(dVal)
'End If
'dVal = m_dFsevPerc
'If GetUserNote("FsevPerc", sVal, m_sCurrSawing, False) Then
' StringToDouble(sVal, m_dFsevPerc)
' SetFsevPerc(dVal)
'End If
End If
End Set
End Property
Friend Property sCurrSawingTilted As String
Get
Return m_sCurrSawingTilted
End Get
Set(value As String)
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, value, sMachIniFile) Then
m_sCurrSawingTilted = value
'm_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
End If
End Set
End Property
Friend Property bApplySawingTilted As Boolean
Get
Return m_bApplySawingTilted
End Get
Set(value As Boolean)
m_bApplySawingTilted = value
If m_bApplySawingTilted Then
WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "1", sMachIniFile)
Else
WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "0", sMachIniFile)
End If
End Set
End Property
@@ -1149,6 +1182,12 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property dHighPieceZ As Double
Get
Return m_dHighPieceZ
End Get
End Property
#End Region
Sub New()
@@ -1264,6 +1303,14 @@ Public Class CurrentMachine
' Leggo utensili correnti
' lama
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile)
' lama inclinata
If m_nShowToolChanger = 4 Then
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, Nothing, m_sCurrSawTilted, sMachIniFile)
Else
' se non è configurato il cambio utensile e allora imposto l'unica lama disponibile per i tagli inclinati
m_sCurrSawTilted = m_sCurrSaw
End If
' foretto
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile)
' fresa
@@ -1280,6 +1327,10 @@ Public Class CurrentMachine
' Leggo lavorazioni correnti
' lama
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile)
' lama inlicnata
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, Nothing, m_sCurrSawingTilted, sMachIniFile)
' applica lavorazione di lama inclinata
m_bApplySawingTilted = (GetPrivateProfileInt(S_MACH_MACH, K_APPLYSAWINGTILTED, 0, sMachIniFile) <> 0)
' foretto
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile)
' fresa
@@ -1417,6 +1468,9 @@ Public Class CurrentMachine
If m_MaxTabDepth < 0 Then
m_MaxTabDepth = 10.0
End If
' Massimo spessore lavorabile con lama grande
m_dHighPieceZ = GetPrivateProfileDouble(S_RAWMOVE, "MaxHeightPiece", 800.0, m_MainWindow.GetMachIniFile())
End Sub
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
+2
View File
@@ -298,6 +298,8 @@ Public Class MachinePageUC
WaterJetBtn.IsChecked = False
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
MachinePageGrid.Children.Add(m_MachiningDbPageUC)
' Aggiorno lista materiali
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
m_ActiveMachinePage = MachinePages.MachiningDb
Case MachinePages.MachineCN
MachiningDBBtn.IsChecked = True
+10 -6
View File
@@ -279,12 +279,16 @@ Public Class MachineStatusUC
Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dRealFeed = m_CN.d_DInterpo_Prog_Feed
Else
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
End If
'' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta (lettura feed per CN Fanuc)
'If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
' dRealFeed = m_CN.d_DInterpo_Prog_Feed
'Else
' dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'End If
' modifica richiesta 24/03/2025 da Fabio per cliente Frigerio
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
+90 -37
View File
@@ -3,6 +3,8 @@ Imports System.ComponentModel
Imports OmagCUT.TreeViewItem
Imports EgtUILib
Imports EgtWPFLib
Imports EgtWPFLib5
Imports FXServer
Public Class SetUpPage
@@ -13,6 +15,7 @@ Public Class SetUpPage
Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
Private m_ToolTreeList As New ObservableCollection(Of CathegoryItem)
Private m_SawsList As CathegoryItem
Private m_DrillbitsList As CathegoryItem
Private m_MillsList As CathegoryItem
Private m_CupsList As CathegoryItem
@@ -26,10 +29,10 @@ Public Class SetUpPage
' Assegno la lista utensili come sorgente dell'albero
ToolTree.ItemsSource = m_ToolTreeList
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
'' Cambio utensile macchina
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
Dim ColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ToolChangerNbr / 5.0))
Dim ColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ToolChangerNbr / 5.0))
If ColNum > 12 Then
EgtOutLog("TC warning : too many tools (max 12 * 5)")
ColNum = 12
@@ -59,11 +62,11 @@ Public Class SetUpPage
'' Cambio utensile manuale
' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina
Dim ManColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ManualToolChangerNbr / 5.0))
If ManColNum > 12 Then
EgtOutLog("ManTC warning : too many tools (max 12 * 5)")
ManColNum = 12
End If
Dim ManColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ManualToolChangerNbr / 5.0))
If ManColNum > 12 Then
EgtOutLog("ManTC warning : too many tools (max 12 * 5)")
ManColNum = 12
End If
For Index As Integer = 12 To ManColNum + 1 Step -1
For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1
ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index2))
@@ -85,7 +88,7 @@ Public Class SetUpPage
Next
' Se portautensili della macchina presente
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
' Apro quello
TlChScVw.Visibility = Windows.Visibility.Visible
ToolChangerBtn.IsChecked = True
@@ -106,15 +109,25 @@ Public Class SetUpPage
Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Inizializzo le famiglie di utensili nell'albero
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
InitializeToolGroup( m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg( 90752), m_DrillbitsList)
InitializeToolGroup( m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg( 90753), m_MillsList)
InitializeToolGroup( m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg( 90754), m_CupsList)
InitializeToolGroup( m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg( 90756), m_PolishingsList)
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then InitializeToolGroup(m_CurrMachine.bSaw, MCH_TY.SAW_STD, EgtMsg(90751), m_SawsList)
InitializeToolGroup(m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg(90752), m_DrillbitsList)
InitializeToolGroup(m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg(90753), m_MillsList)
InitializeToolGroup(m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg(90754), m_CupsList)
InitializeToolGroup(m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg(90756), m_PolishingsList)
' Posiziono utensili già posizionati sul portautensili
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If Not IsNothing( m_DrillbitsList) Then
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso Not IsNothing(m_SawsList) Then
For Each Item As CustomItem In m_SawsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
m_SawsList.Items.Remove(Item)
Exit For
End If
Next
End If
If Not IsNothing(m_DrillbitsList) Then
For Each Item As CustomItem In m_DrillbitsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -123,7 +136,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_MillsList) Then
If Not IsNothing(m_MillsList) Then
For Each Item As CustomItem In m_MillsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -132,7 +145,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_CupsList) Then
If Not IsNothing(m_CupsList) Then
For Each Item As CustomItem In m_CupsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -141,7 +154,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_PolishingsList) Then
If Not IsNothing(m_PolishingsList) Then
For Each Item As CustomItem In m_PolishingsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -158,7 +171,7 @@ Public Class SetUpPage
' Posiziono utensili già posizionati sul portautensili manuale
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger
If ToolPosition.sTool <> String.Empty Then
If Not IsNothing( m_DrillbitsList) Then
If Not IsNothing(m_DrillbitsList) Then
For Each Item As CustomItem In m_DrillbitsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -167,7 +180,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_MillsList) Then
If Not IsNothing(m_MillsList) Then
For Each Item As CustomItem In m_MillsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -176,7 +189,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_CupsList) Then
If Not IsNothing(m_CupsList) Then
For Each Item As CustomItem In m_CupsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -185,7 +198,7 @@ Public Class SetUpPage
End If
Next
End If
If Not IsNothing( m_PolishingsList) Then
If Not IsNothing(m_PolishingsList) Then
For Each Item As CustomItem In m_PolishingsList.Items
If Item.Name = ToolPosition.sTool Then
m_SetUpToolsList.Items.Add(Item)
@@ -710,16 +723,16 @@ Public Class SetUpPage
End Function
' Funzione che carica gli utensili del Db nell'albero
Friend Sub InitializeToolGroup( bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem)
If Not bEnabled Then Return
' Inserisco categoria ed eventuali elementi
ToolCathegory = New CathegoryItem( sFName, nTType)
ToolCathegory = New CathegoryItem(sFName, nTType)
Dim nType As Integer = 0
Dim ToolName As String = String.Empty
Dim bFound As Boolean = EgtTdbGetFirstTool( nTType, ToolName, nType)
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
While bFound
If nType = nTType Then ToolCathegory.Items.Add( New CustomItem( ToolName, nType))
bFound = EgtTdbGetNextTool( nTType, ToolName, nType)
If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
End While
m_ToolTreeList.Add(ToolCathegory)
End Sub
@@ -761,7 +774,7 @@ Public Class SetUpPage
ToolHolderClicked.Tool.IsChecked = False
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
End If
' altrimenti da levare
' altrimenti da levare
Else
RestoreToolInList(GetTxBxFromTlChPos(ToolHolderClicked.Name).Text)
GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty
@@ -771,14 +784,17 @@ Public Class SetUpPage
' Funzione che rimuove l'utensile selezionato dall'albero
Private Sub RemoveToolFromList()
If Not IsNothing( m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains( ToolTree.SelectedItem) Then
m_DrillbitsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_MillsList) AndAlso m_MillsList.Items.Contains( ToolTree.SelectedItem) Then
m_MillsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_CupsList) AndAlso m_CupsList.Items.Contains( ToolTree.SelectedItem) Then
m_CupsList.Items.Remove( ToolTree.SelectedItem)
ElseIf Not IsNothing( m_PolishingsList) AndAlso m_PolishingsList.Items.Contains( ToolTree.SelectedItem) Then
m_PolishingsList.Items.Remove( ToolTree.SelectedItem)
If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso
Not IsNothing(m_SawsList) AndAlso m_SawsList.Items.Contains(ToolTree.SelectedItem) Then
m_SawsList.Items.Remove(ToolTree.SelectedItem)
ElseIf Not IsNothing(m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains(ToolTree.SelectedItem) Then
m_DrillbitsList.Items.Remove(ToolTree.SelectedItem)
ElseIf Not IsNothing(m_MillsList) AndAlso m_MillsList.Items.Contains(ToolTree.SelectedItem) Then
m_MillsList.Items.Remove(ToolTree.SelectedItem)
ElseIf Not IsNothing(m_CupsList) AndAlso m_CupsList.Items.Contains(ToolTree.SelectedItem) Then
m_CupsList.Items.Remove(ToolTree.SelectedItem)
ElseIf Not IsNothing(m_PolishingsList) AndAlso m_PolishingsList.Items.Contains(ToolTree.SelectedItem) Then
m_PolishingsList.Items.Remove(ToolTree.SelectedItem)
End If
End Sub
@@ -786,7 +802,9 @@ Public Class SetUpPage
Private Sub RestoreToolInList(sToolName As String)
For Each Tool As CustomItem In m_SetUpToolsList.Items
If Tool.Name = sToolName Then
If Tool.nType = MCH_TY.DRILL_STD Then
If Tool.nType = MCH_TY.SAW_STD Then
m_SawsList.Items.Add(Tool)
ElseIf Tool.nType = MCH_TY.DRILL_STD Then
m_DrillbitsList.Items.Add(Tool)
ElseIf Tool.nType = MCH_TY.MILL_STD Then
m_MillsList.Items.Add(Tool)
@@ -1084,6 +1102,39 @@ Public Class SetUpPage
EgtTdbSave()
End Sub
' Funzione che genera il file di setup corrente (per Cam5 e Office)
Private Sub SaveSetUpFile()
If m_CurrMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return
Dim sContentFile As String = "; this file has been created by program OmagCUT by current setup" & vbCrLf
sContentFile &= "[General]" & vbCrLf
For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger
Dim sToolName As String = ToolPosition.sTool
Dim sPositionName As String = ToolPosition.sName
Dim sPosition As Integer = ToolPosition.nPosition
If Not String.IsNullOrEmpty(sToolName) Then
EgtTdbSetCurrTool(sToolName)
' Recupero l'uscita
Dim nExit As Integer = 1
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExit)
' Recupero la testa
Dim sHead As String = ""
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sHead)
' Recupero nome file nge dell'utensile
Dim sUUID As String = ""
EgtTdbGetCurrToolParam(MCH_TP.UUID, sUUID)
'local sRaw='Pos'..tostring(Index)..'='..TcPos..';'..EgtTdbGetCurrToolParam( MCH_TP.HEAD)..';'..EgtTdbGetCurrToolParam( MCH_TP.EXIT)..'/'..EgtTdbGetCurrToolParam( MCH_TP.UUID)..'/'..ToolName
sContentFile &= "Pos" & sPosition.ToString & "=" & sPositionName & ";" & sHead & ";" & nExit.ToString & "/" & sUUID & "/" & sToolName & vbCrLf
End If
Next
' Apro il file e lo sovrascrivo
Dim sFileOmagCutSetUp As String = m_CurrMachine.sMachDir & "\SetUp\CurrOmagCUT.stu"
Try
My.Computer.FileSystem.WriteAllText(sFileOmagCutSetUp, sContentFile, False)
Catch ex As Exception
EgtOutLog("Error in creatinf file CurrOmagCUT.stu: " & ex.ToString)
End Try
End Sub
' Evento che permette di aprire le cartelle degli utensili con un click singolo
Private Sub ToolTree_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseUp
If TypeOf ToolTree.SelectedItem Is CathegoryItem Then
@@ -1095,6 +1146,8 @@ Public Class SetUpPage
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
' Eseguo salvataggio (DB utensili + attrezzaggio)
SaveToolChangerStatus()
' Salvo nel file di setup l'attuale configurazione
SaveSetUpFile()
' Esco
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC)
m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me)
@@ -1131,7 +1184,7 @@ Public Class SetUpPage
RemoveToolFromList()
Else
' Altrimenti segnalo che la posizione è già occupata
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
End If
Return
End If
@@ -1149,7 +1202,7 @@ Public Class SetUpPage
RemoveToolFromList()
Else
' Altrimenti segnalo che la posizione è già occupata
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION)
End If
Return
End If
+1 -1
View File
@@ -18,7 +18,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Fill" TargetName="Ellipse" Value="#FFB4B4B4"/>
<Setter Property="Fill" TargetName="Ellipse" Value="#414141"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
+69 -38
View File
@@ -1,12 +1,12 @@
<UserControl x:Class="ToolsDbPageUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1280" Initialized="ToolsDbPage_Initialized" Loaded="ToolsDbPage_Loaded">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1280" Initialized="ToolsDbPage_Initialized" Loaded="ToolsDbPage_Loaded">
<!-- Definizione della ImportPage -->
<Border Style="{DynamicResource OmagCut_PageBorder}">
@@ -24,7 +24,7 @@
<TreeView Name="ToolTreeView" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}" >
<TreeView.Resources>
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
<!--renderlo apribile con un solo click -->
<HierarchicalDataTemplate DataType="{x:Type self:CathegoryItem}" ItemsSource="{Binding Items}">
@@ -224,12 +224,12 @@
</Grid.RowDefinitions>
<TextBlock Name="NameTxBl" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="NameTxBx" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
<Border Name="TCPosBrd" Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="3"
BorderThickness="0" BorderBrush="Black" CornerRadius="3">
BorderThickness="0" BorderBrush="Black" CornerRadius="3">
<Grid>
<Grid.ColumnDefinitions>
@@ -237,17 +237,27 @@
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="TCPosTxBl" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<TextBlock Name="TCPosTxBl" Grid.Column="0">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
<Setter Property="Margin" Value="10,0,0,0"/>
<Style.Triggers>
<Trigger Property="ToolTip" Value="">
<Setter Property="ToolTipService.IsEnabled" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<EgtWPFLib:EgtTextBox Name="TCPosTxBx" Grid.Column="1" Grid.Row="0" Margin="0,0,15,0"
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
Style="{DynamicResource OmagCut_KeyboardTextBox}" />
</Grid>
</Border>
<Border Name="HeadExitBrd" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="4" Grid.RowSpan="3"
Style="{DynamicResource OmagCut_NoNameGroupBorder}">
Style="{DynamicResource OmagCut_NoNameGroupBorder}">
<Grid>
<Grid.ColumnDefinitions>
@@ -259,18 +269,18 @@
<TextBlock Name="HeadTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="HeadTxBx" Grid.Column="1"
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />
<TextBlock Name="ExitTxBl" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ExitTxBx" Grid.Column="3"
Style="{DynamicResource OmagCut_RightCalculatorTextBoxInBorder}" />
Style="{DynamicResource OmagCut_RightCalculatorTextBoxInBorder}" />
</Grid>
</Border>
<GroupBox Name="SpeedGpBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="4" Grid.RowSpan="4"
Style="{DynamicResource OmagCut_GroupBox}">
Style="{DynamicResource OmagCut_GroupBox}">
<Grid>
<Grid.ColumnDefinitions>
@@ -282,19 +292,19 @@
<TextBlock Name="SpeedTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
<TextBlock Name="MaxSpeedTxBl" Grid.Column="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="MaxSpeedTxBx" Grid.Column="3" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
</Grid>
</GroupBox>
<GroupBox Name="FeedGpBx" Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="4" Grid.RowSpan="6"
Style="{DynamicResource OmagCut_GroupBox}">
Style="{DynamicResource OmagCut_GroupBox}">
<Grid>
<Grid.ColumnDefinitions>
@@ -309,23 +319,23 @@
</Grid.RowDefinitions>
<TextBlock Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Grid.Row="0"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
<TextBlock Name="TipFeedTxBl" Grid.Column="2" Grid.Row="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="TipFeedTxBx" Grid.Column="3" Grid.Row="0"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
<TextBlock Name="StartFeedTxBl" Grid.Column="0" Grid.Row="1"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="StartFeedTxBx" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
<TextBlock Name="EndFeedTxBl" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="EndFeedTxBx" Grid.Column="3" Grid.Row="1"
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
</Grid>
@@ -336,7 +346,7 @@
<ComboBox Name="CoolantCmBx" Grid.Column="1" Grid.Row="16" Grid.RowSpan="3" Style="{StaticResource OmagCut_LeftComboBoxNoBorder}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<TextBlock Text="{Binding}" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
@@ -420,11 +430,32 @@
<CheckBox Name="EndLifeChBx" Grid.Column="3" Grid.Row="31" Grid.RowSpan="3"
Style="{StaticResource OmagCut_CheckBox_Single}" Margin="0,8,0,0"/>
<TextBlock Name="UserNotesTxBl" Grid.Column="0" Grid.Row="33" Grid.RowSpan="3"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx" Grid.Column="1" Grid.Row="33"
Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,0,15,0"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<Grid Grid.Column="0" Grid.Row="33" Grid.RowSpan="3" Grid.ColumnSpan="4">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Name="UserNotesTxBl"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx"
Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,0,15,0"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,12,0">
<TextBlock Name="ColorTxBl" Margin="0,0,15,0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<Button Name="ColorBtn"
Style="{StaticResource Color_Button}" />
</StackPanel>
</Grid>
</Grid>
@@ -445,7 +476,7 @@
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
</Grid>
</Grid>
</Grid>
+96 -2
View File
@@ -1,6 +1,5 @@
Imports System.Collections.ObjectModel
Imports OmagCUT.TreeViewItem
Imports System.ComponentModel
Imports EgtUILib
Imports EgtWPFLib
Imports EgtWPFLib5
@@ -84,6 +83,7 @@ Public Class ToolsDbPageUC
CodeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 27) ' Code
SupplierTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 28) ' Supplier
EndLifeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 29) ' End Life
ColorTxBl.Text = EgtMsg(91018) ' Colore lavorazione
' Associo TextBox e Label
Dim TempLabel1 As New Label
@@ -122,7 +122,6 @@ Public Class ToolsDbPageUC
Dim TempLabel12 As New Label
TempLabel12.Content = MaxMatTxBl.Text
MaxMatTxBx.Tag = TempLabel12
End Sub
Private Sub ToolsDbPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -568,6 +567,15 @@ Public Class ToolsDbPageUC
End If
End Sub
Private Sub ColorBtn_Click(sender As Object, e As RoutedEventArgs) Handles ColorBtn.Click
' Il click sul bottone aprirà la finestra ChooseColor che permetterà la scelta del colore
m_MainWindow.m_brCurrentColor = ColorBtn.Background
Dim ChooseColor As New ChooseColor(m_MainWindow)
If ChooseColor.ShowDialog() Then
ColorBtn.Background = m_MainWindow.m_brCurrentColor
End If
End Sub
Private Function AlreadyExist(ToolName As String) As Boolean
Dim ToolFamily As CathegoryItem
For Each ToolFamily In ToolsList
@@ -766,6 +774,50 @@ Public Class ToolsDbPageUC
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
UserNotesTxBx.Text = ToolString
End If
' Inizializzo colore di default
Dim EgtCol As Color3d = Utility.GetColorPV()
ColorBtn.Background = New SolidColorBrush(Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B))
' Eventualmente verifico se inserito nel setup
VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text)
End Sub
Private Sub VerifyToolInSetUp(sNameTool As String, sTCPos As String)
' Se configurato cambio utensile lama
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return
Dim bFound As Boolean = False
Dim sCurrTCPos As String = String.Empty
For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
If ToolPosition.sTool <> String.Empty Then
If sNameTool = ToolPosition.sTool Then
sCurrTCPos = ToolPosition.sName
bFound = True
Exit For
End If
End If
Next
If Not bFound Then
TCPosTxBl.Foreground = Brushes.Red
If String.IsNullOrEmpty(sTCPos) Then
TCPosTxBl.ToolTip = EgtMsg(91019)
Else
TCPosTxBl.ToolTip = EgtMsg(91020)
End If
Else
If String.IsNullOrEmpty(sTCPos) Then
TCPosTxBl.Foreground = Brushes.Gold
TCPosTxBl.ToolTip = EgtMsg(91021) & " " & sCurrTCPos
Else
If sTCPos <> sCurrTCPos Then
TCPosTxBl.Foreground = Brushes.Gold
TCPosTxBl.ToolTip = EgtMsg(91022) & " " & sCurrTCPos
Else
TCPosTxBl.Foreground = Brushes.White
TCPosTxBl.ToolTip = ""
End If
End If
End If
End Sub
Private Sub SetToolParams()
@@ -821,8 +873,40 @@ Public Class ToolsDbPageUC
If Not SetSpecials() Then
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
End If
EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString()))
End Sub
Private Function ColorToString(color As String) As String
Dim colorCut As Color = HexToRbgNew(color)
Return colorCut.R & "," & colorCut.G & "," & colorCut.B
End Function
Public Function HexToRbgNew(ByVal Hex As String) As Color
If Hex.StartsWith("#") Then
Hex = Hex.Remove(0, 3)
End If
Dim red As Byte = CByte(HexadecimalToDecimal(Hex.Substring(0, 2)))
Dim green As Byte = CByte(HexadecimalToDecimal(Hex.Substring(2, 2)))
Dim blue As Byte = CByte(HexadecimalToDecimal(Hex.Substring(4, 2)))
Return Color.FromArgb(255, red, green, blue)
End Function
Private Shared Function HexadecimalToDecimal(hex As String) As Integer
hex = hex.ToUpper()
Dim hexLength As Integer = hex.Length
Dim dec As Double = 0
For i As Integer = 0 To hexLength - 1
Dim b As Byte = CByte(AscW(hex(i)))
If b >= 48 AndAlso b <= 57 Then
b -= 48
ElseIf b >= 65 AndAlso b <= 70 Then
b -= 55
End If
dec += b * Math.Pow(16, ((hexLength - i) - 1))
Next
Return CInt(Math.Truncate(dec))
End Function
Private Sub ViewToolParams()
NameTxBl.Visibility = Windows.Visibility.Visible
NameTxBx.Visibility = Windows.Visibility.Visible
@@ -863,6 +947,9 @@ Public Class ToolsDbPageUC
SupplierTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
ColorTxBl.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden)
ColorBtn.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden)
End Sub
Private Sub HideToolParams()
@@ -890,6 +977,9 @@ Public Class ToolsDbPageUC
SupplierTxBx.Visibility = Windows.Visibility.Hidden
EndLifeTxBl.Visibility = Windows.Visibility.Hidden
EndLifeChBx.Visibility = Windows.Visibility.Hidden
ColorTxBl.Visibility = Visibility.Hidden
ColorBtn.Visibility = Visibility.Hidden
End Sub
Private Sub ToolTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTreeView.PreviewMouseUp
@@ -1338,4 +1428,8 @@ Public Class ToolsDbPageUC
End If
End Sub
Private Sub TCPosTxBx_EgtClosed(sender As Object, e As EventArgs) Handles TCPosTxBx.EgtClosed
VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text)
End Sub
End Class
+8 -4
View File
@@ -26,7 +26,7 @@ Class MainWindow
' Variabile che definisce l'avvio forzato in modalità FRAME
Friend m_OnlyFrame As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = True
Public Shared m_bShowSVGParkInd As Boolean = False
' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
@@ -345,8 +345,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2612, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2612, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2705, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2705, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
@@ -1218,13 +1218,17 @@ Class MainWindow
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
End Select
Select Case m_DirectCutPageUC.m_ControlsDirectCutUC1.m_ActiveDirectCutPage
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.Polishing
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.SawTest
Case ControlsDirectCutUC1.DirectCutPages.SawTest
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
End Select
Return True
End Function
+3 -3
View File
@@ -22,7 +22,7 @@ Imports System.Windows
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("OmagCUT")>
<Assembly: AssemblyCopyright("Copyright © 2015-2024 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2015-2025 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.6.12.1")>
<Assembly: AssemblyFileVersion("2.6.12.1")>
<Assembly: AssemblyVersion("2.7.5.1")>
<Assembly: AssemblyFileVersion("2.7.5.1")>
+16
View File
@@ -413,6 +413,10 @@ Public Class CNCommunication
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
' Solo per controllo speciale NUM 22/01/2025
GetPrivateProfileString(S_NCDATA, K_CPOS, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.CPos, sVal)
If Not String.IsNullOrEmpty(sVal) Then m_CN.bCPos = True
' Inizializzo la comunicazione
m_CN.Init()
@@ -1600,9 +1604,17 @@ Public Class CNCommunication
Return bOk
End Function
Private Sub GetSpecialCAxes()
If m_CN.bCPos Then
m_CN.d_axis_position(m_nA4) = m_CN.dCPos
End If
End Sub
Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double,
ByRef dA4 As Double, ByRef dA5 As Double, ByRef dA6 As Double,
ByRef dA7 As Double, ByRef dA8 As Double, ByRef dA9 As Double, ByRef dA10 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0)
dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0)
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
@@ -1619,6 +1631,8 @@ Public Class CNCommunication
Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double,
ByRef dA4 As Double, ByRef dA5 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0)
dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0)
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
@@ -1637,6 +1651,8 @@ Public Class CNCommunication
End Function
Friend Function GetRotaryAxesPositions(ByRef dR1 As Double, ByRef dR2 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dR1 = If(m_nA4 >= 0, m_CN.d_axis_position(m_nA4), 0)
dR2 = If(m_nA5 >= 0, m_CN.d_axis_position(m_nA5), 0)
Return m_bAxesOk
+7 -1
View File
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
Public Const MAX_VAR As Short = 100
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
Public Const MAX_TOOLS As Short = 100
Public Const NUM_DATA = 57 ' Numero di dati del CN (Speed,Feed,...)
Public Const NUM_DATA = 58 ' Numero di dati del CN (Speed,Feed,...)
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
@@ -74,6 +74,8 @@ Public MustInherit Class CN_generico
nAxes = 55
ResetStatus = 56
CPos = 57
End Enum
Public Enum Type As Short
@@ -233,6 +235,10 @@ Public MustInherit Class CN_generico
Public bRemote As Boolean
' Nuovi di bottoni -------------------------------------------
' gestione speciale asse C
Public bCPos As Boolean = False
Public dCPos As Double
' solo per NumOld
Public bIsDripFeed As Boolean = False
+11 -8
View File
@@ -53,14 +53,14 @@ Namespace Num
Dim WithEvents objDRunTimeSystem As FXServer.DRunTimeSystem
Dim WithEvents objDGroupManager As FXServer.DGroupManager
Dim WithEvents objDReadELS As FXServer.DReadELS
' questa è classe che serve a scrivere i dati nel PLC
' questa classe che serve a scrivere i dati nel PLC
Dim WithEvents objDPlcVariables As FXServer.DPlcVariables
' questa è la classe che serve a scrivere i dati nelle variabili E
' questa la classe che serve a scrivere i dati nelle variabili E
Dim WithEvents objDVariables As FXServer.DVariables
Dim WithEvents objDReadTestExectime As FXServer.DReadTestExectime
Dim WithEvents objDPosition As FXServer.DPosition
Dim WithEvents objDNCKParameter As FXServer.DNCKParameter
' questa è la classe che serve a scrivere i comandi MDI (come ad esempio le funzioni M)
' questa la classe che serve a scrivere i comandi MDI (come ad esempio le funzioni M)
Dim WithEvents objDMdiCommand As FXServer.DMdiCommand
Dim WithEvents objDMainCncData As FXServer.DMainCncData
@@ -458,7 +458,7 @@ Namespace Num
'sz_var_names.Add("Application.IOCONFIG_GLOBALS.Flexium_NCK.WCNC.Spindle[2].Override") ' segnaposto per la speed override
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_Vel_prog") ' FEED
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabRPM") ' Speed
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabAmper") ' Ampère = *0.01
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabAmper") ' Ampre = *0.01
' Creo lista nomi variabili PLC da leggere
m_nCnDataVarNum = 0
@@ -823,7 +823,7 @@ Namespace Num
' Only for FX Server >= 3.9.0.0
' poi in realtà ritorna sempre tipo = -1 per cui è eguale alle altre.....
' poi in realt ritorna sempre tipo = -1 per cui eguale alle altre.....
Private Sub objDReadELS_ValueChanged3(nHandle As Integer, value As Object, DataType As Short, Writable As Short, nerrorCode As Short) Handles objDReadELS.ValueChanged3
Dim edata_type As eDatatype
@@ -996,7 +996,7 @@ Namespace Num
d_spindle_eff(0) = CDbl(values(n))
Case CnData.SpeedOvr ' (5) Potenziom. speed = ...
n_spindle_override(0) = CShort(Math.Round((CDbl(values(n)) * 50 / 255) + 50))
Case CnData.Power ' (6) Ampère = * 0.01
Case CnData.Power ' (6) Ampre = * 0.01
d_spindle_power = CDbl(CLng(values(n))) * 0.01
b_spindle_power_changed = True
Case CnData.Spindle ' (7) Stato rotazione mandrino
@@ -1095,6 +1095,9 @@ Namespace Num
Case CnData.EnablePC ' (54)
nEnablePc = CInt(values(n))
Case CnData.CPos ' (57)
dCPos = CDbl(values(n))
End Select
Next
@@ -1701,11 +1704,11 @@ Namespace Num
nTimeOut += 1
End While
If Not bSetModeDone Then
EgtOutLog("Errore cambio modalità in MDI: " & TIMEOUT)
EgtOutLog("Errore cambio modalit in MDI: " & TIMEOUT)
Return TIMEOUT 'Errore di timeout
End If
If nSetModeResult <> 0 Then
EgtOutLog("Errore 2 cambio modalità in MDI: " & nSetModeResult)
EgtOutLog("Errore 2 cambio modalit in MDI: " & nSetModeResult)
End If
Return nSetModeResult
+23
View File
@@ -177,6 +177,9 @@
<Compile Include="CadCuts\ChooseTestToolWD.xaml.vb">
<DependentUpon>ChooseTestToolWD.xaml</DependentUpon>
</Compile>
<Compile Include="CadCuts\ChangeToolWD.xaml.vb">
<DependentUpon>ChangeToolWD.xaml</DependentUpon>
</Compile>
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
</Compile>
@@ -454,6 +457,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CadCuts\ChangeToolWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1396,6 +1403,22 @@
<Resource Include="Resources\NewIcons\LightArrowOff.png" />
<Resource Include="Resources\NewIcons\LightArrowOn.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Park_Busy.png" />
<Resource Include="Resources\NewIcons\icoRight-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoLeft-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoBack-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoFront-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoBottom-3D.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+609 -603
View File
File diff suppressed because it is too large Load Diff
+49 -2
View File
@@ -338,7 +338,36 @@
</Style.Triggers>
</Style>
<Style x:Key="OmagCut_Button_Wrap" TargetType="{x:Type Button}" BasedOn="{StaticResource OmagCut_Button}">
<Style x:Key="Color_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
<Setter Property="project:ButtonExtensions.CornerRadius" Value="{StaticResource Button_CornerRadius}"/>
<Setter Property="Margin" Value="{StaticResource Button_MarginThickness}"/>
<Setter Property="Padding" Value="5"/>
<Setter Property="Width" Value="60"/>
<Setter Property="Height" Value="35"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFB8C3CD"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="OpacityMask" Value="#33FF0000"/>
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#FFF4F4F4"/>
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="OmagCut_Button_Wrap" TargetType="{x:Type Button}" BasedOn="{StaticResource OmagCut_Button}">
<Setter Property="ContentTemplate" Value="{StaticResource Button_DataTemplate_Wrap}" />
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}" />
</Style>
@@ -1198,7 +1227,14 @@
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<Style x:Key="OmagCut_ErrorTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_UpperCaseCharacterTextBlock}">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontStyle" Value="Italic"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TextBox-->
@@ -2746,5 +2782,16 @@
</Style>
<!-- *************************************************************************** -->
<!--Stile Rettangolo in SplitPaceUC-->
<Style x:Key="Rect_SplitPage" TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="{Binding SawColor}"/>
<Setter Property="Stroke" Value="Black"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Height" Value="20"/>
<Setter Property="Width" Value="5"/>
<Setter Property="StrokeThickness" Value="0.5"/>
</Style>
</ResourceDictionary>
+22 -3
View File
@@ -196,7 +196,7 @@ Public Class CurrentProjectPageUC
' Inizializzo gestore lavorazioni
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
m_bFirst = False
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, "OrtoGraphic", 1, m_MainWindow.GetIniFile()) <> 0)
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0)
EgtSetCameraType(bOrtoGraphic, True)
' creo nuovo progetto
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
@@ -436,21 +436,29 @@ Public Class CurrentProjectPageUC
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
' Parcheggio correttamente i pezzi precedentemente salvati
Dim nIdList As New List(Of Integer)
Dim nStatList As New List(Of Integer)
Dim nId2 As Integer = EgtGetFirstPart()
While nId2 <> GDB_ID.NULL
' Forzo lo stato per avere il giusto calcolo delle posizioni per evitare sovrapposizioni
EgtSetStatus(nId2, GDB_ST.ON_)
' Inserisco correttamente in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
' Aggiorno lo stato di visualizzazione
Dim nInfoStatus As Integer = 1
' Salvo lo stato (per gestire la navigazione)
EgtGetInfo(nId2, INFO_PARKSTATUS, nInfoStatus)
' Imposto lo stato
EgtSetStatus(nId2, nInfoStatus)
' Salvo l'Id e lo stato da impostare successivamente al posizionamento
nIdList.Add(nId2)
nStatList.Add(nInfoStatus)
' Notifica a WeinMatching per modifica Id
VeinMatching.UpdatePart(nId2)
' Passo al pezzo successivo
nId2 = EgtGetNextPart(nId2)
End While
For IndIndex As Integer = 0 To nIdList.Count - 1
EgtSetStatus(nIdList(IndIndex), nStatList(IndIndex))
Next
' Aggiorno Aree totale e da lavorare dei pezzi
SetTotalArea(dTotArea)
UpdateToProduceArea()
@@ -769,6 +777,17 @@ Public Class CurrentProjectPageUC
' Notifico a foto il cambio di path
EgtChangePhotoPath(nPhotoId, sNewPhoto)
End If
'--------------------------------------------------------------------------------
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Gestione visulizzazione lista pezzi in parcheggio
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sPath)
SelParkIndWD.sActualProj = String.Empty
SelParkIndWD.CopyImgSvg(sNewFileName)
End If
'--------------------------------------------------------------------------------
' Se assente, inserisco contrassegno di progetto OmagCut valido
AddProjectMark()
' Eseguo
+59 -52
View File
@@ -6,33 +6,40 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded">
<!-- Definizione della OpenPage -->
<Border>
<Grid Name="OpenPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<!-- Definizione della OpenPage -->
<Border>
<Grid Name="OpenPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<Grid Grid.Row="1" Grid.RowSpan="2">
<!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<Grid Name="SceneHostGrid" Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<Grid Grid.Row="1" Grid.RowSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="6.5*"/>
<RowDefinition Height="0.65*"/>
@@ -53,39 +60,39 @@
</Grid>
</Grid>
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</Border>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</Border>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Button>
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
</Button>
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
</Grid>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</UserControl>
+47 -3
View File
@@ -5,6 +5,7 @@ Public Class OpenPageUC
'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_SelParkInd As SelParkIndWD
'Dichiarazione dello UserControl SceneButtons
Private m_SceneButtons As SceneButtonsUC
@@ -35,11 +36,12 @@ Public Class OpenPageUC
' Assegnazione scena all'host e posizionamento nella OpenPageGrid
OpenSceneHost.Child = OpenScene
OpenSceneHost.SetValue(Grid.ColumnProperty, 1)
OpenSceneHost.SetValue(Grid.RowProperty, 2)
OpenSceneHost.SetValue(Grid.ColumnProperty, 0) '1
OpenSceneHost.SetValue(Grid.RowProperty, 0) ' 2
' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
Me.OpenPageGrid.Children.Add(OpenSceneHost)
'Me.OpenPageGrid.Children.Add(OpenSceneHost)
SceneHostGrid.Children.Add(OpenSceneHost)
' Definizione del collegamento tra ItemList e ListBox1
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
@@ -241,6 +243,14 @@ Public Class OpenPageUC
Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
' Elimino elenco dei parcheggi
If Not IsNothing(m_SelParkInd) Then
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' Pulisco la selezione dei dati
SelParkIndWD.sActualProj = String.Empty
' Eseguo zoom
OpenScene.ZoomAll()
' Cancello messaggio
@@ -302,6 +312,24 @@ Public Class OpenPageUC
MessageBrd.Background = Brushes.Tomato
OkBtn.IsEnabled = False
End If
' Recupero il percorso del progetto per caricare le immagini
SelParkIndWD.sActualProj = sPath
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd, OpenScene.GetCtx)
If ListParkInd.Count > 2 And GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
m_SelParkInd = New SelParkIndWD(m_MainWindow, OpenScene.GetCtx)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
SceneHostGrid.Children.Add(m_SelParkInd)
Else
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
End If
' Eseguo zoom
OpenScene.ZoomAll()
Return bOk
@@ -475,11 +503,21 @@ Public Class OpenPageUC
' Se file dxf devo processarlo opportunamente
Dim bFileDxf As Boolean = (EgtGetFileType(m_sCurrFile) = FT.DXF)
If bFileDxf Then AdjustSlabDxf()
' Istruzioni per chiudere OpenPageUC e aprire currentproject
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
' Lancio caricamento nuovo progetto corrente
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.PostLoad(m_sCurrDir, m_sCurrFile)
'--------------------------------------------------------------------------------
' Gestione visulizzazione lista pezzi in parcheggio
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sNewFileName As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
SelParkIndWD.CopyImgSvg(sNewFileName, OpenScene.GetCtx)
SelParkIndWD.sActualProj = String.Empty
'--------------------------------------------------------------------------------
' Se file dxf
If bFileDxf Then
' Applico le lavorazioni
@@ -513,6 +551,12 @@ Public Class OpenPageUC
End Sub
Private Sub OpenPage_Unloaded(sender As Object, e As RoutedEventArgs)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' resetto il nome del progetto corrente
SelParkIndWD.sActualProj = String.Empty
End Sub
End Class
+23 -2
View File
@@ -43,9 +43,30 @@
<ToggleButton Name="RegisterBtn"
Style="{DynamicResource OmagCut_YellowToggleButton}"></ToggleButton>
<Button Name="ResetCutBtn"
<Button Name="ResetCutBtn"
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
<!--Abilito la selezione delle linee da disegno-->
<Popup Name="ResetCutPopUp"
IsOpen="False"
AllowsTransparency="False"
PopupAnimation="Scroll"
StaysOpen="False"
Placement="Top"
PlacementTarget="{Binding ElementName=ResetCutBtn}">
<WrapPanel Orientation="Vertical"
Background="{DynamicResource OmagCut_Gray}">
<Button x:Name="ResetCut1Btn"
Width ="78" Height="78"
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
<Button x:Name="ResetCut2Btn"
Width ="78" Height="78"
Style="{DynamicResource OmagCut_YellowTextButton}"></Button>
</WrapPanel>
</Popup>
<!--Abilito la selezione delle linee da disegno-->
<ToggleButton Name="TestBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Test-lamaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</ToggleButton>
+74 -23
View File
@@ -26,6 +26,8 @@ Public Class ProjectMgrUC
RegisterBtn.Content = "REG" 'Shape Registration
ResetCutBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ResetCut2Btn.Content = EgtMsg(91024) 'Reset lavorazioni
ResetCut1Btn.Content = EgtMsg(91025) 'Aggiorna feed/speed
SimulateBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1) 'Simulate - Simula
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 10) 'Export - Esporta
@@ -33,7 +35,7 @@ Public Class ProjectMgrUC
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
End If
TestBtn.ToolTip = EgtMsg(90255) 'Test
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Other Reset (Shift)"
End Sub
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -110,24 +112,26 @@ Public Class ProjectMgrUC
' Gestione visulizzazione lista pezzi in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
Dim Extension As String = ".svg"
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
Try
Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
If MainWindow.m_bShowSVGParkInd Then
WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
Else
If File.Exists(sNewFile) Then
File.Delete(sNewFile)
End If
File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
End If
Catch ex As Exception
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
End Try
End If
Next
SelParkIndWD.CopyImgSvg(sNewFileName)
'Dim Extension As String = ".svg"
'If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
'For Each ItemParkInd As ParkInd In ListParkInd
' If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
' Try
' Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
' If MainWindow.m_bShowSVGParkInd Then
' WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
' Else
' If File.Exists(sNewFile) Then
' File.Delete(sNewFile)
' End If
' File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
' End If
' Catch ex As Exception
' EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
' End Try
' End If
'Next
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
@@ -285,11 +289,58 @@ Public Class ProjectMgrUC
End Sub
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
Return
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
If ResetCutPopUp.IsOpen Then
ResetCutPopUp.IsOpen = False
Else
ResetCutPopUp.IsOpen = True
End If
Else
ResetCut3Btn_Click()
End If
End Sub
' Reimposto le feed di tutte le lavorazioni
Private Sub ResetCut1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut1Btn.Click
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
End Sub
' Reimposto le lavorazioni di default e ripristino i parametri
Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
' cancello tutti i tagli di separazione (Waterjet)
ResetAllSplitCurv()
' cancello tutti i punti di inizio (Waterjet)
ResetAllStartCurv()
' cancello tutti i ponticelli disegnati
ResetAllBRidges()
' cancella tutti i tagli di separazione inseriti in OFFICE
ResetAllSplitCut()
' assegno la lavorazione corrente per i tagli di lama inclinati (solo se specificato nella ComboBox della ChooseMachinig)
RestoreDef_Machinig(True)
' assegno la lavorazione corrente per i tagli verticali
RestoreDef_Machinig(False)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
ResetAllRawPart()
' Aggiorno Info C Home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
' Aggiorno visualizzazione
EgtDraw()
End Sub
' Resetta i valori dei parametri (ma non le lavorazioni)
Private Sub ResetCut3Btn_Click()
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
+37
View File
@@ -39,6 +39,43 @@
<Button Name="TopViewBtn" Grid.Column="6" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromTOPImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Popup Name="ViewPopUp"
IsOpen="False"
AllowsTransparency="False"
PopupAnimation="Scroll"
StaysOpen="False"
Placement="Bottom"
PlacementTarget="{Binding ElementName=TopViewBtn}">
<WrapPanel Orientation="Vertical"
Width="78"
Background="{DynamicResource OmagCut_Gray}">
<Button x:Name="BottomViewBtn"
ToolTip="Bottom View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromBOTTOMImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="FrontViewBtn"
ToolTip="Front View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromFRONTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="BackViewBtn"
ToolTip="Back View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromBACKImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="LeftViewBtn"
ToolTip="Left View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromLEFTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="RightViewBtn"
ToolTip="Right View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromRIGHTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</WrapPanel>
</Popup>
</Grid>
+39 -1
View File
@@ -5,6 +5,10 @@ Public Class SceneButtonsUC
'Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private Sub Init() Handles Me.Initialized
TopViewBtn.ToolTip = "Top View" & vbCrLf & "Select View (Shift)"
End Sub
Private Sub MeasureBtn_Checked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Checked
GetCurrScene.SetStatusGetDistance()
Dim ptRef1 As Point3d
@@ -49,6 +53,12 @@ Public Class SceneButtonsUC
'End Sub
Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click
If Keyboard.IsKeyDown(Key.LeftShift) Then
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0)
EgtSetCameraType(Not bOrtoGraphic, True)
WritePrivateProfileString(S_SCENE, K_ORTOGRAPHIC, If(Not bOrtoGraphic, "1", "0"), m_MainWindow.GetIniFile())
Return
End If
GetCurrScene.SetStatusPan()
End Sub
@@ -69,7 +79,35 @@ Public Class SceneButtonsUC
End Sub
Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click
EgtSetView(VT.TOP)
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
If ViewPopUp.IsOpen Then
ViewPopUp.IsOpen = False
Else
ViewPopUp.IsOpen = True
End If
Else
EgtSetView(VT.TOP)
End If
End Sub
Private Sub BottomViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles BottomViewBtn.Click
EgtSetView(VT.BOTTOM)
End Sub
Private Sub FrontViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles FrontViewBtn.Click
EgtSetView(VT.FRONT)
End Sub
Private Sub BackViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackViewBtn.Click
EgtSetView(VT.BACK)
End Sub
Private Sub LeftViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles LeftViewBtn.Click
EgtSetView(VT.LEFT)
End Sub
Private Sub RightViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles RightViewBtn.Click
EgtSetView(VT.RIGHT)
End Sub
Private Function GetCurrScene() As EgtUILib.Scene
+3 -1
View File
@@ -390,6 +390,8 @@ Public Class Camera
' Leggo nome variabile posizione home raggiunta
Dim CameraStateNameVar As String = String.Empty
GetPrivateProfileString(S_PHOTO, K_CAMERA_STATE_VAR, "", CameraStateNameVar, m_MainWindow.GetMachIniFile())
Dim nSteps As Integer = 20
nSteps = GetPrivateProfileInt(S_PHOTO, K_PENDIG_TIME_FOR_PHOTO, nSteps, m_MainWindow.GetMachIniFile())
If String.IsNullOrEmpty(CameraStateNameVar) Then
'Return False
Else
@@ -403,7 +405,7 @@ Public Class Camera
System.Threading.Thread.Sleep(300)
' Definisco flag posizionamento completato
Dim bPositionOk As Boolean = False
For I As Integer = 0 To 40
For I As Integer = 0 To nSteps
' Devo rileggere la variabile ad ogni ciclo
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(CameraStateNameVar, 3)
System.Threading.Thread.Sleep(100)
+36 -1
View File
@@ -35,7 +35,42 @@
</ComboBox.ItemTemplate>
</ComboBox>
<!--LAVORAZIONE SECONDARIA-->
<!--TAGLIO TILTED-->
<Grid Grid.Column="1" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<CheckBox Name ="ApplySawingTiltedChBx" Grid.Column="0"
Style="{StaticResource OmagCut_CheckBox_Single}"
Margin="1.5,0,0,0"/>
<TextBlock Name="CurrSawingTiltedTxBl" Grid.Column="1"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
</Grid>
<ComboBox Name="CurrSawingTiltedCmBx" Grid.Column="1" Grid.Row="1">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="20">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ApplySawingTiltedChBx, Path=IsChecked}" Value="False">
<Setter Property="TextDecorations" Value="Strikethrough"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=ApplySawingTiltedChBx, Path=IsChecked}" Value="True">
<Setter Property="Foreground" Value="Black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--LAVORAZIONE SECONDARIA-->
<TextBlock Name="AuxiliaryMachiningTxBl" Grid.Column="1" Grid.Row="2"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" Visibility="Hidden"/>
<ComboBox Name="AuxiliaryMachiningCmBx" Grid.Column="1" Grid.Row="3" Visibility="Hidden">
+60 -4
View File
@@ -8,6 +8,7 @@ Public Class ChooseMachining
Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
' Liste che contengono gli elementi appartenenti alle ComboBox
Private m_SawingList As New List(Of String)
Private m_SawingTiltedList As New List(Of String)
Private m_AuxMachTypeList As New List(Of StringIdCmBx)
Private m_DrillingList As New List(Of String)
Private m_MillingList As New List(Of String)
@@ -36,6 +37,7 @@ Public Class ChooseMachining
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
CurrSawingCmBx.ItemsSource = m_SawingList
CurrSawingTiltedCmBx.ItemsSource = m_SawingTiltedList
AuxiliaryMachiningCmBx.ItemsSource = m_AuxMachTypeList
CurrDrillingCmBx.ItemsSource = m_DrillingList
CurrMillingCmBx.ItemsSource = m_MillingList
@@ -44,6 +46,7 @@ Public Class ChooseMachining
CurrWJettingQualityCmBx.ItemsSource = m_CurrentMachine.Qualities
CurrSawingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 1)
CurrSawingTiltedTxBl.Text = EgtMsg(91023) ' Lavorazione inclinata
AuxiliaryMachiningTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 2)
CurrDrillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 3)
CurrMillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 4)
@@ -69,7 +72,13 @@ Public Class ChooseMachining
' -- TAGLIO --
CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSaw, m_SawingList)
' aggiungo un campo vuoto
m_SawingList.Add( "")
m_SawingList.Add("")
' -- TAGLIO TILTED --
CurrSawingTiltedCmBx.IsEnabled = m_MainWindow.m_CurrentMachine.bApplySawingTilted
ApplySawingTiltedChBx.IsChecked = m_MainWindow.m_CurrentMachine.bApplySawingTilted
CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSawTilted, m_SawingTiltedList)
' aggiungo un campo vuoto
m_SawingTiltedList.Add("")
' Verifico la configurazione della macchina per creare i combobox
Select Case m_CurrentMachine.MountedToolConfig
@@ -78,7 +87,7 @@ Public Class ChooseMachining
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl)
ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx)
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW
' Creo lista lavorazioni foretto e fresa
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
@@ -114,7 +123,10 @@ Public Class ChooseMachining
' ---- MACCHINA CON CAMBIO UTENSILE ----
ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
' -- TAGLIO --
' Il taglio è aggiunto sempre (all'inizio di questo metodo)
' -- FORATURA --
CreateMachiningList(MCH_MY.DRILLING, m_DrillingList)
' Se la lista è vuota cancello la lavorazione corrente di questo tipo
@@ -206,7 +218,8 @@ Public Class ChooseMachining
m_AuxMachTypeList.Add(New StringIdCmBx(4, EgtMsg(91069)))
End If
If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or
m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
m_AuxMachTypeList.Add(New StringIdCmBx(3, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 8)))
End If
End If
@@ -490,6 +503,8 @@ Public Class ChooseMachining
Dim nDeltaRow As Integer = 4
Dim nNewRow As Integer = 2
' nascondo tutte le CmBx e TxBl
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden
CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Hidden
CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden
CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden
CurrMillingTxBl.Visibility = Windows.Visibility.Hidden
@@ -499,6 +514,33 @@ Public Class ChooseMachining
CurrWJettingTxBl.Visibility = Windows.Visibility.Hidden
CurrWJettingCmBx.Visibility = Windows.Visibility.Hidden
' -- LAMA TILTED -- se definito il cambio utensile con lama
'If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
If Not String.IsNullOrEmpty(m_CurrentMachine.sCurrSawTilted) Then
' Definizione di due righe della tabella con la giusta altezza
For Index As Integer = 1 To nNewRow
Dim Row As New RowDefinition
Row.Height = New GridLength(0.5, GridUnitType.Star)
ChooseMachiningGrid.RowDefinitions.Add(Row)
Next
m_RowNumber = m_RowNumber + nNewRow
' titolo della ComboBox
CurrSawingTiltedTxBl.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow)
' ComboBox (nella riga successiva al titolo)
CurrSawingTiltedCmBx.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow + 1)
'ButtonsGrid.SetValue(Grid.RowProperty, 5)
If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then
CurrSawingTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawingTilted
End If
' verifico che la selezione sia andata a buon fine, altrimenti comunico l'avvenuta modifica
If String.IsNullOrEmpty(CurrSawingTiltedCmBx.SelectedItem) Then
' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica
If CurrSawingTiltedCmBx.SelectedItem <> m_CurrentMachine.sCurrSawingTilted Then m_MachIsModified = True
End If
CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible
CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Visible
End If
' -- FORATURA -- se foretto presente
If m_CurrentMachine.bDrill And m_DrillingList.Count() > 0 Then
' Definizione di due righe della tabella con la giusta altezza
@@ -621,6 +663,20 @@ Public Class ChooseMachining
m_MainWindow.m_CurrentMachine.sCurrSawing = CurrSawingCmBx.SelectedItem.ToString()
End Sub
Private Sub ApplySawingTiltedChBx_Checked() Handles ApplySawingTiltedChBx.Click
If ApplySawingTiltedChBx.IsChecked Then
CurrSawingTiltedCmBx.IsEnabled = True
m_MainWindow.m_CurrentMachine.bApplySawingTilted = True
Else
CurrSawingTiltedCmBx.IsEnabled = False
m_MainWindow.m_CurrentMachine.bApplySawingTilted = False
End If
End Sub
Private Sub CurrSawingTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawingTiltedCmBx.SelectionChanged
m_MainWindow.m_CurrentMachine.sCurrSawingTilted = CurrSawingTiltedCmBx.SelectedItem.ToString()
End Sub
Private Sub CurrDrillingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillingCmBx.SelectionChanged
m_MainWindow.m_CurrentMachine.sCurrDrilling = CurrDrillingCmBx.SelectedItem.ToString()
End Sub
+25 -9
View File
@@ -4,7 +4,7 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False">
Title="ModifStartEndWD" Height="350" Width="320" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
@@ -28,14 +28,30 @@
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
<TextBlock Name="SelRefTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
<ComboBox Name="RefTabCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabOrientationCmBx" Grid.Column="2" Grid.Row="3" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -44,17 +60,17 @@
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="5"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="5"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="7"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="7"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="10" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
+135 -14
View File
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib
@@ -12,9 +13,14 @@ Public Class OtherRefTabWD
Private m_dPrevOffsetX As Double = 0
Private m_dPrevOffsetY As Double = 0
Private m_bModifX As Boolean = False
Private m_bModifY As Boolean = False
Private m_SelIndex As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer)
Private m_SelRef As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer, SelRef As Integer)
Me.Owner = Owner
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
@@ -25,6 +31,7 @@ Public Class OtherRefTabWD
m_dPrevOffsetX = OffsetX
m_dPrevOffsetY = OffsetY
m_SelIndex = OtherRefMode
m_SelRef = SelRef
End Sub
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -36,8 +43,11 @@ Public Class OtherRefTabWD
RefRawTxbl.Text = "Raw reference"
RefTabXTxbl.Text = "Position X"
RefTabYTxbl.Text = "Position Y"
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
SelRefTxbl.Text = "Sel reference"
RefTabOrientationCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabOrientationList
RefTabOrientationCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
RefTabCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
End Sub
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -45,9 +55,44 @@ Public Class OtherRefTabWD
RefTabYTxBx.Text = m_sPosY
End Sub
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
Private Sub RefTabCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabCmBx.SelectionChanged
If m_bModifX Or m_bModifY Then
Dim SaveCurrToolWnd = New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 2), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
Select Case SaveCurrToolWnd.m_nPressedBtn
Case 0 ' Annulla
' annullo l'operazione di cambio indice
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
Return
Case 1 ' Si
' salvo i valori modificati
UpdateCurrOffset()
' recupero l'oggetto precedentemente selezionato e lo aggiorno (per evitare di rileggere il file ini)
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
temp_RefTab.dOffsetX = m_RawPartPage.m_OtherRefTabX
temp_RefTab.dOffsetY = m_RawPartPage.m_OtherRefTabY
temp_RefTab.nPos = m_RawPartPage.m_OtherRefTabPos
Case 2 ' No
' Non salvo e vado oltre
m_bModifX = False
m_bModifY = False
End Select
End If
' recupero l'oggetto selezionato
Dim local_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(RefTabCmBx.SelectedIndex)
m_RawPartPage.m_CurrRefTab = RefTabCmBx.SelectedIndex
' Imposto gli Offset del riferimento selezionato
RefTabXTxBx.Text = LenToString(local_RefTab.dOffsetX, 2)
m_RawPartPage.m_OtherRefTabX = local_RefTab.dOffsetX
RefTabYTxBx.Text = LenToString(local_RefTab.dOffsetY, 2)
m_RawPartPage.m_OtherRefTabY = local_RefTab.dOffsetY
' Aggiorno la posizine del grezzo
m_RawPartPage.RefTabModeChange()
m_bModifX = False
m_bModifY = False
End Sub
Private Sub RefTabOrientationCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabOrientationCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabOrientationCmBx.SelectedIndex
m_RawPartPage.RefTabModeChange()
End Sub
@@ -66,6 +111,7 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabX = dX
m_bModifX = True
m_RawPartPage.RefTabModeChange()
End If
End Sub
@@ -85,24 +131,99 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola
End If
m_RawPartPage.m_OtherRefTabY = dY
m_bModifY = True
m_RawPartPage.RefTabModeChange()
End If
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_CURRENTREFTAB, m_RawPartPage.m_CurrRefTab.ToString, m_MainWindow.GetIniFile())
' Aggiorno il valore del riferimento correntemente modificato
UpdateCurrOffset()
m_RawPartPage.RefTabModeChange()
Me.Close()
End Sub
Private Sub UpdateCurrOffset()
Dim sKeyMsg As String = K_REFTAB & m_RawPartPage.m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_RawPartPage.m_OtherRefTabX, 2) & "," & DoubleToString(m_RawPartPage.m_OtherRefTabY, 2) & "," & m_RawPartPage.m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' riposiziono l'origine
m_RawPartPage.m_OtherRefTabX = m_sPosX
m_RawPartPage.m_OtherRefTabY = m_sPosY
' ripristino il valore della combobox
m_RawPartPage.m_OtherRefTabPos = m_SelIndex
' Recupero la prima selezione eseguita
m_RawPartPage.m_CurrRefTab = m_SelRef
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
' aggiorno i valori
m_RawPartPage.m_OtherRefTabX = temp_RefTab.dOffsetX
m_RawPartPage.m_OtherRefTabY = temp_RefTab.dOffsetY
m_RawPartPage.m_OtherRefTabPos = temp_RefTab.nPos
m_RawPartPage.RefTabModeChange()
End Sub
End Class
Public Class ReferenceTable
Private m_dOffsetX As Double
Private m_dOffsetY As Double
Private m_nPos As RawPartPageUC.OTHERREFMODE = RawPartPageUC.OTHERREFMODE.BL
Private m_nIndexRef As Integer = 0
Public Property dOffsetX As Double
Get
Return m_dOffsetX
End Get
Set(value As Double)
m_dOffsetX = value
End Set
End Property
Public Property dOffsetY As Double
Get
Return m_dOffsetY
End Get
Set(value As Double)
m_dOffsetY = value
End Set
End Property
Public Property nPos As Integer
Get
Return m_nPos
End Get
Set(value As Integer)
m_nPos = value
End Set
End Property
Public Property nIndexRef As Integer
Get
Return m_nIndexRef
End Get
Set(value As Integer)
m_nIndexRef = value
End Set
End Property
Public ReadOnly Property Name As String
Get
Return "REF_" & m_nIndexRef.ToString()
End Get
End Property
Public ReadOnly bOk As Boolean = True
Sub New(sStringFromIni As String, IndexRef As Integer)
Dim sItems() As String = sStringFromIni.Split(","c)
If sItems.Count = 3 Then
bOk = bOk And StringToLen(sItems(0), m_dOffsetX)
bOk = bOk And StringToLen(sItems(1), m_dOffsetY)
bOk = bOk And StringToInt(sItems(2), m_nPos)
m_nIndexRef = IndexRef
Else
bOk = False
End If
End Sub
End Class
+8 -2
View File
@@ -176,7 +176,9 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
@@ -197,7 +199,11 @@
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Button Name="ManualModeBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="8" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
+223 -19
View File
@@ -1,12 +1,13 @@
Imports System.Globalization
Imports System.IO
Imports System.Windows.Media.Animation
Imports System.IO
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib
Imports Microsoft.VisualBasic.Devices
Public Class RawPartPageUC
' Dati generali CN
' Friend m_CN As CN_generico
' Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Dim WithEvents m_CurrProjPage As CurrentProjectPageUC
@@ -81,13 +82,23 @@ Public Class RawPartPageUC
' Costante raggio cerchietto
Private Const RAD_CIRCLE As Double = 30
Private m_nIdMinRedX As Integer = -1
Private m_SafetyZone_X = 0
Private m_nIdMinRedY As Integer = -1
Private m_SafetyZone_Y = 0
Private m_bSafetyZoneRight As Boolean = True
Private m_bSafetyZoneBottom As Boolean = True
Private m_bExistsSafetyZone As Boolean = False
' Riferimento grezzo
Private m_bEnableOtherRefTab As Boolean = False
Private m_bOtherRefTab As Boolean
Public m_OtherRefTabX As Double = 0
Public m_OtherRefTabY As Double = 0
Public m_OtherRefTabList(3) As String
Public m_OtherRefTabPos As Integer = 0
Public m_OtherRefTabX As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabY As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabPos As Integer = 0 ' poisizione riferimento (Bottom-Left, ..)
Public m_OtherRefTabOrientationList(3) As String ' oriemtazione riferiemnto
Public m_OtherRefTabList As New List(Of ReferenceTable) ' lista dei riferiemneti configurata nel programma
Public m_CurrRefTab As Integer = 1 ' inidice del riferimento della lista corrente
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
Private m_OtherRefTabPoint As Point3d
@@ -118,13 +129,20 @@ Public Class RawPartPageUC
FROM_SAW = 7
End Enum
Private Enum OTHERREFMODE As Integer
Friend Enum OTHERREFMODE As Integer
BL = 0
BR = 1
TR = 2
TL = 3
End Enum
Private Enum STATDRAG As Integer
OK = 0
X_ = 1
_Y = 2
XY = 3
End Enum
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
'Creazione della Page UserControl e relative impostazioni
@@ -167,10 +185,10 @@ Public Class RawPartPageUC
RawModeCmBx.ItemsSource = m_RawModeList
' Creo la lista dei riferimenti tavola
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left"
m_OtherRefTabOrientationList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabOrientationList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabOrientationList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabOrientationList(OTHERREFMODE.TL) = "Top left"
' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
@@ -214,6 +232,7 @@ Public Class RawPartPageUC
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
OtherRefTabTxBl.Text = "New Ref On Tab"
End Sub
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -320,6 +339,23 @@ Public Class RawPartPageUC
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
KerfTxBx.Text = LenToString(dInvertKerf * m_RawKerf, 2)
' Recupero gli ID delle pareti che delimitano l'area Protetta (movimenti in OverZ)
Dim nIdBase As Integer = EgtGetBaseId("Base")
m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
If m_nIdMinRedY <> GDB_ID.NULL And m_nIdMinRedY <> GDB_ID.NULL Then
m_bExistsSafetyZone = True
Dim ptMinX, ptMaxX As Point3d
EgtGetBBoxGlob(m_nIdMinRedX, GDB_BB.STANDARD, ptMinX, ptMaxX)
m_SafetyZone_X = ptMinX.x
Dim ptMinY, ptMaxY As Point3d
EgtGetBBoxGlob(m_nIdMinRedY, GDB_BB.STANDARD, ptMinY, ptMaxY)
m_SafetyZone_Y = ptMinY.y
End If
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
' Creo layer temporaneo per crocette
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
@@ -348,7 +384,6 @@ Public Class RawPartPageUC
EgtZoom(ZM.ALL)
End If
'Imposto il materiale corrente nella combobox
'MaterialsCmbx.SelectedItem = m_CurrentMachine.CurrMat
Dim Item As Material
For Each Item In MaterialsCmbx.Items
If Not IsNothing(m_CurrentMachine.CurrMat) AndAlso Item.sName = m_CurrentMachine.CurrMat.sName Then
@@ -368,9 +403,36 @@ Public Class RawPartPageUC
OtherRefTabBtn.Visibility = Visibility.Visible
End If
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
' Recupero il riferimento attivo
m_CurrRefTab = GetPrivateProfileInt(S_RAWPART, K_CURRENTREFTAB, 0, m_MainWindow.GetIniFile())
' carico l'elenco dei riferimenti da usare
LoadRefTabList()
' Solo se non esiste una lista allora leggo i valori
If m_OtherRefTabList.Count = 0 Then
' Versione precedente 2.7c# DEPRECABILE
Dim Off_X As Double = -1000
Dim Off_Y As Double = -1000
Dim Pos_Ind As Integer = -1
Off_X = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, -1000, m_MainWindow.GetIniFile())
Off_Y = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, -1000, m_MainWindow.GetIniFile())
Pos_Ind = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, -1, m_MainWindow.GetIniFile())
If Off_X <> -1000 And Off_Y <> -1000 And Pos_Ind <> -1 Then
Dim Local_Text As String = DoubleToString(Off_X, 2) & "," & DoubleToString(Off_Y, 2) & "," & Pos_Ind.ToString
Dim local_NewRef As New ReferenceTable(Local_Text, 0)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
m_CurrRefTab = 0
' Carico i valori
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
' Creo la nuova configurazione da usare
Dim sKeyMsg As String = K_REFTAB & m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_OtherRefTabX, 2) & "," & DoubleToString(m_OtherRefTabY, 2) & "," & m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End If
End If
End If
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
OtherRefTabChBx.IsChecked = m_bOtherRefTab
' se riferimento tavola differente da quello atteso
@@ -389,6 +451,29 @@ Public Class RawPartPageUC
' EgtDraw()
End Sub
Private Sub LoadRefTabList()
m_OtherRefTabList.Clear()
Dim sRefTab As String = String.Empty
Dim nIndex As Integer = 0
While GetPrivateProfileString(S_RAWPART, K_REFTAB & nIndex.ToString, "", sRefTab, m_MainWindow.GetIniFile()) > 0
Dim local_NewRef As New ReferenceTable(sRefTab, nIndex)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
nIndex += 1
Else
EgtOutLog("ERROR in reading RefTab" & nIndex.ToString & " is not correctly defined in file OmagCUT.ini, any other reference will not loaded")
Exit While
End If
End While
' Assegno il riferimento corrente
If m_CurrRefTab < m_OtherRefTabList.Count Then
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -571,6 +656,19 @@ Public Class RawPartPageUC
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Creo una copia del punto corrente
Dim ptTemp As New Point3d(ptCurr.x, ptCurr.y, ptCurr.z)
Select Case DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, ptCurr - m_ptPrev)
Case STATDRAG.X_
ptCurr.x = m_ptPrev.x
Case STATDRAG._Y
ptCurr.y = m_ptPrev.y
Case STATDRAG.XY
m_ptPrev = ptCurr
Return
End Select
' Eseguo modifica
Select Case m_ActiveRawMode
Case RAWMODE.RECTANGLE
@@ -581,7 +679,7 @@ Public Class RawPartPageUC
ModifyDamaged(ptCurr)
End Select
' Aggiorno il punto precedente
m_ptPrev = ptCurr
m_ptPrev = ptTemp
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
End Sub
@@ -764,6 +862,13 @@ Public Class RawPartPageUC
If m_bProbingOn Then Return
' reimposto il comando OutLine
OutlineBtn_Click(Nothing, Nothing)
' Nasocndo eventuali pareti
If m_bExistsSafetyZone Then
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End If
' Se confermata uscita
If ExitRawPart(True) Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
@@ -2019,6 +2124,8 @@ Public Class RawPartPageUC
Dim dInvertKerf As Double = 1
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
Dim dMaxLen = m_dTableLength - m_RawOffsX - m_RawKerf * dInvertKerf
' Se è attiva l'area sicura allora devo ricalcolare la dimensione massima
If dLength <= dMaxLen Then
m_CurrProjPage.ClearMessage()
If dKerf < 0 Then
@@ -2063,6 +2170,8 @@ Public Class RawPartPageUC
If Not StringToLen(HeightTxBx.Text, dHeight) Then
Return
End If
' verifico se l'altezza del pezzo è maggiore di quella consentita in macchina
DrawSafetyZone(dHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
If dHeight > -EPS_ZERO Then
m_CurrProjPage.ClearMessage()
If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then
@@ -2132,6 +2241,91 @@ Public Class RawPartPageUC
End If
End Sub
' Funzione che si occupa di disegnare le pareti dell'area sicura e di gestire il grezzo (
Private Function DrawSafetyZone(dHeight As Double, dHighPieceZ As Double, vtMove As Vector3d) As STATDRAG
' Se non esiste allora esci senza eseguire controlli
If Not m_bExistsSafetyZone Then Return STATDRAG.OK
' Verifico se attivare la visualizzazione
Dim nStatus As GDB_ST = GDB_ST.OFF
If dHeight > dHighPieceZ Then
nStatus = GDB_ST.ON_
End If
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
EgtSetStatus(m_nIdMinRedX, nStatus)
EgtSetStatus(m_nIdMinRedY, nStatus)
EgtDraw()
If nStatus = GDB_ST.ON_ Then
Return VerifyDimensionRawSafetyZone(vtMove)
End If
Return STATDRAG.OK
End Function
' Verifica che le dimensioni del grezzo siano conformi con l'area sicura (altrimenti provvedo a ridimensionare il grezzo)
Private Function VerifyDimensionRawSafetyZone(vtMove As Vector3d) As STATDRAG
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim ptMinRaw, ptMaxRaw As Point3d
EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
' Dimensioni grezzo
Dim Len_X As Double = ptMaxRaw.x - ptMinRaw.x
Dim Wid_Y As Double = ptMaxRaw.y - ptMinRaw.y
' Posiztion SafetyZone: RIGHT-BOTTOM
Dim RedTab_X = m_dTableLength - Math.Abs(m_SafetyZone_X - m_ptTableMin.x)
Dim RedTab_Y = Math.Abs(m_SafetyZone_Y - m_ptTableMin.y)
If RedTab_X < Len_X Then
' riduco le dimensioni del grezzo
m_RawLength = RedTab_X - EPS_SMALL * 10
LengthTxBx.Text = LenToString(m_RawLength, 2)
UpdateRawPart()
End If
If RedTab_Y < Wid_Y Then
' riduco le dimensioni del grezzo
m_RawWidth = RedTab_Y - EPS_SMALL * 10
WidthTxBx.Text = LenToString(m_RawWidth, 2)
UpdateRawPart()
End If
Return VerifyRawInSafetyZone(vtMove)
End Function
' Verifico che la posizione del grezzo sia conforme con la posizione di area sicura
Private Function VerifyRawInSafetyZone(vtMove As Vector3d) As STATDRAG
Dim nStat As STATDRAG = STATDRAG.OK
Dim bCalcBBoxRaw As Boolean = False
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim ptMinRaw, ptMaxRaw As Point3d
EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
' Posiztion SafetyZone: RIGHT-BOTTOM
' Verifico che il grezzo sia all'interno di questi estremi
If ptMinRaw.x + vtMove.x < m_SafetyZone_X Then
' riposiziono il grezzo sulla parete
Dim ptRef As Point3d = New Point3d(m_SafetyZone_X - m_ptTableMin.x, ptMinRaw.y - m_ptTableMin.y, 0)
EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
' aggiorno il valore di Offset
m_RawOffsX = m_SafetyZone_X + m_RawKerf - m_ptTableMin.x
m_RawOffsY = ptMinRaw.y + m_RawKerf - m_ptTableMin.y
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
bCalcBBoxRaw = True
nStat = STATDRAG.X_
End If
' Ricalcolo la posizione del grezzo se nel processo sopra ho eseguito uno spostamento
If bCalcBBoxRaw Then EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
If ptMaxRaw.y + vtMove.y > m_SafetyZone_Y Then
Dim dRawWidth As Double = ptMaxRaw.y - ptMinRaw.y
Dim ptRef As Point3d = New Point3d(ptMinRaw.x - m_ptTableMin.x, m_SafetyZone_Y - dRawWidth - m_ptTableMin.y, 0)
EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
m_RawOffsX = ptMinRaw.x + m_RawKerf - m_ptTableMin.x
m_RawOffsY = m_SafetyZone_Y - dRawWidth + m_RawKerf - m_ptTableMin.y
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
bCalcBBoxRaw = True
nStat = nStat + STATDRAG._Y
End If
EgtDraw()
' Se ho ricalcolato la posizione del BBox grezzo allora ritorno falso
Return nStat
End Function
#Region "OTHERREFTAB"
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
@@ -2228,11 +2422,19 @@ Public Class RawPartPageUC
End Sub
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
' Aggiorno la lista dei riferimenti
LoadRefTabList()
' apro la finestra per gestire il riferimento
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos)
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos, m_CurrRefTab)
OthWD.ShowDialog()
End Sub
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
' Imposto modalità manuale della macchina
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
End Sub
#End Region ' OtherRefTab
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
@@ -2352,6 +2554,8 @@ Public Class RawPartPageUC
KerfTxBx.Text = LenToString(m_RawKerf, 2)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 22) & " " & LenToString(dMaxKerf, 2)) 'Massimo kerf =
End If
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
End Sub
Private Sub RawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawProbingBtn.Click
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

+14 -5
View File
@@ -36,6 +36,7 @@ Public Class SimulationPageUC
Friend Sub ResetSimulation()
' Termino la simulazione
SetStatus(MCH_SIM_ST.UI_STOP)
System.Threading.Thread.Sleep(250)
EgtSimExit()
' Salvo valore dello slider
Dim sVal As String = DoubleToString(SpeedSlider.Value, 1)
@@ -86,6 +87,7 @@ Public Class SimulationPageUC
End Sub
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
EgtOutLog(" -- PREPARE SIMUL --")
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
Dim bOk As Boolean = True
' Elimino eventuale attrezzaggio da OmagOFFICE
@@ -110,9 +112,9 @@ Public Class SimulationPageUC
If bOk Then m_CurrProjPage.SetOrderMachiningFlag()
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
Else
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
End If
End If
' Costringo ad aggiornare UI
@@ -130,7 +132,7 @@ Public Class SimulationPageUC
' Se errore in setup, lo segnalo
If Not bSetup Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
' Se errore in generazione, segnalo l'errore
' Se errore in generazione, segnalo l'errore
ElseIf Not bOk Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
@@ -170,7 +172,7 @@ Public Class SimulationPageUC
' Nascondo eventuale contorno da foto
m_CurrProjPage.ShowContour(False)
' Nascondo eventuali testi con dati su aree
m_CurrProjPage.SetAreasStatus( false)
m_CurrProjPage.SetAreasStatus(False)
' Recupero eventuale fase di ripartenza
m_nRestart = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart()
' Imposto prima fase
@@ -206,6 +208,12 @@ Public Class SimulationPageUC
Else
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative))
End If
Dim nIdBase As Integer = EgtGetBaseId("Base")
Dim m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
If m_nIdMinRedX <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
Dim m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
If m_nIdMinRedY <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End Sub
Private Sub StepBtn_Click(sender As Object, e As RoutedEventArgs) Handles StepBtn.Click
@@ -477,7 +485,8 @@ Public Class SimulationPageUC
Private Function LoadCurrTools() As Boolean
' Se macchina senza cambio utensile automatico devo caricare gli utensili
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER And
m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then
' Imposto la lama corrente
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not EgtLoadTool("H1", 1, sSaw) Then Return False
+21
View File
@@ -453,6 +453,27 @@ Module Utility
Return True
End Function
' Restituisce il colore dell'utensile correntemente settato, se non trova l'utesile o il colore ritorna il default (0,255,0)
Friend Function GetColorPV() As Color3d
Dim ToolString As String = String.Empty
Dim ToolColor As String = String.Empty
'EgtTdbGetCurrToolParam(MCH_MP.SYSNOTES, ToolString)
EgtTdbGetCurrToolParam(MCH_TP.SYSNOTES, ToolString)
EgtTdbGetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ToolColor)
Dim sItems As String() = ToolColor.Split(","c)
' Verifico che siano almeno 3 campi
If sItems.Count < 3 Then
Return New Color3d(0, 255, 0, 100)
Else
' Verifico che tutti i campi siano numerici
If IsNumeric(sItems(0)) And IsNumeric(sItems(1)) And IsNumeric(sItems(2)) Then
Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2)), 100)
Else
Return New Color3d(0, 255, 0, 100)
End If
End If
End Function
'--------------------------------------------------------------------------------------------------
Public Class Language