Compare commits

...

144 Commits

Author SHA1 Message Date
NicolaP 02a8e3a274 Migliorata gestione/visualizzazione giunzione dei tagli inclinati 2022-10-24 18:03:25 +02:00
NicolaP 00bbe3ad70 Migliorata visualizzazione e invertito segno degli angoli 2022-10-20 10:28:19 +02:00
NicolaP 4ca3b4ee47 Gestione primo taglio inclinato 2022-10-11 18:34:32 +02:00
NicolaP 6b6031379b Merge branch 'master' into develop 2022-10-06 13:02:48 +02:00
NicolaP 7e96fb2385 Cambio versione: 2.4i4 2022-10-06 13:02:11 +02:00
NicolaP 7ee4a2e552 Merge branch 'develop' 2022-10-06 12:59:49 +02:00
NicolaP 105a12c497 Merge branch 'Features/Manage_Pause_Unloading' into develop 2022-10-06 11:09:59 +02:00
NicolaP e0f380ed1d Merge branch 'Features/StartEnd_Modify_On_Internal_Corner' into develop 2022-10-06 10:48:08 +02:00
NicolaP a568c614fb Migliorata gestione deposito su tavola ausiliaria 2022-10-03 19:14:22 +02:00
NicolaP 6dc5fe5a12 Gestione modifica per scarico su tavola 2 2022-10-03 18:23:20 +02:00
NicolaP a1db5945df Gestione allungamenti tagli sugli angoli interni 2022-10-03 13:11:23 +02:00
NicolaP fba8b377f9 Correzione Merge 2022-10-03 11:53:55 +02:00
NicolaP 401b171c4e Merge branch 'Features/Manage_General_Cut_Param' into develop 2022-09-30 19:55:41 +02:00
NicolaP 3285d72817 Merge branch 'Features/Scraps_From_Cut' into develop 2022-09-30 19:55:15 +02:00
NicolaP 17229ab9bc Migliorata gestione scene e eliminazione Slab 2022-09-28 11:59:11 +02:00
NicolaP c3abca3cee Inizio gestione modifica per spostamenti 2022-09-22 20:16:19 +02:00
NicolaP 2e0f2eab1b Gestione riconoscimento sfridi da progetto 2022-09-22 17:33:17 +02:00
NicolaP 9c60ef020f Sacrico tutti i pezzi da tavola ausiliaria 2022-09-21 18:56:49 +02:00
NicolaP 58c62ebd5c Carico coordinate punti del grezzo (Da verificare) 2022-09-21 18:23:05 +02:00
NicolaP ab525c7431 Aggiunta modifica 2022-09-21 17:55:33 +02:00
NicolaP 613b9fa725 Correzione gestione salvataggio fase 2022-09-21 17:52:51 +02:00
NicolaP e4e20b9f91 Salvataggio nell'utensile delle info di taglio 2022-09-19 20:22:22 +02:00
NicolaP ca6a468cda Merge branch 'develop' 2022-09-19 15:09:11 +02:00
NicolaP 24ddd7d245 Migliorata gestione ponticelli 2022-09-19 14:59:48 +02:00
NicolaP f9fd0f0168 Miglioramento gestione comado AddSpar/RemoveScrap 2022-09-19 12:19:40 +02:00
NicolaP eac7b0999a Merge branch 'develop' 2022-09-15 12:15:52 +02:00
NicolaP a464e0dc3b Milgiorato Reset ponticelli da movimento pezzo 2022-09-15 12:15:25 +02:00
NicolaP 401af44bb5 Merge branch 'develop' 2022-09-15 12:00:00 +02:00
NicolaP 1599515d58 Gestione eliminazione Pezzi/Ponticelli 2022-09-15 11:59:45 +02:00
NicolaP 0be1695246 Merge branch 'develop' 2022-09-15 11:20:19 +02:00
NicolaP a79725783f Migliorata selezione lati per ponticelli 2022-09-15 11:19:39 +02:00
NicolaP f13a51e8a1 Merge remote-tracking branch 'origin/master' into develop 2022-09-15 11:06:00 +02:00
NicolaP b77ed406ae Inizio gestione salvataggio parametri lavorazione 2022-09-15 11:05:37 +02:00
DarioS bb650afe9c OmagCUT :
- aggiunte altre info per Bridges.
2022-09-14 10:11:37 +02:00
NicolaP 1d87ac5c47 Merge branch 'develop' 2022-09-13 15:28:30 +02:00
NicolaP fc3053df66 Eliminazione Bridges se muovo grezzo 2022-09-13 15:28:06 +02:00
NicolaP 588ef08b17 Merge branch 'develop' 2022-09-13 12:27:27 +02:00
NicolaP ebdaeece85 Merge branch 'Features/Research_DXF' into develop 2022-09-13 12:27:10 +02:00
NicolaP 1605f81090 Merge branch 'develop' 2022-09-13 11:28:05 +02:00
NicolaP a10703fe94 Aggiorno lavorazioni dopo Ins/Del di ogni Bridge 2022-09-13 11:27:31 +02:00
NicolaP a0575cbbac Migliorata gestione dei pontocelli 2022-09-13 11:21:42 +02:00
NicolaP 8180ffaeaa Merge remote-tracking branch 'origin/HEAD' into develop 2022-09-13 10:14:08 +02:00
DarioS 848783078c Merge branch 'master' of https://gitlab.steamware.net/egaltech/OmagCUT 2022-09-13 09:01:49 +02:00
DarioS 45f0245f9f OmagCUT 2.4i2 :
- ricompilazione con cambio di versione.
2022-09-13 09:01:10 +02:00
NicolaP a81a7f8d9e Correzione gestione importazione di più pezzi DXF 2022-09-12 14:54:54 +02:00
NicolaP ca0210cf09 Aggiunta gestine notifica di lastra in letttura 2022-09-12 10:22:40 +02:00
NicolaP 622912dec3 Gestione Add/Save/Delete lastra da DB 2022-09-09 17:24:16 +02:00
NicolaP 8ed35a5c46 Merge branch 'develop' 2022-09-09 09:46:05 +02:00
NicolaP a2bbcfed95 Cambio versione 2022-09-09 09:44:42 +02:00
NicolaP 0667da3692 Merge branch 'Features/Save_TRF_Data' into develop 2022-09-09 09:42:35 +02:00
NicolaP 5ff39c9d1c Gestione personalizzata OmagPHOTO 2022-09-08 19:27:24 +02:00
NicolaP 60a666c1c1 Creazione pagina per gestione campi DB 2022-09-07 18:10:03 +02:00
NicolaP df47692e8e Salvataggio nel file *.ini del programma dati TRF 2022-09-06 12:59:11 +02:00
NicolaP 5f2d03cbcb Gestione ricerca progetti 2022-09-05 16:56:04 +02:00
NicolaP 5255fad7fc Gestione ricerca file DXF 2022-09-05 16:30:04 +02:00
NicolaP 41903872b1 Definita funzione per il salvataggio TabAux (ERRORE simulazione) 2022-09-05 12:13:26 +02:00
NicolaP beb3ce841b Inizio gestione creazione grezzi per scarico (ERRORI simulazione) 2022-09-01 20:29:46 +02:00
NicolaP 4a2da4ac41 Merge branch 'Features/Waterjet_Bridges' into develop 2022-09-01 11:23:20 +02:00
NicolaP 869b459c3b Introduzione costanti Bridges e BridgeLine 2022-08-31 17:55:20 +02:00
NicolaP aa84b2c8ab Gestione verifica interferenza Bridge-Region 2022-08-31 17:47:08 +02:00
NicolaP 555d2d029f Gestione eliminazione Ponticelli WaterJet (manca verifica interferenza) 2022-08-31 15:13:46 +02:00
NicolaP 749fb2d949 Gestione creazione di Ponticelli WaterJet 2022-08-30 17:43:34 +02:00
NicolaP 5b3e73290c Salvataggio in DB dell'iimagine ritagliata 2022-08-29 20:09:46 +02:00
NicolaP 854519b706 Aggiunti riferimenti alla libreria EgtPHOTOLib 2022-08-25 19:28:07 +02:00
NicolaP d8179b47ee Inizio gestione sfridi 2022-08-24 18:58:33 +02:00
NicolaP f68e141449 Merge commit '011c94cc6b6b792e734851ae695fbbf637b1de93' into develop 2022-08-24 12:44:26 +02:00
DarioS 011c94cc6b OmagCUT 2.4g1 :
- cambio di versione
2022-08-11 10:45:23 +02:00
NicolaP 64da46c0a4 Merge branch 'master' into develop 2022-08-08 09:35:15 +02:00
DarioS aab81c6af7 Merge branch 'master' of https://gitlab.steamware.net/egaltech/OmagCUT 2022-08-02 10:01:28 +02:00
Emmanuele Sassi 46be644285 Merge remote-tracking branch 'origin/develop' 2022-08-02 09:54:53 +02:00
DarioS 5fe75b78e5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/OmagCUT 2022-08-02 08:25:41 +02:00
Emmanuele Sassi eafe6184eb Merge branch 'Test' 2022-08-01 19:46:31 +02:00
Emmanuele Sassi 1bf42ebbc1 - Aggiornata versione a 2.4f1
- Allungato tempo attesa risposta modifica stato macchina su num flexium
- Aggiunta verifica diametro utensile su tastatura tagli inclinati
2022-08-01 19:46:07 +02:00
NicolaP 0e35e41c4a Merge branch 'Features/Raw_Definition_By_Saw' into develop 2022-07-05 17:42:26 +02:00
NicolaP 64e3fd83de Aggiunto commento nuova libreria 2022-07-05 17:41:07 +02:00
NicolaP e5e74a6afd Merge branch 'develop' into Features/Raw_Definition_By_Saw 2022-07-05 17:15:50 +02:00
NicolaP 28deac8501 Merge branch 'Features/Refactory_WaterJet_Lib' into develop 2022-07-05 17:14:14 +02:00
NicolaP 367a8c9fc3 Nuova gestione libreria EgtWPFLib5 2022-07-05 17:13:42 +02:00
NicolaP 0717546ad0 Gestione macchine WaterJet 2022-07-04 17:56:33 +02:00
NicolaP 3bf1a87688 Correzione gestione uscita Area Danneggiata e Elimina Area con Laser e Lama 2022-07-04 15:18:49 +02:00
NicolaP 6d82b6efee Definizione grezzo e aree rovinate tramite posizione Lama 2022-07-04 12:39:19 +02:00
NicolaP 94102172dd Merge branch 'Features/Manage_Filo_Top_Corner' into develop 2022-07-04 10:43:47 +02:00
NicolaP 82426db72a Correzione scrittura codice 2022-06-30 18:59:59 +02:00
NicolaP 20fd722dee Migliorata gestione filotop associata 2022-06-30 15:14:30 +02:00
NicolaP c83b3e6bea Merge branch 'develop' 2022-06-29 16:01:32 +02:00
NicolaP a45613ff39 Correzione spianatura con fresa 2022-06-29 15:36:52 +02:00
NicolaP 84690ddf32 Inizio gestione arrotondamento FiloTop 2022-06-29 15:08:28 +02:00
NicolaP 844cb3cfe6 Aggiunto commanto per uso Fresa nella lavorazione SPIANATURA 2022-06-28 19:15:59 +02:00
NicolaP ee84a57194 Merge branch 'master' into develop 2022-06-27 12:20:13 +02:00
NicolaP efa1cb1272 Cambio versione 2.4f1 2022-06-27 12:19:34 +02:00
NicolaP 1437d20353 Correzione inserimento in parcheggio pezzo rovinato (ProdLine) 2022-06-27 12:13:33 +02:00
NicolaP 3d4a921719 Correzione stampa numero settimana 2022-06-23 19:07:11 +02:00
NicolaP e26d68b0f3 Merge branch 'master' into develop 2022-06-23 12:37:23 +02:00
NicolaP 7815b7ec89 Cambio versione 2.4e5 2022-06-23 12:29:11 +02:00
NicolaP 66051943c7 Correzione deselezione lato TestTaglio 2022-06-23 12:25:43 +02:00
NicolaP 2e9071569a Merge branch 'master' into develop 2022-06-23 11:31:51 +02:00
NicolaP 813d224f50 Correzioen messaggi 2022-06-23 11:31:08 +02:00
NicolaP 5f03a36df2 Merge branch 'Features/Manage_Engrave' into develop 2022-06-20 17:21:40 +02:00
NicolaP ac9c347bc0 Merge branch 'Features/SHOTT_Over_Table' into develop 2022-06-20 17:21:29 +02:00
NicolaP 9784c75766 Merge branch 'Features/Manage_REDO' into develop 2022-06-20 17:21:10 +02:00
NicolaP 8af69e553d Eliminato file temporaneo di salvataggio per test 2022-06-13 12:50:40 +02:00
NicolaP 3128f89f63 Gestione affondamento incisioni successive alla prima 2022-06-09 18:24:27 +02:00
NicolaP 56884c34f2 Migliorata lettura dato Sovratavola 2022-06-01 12:35:06 +02:00
NicolaP 332b17e55e Lettura/Scrittura dimensione sovratavola nel progetto 2022-06-01 11:50:03 +02:00
NicolaP 4aaf1d084e Merge branch 'develop' into Features/Manage_REDO 2022-06-01 10:19:56 +02:00
NicolaP 4bcbe8d290 Merge branch 'master' into develop 2022-06-01 10:18:53 +02:00
NicolaP 8484087c69 Corretto versione KeyOption 2022-05-30 15:10:58 +02:00
NicolaP 116289cac5 Merge branch 'develop' 2022-05-30 15:03:00 +02:00
NicolaP 30ee1bcf99 Merge remote-tracking branch 'origin/master' 2022-05-30 14:58:08 +02:00
NicolaP a1d7983704 Cambio versione 2022-05-30 14:52:25 +02:00
NicolaP 636d3a9eca Inseriti messaggi, costanti e immagini per comandi WJ 2022-05-30 14:32:46 +02:00
NicolaP bd70bf1ec9 Gestione StartPoint per tagli WJ InLoop 2022-05-26 17:51:22 +02:00
NicolaP d66b331478 Aggiunta visualizzazione tgli WJ separati 2022-05-26 16:36:35 +02:00
NicolaP aecb8ed442 Migliorato controllo contorno WaterJet per StartPoint 2022-05-25 18:08:08 +02:00
NicolaP 3e72b216a6 Migliorata evidenziazione PreView in SplitCurv 2022-05-25 15:28:43 +02:00
NicolaP 5baa701681 Merge branch 'Features/Statistic_4.0' into develop 2022-05-23 18:41:05 +02:00
NicolaP e3a1330889 Merge branch 'Feature/WaterJet_Punto_Inizio' into develop 2022-05-23 18:40:07 +02:00
NicolaP aa237fd744 Gestione scrittura info per definizioen StartPoint 2022-05-23 18:39:33 +02:00
NicolaP ccfc8f89e4 Gestione separazione tagli waterjet in pagina Nest 2022-05-23 15:54:01 +02:00
NicolaP a2e28fa134 Aggiunta info "ProjName" nel gruppo "OmagCut" del progetto 2022-05-18 12:22:06 +02:00
DarioS d8c16a34f0 OmagCUT 2.4e3 :
- ricompilazione per nuova versione (nelle dll corretto problema rallentamenti iniziali e finali non più eseguiti).
2022-05-17 08:49:27 +02:00
DarioS 1847154a29 OmagCUT 2.4e1 :
- ricompilazione con cambio versione.
2022-05-02 17:30:50 +02:00
NicolaP 2362c8df61 Merge branch 'Features/Manage_Interference_On_Vacuum_Move' into develop 2022-05-02 15:05:57 +02:00
NicolaP 54127e61ec Correzione veriosne 2.4d1 (non è mai stata rilasciata una versione d1) 2022-04-28 18:26:37 +02:00
NicolaP aaa39c3779 Merge branch 'master' into develop 2022-04-28 16:25:31 +02:00
NicolaP 78fc3118ab Aggrionata versione 2.4d2 2022-04-28 16:24:28 +02:00
NicolaP 4ff2ac1063 Merge branch 'master' into develop 2022-04-28 15:06:29 +02:00
NicolaP edab1024c3 Merge branch 'Features/Limit_Vacuum_On_Stroke' 2022-04-28 14:54:27 +02:00
NicolaP 5092385ea4 Merge branch 'Features/Manage_File_CadCut' 2022-04-28 14:53:53 +02:00
NicolaP 6cde63cd2e Correzione scrittura codice 2022-04-28 14:50:29 +02:00
NicolaP 4f12bce90a Aggiunta icona per generazione CN 2022-04-27 18:47:31 +02:00
NicolaP 0107fc022b Miglioramento comando Modifica in pagina Split 2022-04-21 11:50:57 +02:00
NicolaP a69418c6f5 Merge branch 'Features/Manage_File_CadCut' into Features/Manage_Interference_On_Vacuum_Move 2022-04-20 11:31:11 +02:00
NicolaP c79e1b0327 Verifica collisione pezzi in fase di manipolazione 2022-04-14 18:34:37 +02:00
NicolaP 915d3c0408 Generazione file CadCut dalla pagina della simulazione 2022-04-14 10:59:40 +02:00
NicolaP f53b6e0bd5 Verifica movimentazione dei pezzi entro i limiti corse 2022-04-13 17:31:45 +02:00
NicolaP fc7b4d276c Gestione limiti corsa in fase di prelievo 2022-04-11 19:36:49 +02:00
NicolaP 95460ecbb2 Merge branch 'master' into Features/Max_Weight_On_Vacuums 2022-04-11 13:05:46 +02:00
NicolaP de203b55fa Gestione dell'extra corsa anche per l'asse X 2022-04-11 10:14:45 +02:00
NicolaP 0a8dbb3557 Abilitata la lettura degli angoli preferenziali per extra corsa Y ventose 2022-04-08 15:04:21 +02:00
NicolaP 1f66a8f4ef Merge branch 'Features/Manage_Vacuum_StrokeY' into Features/Max_Weight_On_Vacuums 2022-04-08 12:58:02 +02:00
NicolaP 93b432284d Gestione rotazione ventosa vicino finecorsa Y 2022-04-07 19:25:46 +02:00
NicolaP 677c3af3b7 Correzione definizione funzione 2022-04-07 18:31:47 +02:00
NicolaP eb22771d06 Verifica del peso del grezzo prima del prelievo 2022-04-07 17:48:00 +02:00
60 changed files with 4297 additions and 227 deletions
+77 -1
View File
@@ -93,7 +93,7 @@ Friend Module CamAuto
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
' Reinserisco tutte le lavorazioni piane
AddMachinings(GDB_ID.NULL, nWarn)
' Se altrimenti progetto con cornici
' Se altrimenti progetto con cornici
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
' Reinserisco tutte le lavorazioni delle cornici
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
@@ -101,6 +101,82 @@ Friend Module CamAuto
Return True
End Function
Friend Function ResetAllSplitCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
Friend Function ResetAllStartCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
Friend Function ResetAllBRidges() As Boolean
Dim bOk As Boolean = True
Dim nMachGroup As Integer = EgtGetCurrMachGroup()
Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
bOk = EgtErase(nBridgesGroup)
Return bOk
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
Dim nValInfo As Integer = 1
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
If nValInfo = 0 Then Return False
End If
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
Return True
End Function
Friend Function RemoveFinalEmptyPhases() As Boolean
Dim nOpeId As Integer = EgtGetLastOperation()
While nOpeId <> GDB_ID.NULL
+10
View File
@@ -108,6 +108,8 @@ Public Class CadCutPageUC
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Se macchina fotografica collegata, faccio una foto
@@ -142,6 +144,8 @@ Public Class CadCutPageUC
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
@@ -168,6 +172,8 @@ Public Class CadCutPageUC
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
@@ -176,6 +182,8 @@ Public Class CadCutPageUC
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
@@ -198,6 +206,8 @@ Public Class CadCutPageUC
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
m_ProjectMgr.TestBtn.IsChecked = False
+12 -6
View File
@@ -133,10 +133,14 @@
</Button>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
@@ -155,9 +159,11 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
</Grid>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid>
+535 -43
View File
@@ -11,8 +11,12 @@ Public Class MoveRawPartPage
Private m_nAuxTabId As Integer = GDB_ID.NULL
' Fase corrente
Private m_nCurrPhase As Integer = 0
' Disposizione corrente
Private m_nCurrDisposition As Integer = GDB_ID.NULL
' Premuto Prev
Private m_bPrev As Boolean = False
' Pemuto Next
Private m_bToNext As Boolean = False
' Dati movimento
Private m_dStep As Double = 0
Private m_dRotation As Double = 0
@@ -28,17 +32,22 @@ Public Class MoveRawPartPage
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Assegno testi
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ScrapsBtn.Content = "Add Scraps"
End Sub
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_SplitPage = m_MainWindow.m_CadCutPageUC.m_SplitPage
m_bActive = True
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Leggo tipo movimento grezzi
m_bByHand = (GetVacuumType() = 0 Or
Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP) Or
@@ -55,40 +64,42 @@ Public Class MoveRawPartPage
m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente
Dim nPrevPhase As Integer = EgtGetCurrPhase()
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
If Not m_SplitPage.m_bShow Then
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
Else
EgtSetCurrPhase(nPrevPhase + 1)
HideAllMachinings()
End If
m_nCurrPhase = EgtGetCurrPhase()
'---------------------------- SCRAPS ----------------------------
' gestione visualizzazione del comando "Scraps"
Dim ScrapsVisibility As Visibility = Visibility.Collapsed
' verifico se licenza abilitat: m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SCRAPS)
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, m_MainWindow.GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, m_MainWindow.GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\OmagPHOTODb.sqlite") Then
ScrapsVisibility = Visibility.Visible
End If
End If
' verifico che siano stati generati dei nuovi grezzi
If vNewRaws.Count = 0 Then
ScrapsVisibility = Visibility.Collapsed
End If
' aggiorno la grafica
ScrapsBtn.Visibility = ScrapsVisibility
'---------------------------- SCRAPS ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' altrimenti, aggiorno visualizzazione
' assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
' altrimenti, aggiorno visualizzazione
Else
EgtDraw()
End If
@@ -126,14 +137,14 @@ Public Class MoveRawPartPage
' Distanza iniziale
m_dCurrDist = 0
End If
' Non dovrebbe mai accadere, ma inizializzo con default
' Non dovrebbe mai accadere, ma inizializzo con default
Else
m_vtDir = Vector3d.Y_AX()
m_ptMid = Point3d.ORIG()
m_dOrigDist = 0
m_dCurrDist = 0
End If
' Altrimenti movimento con ventose
' Altrimenti movimento con ventose
Else
m_bRemovedRaw = False
m_bRawWithCups = False
@@ -147,6 +158,9 @@ Public Class MoveRawPartPage
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
End If
End If
' aggiorno il messaggio del comando per gestire gli sfridi
VerifyIsNewScrap(m_CurrRawOnVacuum)
' Aggiorno interfaccia per taglio perpendicolare
If m_bByHand Then
UpBtn.Visibility = Windows.Visibility.Visible
@@ -162,8 +176,10 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento con ventose
ScrapsBtn.Visibility = Windows.Visibility.Visible
' altrimenti per movimento con ventose
ElseIf Not m_SplitPage.m_bOnAuxTab Then
UpBtn.Visibility = Windows.Visibility.Visible
LeftBtn.Visibility = Windows.Visibility.Visible
@@ -178,8 +194,10 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento finale dei pezzi
ScrapsBtn.Visibility = Windows.Visibility.Visible
' altrimenti per movimento finale dei pezzi
Else
UpBtn.Visibility = Windows.Visibility.Hidden
LeftBtn.Visibility = Windows.Visibility.Hidden
@@ -194,14 +212,48 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Visible
BottomLBtn.Visibility = Windows.Visibility.Visible
BottomRBtn.Visibility = Windows.Visibility.Visible
PauseBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible
ScrapsBtn.Visibility = Windows.Visibility.Hidden
End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
Private Sub SetAuxTabInCurrDisposition()
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' verifico che siano state salvate correttamente le info della tavola di scarico
EgtSaveFile("c:\EgtData\OmagCUT\Temp\AuxTab.nge", NGE.BIN)
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
@@ -230,16 +282,50 @@ Public Class MoveRawPartPage
If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nId, nStat)
' aggiorno il messaggio del bottone "Scrap" a seconda che il grezzo sia già uno scrap
VerifyIsNewScrap(nId)
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
' verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' esco dal ciclo, prima devo depositare correttamente il pezzo
Exit While
End If
' salvo l'indice del pezzo correntemente attaccato alle ventose
m_CurrRawOnVacuum = nId
' Deseleziono tutto e abilito la selezione del pezzo corrente
EgtDeselectAll()
EgtSetStatus(nId, GDB_ST.SEL)
' Se con ventose, le posiziono sul grezzo
If Not m_bByHand Then
Dim rmData As New RawMoveData
' inizializzo i dati del grezzo per il cacolo del peso
Dim MaxSinglePlugger As Double = 250
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, m_MainWindow.GetMachIniFile())
Dim MaxDoublePlugger As Double = 750
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
Dim AverageDensity As Double = 2700
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
@@ -249,10 +335,18 @@ Public Class MoveRawPartPage
' Reset eventuale messaggio
m_CurrProjPage.ClearMessage()
Else
' nascondo la visualizzazione delle ventose
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' Aggiorno i dati
m_bRawWithCups = False
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
If VacuumCups.bOverWeight Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4)) 'Pezzo troppo pesante : non si può muovere
ElseIf VacuumCups.bExtraStroke Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5)) 'Pezzo oltre le corse : non si può muovere
Else
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
End If
End If
End If
End If
@@ -261,8 +355,75 @@ Public Class MoveRawPartPage
End If
nId = EgtGetNextObjInSelWin()
End While
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
End If
End Sub
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
If m_SplitPage.m_bOnAuxTab Then Return False
If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
EgtSetName(m_nTempId, "RawTemp")
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
Dim nCurrPhase As Integer = EgtGetCurrPhase()
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
Dim nIdRaw As Integer = EgtGetFirstRawPart()
' ciclo su tutti i grezzi per veririficare eventuali collisioni
While nIdRaw <> GDB_ID.NULL
' verifico la fase del grezzo
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
' recupero il contorno del pezzo
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
If EgtExistsObj(nIdRawFlatRegion) Then
EgtErase(m_nTempId)
' esiste una intersezione delle superfici
Return True
End If
End If
End If
nIdRaw = EgtGetNextRawPart(nIdRaw)
End While
EgtErase(m_nTempId)
Return False
End Function
Private Function VerifyIsNewScrap(nMyId As Integer) As Boolean
Dim nVal As Integer = 0
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
If nVal = 1 Or nVal = 2 Then
' 1 → è stato definito come nuovo grezzo oppure, 2 → è stato definito come nuovo grezzo ed è stato inserito nel DB delle lastre
ScrapsBtn.Content = "Remove Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return True
ElseIf nVal = 3 Then
' non è possibile rimuovere il grezzo in questa fase
ScrapsBtn.Content = "Defined as Scrap"
ScrapsBtn.IsEnabled = False
Return True
End If
End If
' non è un nuovo grezzo
ScrapsBtn.Content = "Add Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return False
End Function
#Region "Move Up/Down/Left/Right"
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
@@ -285,9 +446,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -322,9 +489,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -342,9 +515,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -361,9 +540,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(-m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -373,6 +558,77 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
#End Region 'Move Up/Down/Left/Right
' verifica che la poszione da raggiungere sia nei limiti delle corse
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
ptEndPointLift.x += vtMove.x
ptEndPointLift.y += vtMove.y
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
Case 1
' extra corsa sulla x-: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 2
' extra corsa sulla x+: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 4
' extra corsa sulla y-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
Case 8
' extra corsa sulla y+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
Return bOk
End Function
#Region "Rotate CounterClockWise/ClockWise"
Private Sub RotateCounterClockwiseBtn_Click(sender As Object, e As RoutedEventArgs) Handles RotateCounterClockwiseBtn.Click
' Solo movimento con ventose
If m_bByHand Then Return
@@ -380,14 +636,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -404,14 +670,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = -m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -421,6 +697,44 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
#End Region ' Rotate CounterClockWise/ClockWise
' verifica che la rotazione da raggiungere sia nei limiti delle corse
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
Case 16
' extra corsa sulla c-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
Case 34
' extra corsa sulla c+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
VacuumCups.dDegRotStartAng = dDegRotEndAng
Return bOk
End Function
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
@@ -440,6 +754,29 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
Private Sub ScrapsBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ScrapsBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
' verifico che il grezzo non contenga dei pezzi (altrimenti non risulta selezionabile)
Dim nPartInRaw As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPartInRaw = GDB_ID.NULL Then
If Not VerifyIsNewScrap(nRawId) Then
EgtSetInfo(nRawId, K_ISNEWSCRAPS, "1")
Else
EgtRemoveInfo(nRawId, K_ISNEWSCRAPS)
End If
' aggiorno il contenuto del bottone
VerifyIsNewScrap(nRawId)
Else
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetErrorMessage("Part inside raw!")
End If
' passo al grezzo succesivo (NON dovrebbero esserci altri grezzi selezionabili contemporaneamente!)
nRawId = EgtGetNextSelectedObj()
End While
End Sub
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
Dim dStep As Double
If StringToLen(StepMoveTxBx.Text, dStep) Then
@@ -524,6 +861,16 @@ Public Class MoveRawPartPage
Next
If Not bOkRotate Then Return
Else
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
Dim b3Area As New BBox3d
EgtGetTableArea(1, b3Area)
Dim b3RawTemp As New BBox3d
EgtGetRawPartBBox(nRawId, b3RawTemp)
' ricavo il riferimento dell'angolo in basso a sinstra del grezzo rispetto alla tavola
Dim ptCorner As Point3d = New Point3d(b3Area.DimX / 2, b3Area.DimY / 2, 0) - New Vector3d(b3RawTemp.DimX / 2, b3RawTemp.DimY / 2, 0)
' sposto il pezzo in questa posizione
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
' riprovo il movimento
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima
@@ -638,6 +985,62 @@ Public Class MoveRawPartPage
Return True
End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
Dim Index As Integer = 0
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
m_RawMoveDataList.RemoveAt(Index)
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
' Creo nuova fase
Dim nNewPhase As Integer = EgtAddPhase()
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
SetPause(nCurrDisposition)
m_nCurrDisposition = nCurrDisposition
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtSetCurrPhase(nNewPhase)
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj()
@@ -658,17 +1061,75 @@ Public Class MoveRawPartPage
End Sub
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' non cambio pagina
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Torno alla fase precedente
m_bPrev = True
' Passo alla pagina delle spezzature
' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
' verifico se la fasa precedente è di tipo scarico
If IsDispUnloadOnAuxTab(nPrevDispId) Then
EgtSetCurrPhase(m_nCurrPhase - 1)
m_nCurrDisposition = nPrevDispId
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
EgtDraw()
Return
End If
'If EgtGetOperationType(EgtGetPrevOperation(m_nCurrDisposition)) = MCH_OY.DISP AndAlso m_SplitPage.m_bOnAuxTab Then
' EgtSetCurrPhase(m_nCurrPhase - 1)
' m_nCurrDisposition = EgtGetPrevOperation(m_nCurrDisposition)
' m_nCurrPhase -= 1
' m_bPrev = False
' m_SplitPage.m_bShow = True
' EgtDraw()
' Return
'End If
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage)
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' non cambio pagina
Return
End If
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Passo alla pagina delle spezzature
@@ -712,6 +1173,26 @@ Public Class MoveRawPartPage
EnableButtons()
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer)
' verifico se la fase precedente è uno scarico su tavola ausiliaria
Dim bVal As Integer = 0
EgtGetInfo(nCurrDispId, "Pat", bVal)
Return bVal
End Function
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
Public Function GetNextDisposition(nCurrDisposId As Integer)
Dim nDispId As Integer = nCurrDisposId
While nDispId <> GDB_ID.NULL
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
Return nDispId
End If
nDispId = EgtGetNextOperation(nDispId)
End While
Return GDB_ID.NULL
End Function
Private Sub EnableButtons()
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -726,11 +1207,22 @@ Public Class MoveRawPartPage
TopRBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
End If
End Sub
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
' Se movimento con ventose
If Not m_bByHand Then
' nascondo le ventose
@@ -746,11 +1238,11 @@ Public Class MoveRawPartPage
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable( nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
' se altrimenti movimento senza ventose perchè lama troppo grande
' se altrimenti movimento senza ventose perchè lama troppo grande
ElseIf GetVacuumType() > 0 Then
' se non solo visualizzazione
If Not m_SplitPage.m_bShow Then
+10 -4
View File
@@ -99,23 +99,29 @@
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="StorePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="StartCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource StartWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" >
<Button Name="RemovePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="DragRettanleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Drag_RettangleImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="SplitCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource SplitWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
+487 -9
View File
@@ -16,12 +16,18 @@ Public Class NestPageUC
' dati per DragRettangoli (estensio/accorciamento dei rettangoli trascinando un lato)
Private m_bIsVisibleDragRettangle As Boolean = False
Friend m_bIsCheckedDragRettangle As Boolean = False
' dati per attivare disattivare le lavorazioni WaterJet
Private m_bIsVisibleSliptCurveWJ As Boolean = False
Friend m_bIsCheckedSplitCurveWJ As Boolean = False
' dati per attivare disattivare la selezione del pubnto di inizio
Private m_bIsVisibleStarCurvetWJ As Boolean = False
Friend m_bIsCheckedStartCurveWJ As Boolean = False
' Id della curva e del taglio selezionati per eseguire il test
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
Friend m_CurrSelectedSawCurv As Integer = GDB_ID.NULL
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
' Id del rettangolo, del taglio e della curva da modificare tramite Drag
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
@@ -33,6 +39,10 @@ Public Class NestPageUC
Private m_sTextContent As String = String.Empty
Private m_dRettangleIsModified As Boolean = False
' Id dei lato WJ da separare tramite comando ON_OFF
Private m_nIdSelectedSideWJ As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet As Integer = GDB_ID.NULL
Enum PART_POS As Integer
IN_TABLE = -1
NONE_TABLE = 0
@@ -85,13 +95,36 @@ Public Class NestPageUC
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
Dim nColumsIn_UG1 As Integer = 2
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bIsVisibleDragRettangle Then
UG1.Columns = 1
nColumsIn_UG1 = 1
DragRettanleBtn.Visibility = Visibility.Collapsed
End If
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
nColumsIn_UG1 += 1
SplitCurveWJBtn.Visibility = Visibility.Visible
'91133=Separa
SplitCurveWJBtn.ToolTip = EgtMsg(91133)
Else
SplitCurveWJBtn.Visibility = Visibility.Collapsed
End If
UG1.Columns = nColumsIn_UG1
Dim nColumnIn_UG0 As Integer = 2
' gestisco la visualizzazione del comando Punto_Inizio (per i tagli waterjet)
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
nColumnIn_UG0 += 1
StartCurveWJBtn.Visibility = Visibility.Visible
' 91132=Start
StartCurveWJBtn.ToolTip = EgtMsg(91132)
Else
StartCurveWJBtn.Visibility = Visibility.Collapsed
End If
UG0.Columns = nColumnIn_UG0
End Sub
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -191,7 +224,7 @@ Public Class NestPageUC
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
If Not EgtGetGroupObjs(nIdSaw) Then
m_CurrSelectedSawCurv = nIdSaw
@@ -209,6 +242,161 @@ Public Class NestPageUC
Return
End Sub
' funzione per la selezione dei lati su cui operare la separazione del tagli waterjet
Private Sub OnMyMouseDownSceneSplitCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_bIsCheckedSplitCurveWJ Then
Return
End If
' Se esiste un elemento selezionato
EgtResetMark(m_nIdSelectedWaterJet)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
EgtDeselectObj(m_nIdSelectedSideWJ)
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
' se non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then
m_nIdSelectedSideWJ = nIdMy
Dim nValInfo As String = 1
Dim nNewValInfo As Integer = nValInfo
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
If nValInfo = 1 Then
nNewValInfo = 0
Else
nNewValInfo = 1
End If
Else
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
nNewValInfo = 0
End If
EgtSetInfo(nIdMy, INFO_JOINENTITY, nNewValInfo)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' assegno un identificativo grafico per inidcare che è un taglio separato
If nNewValInfo = 0 Then
AssignFlagOnGraphic(nIdMy, nIdParentPart)
Else
EraseFlagOnGraphic(nIdMy, nIdParentPart)
End If
m_nIdSelectedWaterJet = nIdWJ
' salvo il valore del PreView evidenziato
EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
Return
End Sub
' funzione per la selezione del punto di inizio tagli waterjet (percorso chiuso)
Private Sub OnMyMouseDownSceneStartCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_bIsCheckedStartCurveWJ Then
Return
End If
' Acquisisco punto da disegno
Dim ptStartCurv As New Point3d
EgtUnProjectPoint(e.Location, ptStartCurv)
' Aggiusto Z punto acquisito (è in globale)
Dim ptRawMax As New Point3d
Dim ptRawMin As New Point3d
If GetRawBox(ptRawMin, ptRawMax) Then
ptStartCurv.z = ptRawMax.z
End If
' Se esiste un elemento selezionato
EgtResetMark(m_nIdSelectedWaterJet)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Or sLayer = NAME_INLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
' verifico che il contorno sia chiuso, altrimenti esco
If Not VerifyOutLoopIsClosed(nIdParent) Then
' 91131=Il contorno non è chiuso
m_CurrProjPage.SetWarningMessage(EgtMsg(91131))
Exit While
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet_n_S associate a questo Part
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
' se non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count = 1 And ListGroupSaw.Count = 0 Then
EgtSetInfo(nIdParent, INFO_START, ptStartCurv)
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
m_nIdSelectedWaterJet = nIdWJ
EgtSetMark(nIdWJ)
EgtDraw()
Exit While
Else
' 91131=Il contorno non è chiuso
m_CurrProjPage.SetWarningMessage(EgtMsg(91131))
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
Return
End Sub
#Region "DRAG RETTANGLE"
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
@@ -216,7 +404,7 @@ Public Class NestPageUC
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left then
If e.Button <> Windows.Forms.MouseButtons.Left Then
Return
End If
' Verifico se selezionato indicativo di pezzo
@@ -511,6 +699,186 @@ Public Class NestPageUC
#End Region ' Drag Rettangolo
#Region "SPLIT/START CURVE"
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
Dim ListOfGroupPV As New List(Of Integer)
Dim nIdGroup As Integer = GDB_ID.NULL
Dim nIdMy As Integer = GDB_ID.NULL
' recupero il primo lato dall'elenco dei lati della figura
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
While nIdMy <> GDB_ID.NULL
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
End If
nIdMy = EgtGetNext(nIdMy)
End While
Return ListOfGroupPV
End Function
' restituisce l'elenco dei Gruppi Saw associati al contorno indicato
Public Function ResearchGropuSaw(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
Dim ListOfGroupPV As New List(Of Integer)
Dim nIdGroup As Integer = GDB_ID.NULL
Dim nIdMy As Integer = GDB_ID.NULL
' recupero il primo lato dall'elenco dei lati della figura
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
While nIdMy <> GDB_ID.NULL
' verifico se esiste una Preview associata al lato
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
If nIdGroup <> GDB_ID.NULL Then
ListOfGroupPV.Add(nIdGroup)
End If
nIdMy = EgtGetNext(nIdMy)
End While
Return ListOfGroupPV
End Function
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
Dim IdWaterjetPV As Integer = GDB_ID.NULL
For Each nIdItem As Integer In ListGroup
Dim sName As String = String.Empty
If EgtGetName(nIdItem, sName) Then
If sName.Contains(nIdMy.ToString) Then
IdWaterjetPV = nIdItem
Exit For
End If
End If
Next
Return IdWaterjetPV
End Function
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
Dim nCount As Integer = 0
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJNext, INFO_JOINENTITY, nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJNext = EgtGetNext(nIdWJNext)
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
Dim nValInfo As Integer = 1
' espressione di controllo per evitare di generare Loop infinito
If nCount > nObjInGroup Then Return
If nIdWj = GDB_ID.NULL Then
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
nCount += 1
EgtGetInfo(nIdWJPrev, INFO_JOINENTITY, nValInfo)
If nValInfo = 1 Then
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
If nIdWj <> GDB_ID.NULL Then Return
Else
Return
End If
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
If nIdWj <> GDB_ID.NULL Then Return
End If
End Sub
Public Sub ResetSplitCurvWJParam()
EgtDeselectObj(m_nIdSelectedSideWJ)
EgtResetMark(m_nIdSelectedWaterJet)
m_nIdSelectedSideWJ = GDB_ID.NULL
m_nIdSelectedWaterJet = GDB_ID.NULL
EgtDraw()
End Sub
' ricevo l'ID del percorso di lavorazione WJ al quale associo una etichetta grafica con scritto "S"
Private Sub AssignFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
If IdAuxLayer = GDB_ID.NULL Then
IdAuxLayer = EgtCreateGroup(IdParentPart)
EgtSetName(IdAuxLayer, INFO_AUX_SPLIT_WJ)
End If
' recupero il punto medio del segmento selezionato
Dim MidPoint As Point3d
EgtMidPoint(nIdMy, GDB_RT.GLOB, MidPoint)
'Dim nIdTextFlag As Integer = EgtCreateText(IdAuxLayer, MidPoint, "*", 20, GDB_RT.GLOB)
Dim nIdTextFlag As Integer = GetCreateFlagText(nIdMy, IdAuxLayer)
EgtSetColor(nIdTextFlag, New Color3d(255, 0, 0))
EgtSetName(nIdTextFlag, "RefSide_" & nIdMy.ToString)
End Sub
Private Function GetCreateFlagText(nId As Integer, nIdLayer As Integer, Optional sText As String = "*") As Integer
' recupero il punto medio
Dim MidPoint As Point3d
EgtMidPoint(nId, GDB_RT.GLOB, MidPoint)
' recupero la direzione del vettore nel punto medio
Dim vVers As Vector3d
EgtMidVector(nId, GDB_RT.GLOB, vVers)
vVers.Normalize()
vVers.Rotate(Vector3d.Z_AX, 90)
' Ingombro complessivo della lavorazione
Dim ptMin, ptMax As Point3d
EgtStartPoint(nId, GDB_RT.GLOB, ptMin)
EgtEndPoint(nId, GDB_RT.GLOB, ptMax)
' Metto il numero nel centro
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
Dim dHtxt As Double = 50
Dim dRat As Double = 0.75
If dRadXY < 200 Then
dHtxt = 40
dRat = 0.6
ElseIf dRadXY < 25 Then
dHtxt = 25
dRat = 0.5
End If
' determino la posizione del flag
MidPoint.x += vVers.x * dHtxt / 2
MidPoint.y += vVers.y * dHtxt / 2
Return EgtCreateTextAdv(nIdLayer, MidPoint, 0, sText, "", 300, False, dHtxt, dRat, 0, INS_POS.MC, GDB_RT.GLOB)
End Function
Private Sub EraseFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
If IdAuxLayer = GDB_ID.NULL Then Return
Dim nIdTextFlag As Integer = EgtGetFirstNameInGroup(IdAuxLayer, "RefSide_" & nIdMy.ToString)
EgtErase(nIdTextFlag)
End Sub
Public Sub ResetStartCurvWJParam()
EgtResetMark(m_nIdSelectedWaterJet)
m_nIdSelectedWaterJet = GDB_ID.NULL
EgtDraw()
End Sub
#End Region ' Split/Start Curve
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à registrazione
If Not m_bActive Or m_bRegister Then Return
@@ -539,6 +907,18 @@ Public Class NestPageUC
Return
End If
' se in modalità SplitCurveWJ (separazione dei tagli WaterJet)
If m_bIsCheckedSplitCurveWJ Then
OnMyMouseDownSceneSplitCurv(sender, e)
Return
End If
' se in modalità StartCurveWJ (punto di inzio taglio waterjet)
If m_bIsCheckedStartCurveWJ Then
OnMyMouseDownSceneStartCurv(sender, e)
Return
End If
' Per default no drag
m_bDrag = False
' Verifico se selezionato indicativo di pezzo
@@ -588,10 +968,10 @@ Public Class NestPageUC
' Drag possibile
m_bDrag = True
Exit While
Else
' verifico se l'elemento selezionato è il nome della tavola
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
Exit While
Else
' verifico se l'elemento selezionato è il nome della tavola
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
' se non è stata eseguita nessuna scelta esco dal ciclo
If nRes = 0 Then Exit While
@@ -795,6 +1175,10 @@ Public Class NestPageUC
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
'' elimino il ponticello associato: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
'DeleteBridgeAssociated(nMoveId)
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
End Sub
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseUpScene
@@ -802,12 +1186,19 @@ Public Class NestPageUC
If Not m_bActive Then Return
' verifico che non sia attivo il comando Test
If m_bSelectCurv Then Return
' verifico che non sia attivo il comando di Drag dei rettangoli
' verifico che sia attivo il comando di Drag dei rettangoli
If m_bIsCheckedDragRettangle Then
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
ResetDragRettangleParam()
Return
End If
' verifico che sia attivo il comando di modifica tagli waterjet
If m_bIsCheckedSplitCurveWJ Then
Return
End If
If m_bIsCheckedStartCurveWJ Then
Return
End If
' Se eseguito drag
If Not m_bDragToStart Then
@@ -1850,6 +2241,12 @@ Public Class NestPageUC
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
If DragRettanleBtn.IsChecked Then
m_bIsCheckedDragRettangle = True
SplitCurveWJBtn.IsChecked = False
ResetSplitCurvWJParam()
m_bIsCheckedSplitCurveWJ = False
StartCurveWJBtn.IsChecked = False
ResetStartCurvWJParam()
m_bIsCheckedStartCurveWJ = False
Else
m_bIsCheckedDragRettangle = False
ResetDragRettangleParam()
@@ -1859,6 +2256,42 @@ Public Class NestPageUC
EgtDraw()
End Sub
Private Sub SplitCurveWJBtn_Click() Handles SplitCurveWJBtn.Click
If SplitCurveWJBtn.IsChecked Then
m_bIsCheckedSplitCurveWJ = True
DragRettanleBtn.IsChecked = False
m_bIsCheckedDragRettangle = False
StartCurveWJBtn.IsChecked = False
ResetStartCurvWJParam()
m_bIsCheckedStartCurveWJ = False
Else
m_bIsCheckedSplitCurveWJ = False
' resetto i parametri di selezione dei lati
ResetSplitCurvWJParam()
m_CurrProjPage.ClearMessage()
ShowParkedParts()
End If
EgtDraw()
End Sub
Private Sub StartCurveWJBtn_Click() Handles StartCurveWJBtn.Click
If StartCurveWJBtn.IsChecked Then
m_bIsCheckedStartCurveWJ = True
DragRettanleBtn.IsChecked = False
m_bIsCheckedDragRettangle = False
ResetSplitCurvWJParam()
SplitCurveWJBtn.IsChecked = False
m_bIsCheckedSplitCurveWJ = False
Else
m_bIsCheckedStartCurveWJ = False
' resetto i parametri di selezione dei lati
ResetStartCurvWJParam()
m_CurrProjPage.ClearMessage()
ShowParkedParts()
End If
EgtDraw()
End Sub
Private Sub StorePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StorePartBtn.Click
' creo la lista delle famiglie di pezzi presenti in parcheggio
GetFamilyGroupInPark()
@@ -1958,6 +2391,10 @@ Public Class NestPageUC
Dim dEraseArea As Double = 0
nId = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
'' elimino eventuali ponticelli associati al pezzo: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
'DeleteBridgeAssociated(nId)
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
' Recupero indice del successivo
Dim nNextId = EgtGetNextSelectedObj()
' Se abilitata cancellazione in ogni caso o pezzo non da Csv
@@ -2003,6 +2440,47 @@ Public Class NestPageUC
EgtZoom(ZM.ALL)
End Sub
Private Sub DeleteBridgeAssociated(nMyId As Integer)
' verifico se esistono dei ponticelli associati al pezzo indicato
' recuoero il gruppo di lavorazione corrente
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
' creo il gruppo per i ponticelli
Dim sNameGroup As String = BRIDGES
Dim nIdBridgesGroup As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
If nIdBridgesGroup <> GDB_ID.NULL Then
' carico la prima entità del gruppo BRIDGES
Dim nIdBridgeLine As Integer = GDB_ID.NULL
nIdBridgeLine = EgtGetFirstNameInGroup(nIdBridgesGroup, BRIDGELINE)
' ciclo su tutte le entità
While nIdBridgeLine <> GDB_ID.NULL
Dim nNextBridgeLine As Integer = GDB_ID.NULL
Dim nIdPart As Integer = GDB_ID.NULL
If EgtGetInfo(nIdBridgeLine, "PartStart", nIdPart) Then
If nIdPart = nMyId Then
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
' il ponticello deve essere eliminato
EgtErase(nIdBridgeLine)
nIdBridgeLine = nNextBridgeLine
' riparto dall'inizio del ciclo
Continue While
End If
End If
If EgtGetInfo(nIdBridgeLine, "PartEnd", nIdPart) Then
If nIdPart = nMyId Then
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
' il ponticello deve essere eliminato
EgtErase(nIdBridgeLine)
nIdBridgeLine = nNextBridgeLine
' riparto dall'inizio del ciclo
Continue While
End If
End If
' il BridgeLine corrente non contiene riferimeti al pezzo da eliminare
nIdBridgeLine = EgtGetNext(nIdBridgeLine)
End While
End If
End Sub
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Numero dei pezzi in tavola
+7
View File
@@ -363,6 +363,13 @@ Public Module SplitAuto
vNewRaws.Add(nNewRawId)
nNewRawId = EgtGetNextRawPart(nNewRawId)
End While
Else
' verifico che nella fase precedente è stato definito come sfrido, allora lo riassegno
Dim nVal As Integer = 0
EgtGetInfo(nRawId, K_ISNEWSCRAPS, nVal)
If nVal = 1 Or nVal = 2 Or nVal = 3 Then
EgtSetInfo(nRaw1Id, K_ISNEWSCRAPS, "3")
End If
End If
' Assegno ai nuovi grezzi eventuale texture del grezzo originale
Dim nSolidId = EgtGetFirstNameInGroup(nRawId, NAME_RAW_SOLID)
+13 -2
View File
@@ -48,8 +48,8 @@
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="AutoBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
</Grid>
<!--Left Button Grid-->
@@ -125,6 +125,17 @@
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesWJBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<!-- 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>
<Button Name="CutEndBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Fine-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
+466 -23
View File
@@ -7,6 +7,7 @@ Public Class SplitPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Tipo movimento dei grezzi (manuale o con testa ventosa)
@@ -26,6 +27,19 @@ Public Class SplitPageUC
' verifico che le lavorazioni selezionate siano omogenee (con lo stesso utensile)
Private m_bAreHomogeneous As Boolean = False
' Id tagli WJ per generazione ponticelli tra due percorsi
Private m_nIdSelectedPartWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedPartWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL
' Id gruppo Bridges (Nuovo da versione 30/08/2022)
Private m_nIdBridgesGroup As Integer = GDB_ID.NULL
Private m_nIdBridge As Integer = GDB_ID.NULL
Private m_ptSrtBridge As New Point3d
Private m_ptEndBridge As New Point3d
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
'Private m_CurrInd As Integer = -1
'Private m_CurrItems As New List(Of NameIdLsBxItem)
@@ -43,6 +57,8 @@ Public Class SplitPageUC
Private m_bDragging As Boolean = False
' Selected cut
Private m_nSelected As Integer = GDB_ID.NULL
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
Private m_StartEndModifyOnIntCorner As Boolean = False
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
PrevBtn.IsEnabled = False
@@ -70,6 +86,8 @@ Public Class SplitPageUC
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) ' Modifica
AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto
RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart
BridgesWJBtn.ToolTip = "Bridges"
BridgesDeleteWJBtn.ToolTip = "Remove bridges"
End Sub
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -90,6 +108,8 @@ Public Class SplitPageUC
m_bEnableOnAuxTab = Not m_bByHand AndAlso
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
' verifico se è abilitata la possibiltà di allungare i lati interni
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, m_MainWindow.GetIniFile()) <> 0)
' Nascondo eventuali pezzi in parcheggio
HideParkedParts()
' Nascondo eventuale contorno da foto
@@ -195,6 +215,243 @@ Public Class SplitPageUC
Next
End Sub
#Region "BRIDGE"
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
ByVal IsFirst As Boolean,
ByRef m_nIdSelectedSideWJ As Integer,
ByRef m_nIdSelectedWaterJet As Integer,
ByRef nIdParentPart As Integer)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If (EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE) AndAlso VerifySideIsAcceptable(nIdMy) Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
EgtDeselectObj(m_nIdSelectedSideWJ)
End If
' recupero il gruppo della lavorazione associata
nIdParentPart = EgtGetParent(nIdParent)
' se non esiste almeno 1 Preview di tipo WaterJet
If IsWaterJetting(nIdMy) Then
' NON RECUPERO LA PREVIEW DELLA LAVORAZIONE m_nIdSelectedWaterJet
m_nIdSelectedSideWJ = nIdMy
' recupero il punto più vicino alla curva passata
If IsFirst Then
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge)
Else
' prima di confermare verifico che non ci siano interferenze
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptEndBridge)
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
If VerifyInterference(m_nIdBridge) Then
m_CurrProjPage.ClearMessage()
EgtSetInfo(m_nIdBridge, "PartStart", m_nIdSelectedPartWJ_Srt)
EgtSetInfo(m_nIdBridge, "EntStart", m_nIdSelectedSideWJ_Srt)
EgtSetInfo(m_nIdBridge, "PartEnd", m_nIdSelectedPartWJ_End)
EgtSetInfo(m_nIdBridge, "EntEnd", m_nIdSelectedSideWJ_End)
EgtSetInfo(m_nIdBridge, "Ph", EgtGetCurrPhase())
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
Else
' attendo la selezione di un punto valido
m_nIdSelectedSideWJ = GDB_ID.NULL
nIdParentPart = GDB_ID.NULL
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Bridge intersects part")
Return
End If
End If
' salvo il valore del PreView evidenziato
EgtSetMark(nIdParentPart)
' EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseDownSceneBridgesDelete(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sGroupName As String = String.Empty
Dim sSelName As String = String.Empty
' gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del gruppo di appartenenza
EgtGetName(nIdParent, sGroupName)
' recupero il nome dell'oggetto selezionato
EgtGetName(nIdMy, sSelName)
If sGroupName.Contains(BRIDGES) AndAlso sSelName.Contains(BRIDGELINE) Then
EgtErase(nIdMy)
EgtDraw()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
Return
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseMoveSceneBridges(ptCurr As Point3d)
ptCurr.z = m_ptSrtBridge.z
' rappresento il egmento
If m_nIdBridge = GDB_ID.NULL Then
m_nIdBridge = EgtCreateLine(m_nIdBridgesGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB)
' assegno un nome alla linea
EgtSetName(m_nIdBridge, BRIDGELINE)
End If
EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB)
EgtDraw()
End Sub
Private Function VerifyInterference(nIdBridge As Integer) As Boolean
' prima di procedere alla verifica accorco il segmento (solo per sicurezza) 10 * EPS_SMALL
Dim dLen As Double
EgtCurveLength(nIdBridge, dLen)
If dLen > 21 AndAlso Not EgtCurveIsClosed(nIdBridge) Then
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
End If
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
Dim nIdPart As Integer = GDB_ID.NULL
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
While nIdPart <> GDB_ID.NULL
Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nIdPart, "Region")
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
While nIdSurf <> GDB_ID.NULL
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
' se la linea bridge interseca la superficie allora restitusco false
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
Return False
End If
Exit While
End If
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return True
End Function
Private Function VerifySideIsAcceptable(nMyId As Integer) As Boolean
Dim dVal As Double = 0
' verifico che l'entità selezionata non contenga questi parametri
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE2, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
If EgtGetInfo(nMyId, INFO_ORIG_SIDE_ANGLE, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
' altrimenti l'entità è accettabile
Return True
End Function
' verifico che il lato selezionato appartenga ad una lavorazione di tipo Waterjet
Private Function IsWaterJetting(nMyId As Integer) As Boolean
' verifico che sul lato indicato sia impostato un taglio di tipo WaterJet
Dim nMchId As Integer = GDB_ID.NULL
For nInd As Integer = 0 To m_MachiningList.Count() - 1
nMchId = m_MachiningList(nInd).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(m_MachiningList(nInd).m_nId)
If nMachiningType = MCH_MY.WATERJETTING Then
EgtSetCurrMachining(nMchId)
Dim nIndex As Integer = 0
Dim nIdSide As Integer = GDB_ID.NULL
Dim nSub As Integer = GDB_ID.NULL
While EgtGetMachiningGeometry(nIndex, nIdSide, nSub)
If nIdSide = nMyId Then
Return True
End If
nIndex += 1
End While
End If
Next
Return False
End Function
Private Sub RefreshMachList()
For nI As Integer = 0 To m_MachiningList.Count() - 1
' cancello tutti gli indici di lavorazione presenti nel disegno
Dim nNbrId As Integer = GDB_ID.NULL
EgtErase(m_MachiningList(nI).m_nNbrId)
EgtRemoveInfo(m_MachiningList(nI).m_nId, "NbrId")
Next
' Preparo la lista delle lavorazioni
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
' Aggiorno visualizzazione delle lavorazioni
For nI As Integer = 0 To m_MachiningList.Count() - 1
' sistemo colore
ColorMachining(m_MachiningList(nI))
' assegno nuova numerazione
NumberDirectionMachining(nI)
' conto il numero di tipi di lavorazioni
CountMachiningType(m_MachiningList(nI), m_nCountSawing, m_nCountWaterjetting, m_nCountOtherMachining)
Next
' aggiorno grafica
ShowMachiningList()
' aggiorno la visualizzazione
EgtDraw()
End Sub
Private Sub DeselectWJBridgesPart()
' se in fase di definzione di un ponticello lo elimino
If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
EgtErase(EgtGetParent(m_nIdBridge))
End If
m_nIdBridge = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_Srt)
m_nIdSelectedPartWJ_Srt = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_Srt)
m_nIdSelectedSideWJ_Srt = GDB_ID.NULL
m_nIdSelectedWaterJet_Srt = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_End)
m_nIdSelectedPartWJ_End = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_End)
m_nIdSelectedSideWJ_End = GDB_ID.NULL
m_nIdSelectedWaterJet_End = GDB_ID.NULL
EgtDraw()
End Sub
#End Region ' Bridge
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
@@ -203,6 +460,31 @@ Public Class SplitPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt = GDB_ID.NULL Then
OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
Else
OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
' aggiorno la visualizzazione delle lavorazioni e la lista
RefreshMachList()
End If
' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
DeselectWJBridgesPart()
End If
Return
End If
' eliminazione dei ponticelli
If BridgesDeleteWJBtn.IsChecked Then
OnMyMouseDownSceneBridgesDelete(sender, e)
' aggiorno la visualizzazione delle lavorazioni e la lista
RefreshMachList()
Return
End If
' Reset drag
m_nDragInd = -1
m_nDragType = 0
@@ -287,13 +569,23 @@ Public Class SplitPageUC
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL Then
OnMyMouseMoveSceneBridges(ptCurr)
End If
Return
End If
' Se drag non abilitato o in corso
If m_nDragInd = -1L Or m_bDragging Then Return
m_bDragging = True
Dim nOperId As Integer = m_MachiningList(m_nDragInd).m_nId
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento e la variazione di lunghezza
Dim vtMove As Vector3d = ptCurr - m_ptDragPrev
Dim dDelta = vtMove * m_MachiningList(m_nDragInd).m_vtDir
@@ -641,6 +933,51 @@ Public Class SplitPageUC
EnableButtons()
End Sub
' ERRORE: questo evento non è eseguito!
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
End If
End Sub
Private Sub BridgeBtn_Click(sender As Object, e As RoutedEventArgs) Handles BridgesWJBtn.Click
' eventualmente spengo il comando per eliminare i ponticelli
If BridgesDeleteWJBtn.IsChecked Then
BridgesDeleteWJBtn.IsChecked = False
End If
' se deseleziono resetto tutte le variabili
If Not BridgesWJBtn.IsChecked Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
Return
End If
' recuoero il gruppo di lavorazione corrente
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
' creo il gruppo per i ponticelli
Dim sNameGroup As String = BRIDGES
Dim nId As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
If nId <> GDB_ID.NULL Then
m_nIdBridgesGroup = nId
End If
' se non lo trovo allora lo creo
If nId = GDB_ID.NULL Then
m_nIdBridgesGroup = EgtCreateGroup(nIdCurrMachGroup)
EgtSetName(m_nIdBridgesGroup, BRIDGES)
End If
End Sub
Private Sub BridgeDeleteBtn_Click(Sender As Object, e As RoutedEventArgs) Handles BridgesDeleteWJBtn.Click
' eventualmente spengo il comando per inserire i ponticelli
If BridgesWJBtn.IsChecked Then
BridgesWJBtn.IsChecked = False
End If
If Not BridgesDeleteWJBtn.IsChecked Then
DeselectWJBridgesPart()
End If
End Sub
Private Function AdjustBothCuts(nI As Integer,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
@@ -1042,21 +1379,24 @@ Public Class SplitPageUC
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
End If
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
@@ -1210,21 +1550,24 @@ Public Class SplitPageUC
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
End If
End If
' Modifica della lavorazione
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
@@ -1396,6 +1739,16 @@ Public Class SplitPageUC
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) Then
' verifico che l'operazione sia una disposizione, altrimenti cerco
NextDisposition = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.GetNextDisposition(NextDisposition)
m_bOnAuxTab = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.IsDispUnloadOnAuxTab(NextDisposition)
End If
End If
m_bToNext = True
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
@@ -1467,8 +1820,37 @@ Public Class SplitPageUC
' assegno numerazione
NumberDirectionMachining(nI)
Next
' -------------------- Recupero le lavorazioni indicate come attive --------------------
Dim ActiveMachLst As New List(Of Integer)
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
ActiveMachLst.Add(ItemSplitMach.Ind)
Next
' -------------------- Recupero le lavorazioni indicate come attive --------------------
' Preparo la lista degli Item
ShowMachiningList()
' -------------------- Riattivo le lavorazioni precedenti --------------------
For Each Item As SplitMach In m_MachiningList
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
Next
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
EgtRemoveInfo(m_MachiningList(ItemSplitMach.Ind).m_nId, INFO_MCH_USER_OFF)
m_MachiningList(ItemSplitMach.Ind).m_bEnabled = True
ItemSplitMach.bIsActive = True
' sistemo colore
ColorMachining(m_MachiningList(ItemSplitMach.Ind))
Exit For
End If
Next
Next
' -------------------- Riattivo le lavorazioni precedenti --------------------
' Aggiorno visualizzazione
EgtDraw()
' Aggiono abilitazione bottoni
@@ -1483,6 +1865,10 @@ Public Class SplitPageUC
End Sub
Friend Sub ExitSplit(Optional bTrueExit As Boolean = True)
DeselectWJBridgesPart()
BridgesWJBtn.IsChecked = False
BridgesDeleteWJBtn.IsChecked = False
' Rimuovo evidenziazione e numeri
RemoveMarkAndNumbers()
' Ripristino colori lavorazioni
@@ -1594,7 +1980,7 @@ Public Class SplitPageUC
m_bOnAuxTab = False
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
@@ -1605,7 +1991,7 @@ Public Class SplitPageUC
' Deve essere permesso almeno un tipo di movimento
NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab
End If
' altrimenti sto solo visualizzando
' altrimenti sto solo visualizzando
Else
' movimento su tavola di scarico
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
@@ -1644,6 +2030,8 @@ Public Class SplitPageUC
ModifEndBtn.IsEnabled = Not m_bShow
InvertBtn.IsEnabled = Not m_bShow
PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause
BridgesWJBtn.IsEnabled = Not m_bShow
BridgesDeleteWJBtn.IsEnabled = Not m_bShow
' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive
If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining) Then
@@ -1725,6 +2113,7 @@ Public Class SplitPageUC
Private Sub VisibilityButtonFromMachinig(ByVal Type As Integer)
If Type <> MCH_OY.SAWING Then
CutBtn.Visibility = Visibility.Hidden
CutStartBtn.Visibility = Visibility.Hidden
CutEndBtn.Visibility = Visibility.Hidden
@@ -1755,6 +2144,21 @@ Public Class SplitPageUC
AllExtendBtn.Visibility = Visibility.Visible
AllReduceBtn.Visibility = Visibility.Visible
End If
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
BridgesDeleteWJBtn.Visibility = Visibility.Visible
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
End Sub
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
@@ -1799,6 +2203,15 @@ Public Class SplitPageUC
vtXY.Normalize()
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
ptCen.z = ptMax.z + 1
' ricavo la posizione del punto (se waterjet separata)
If m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Or m_MachiningList(nI).m_nType = MCH_OY.MILLING Then
Dim ptMid As Point3d
Dim vVers As Vector3d
MidPointOfCurve(m_MachiningList(nI).m_nId, ptMid, vVers)
ptCen = ptMid ' + vVers * If(Not b2ndLav, -0.8, 0.8) * dHtxt
End If
If bNumber Then
Dim nNbrId As Integer = EgtCreateTextAdv( m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
300, False, dHtxt, dRat, 0, INS_POS.MC)
@@ -1853,6 +2266,36 @@ Public Class SplitPageUC
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
End Function
Private Function MidPointOfCurve(nOperId As Integer, ByRef ptMid As Point3d, ByRef vVers As Vector3d) As Boolean
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
' creo un layer ausiliario per creare la curva composita
Dim AuxLayer As Integer = EgtCreateGroup(nPvId)
' imposto la lavorazione corrente
EgtSetCurrMachining(nOperId)
' recupero tutte le entità della lavorazione corrente
Dim nInd As Integer = 0
Dim nIdCurr As Integer
Dim nSub As Integer
Dim CurveCompoList As New List(Of Integer)
While EgtGetMachiningGeometry(nInd, nIdCurr, nSub)
CurveCompoList.Add(nIdCurr)
nInd += 1
End While
Dim PtNearStart As Point3d
Dim nIdCutPath As Integer = EgtCreateCurveCompoByChain(AuxLayer, CurveCompoList.ToArray, PtNearStart, False)
Dim dLength As Double = 0
EgtCurveLength(nIdCutPath, dLength)
Dim dParam As Double = 0
EgtCurveParamAtLength(nIdCutPath, dLength / 2, dParam)
EgtAtParamPoint(nIdCutPath, dParam, GDB_RT.GLOB, ptMid)
EgtAtParamVector(nIdCutPath, dParam, -1, vVers)
vVers.Normalize()
vVers.Rotate(Vector3d.Z_AX, 90)
EgtErase(AuxLayer)
Return True
End Function
Private Function AddMachiningDirection( ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
Dim dArrX As Double = dLen * Math.Cos( 30 * Math.PI / 180)
Dim dArrY As Double = dLen * Math.Sin( 30 * Math.PI / 180)
+147 -4
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Text.RegularExpressions
Module VacuumCups
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
@@ -10,7 +11,22 @@ Module VacuumCups
Private m_dPreferredRot As Double = 0
Private m_dPrefVertRotXMinus As Double = 0
Private m_dPrefVertRotXPlus As Double = 0
Private m_dPrefVertRotYMinus As Double = 0
Private m_dPrefVertRotYPlus As Double = 0
Private m_dDripRefAng As Double = 0
' dati carico massimo manipolatore
Private m_RawDensity As Double = 2500
Private m_RawWeight As Double = 0
Private m_MaxWeightSinglePlugger As Double = 250
Private m_MaxWeightDoublePlugger As Double = 750
Public bOverWeight As Boolean = False
' dati per rotazione ventose vicono al fine corsa Y e X
Private bRotateVacuumNearExtraStrokeY As Boolean = False
Private bRotateVacuumNearExtraStrokeX As Boolean = False
' dati stroke
Public bExtraStroke As Boolean = False
Public ptStartPointLift As Point3d
Public dDegRotStartAng As Double
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
@@ -50,6 +66,20 @@ Module VacuumCups
Return m_nVacType
End Function
' carico i dati macchina relativi al peso massimo movimentabile
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
m_RawDensity = Density
m_MaxWeightSinglePlugger = MaxSingle
m_MaxWeightDoublePlugger = MaxDouble
End Sub
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
bRotateVacuumNearExtraStrokeY = Rotate
End Sub
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
bRotateVacuumNearExtraStrokeX = Rotate
End Sub
Friend Function GetVacuumId() As Integer
Return m_nVacId
End Function
@@ -66,6 +96,8 @@ Module VacuumCups
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -78,7 +110,9 @@ Module VacuumCups
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
@@ -165,6 +199,18 @@ Module VacuumCups
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
Dim ptKerfCen As Point3d
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
'-------------------- INIZIO CALCOLO PESO --------------------
' recupero l'area del grezzo da muovere
Dim RawArea As Double = 0
' superficie del grezzo senza considerare eventuali fori
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
@@ -187,6 +233,7 @@ Module VacuumCups
Return False
End Function
' utilizzata per gestire la movimentazione dei pezzi per eseguire i drip
Friend Function PutVacuumCupsOnPart(nPartId As Integer,
ByRef rmData As RawMoveData, ByRef b3Part As BBox3d) As Boolean
' Ripristino posizione originale ventose
@@ -266,6 +313,7 @@ Module VacuumCups
Dim sCups() As String = Nothing
Dim sCups2() As String = Nothing
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
bExtraStroke = False
' Determino validità soluzioni della configurazione
Dim vtMove As New Vector3d
Dim ptRotCen As New Point3d
@@ -294,6 +342,7 @@ Module VacuumCups
Dim frCurrRef As New Frame3d
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
' Assegno dati noti al movimento del grezzo
rmData.m_nId = nRawId
rmData.m_vtRawMove = Vector3d.NULL()
@@ -368,6 +417,23 @@ Module VacuumCups
If b3Vac.IsEmpty() Then Return INFINITO
' Se box maggiore di quello del pezzo, scarto soluzione
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
'-------------------- INIZIO VERIFICA PESO --------------------
bOverWeight = False
Select Case GetPluggerFromCameras(sCups)
Case 2
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightDoublePlugger Then
bOverWeight = True
Return INFINITO
End If
Case 1
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightSinglePlugger Then
bOverWeight = True
Return INFINITO
End If
End Select
'-------------------- FINE VERIFICA PESO --------------------
' Recupero l'area della tavola
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
@@ -383,13 +449,24 @@ Module VacuumCups
dRotAngDeg = dAngOrizzDeg
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dPreferredRot As Double = m_dPreferredRot
If Math.Abs( dRotAngDeg - 90) < 45 Or Math.Abs( dRotAngDeg - 270) < 45 Then
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
' verifico l'orientamento del pezzo
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
' se l'orientamento è verticale
If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus
else
Else
dPreferredRot = m_dPrefVertRotXPlus
End If
End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus
Else
dPreferredRot = m_dPrefVertRotYMinus
End If
End If
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
dRotAngDeg -= dAngDelta
@@ -446,11 +523,55 @@ Module VacuumCups
' Applico movimento e rotazione al punto
ptRef.Move(vtMove)
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
bExtraStroke = True
Return INFINITO
End If
' se la posizione è accettbaile allora salvo i dati
ptStartPointLift = ptRef
dDegRotStartAng = dRotAngDeg
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
' Ne calcolo la distanza dal centro della tavola
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
Return dDist
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double
Dim nStat As Integer
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
Return nStat
End Function
' dall'informazione di extra corsa recupera il valore indicato
Public Function GetExtraStrokeValue(sInfo As String) As Double
Dim dExtraStroke As Double = 0
Dim sItems As String() = sInfo.Split("="c)
If sItems.Count = 2 Then
Dim nStartIndex As Integer = 0
For Each ItemChar As Char In sItems(1)
If ItemChar = "("c Then
Exit For
End If
nStartIndex += 1
Next
If nStartIndex > 0 Then
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
StringToLen(sValue, dExtraStroke)
End If
End If
Return dExtraStroke
End Function
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
' Eseguo verifica delle ventose rispetto al grezzo
@@ -471,6 +592,28 @@ Module VacuumCups
Return bVacOk
End Function
' dato il vettore delle camere restituisco il quali attuatori sono coinvolti
Private Function GetPluggerFromCameras(sCups() As String) As Integer
Dim nCountPlunger As Integer = 1
Dim bPlugger1 As Boolean = False
Dim bPlugger2 As Boolean = False
For Each Camera As String In sCups
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
bPlugger1 = True
Else
bPlugger2 = True
End If
Next
' verifico quali sono le camere attive
If bPlugger1 And bPlugger2 Then
nCountPlunger = 2
ElseIf Not bPlugger1 And Not bPlugger2 Then
nCountPlunger = 0
End If
' restituisco il numero di Plugger in uso
Return nCountPlunger
End Function
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
' Assegno le informazioni
EgtSetInfo(nId, "Id", rmData.m_nId)
+20 -1
View File
@@ -94,6 +94,8 @@ Module ConstGen
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
' Info in asse rotante ventosa per step discreti
@@ -185,6 +187,8 @@ Module ConstGen
Public Const INFO_TOTAREA As String = "TotArea"
' Info per area da produrre dei pezzi del progetto
Public Const INFO_TOPRODAREA As String = "ToProdArea"
' Info per nome progetti
Public Const INFO_PROJNAME As String = "ProjName"
' Nome layer delle regioni
Public Const NAME_REGION As String = "Region"
@@ -210,7 +214,8 @@ Module ConstGen
Public Const INFO_DEPTH As String = "Depth"
Public Const INFO_WIDTH As String = "Width"
Public Const INFO_DEPTH2 As String = "Depth2"
Public CONST INFO_AGG2 As String = "Agg2"
Public Const INFO_AGG2 As String = "Agg2"
Public Const INFO_ROUNDOFF As String = "RoundOff"
' Info in entità da tagliare per taglio ristretto
Public Const INFO_STRICT As String = "Strict"
' Info in entità da tagliare per angolo di lato e tallone
@@ -300,6 +305,12 @@ Module ConstGen
Public Const INFO_PARTOK As String = "POK"
' Info in pezzo per stato rotazione
Public Const INFO_PARTROT As String = "ROT"
' Info in entità in OutLoop per indicare se è separata WaterJet
Public Const INFO_JOINENTITY As String = "JoinEntity"
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
' Info in OutLoop per punto inzio lavorazione WaterJet
Public Const INFO_START As String = "Start"
' Nome di pezzo che è una cornice
Public Const NAME_FRAME As String = "Frame"
@@ -332,6 +343,11 @@ Module ConstGen
' Info in pezzo per facet di ultima superficie selezionata
Public Const INFO_FRAME_FACET As String = "Facet"
' Nome del groppo dei ponticelli per lavorazioni Water
Public Const BRIDGES As String = "Bridges"
' Nome dell'entità ponticello contenuta nel gruppo BRIDGES
Public Const BRIDGELINE As String = "BridgeLine"
' utensile per le lavorazioni manuali
Public Const DUMMY_SAW As String = "DummySAW"
' lavorazione manuale
@@ -375,6 +391,9 @@ Module ConstGen
Public Function COL_MCH_DRIPCUT() As Color3d
Return New Color3d(255, 0, 165)
End Function
Public Function COL_MCH_ONENGRAVE_ANG() As Color3d
Return New Color3d(255, 255, 100)
End Function
Public Function COL_MCH_DRIPFREE() As Color3d
Return New Color3d(192, 0, 128)
End Function
+25
View File
@@ -46,6 +46,10 @@ Module ConstIni
Public Const K_THEME As String = "Theme"
Public Const K_MANUAL_CUT As String = "ManualCut"
Public Const K_TEST As String = "Test"
Public Const K_SMARTMACHININGPAGE As String = "SmartMachiningPage"
Public Const K_STARTPROGRAM As String = "StartProgram"
Public Const K_GENERATECN As String = "GenerateCN"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
@@ -129,7 +133,9 @@ Module ConstIni
Public Const K_ENGRAVENUMBER2 As String = "EngraveNumber2"
Public Const K_ENGRAVEOFFSET2 As String = "EngraveOffset2"
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
Public Const K_ENGRAVESHORT As String = "EngraveShort"
Public Const K_ENGRAVEANGLE As String = "EngraveAngle"
Public Const K_DRIPOFFSET As String = "DripOffset"
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
Public Const K_DRIPDEPTH As String = "DripDepth"
@@ -137,6 +143,7 @@ Module ConstIni
Public Const K_UNDERDRILLDEPTH As String = "UnderDrillDepth"
Public Const K_FILOTOPOFFSET As String = "FiloTopOffset"
Public Const K_FILOTOPDEPTH As String = "FiloTopDepth"
Public Const K_ROUNDOFF As String = "RoundOff"
Public Const S_NEST As String = "Nest"
Public Const K_DIRECT As String = "Direct"
@@ -149,6 +156,7 @@ Module ConstIni
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAG_RETTANGLE As String = "DragRectangle"
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
@@ -164,6 +172,14 @@ Module ConstIni
Public Const K_CSVCURRDIR As String = "CurrDir"
Public Const K_CSVLASTFILE As String = "LastFile"
Public Const S_TRF As String = "TRF"
Public Const K_ORDCODE As String = "OrdCode"
Public Const K_ORDDESC As String = "OrdDesc"
Public Const K_PARTCODE As String = "PartCode"
Public Const K_MATCODE As String = "MatCode"
Public Const K_SURFCODE As String = "SurfCode"
Public Const K_TRFTHICKNESS As String = "TrfThickness"
Public Const S_SLABDXF As String = "SlabDxf"
Public Const K_IMPORTSLABDXF As String = "ImportSlabDxf"
Public Const K_SLABLAYER As String = "SlabLayer"
@@ -210,6 +226,15 @@ Module ConstIni
Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular"
Public Const S_SCRAPS As String = "Scraps"
Public Const K_ENABLESCRAPS As String = "EnableScraps"
Public Const K_PHOTODIR As String = "PhotoDir"
Public Const K_LASTBLOCK As String = "LastBlock"
Public Const K_TEMPLATE As String = "Template"
Public Const K_DAT As String = "Dat"
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
Public Const K_ENABLE_PRINTER As String = "EnablePrinter"
Public Const S_REG As String = "Reg"
Public Const K_REGSTEP As String = "Step"
Public Const K_REGANGSTEP As String = "AngStep"
+8
View File
@@ -228,6 +228,13 @@
Public Const S_MACH_RAWMOVE As String = "RawMove"
Public Const K_MACH_RM_ROTATE As String = "Rotate"
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const K_ISNEWSCRAPS As String = "IsNewScraps"
Public Const K_DATABASEID As String = "DatabaseID"
Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
@@ -290,5 +297,6 @@
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
End Module
+7 -1
View File
@@ -66,6 +66,7 @@ Public Class FlatteningCut
Right
End Enum
' Per abilitare la spianatura con la FRESA deve essere imposatato a TRUE il flag "Usa Fresa" nella pagina MACCHINA (campo INCISIONI)
Private Sub FlatteningCut_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creo lista modalità di acquisizione punto
m_PointsModeArray(PT_MODE.SAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24)
@@ -614,9 +615,11 @@ Public Class FlatteningCut
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
Private Function GetFootPrintTool() As Double
' vedere nella pagina Allarm il capito "Incisioni"
Dim bForceUseMill As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0)
Dim dFootPrint As Double = 0
' verifico quale lavorazione è attiva
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) Then
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) AndAlso Not bForceUseMill Then
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
@@ -652,6 +655,9 @@ Public Class FlatteningCut
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
If (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0) Then
EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool)
End If
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, 0)
' Imposto prima direzione
EgtSetInfo(nCutId, INFO_DIR, 1)
+3 -3
View File
@@ -76,9 +76,9 @@ Public Class AlzFrontUC
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
' nome dei parametri condivisi
Parameter1TxBl.Text = "Altezza"
Parameter2TxBl.Text = "Delta angolo"
Parameter5TxBl.Text = "Spessore"
Parameter1TxBl.Text = EgtMsg(91134)
Parameter2TxBl.Text = EgtMsg(91135)
Parameter5TxBl.Text = EgtMsg(91136)
EgtZoom(ZM.ALL)
End Sub
+38
View File
@@ -336,6 +336,7 @@ Public Class CompoDimensionUC
Dim nCmpInfo As Integer = 0
If EgtGetInfo(nId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
EgtSetStatus(nId, GDB_ST.OFF)
UpdateInLoopReference(nCmp)
Exit While
End If
nId = EgtGetNextName(nId, "HoleLabels")
@@ -379,5 +380,42 @@ Public Class CompoDimensionUC
EgtDraw()
End Sub
Private Sub UpdateInLoopReference(nCmp As Integer)
' aggiorno il layer "FiloTop"
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
While nIdInLoop <> GDB_ID.NULL
Dim nCmpInfoIL As Integer = 0
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
Dim nLayFiloTop As Integer = GDB_ID.NULL
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
If nLayFiloTop <> GDB_ID.NULL Then
Dim LocalList As New List(Of Integer) From {nIdInLoop}
m_DrawPage.m_FiloTopUC.CreateFiloTopPreView(LocalList)
EgtSetStatus(nLayFiloTop, GDB_ST.ON_)
Exit While
End If
End If
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
End While
End Sub
' riceve la info "ID" della componente
Public Sub SetStatusVisibilityInLoopReference(nCmp As Integer, Status As GDB_ST)
' aggiorno il layer "FiloTop"
Dim nIdInLoop As Integer = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "InLoop")
While nIdInLoop <> GDB_ID.NULL
Dim nCmpInfoIL As Integer = 0
If EgtGetInfo(nIdInLoop, "ID", nCmpInfoIL) AndAlso nCmp = nCmpInfoIL Then
Dim nLayFiloTop As Integer = GDB_ID.NULL
EgtGetInfo(nIdInLoop, "FiloTopRef", nLayFiloTop)
If nLayFiloTop <> GDB_ID.NULL Then
EgtSetStatus(nLayFiloTop, Status)
Exit While
End If
End If
nIdInLoop = EgtGetNextName(nIdInLoop, "InLoop")
End While
End Sub
#End Region ' METHODS for InternalCompo
End Class
+24
View File
@@ -24,6 +24,7 @@ Public Class CompoTrfData
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
DialogResult = True
SaveData()
Close()
End Sub
@@ -32,7 +33,30 @@ Public Class CompoTrfData
Close()
End Sub
Private Sub SaveData()
WritePrivateProfileString(S_TRF, K_ORDCODE, OrdCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_ORDDESC, OrdDescTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_PARTCODE, PartCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_MATCODE, MatCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_SURFCODE, SurfCodeTxBx.Text, m_MainWindow.GetIniFile())
' prima di salvare lo spessore converto in mm e poi di nuovo in stringa
Dim dVal As Double = 0
StringToLen(ThicknessTxBx.Text, dVal)
WritePrivateProfileString(S_TRF, K_TRFTHICKNESS, DoubleToString(dVal, 4), m_MainWindow.GetIniFile())
End Sub
Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sPartCode As String, sMatCode As String, sSurfCode As String, dTh As Double)
' se verifico che non sono stati iniziliazzti i campi allora provvedo a leggere il file ini del programma
If sOrdCode = "" And sOrdDesc = "" And sPartCode = "" And sMatCode = "" And sSurfCode = "" Then
GetPrivateProfileString(S_TRF, K_ORDCODE, sOrdCode, sOrdCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_ORDDESC, sOrdDesc, sOrdDesc, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_PARTCODE, sPartCode, sPartCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_MATCODE, sMatCode, sMatCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_SURFCODE, sSurfCode, sSurfCode, m_MainWindow.GetIniFile())
' recupero il dato dello spessore che deve essere in mm
dTh = GetPrivateProfileDouble(S_TRF, K_TRFTHICKNESS, dTh, m_MainWindow.GetIniFile())
End If
' inizializzo i campi della finestra
OrdCodeTxBx.Text = sOrdCode
OrdDescTxBx.Text = sOrdDesc
PartCodeTxBx.Text = sPartCode
+1 -1
View File
@@ -64,7 +64,7 @@
<ToggleButton Name="DimensionBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowToggleButton}" Visibility="Collapsed"/>
</Grid>
<Grid Name="VariablesGrd" Grid.Row="1" Grid.ColumnSpan="2"/>
<Grid Name="VariablesGrd" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2"/>
<Grid Name="MessageGrid" Grid.Row="2" Grid.ColumnSpan="2">
<TextBlock Name="MessageTxBl" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
+39 -21
View File
@@ -41,6 +41,9 @@ Public Class DrawPageUC
Friend m_bDrawOk As Boolean = False
Private m_bFirst As Boolean = True
Private m_SelListHole As New List(Of Integer)
Private m_DeselectListHole As New List(Of Integer)
' questa variabile serve per risalire al nome della componente che ospita i componenti interni att
Friend m_sMainCompo As String = String.Empty
@@ -360,6 +363,8 @@ Public Class DrawPageUC
Dim nCmpInfo As Integer = 0
If EgtGetInfo(nHLId, "ID", nCmpInfo) AndAlso nCmp = nCmpInfo Then
EgtSetStatus(nHLId, GDB_ST.ON_)
' nascondo eventuali FiloTop
m_CompoDimension.SetStatusVisibilityInLoopReference(nCmp, GDB_ST.OFF)
Exit While
End If
nHLId = EgtGetNextName(nHLId, "HoleLabels")
@@ -462,21 +467,25 @@ Public Class DrawPageUC
EgtDeselectObj(nId)
EgtDeselectObj(nLayId)
Dim sLayName As String = ""
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtRemoveInfo( nLayId, INFO_FILOTOP)
EgtRemoveInfo( nLayId, INFO_OFFSET)
EgtRemoveInfo( nLayId, INFO_DEPTH)
EgtResetColor( nLayId)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtRemoveInfo(nLayId, INFO_FILOTOP)
EgtRemoveInfo(nLayId, INFO_OFFSET)
EgtRemoveInfo(nLayId, INFO_DEPTH)
EgtResetColor(nLayId)
End If
m_DeselectListHole.Add(nLayId)
m_SelListHole.Remove(nLayId)
Else
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
EgtSelectObj( nId)
EgtSelectObj( nLayId)
EgtSetInfo( nLayId, INFO_FILOTOP, 1)
EgtSetInfo( nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
EgtSetInfo( nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
EgtSetColor( nLayId, New Color3d(255, 255, 255))
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
EgtSelectObj(nId)
EgtSelectObj(nLayId)
EgtSetInfo(nLayId, INFO_FILOTOP, 1)
EgtSetInfo(nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
EgtSetInfo(nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
EgtSetColor(nLayId, New Color3d(255, 255, 255))
m_SelListHole.Add(nLayId)
m_DeselectListHole.Remove(nLayId)
End If
End If
EgtDraw()
@@ -484,6 +493,8 @@ Public Class DrawPageUC
End If
nId = EgtGetNextObjInSelWin()
End While
m_FiloTopUC.CreateFiloTopPreView(m_SelListHole)
m_FiloTopUC.EraseFiloTopPreview(m_DeselectListHole)
End Sub
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles DrawScene.OnShowDistanceVector
@@ -1162,8 +1173,10 @@ Public Class DrawPageUC
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
If m_bTrfData Then
Dim DlgTrfData As New CompoTrfData(m_MainWindow)
' carico i dati appena salvati nella pagina
DlgTrfData.SetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
If DlgTrfData.ShowDialog() Then
' recupero i dati salvati nella pagina
DlgTrfData.GetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
End If
ElseIf m_bCsvData Then
@@ -1242,6 +1255,8 @@ Public Class DrawPageUC
Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False
If EngraveBtn.IsChecked Then
' Aumento lo spazio disponibile per inserirei i parametri (tolgo spazio ad eventuali messaggi)
Grid.SetRowSpan(VariablesGrd, 2)
' Imposto modalità
m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE
If m_ActiveComponentPage = Pages.CompoDimension Then
@@ -1273,6 +1288,7 @@ Public Class DrawPageUC
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
Grid.SetRowSpan(VariablesGrd, 2)
VariablesGrd.Children.Remove(m_SideAngleUC)
If m_PrevSideAnglePage = Pages.CompoDimension Then
VariablesGrd.Children.Add(m_CompoDimension)
@@ -1362,6 +1378,8 @@ Public Class DrawPageUC
End Sub
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
m_SelListHole.Clear()
m_DeselectListHole.Clear()
m_SceneButtons.MeasureBtn.IsChecked = False
If FiloTopBtn.IsChecked Then
' Imposto modalità
@@ -1375,25 +1393,25 @@ Public Class DrawPageUC
m_PrevSideAnglePage = Pages.AlzFront
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End If
VariablesGrd.Children.Add( m_FiloTopUC)
VariablesGrd.Children.Add(m_FiloTopUC)
SideAngleBtn.IsEnabled = False
EngraveBtn.IsEnabled = False
DripCutBtn.IsEnabled = False
MessageGrid.Visibility = Windows.Visibility.Hidden
BackBtn.Visibility = Windows.Visibility.Hidden
MessageTxBx.Text = EgtMsg( MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
' In ogni caso, nascondo layer delle misure
Dim PartId As Integer = EgtGetFirstInGroup( GDB_ID.ROOT)
EgtSetStatus(EgtGetFirstNameInGroup( PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup( PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup( PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_AUX), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else
VariablesGrd.Children.Remove( m_FiloTopUC)
VariablesGrd.Children.Remove(m_FiloTopUC)
If m_PrevSideAnglePage = Pages.CompoDimension Then
VariablesGrd.Children.Add( m_CompoDimension)
VariablesGrd.Children.Add(m_CompoDimension)
ElseIf m_PrevSideAnglePage = Pages.InternalComponent Then
LeftButtonGrd.Children.Add( m_CompoDimension.m_InternalCompoPage)
LeftButtonGrd.Children.Add(m_CompoDimension.m_InternalCompoPage)
End If
SideAngleBtn.IsEnabled = m_bEnableSideAngle
EngraveBtn.IsEnabled = True
+6 -2
View File
@@ -41,7 +41,11 @@
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
<EgtWPFLib:EgtTextBox Name="Parameter2TxBx" Grid.Column="1" Grid.Row="11" Width="90"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
<TextBlock Name="Parameter3TxBl" Grid.Row="12" Text="Arrotonda"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
<CheckBox Name="Parameter3ChBx" Grid.Row="12" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Center" Margin="0,0,6,0"/>
</Grid>
</UserControl>
+174 -2
View File
@@ -7,6 +7,8 @@ Public Class FiloTopUC
' Riferimento alla pagina che ha aperto SideAngleUC
Private m_CallingPage As MainWindow.Pages
Private m_SelList As New List(Of Integer)
' Offset della sfilettatura
Private m_dFiloTopOffset As Double = 0
Friend ReadOnly Property FiloTopOffset As Double
@@ -23,6 +25,13 @@ Public Class FiloTopUC
End Get
End Property
' esegue l'arrotindamento sugli angoli del percorso utensile
Private m_bCornerradius As Boolean = False
Friend ReadOnly Property bCornerRadius As Boolean
Get
Return m_bCornerradius
End Get
End Property
Private Sub FiloTopUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Imposto riferimenti ad altre pagine
@@ -43,14 +52,18 @@ Public Class FiloTopUC
End If
' Gestisco visualizzazione dei parametri
Parameter2TxBl.Visibility = Windows.Visibility.Visible
ParameterTxBl.Visibility = Windows.Visibility.Visible
Parameter2TxBx.Visibility = Windows.Visibility.Visible
Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString( m_dFiloTopDepth, 3)
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius
m_SelList.Clear()
End Sub
Private Sub FiloTopUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
@@ -74,6 +87,8 @@ Public Class FiloTopUC
End While
nPartId = EgtGetNextPart(nPartId)
End While
' aggiorno la preview
CreateFiloTopPreView(m_SelList, False)
End Sub
Private Sub Parameter2TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter2TxBx.EgtClosed
@@ -95,4 +110,161 @@ Public Class FiloTopUC
End While
End Sub
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
' Assegno il valore
m_bCornerradius = Parameter3ChBx.IsChecked
WritePrivateProfileString(S_SIDES, K_ROUNDOFF, If(m_bCornerradius, "1", "0"), m_MainWindow.GetIniFile())
' Aggiorno le info del profilo
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_ROUNDOFF, If(m_bCornerradius, 1, 0))
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
' aggiorno la preview (False = blocco la lettura dei dati della componente)
CreateFiloTopPreView(m_SelList, False)
End Sub
Public Sub CreateFiloTopPreView(SelList As List(Of Integer), Optional bReadInfo As Boolean = True)
m_SelList = SelList
If m_SelList.Count < 1 Then Return
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
' verifico che lemento corrente appartenga all'elenco degli elementi selezionati
Dim bIsSelected As Boolean = m_SelList.Find(Function(value As Integer)
Return value = nLayId
End Function) <> 0
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) AndAlso bIsSelected Then
' ---------------------- Inizio GESTIONE PREVIEW percorso -------------------------------
Dim nLayFiloTop As Integer = GDB_ID.NULL
Dim nInLoopRef As Integer = GDB_ID.NULL
nLayFiloTop = EgtGetFirstNameInGroup(nPartId, "FiloTop")
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
' verifico il Layer "FiloTop" sia associato all'InLoop corrente
While (nLayFiloTop <> GDB_ID.NULL AndAlso nInLoopRef <> nLayId)
nLayFiloTop = EgtGetNextName(nLayFiloTop, "FiloTop")
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
End While
' se non esiste il Layer "FiloTop"
If nLayFiloTop = GDB_ID.NULL Then
' lo creo
nLayFiloTop = EgtCreateGroup(nPartId)
EgtSetName(nLayFiloTop, "FiloTop")
EgtSetInfo(nLayFiloTop, "InLoopRef", nLayId)
EgtSetInfo(nLayId, "FiloTopRef", nLayFiloTop)
End If
' carico i dati del filo top selezionato
If bReadInfo Then
EgtGetInfo(nLayFiloTop, INFO_OFFSET, m_dFiloTopOffset)
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
EgtGetInfo(nLayFiloTop, INFO_DEPTH, m_dFiloTopDepth)
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
Dim nVal As Integer = If(m_bCornerradius, 1, 0)
EgtGetInfo(nLayFiloTop, INFO_ROUNDOFF, nVal)
Parameter3ChBx.IsChecked = If(nVal = 1, True, False)
m_bCornerradius = Parameter3ChBx.IsChecked
End If
' procedo alla creazione della curva
Dim nIdCompoCurve As Integer = GDB_ID.NULL
' cancello un eventuale curva composita creata in precedenza
nIdCompoCurve = EgtGetFirstNameInGroup(nLayFiloTop, "OffsetPreView")
If nIdCompoCurve <> GDB_ID.NULL Then
EgtErase(nIdCompoCurve)
End If
Dim nCompoCurve As New List(Of Integer)
' costruisco il percorso chiuso dati i lati di contorno
Dim nLine As Integer = EgtGetFirstInGroup(nLayId)
While nLine <> GDB_ID.NULL
nCompoCurve.Add(nLine)
nLine = EgtGetNext(nLine)
End While
Dim PtNearStart As Point3d
Dim nInfoRoundOff As Integer = If(m_bCornerradius, 1, 0)
nIdCompoCurve = EgtCreateCurveCompoByChain(nLayFiloTop, nCompoCurve.ToArray, PtNearStart, False)
EgtSetName(nIdCompoCurve, "OffsetPreView")
' salvo i dati nel layer FiloTop
EgtSetInfo(nLayFiloTop, INFO_OFFSET, m_dFiloTopOffset)
EgtSetInfo(nLayFiloTop, INFO_DEPTH, m_dFiloTopDepth)
EgtSetInfo(nLayFiloTop, INFO_ROUNDOFF, nInfoRoundOff)
Dim bOk As Boolean = False
' leggo che tipo di offset applicare (Round, Extend)
If nInfoRoundOff <> 1 Then
bOk = EgtOffsetCurve(nIdCompoCurve, -m_dFiloTopOffset, OFF_TYPE.EXTEND)
Else
bOk = EgtOffsetCurve(nIdCompoCurve, -m_dFiloTopOffset, OFF_TYPE.FILLET)
End If
' se la generazione della curva non va a buon fine
If Not bOk Then
EgtErase(nLayFiloTop)
EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
End If
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
' riceve la lista dei LayerFiloTop che devono essere eliminati
Public Sub EraseFiloTopPreview(EraseList As List(Of Integer))
Dim m_EraseList As List(Of Integer) = EraseList
If m_EraseList.Count < 1 Then Return
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
Dim bIsSelected As Boolean = m_EraseList.Find(Function(value As Integer)
Return value = nLayId
End Function) <> 0
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso bIsSelected Then
' ---------------------- Inizio GESTIONE PREVIEW percorso -------------------------------
Dim nLayFiloTop As Integer = GDB_ID.NULL
Dim nInLoopRef As Integer = GDB_ID.NULL
nLayFiloTop = EgtGetFirstNameInGroup(nPartId, "FiloTop")
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
' cerco il Layer associato all'InLoop corrente
While (nLayFiloTop <> GDB_ID.NULL AndAlso nInLoopRef <> nLayId)
nLayFiloTop = EgtGetNextName(nLayFiloTop, "FiloTop")
EgtGetInfo(nLayFiloTop, "InLoopRef", nInLoopRef)
End While
' se non esiste il Layer
If nLayFiloTop = GDB_ID.NULL Then
' esco
Return
Else
' lo elimino
EgtErase(nLayFiloTop)
EraseList.Remove(nLayId)
End If
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
EgtDraw()
End Sub
End Class
+16 -3
View File
@@ -49,15 +49,28 @@
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="7.25*"/>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
ItemsSource="{Binding ItemList}"/>
<Border Name="MessageBrd" Grid.Row="4" BorderThickness="0,1,0,0" BorderBrush="Gray">
<Grid Grid.Row="3" Margin="0,0,8,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="FindTxBx" Grid.Column="0"
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
<Button Name="ClearFindBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Margin="0,6,2,6">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}" Width="30" />
</Button>
</Grid>
<Border Name="MessageBrd" Grid.Row="5" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</Border>
+33 -1
View File
@@ -297,6 +297,36 @@ Public Class ImportPageUC
End Select
End Sub
Private Sub FindTxBx_EgtClosed(sender As Object, e As EventArgs) Handles FindTxBx.EgtClosed
' Elimino spazi iniziali e finali
FindTxBx.Text = FindTxBx.Text.Trim()
' ricarico la lista dei file
LoadCurrDir()
Dim UpdateListFile As New List(Of IconListBoxItem)
' Se esiste un nome
If Not String.IsNullOrWhiteSpace(FindTxBx.Text) Then
For Each Item As IconListBoxItem In FileListBox.ItemsSource
If Item.Name.ToLower.Contains(FindTxBx.Text.ToLower) Then
UpdateListFile.Add(Item)
End If
Next
End If
If UpdateListFile.Count > 0 Then
FileListBox.ItemsSource = UpdateListFile
Else
FileListBox.ItemsSource = m_MainWindow.m_ImportItemList
End If
End Sub
Private Sub ClearFindBtn_Click() Handles ClearFindBtn.Click
' svuoto la text
FindTxBx.Text = ""
' ricarico la lista dei file
LoadCurrDir()
' e aggiorno la lista dei file
FileListBox.ItemsSource = m_MainWindow.m_ImportItemList
End Sub
Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
@@ -809,7 +839,7 @@ Public Class ImportPageUC
PartId = EgtGetNextPart(PartId)
End While
' identificativo univoico del gruppo di pezzi, se più di un pezzo
' identificativo univoico del gruppo di pezzi, se più di un "Repeat"
Dim sGUICode As New List(Of String)
' Scrivo testi per nesting
@@ -851,6 +881,7 @@ Public Class ImportPageUC
EgtInsertFile(sTmpFile)
Dim FirstOfImport As Integer = EgtGetNextPart(nFirst2Id)
If FirstOfImport = GDB_ID.NULL Then FirstOfImport = EgtGetFirstPart()
Dim Index As Integer = 1
While FirstOfImport <> GDB_ID.NULL And Index <= sGUICode.Count
If Not String.IsNullOrEmpty(sGUICode(Index - 1)) Then
@@ -887,6 +918,7 @@ Public Class ImportPageUC
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
' Ciclo sui pezzi inseriti
nId = nFirstId
While nId <> GDB_ID.NULL
+18 -7
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.IO
Imports EgtUILib
Public Class InternalComponentPageUC
@@ -286,12 +287,22 @@ Public Class InternalComponentPageUC
If sCompoImage.Length <> 0 Then
Try
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
If File.Exists(sPath) Then
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
Else
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
GetLabel(index).SetValue(Grid.ColumnProperty, 0)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 2)
End If
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty
+18 -7
View File
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="597.1" d:DesignWidth="255.9">
d:DesignHeight="636.9" d:DesignWidth="255.9">
<!-- Definizione della Grid Laterale -->
<Grid Name="VariablesCompoGrid" Grid.RowSpan="2">
@@ -28,7 +28,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="5*"/>
<!--<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>-->
@@ -135,7 +135,7 @@
Margin="0,0,0,-2"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4">
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.3*"/>
@@ -143,10 +143,11 @@
<ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.9*"/>
</Grid.RowDefinitions>
<TextBlock Name="Parameter1TxBl" Grid.Row="0" Grid.ColumnSpan="2"
@@ -196,6 +197,16 @@
Margin="0,0,0,-2"
Width="85" Height="30"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Parameter5TxBl" Grid.Row="4" Grid.ColumnSpan="2"
Text="Angolo"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
<EgtWPFLib:EgtTextBox Name="Parameter5TxBx"
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4"
Margin="0,0,0,-2"
Width="85" Height="30"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
<!--<TextBlock Name="Parameter1TxBl" Grid.Row="11" Text="Offset"
+119 -8
View File
@@ -34,7 +34,9 @@ Public Class SideAngleUC
Friend m_dDripOffset2 As Double = 0
Friend m_nEngrNbr2 As Integer = 1
Friend m_dDripDepth As Double = 10
Friend m_dEngraveDepth2 As Double = 15
Friend m_dDripShort As Double = 0
Friend m_dEngraveAngle As Double = 0
Private CurrEntityDrip As DripEntity
@@ -105,6 +107,9 @@ Public Class SideAngleUC
' Accorciamento
Parameter4TxBl.Visibility = Windows.Visibility.Hidden
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
' Angolo
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
Else
' se aggiungo gli ENGRAVE e i DRIP
@@ -116,10 +121,12 @@ Public Class SideAngleUC
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
Next
' Offset
Parameter1TxBl.Visibility = Windows.Visibility.Visible
Parameter1TxBx.Visibility = Windows.Visibility.Visible
Parameter2TxBl.Visibility = Windows.Visibility.Visible
' Offset2
If m_Mode <> ModeOpt.ENGRAVE Then
Parameter2TxBx.Visibility = Windows.Visibility.Visible
@@ -130,12 +137,33 @@ Public Class SideAngleUC
Parameter2aTxBx.Visibility = Windows.Visibility.Visible
Parameter2bTxBx.Visibility = Windows.Visibility.Visible
End If
' Affondamento
Parameter3TxBl.Visibility = Windows.Visibility.Visible
Parameter3TxBx.Visibility = Windows.Visibility.Visible
' Accorciamento
Parameter4TxBl.Visibility = Windows.Visibility.Hidden
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
If m_Mode = ModeOpt.ENGRAVE Then
' modifico il nome del messaggio
Parameter4TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) & "2" ' Affondamento2
Parameter4TxBl.Visibility = Windows.Visibility.Visible
Parameter4TxBx.Visibility = Windows.Visibility.Visible
Else
Parameter4TxBl.Visibility = Windows.Visibility.Hidden
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
End If
' Angolo
If m_Mode = ModeOpt.ENGRAVE Then
' modifico il nome del messaggio
Parameter5TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo
Parameter5TxBl.Visibility = Windows.Visibility.Visible
Parameter5TxBx.Visibility = Windows.Visibility.Visible
Else
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
End If
End If
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
@@ -156,12 +184,14 @@ Public Class SideAngleUC
m_nEngrNbr2 = GetPrivateProfileInt( S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_ENGRAVESHORT, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3)
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString( m_dDripShort, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = LenToString(m_dEngraveAngle, 3)
End If
' Aggiorno visualizzazione
@@ -489,7 +519,9 @@ Public Class SideAngleUC
WritePrivateProfileString( S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
'WritePrivateProfileString( S_SIDES, K_ENGRAVESHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEANGLE, LenToString(m_dEngraveAngle, 3), m_MainWindow.GetIniFile())
End If
EgtDraw()
@@ -635,7 +667,7 @@ Public Class SideAngleUC
SideAngle.AddTextToLine(sEntityName, TextLayer, CurrLine, 20, dBBoxRad, True)
End Sub
' Funzione che crea le geometrie dei gocciolatoi
' Funzione che crea le geometrie dei gocciolatoi (NON UTILIZZATA)
Friend Sub CreateDripGeomOLD(nPartId As Integer)
' Recupero Id layer di contorno esterno
Dim nOutLoopId = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
@@ -830,6 +862,9 @@ Public Class SideAngleUC
Dim nCrvId = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL
EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
If m_Mode = ModeOpt.ENGRAVE Then
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
End If
nCrvId = EgtGetNext(nCrvId)
End While
' Eventuali curve aggiuntive con offset2
@@ -840,10 +875,16 @@ Public Class SideAngleUC
For i As Integer = 1 To m_nEngrNbr2
Dim nNewId As Integer = EgtCopy(nCrvId, nCrvId, GDB_POS.AFTER)
EgtOffsetCurve(nNewId, -i * m_dDripOffset2, OFF_TYPE.EXTEND)
If m_Mode = ModeOpt.ENGRAVE Then
EgtSetInfo(nNewId, INFO_DEPTH, m_dEngraveDepth2)
End If
Next
nCrvId = nNextCrvId
End While
End If
Dim ListEngraveSideAng As New List(Of Integer)
If m_Mode = ModeOpt.DRIP Then
' Esplodo nelle curve componenti
nCrvId = EgtGetFirstInGroup(DripLayer)
@@ -863,14 +904,70 @@ Public Class SideAngleUC
End While
Else
' Assegno colore e attributi
Dim nInd As Integer = 0
nCrvId = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL
EgtSetColor(nCrvId, COL_MCH_DRIPCUT())
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
'EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0"))
If nInd = 0 Then
' solo se m_dEngraveAngle > 0
If Math.Abs(m_dEngraveAngle) > EPS_ANG_SMALL Then
' salvo l'Id della curva che deve essere manipolato separatamente
ListEngraveSideAng.Add(nCrvId)
Else
EgtRemoveInfo(nCrvId, INFO_SIDE_ANGLE)
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
Else
If nInd = m_nEngrNbr2 Then
nInd = -1
End If
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
nInd = nInd + 1
If nInd > m_nEngrNbr2 Then nInd = 0
nCrvId = EgtGetNext(nCrvId)
End While
End If
SplitJointedSideEngrave(ListEngraveSideAng)
End Sub
Private Sub SplitJointedSideEngrave(ListEngraveSideAngId As List(Of Integer))
For Each nCrvId As Integer In ListEngraveSideAngId
' eventualmente separo il taglio inclinato
Dim dUs, dUe As Double
EgtCurveDomain(nCrvId, dUs, dUe)
Dim dU As Double = dUs
While dU < dUe ' + EPS_ZERO
Dim ptCurr As Point3d
EgtAtParamPoint(nCrvId, dU + 1, nCrvId, ptCurr)
' separa la curva in questo punto
Dim nNewCurvId As Integer = GDB_ID.NULL
If dUe > 1 Then
nNewCurvId = EgtSplitCurveAtPoint(nCrvId, ptCurr, GDB_RT.LOC)
Else
nNewCurvId = nCrvId
End If
EgtSetColor(nCrvId, COL_MCH_ONENGRAVE_ANG())
EgtSetInfo(nCrvId, INFO_SIDE_ANGLE, m_dEngraveAngle)
' recupero il vettore di estrusione della curva e la direzione della curva
Dim vtAux As Vector3d
EgtStartVector(nCrvId, vtAux)
Dim vtExtrusion As Vector3d
EgtCurveExtrusion(nCrvId, vtExtrusion)
' ruoto il vetottore nella nuova direzione
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
Dim ExtendFactor As Double = New Vector3d(0, 0, 1) * vtExtrusion
EgtModifyCurveThickness(nCrvId, -m_dDripDepth / ExtendFactor)
If dUe = 1 Then Exit While
nCrvId = nNewCurvId
' aggiorno i valori del dominio della curva che rimane
EgtCurveDomain(nCrvId, dUs, dUe)
End While
Next
End Sub
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
@@ -1304,11 +1401,25 @@ Public Class SideAngleUC
End Sub
Private Sub Parameter4TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter4TxBx.EgtClosed
If m_Mode = ModeOpt.DRIP Or m_Mode = ModeOpt.ENGRAVE Then
If m_Mode = ModeOpt.DRIP Then
' Recupero il valore
StringToLen(Parameter4TxBx.Text, m_dDripShort)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
ElseIf m_Mode = ModeOpt.ENGRAVE Then
' Recupero il valore
StringToLen(Parameter4TxBx.Text, m_dEngraveDepth2)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
End If
End Sub
Private Sub Parameter5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter5TxBx.EgtClosed
If m_Mode = ModeOpt.ENGRAVE Then
' Recupero il valore
StringToLen(Parameter5TxBx.Text, m_dEngraveAngle)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
End If
End Sub
+158 -11
View File
@@ -1,16 +1,48 @@
<ResourceDictionary
x:Class="EgtDictionary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Project="clr-namespace:OmagCUT"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions">
<ResourceDictionary x:Class="EgtDictionary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Project="clr-namespace:OmagCUT"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions">
<!--Template che permette di andare a capo-->
<EgtWPFLib5:StatusBarVM x:Key="StatusBarVM"/>
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
<EgtPHOTOLib:ProjectSlabVM x:Key="ProjectSlabVM"/>
<EgtPHOTOLib:OptionPanelSlabVM x:Key="OptionPanelSlabVM"/>
<EgtPHOTOLib:ListPageSlabVM x:Key="ListPageSlabVM"/>
<EgtPHOTOLib:DetailPageSlabVM x:Key="DetailPageSlabVM"/>
<EgtPHOTOLib:SearchPanelSlabVM x:Key="SearchPanelSlabVM"/>
<EgtPHOTOLib:MyInstrumentPanelSlabVM x:Key="MyInstrumentPanelSlabVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
<SolidColorBrush x:Key="Omag_Green" Color="LawnGreen" />
<SolidColorBrush x:Key="Omag_VeryLightGray" Color="#FFF2F2F2" />
<SolidColorBrush x:Key="Omag_LightGray" Color="LightGray" />
<SolidColorBrush x:Key="Omag_Gray" Color="#FF9E9E9E" />
<SolidColorBrush x:Key="Omag_DarkGray" Color="#FF444444" />
<SolidColorBrush x:Key="Omag_White" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="Omag_Black" Color="#FF000000" />
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF095CA8" />
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="Button_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}"/>
</DataTemplate>
<!--ButtonBase-->
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- Button Style -->
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
@@ -71,7 +103,44 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="WrapButton_DataTemplate">
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="ToolBar_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="80"/>
</Style>
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_TextWrapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="Height" Value="45"/>
</Style>
<Style x:Key="OptionPanel_NestingButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="EgtWPFLib5_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="60"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="CheckBox_DataTemplate_Wrap">
@@ -375,7 +444,59 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<Style x:Key="ToolBar_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="70"/>
</Style>
<Style x:Key="OptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="CompoWindow_WrapToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="5"/>
<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>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TreeViewBase-->
<!--Style e colori della freccia di espansione, necessari per modificare il ContainerItemStyle perchè contiene riferimenti ad essi-->
@@ -431,6 +552,32 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtCustomWindow -->
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
<Setter Property="TitleBarHeight" Value="32"/>
<Setter Property="TitleBarBrush" Value="{StaticResource Omag_LightGray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtFloatingPanel -->
<Style x:Key="ToolBar_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<Style x:Key="Option_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="IsToolBar" Value="False"/>
<Setter Property="TitleBarOrientation" Value="Vertical"/>
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
</ResourceDictionary>
+27
View File
@@ -578,6 +578,33 @@ Public Class AlarmsPageUC
String.Compare(sMchTool, m_CurrentMachine.sCurrSaw, True) <> 0 Then
m_CurrentMachine.sCurrSawing = String.Empty
End If
'Dim sVal As String = String.Empty
'Dim dVal As Double = 0
'If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSawing, false) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevLength(dVal)
'End If
'If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSawing, false) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevPerc(dVal)
'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
+186 -3
View File
@@ -609,6 +609,18 @@ 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
@@ -752,6 +764,7 @@ Public Class CurrentMachine
End Select
End Get
Set(value As Double)
Dim dValue As Double = 0
Select Case GetCurrentTable()
Case 3
If Math.Abs(value - m_dTab3AdditionalTable) > EPS_SMALL And
@@ -760,14 +773,24 @@ Public Class CurrentMachine
m_dTab3AdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, value)
End If
End If
Case 2
Case 2
If Math.Abs(value - m_dTab2AdditionalTable) > EPS_SMALL And
WritePrivateProfileString(S_TABLE, K_TAB2_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
' Aggiorno il valore corrente
m_dTab2AdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, value)
End If
End If
Case Else
If Math.Abs(value - m_dAdditionalTable) > EPS_SMALL And
@@ -776,6 +799,11 @@ Public Class CurrentMachine
m_dAdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, value)
End If
End If
End Select
End Set
@@ -845,9 +873,18 @@ Public Class CurrentMachine
Set(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevLength = value
' salvo il dato nelle UserNote della lavorazione
'MdbSetCurrMachiningUserNote("FsevLength", m_dFsevLength.ToString, sCurrSawing, false)
' salvo il dato nelle UserNote dell'utensile
TdbSetCurrToolUserNote("FsevLength", m_dFsevLength.ToString, sCurrSaw)
End If
End Set
End Property
Friend Sub SetFsevLength(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevLength = value
End If
End Sub
Friend Property dFsevPerc As Double
Get
@@ -856,9 +893,18 @@ Public Class CurrentMachine
Set(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevPerc = value
'' salvo il dato nelle UserNote della lavorazione
'MdbSetCurrMachiningUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSawing)
' salvo il dato nelle UserNote dell'utensile
TdbSetCurrToolUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSaw)
End If
End Set
End Property
Friend Sub SetFsevPerc(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevPerc = value
End If
End Sub
Friend ReadOnly Property ToolChangerNbr As Integer
Get
@@ -1249,6 +1295,7 @@ Public Class CurrentMachine
' Leggo dati per feed ridotta all'inizio/fine dei tagli
m_bFsevEnable = (GetPrivateProfileInt(S_NEST, K_MACH_CUTFSEVENABLE, 0, sMachIniFile) <> 0)
' sposto la lettura nel DB delle lavorazioni della lama corrente!
m_dFsevLength = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVLEN, 0, sMachIniFile)
m_dFsevPerc = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVPERC, 0, sMachIniFile)
@@ -1311,7 +1358,7 @@ Public Class CurrentMachine
' Leggo valori da file Data e li carico nelle proprietà
Dim sFilePath As String = sMachDir & "\" & MACHININGS_DIR & "\" & WATERJETDB_FILE
Dim Local_MaterialList = New ObservableCollection(Of EgtWPFLib5.WjMaterial)
Local_MaterialList = EgtWPFLib5.WaterjetDbWindowVM.LoadWjMaterials(sFilePath)
Local_MaterialList = WaterjetDbWindowVM_OmagCUT.LoadWjMaterials(sFilePath)
' definisco la lista delle qualità (solo se è vuota)
If m_Qualities.Count < 1 Then
m_Qualities.Add("Q1")
@@ -1342,7 +1389,7 @@ Public Class CurrentMachine
' Leggo valori da file Data e li carico nelle proprietà
Dim sFilePath As String = sMachDir & "\" & MACHININGS_DIR & "\" & WATERJETDB_FILE
Dim Local_MaterialList = New ObservableCollection(Of EgtWPFLib5.WjMaterial)
Local_MaterialList = EgtWPFLib5.WaterjetDbWindowVM.LoadWjMaterials(sFilePath)
Local_MaterialList = WaterjetDbWindowVM_OmagCUT.LoadWjMaterials(sFilePath)
Dim sItems() As String = sCurMat.Split("."c)
If sItems.Count > 1 Then
Dim sMat As String = sItems(0)
@@ -1370,6 +1417,142 @@ Public Class CurrentMachine
Return dMaxThick
End Function
#Region "USERNOTE"
' recupero le note UserNote associate alla LAVORAZIONE Machining
Friend Function MdbGetCurrMachiningUserNote(Machining As String) As String
Dim UserNotes As String = String.Empty
' lavorazione corrente
Dim CurrMach As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, CurrMach)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Machining) AndAlso EgtMdbSetCurrMachining(Machining) Then
' leggo nel db corrente della lavorazione questa info
EgtMdbGetCurrMachiningParam(MCH_MP.USERNOTES, UserNotes)
' reimposto lavorazione corrente
EgtMdbSetCurrMachining(CurrMach)
End If
Return UserNotes
End Function
' recupero le note UserNote associate all'UTENSILE Tool
Friend Function TdbGetCurrToolUserNote(Tool As String) As String
Dim UserNotes As String = String.Empty
' lavorazione corrente
Dim CurrTool As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.NAME, CurrTool)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Tool) AndAlso EgtTdbSetCurrTool(Tool) Then
' leggo nel db corrente della lavorazione questa info
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, UserNotes)
' reimposto lavorazione corrente
EgtTdbSetCurrTool(CurrTool)
End If
Return UserNotes
End Function
' imposta il nuovo valore in UserNote della LAVORAZIONE Machining
Friend Sub MdbSetCurrMachiningUserNote(sKeyUserNote As String, sValUserNote As String, Machining As String)
' lavorazione corrente
Dim CurrMach As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, CurrMach)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Machining) AndAlso EgtMdbSetCurrMachining(Machining) Then
Dim UserNotes As String = String.Empty
' salvo nel db corrente della lavorazione questa info devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
EgtMdbSetCurrMachiningParam(MCH_MP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Machining))
EgtMdbSaveCurrMachining()
EgtMdbSave()
' reimposto lavorazione corrente
EgtMdbSetCurrMachining(CurrMach)
End If
End Sub
' imposta il nuovo valore in UserNote dell'UTENSILE Tool
Friend Sub TdbSetCurrToolUserNote(sKeyUserNote As String, sValUserNote As String, Tool As String)
' lavorazione corrente
Dim CurrTool As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.NAME, CurrTool)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Tool) AndAlso EgtTdbSetCurrTool(Tool) Then
Dim UserNotes As String = String.Empty
' salvo nel db corrente della lavorazione questa info devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Tool))
EgtTdbSaveCurrTool()
EgtTdbSave()
' reimposto lavorazione corrente
EgtTdbSetCurrTool(Tool)
End If
End Sub
' separa la le note UserNote della LAVORAZIONE
Private Function SplitUserNoteMachinig(Machining As String) As String()
Dim sUserNotes As String = MdbGetCurrMachiningUserNote(Machining)
If String.IsNullOrEmpty(sUserNotes) Then Return Nothing
Dim sItems As String() = sUserNotes.Split(";"c)
Return sItems
End Function
' separa la le note UserNote della LAVORAZIONE
Private Function SplitUserNoteTool(Tool As String) As String()
Dim sUserNotes As String = TdbGetCurrToolUserNote(Tool)
If String.IsNullOrEmpty(sUserNotes) Then Return Nothing
Dim sItems As String() = sUserNotes.Split(";"c)
Return sItems
End Function
' recupera il valore della associato alla chiave per la lavorazione oppure utensile (bIsToolNote)
Friend Function GetUserNote(sKeyUserNote As String, ByRef sValUserNote As String, sName As String, Optional bIsToolNote As Boolean = True) As Boolean
Dim sUserNotesList As String() = Nothing
If bIsToolNote Then
sUserNotesList = SplitUserNoteTool(sName)
Else
sUserNotesList = SplitUserNoteMachinig(sName)
End If
If IsNothing(sUserNotesList) Then Return False
For Index As Integer = 0 To sUserNotesList.Count - 1
Dim sNote As String() = sUserNotesList(Index).Split("="c)
If sNote.Count = 2 AndAlso sNote(0).Trim = sKeyUserNote Then
sValUserNote = sNote(1).Trim
End If
Next
Return True
End Function
' ricostruisce la stringa UserNote da salvare
Friend Function AssembUserNote(sKeyUserNote As String, sValUserNote As String, sName As String, Optional bIsToolNote As Boolean = True) As String
Dim sUserNotes As String = String.Empty
Dim sUserNotesList As String() = Nothing
If bIsToolNote Then
sUserNotesList = SplitUserNoteTool(sName)
Else
sUserNotesList = SplitUserNoteMachinig(sName)
End If
Dim bExists As Boolean = False
If Not IsNothing(sUserNotesList) Then
For Index As Integer = 0 To sUserNotesList.Count - 1
Dim sNote As String() = sUserNotesList(Index).Split("="c)
If sNote.Count = 2 AndAlso sNote(0).Trim = sKeyUserNote Then
sUserNotesList(Index) = sKeyUserNote & "=" & sValUserNote
bExists = True
Exit For
End If
Next
' riassemblo la stringa
For Each Item As String In sUserNotesList
If Not String.IsNullOrWhiteSpace(Item) Then
sUserNotes &= Item & ";"
End If
Next
End If
If Not bExists Then
sUserNotes &= sKeyUserNote & "=" & sValUserNote & ";"
End If
Return sUserNotes
End Function
#End Region ' USERNOTE
Friend Function IsVacuumMovePossible() As Boolean
' Recupero diametro lama corrente
EgtTdbSetCurrTool(sCurrSaw)
+18 -18
View File
@@ -145,12 +145,12 @@ Public Class MachinePageUC
m_ActiveMachinePage = MachinePages.Alarms
Case MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
AlarmsBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
@@ -215,12 +215,12 @@ Public Class MachinePageUC
m_ActiveMachinePage = MachinePages.ToolsDb
Case MachinePages.WaterJet
'Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
ToolsDBBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
@@ -285,12 +285,12 @@ Public Class MachinePageUC
m_ActiveMachinePage = MachinePages.MachiningDb
Case MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
MachiningDBBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
@@ -358,12 +358,12 @@ Public Class MachinePageUC
PolishingsBtn.IsChecked = True
Case MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
PolishingsBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
@@ -513,12 +513,12 @@ Public Class MachinePageUC
m_ActiveMachinePage = MachinePages.MachineCN
Case MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
TestingPageBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
@@ -593,12 +593,12 @@ Public Class MachinePageUC
m_ActiveMachinePage = MachinePages.Statistics
Case MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
StatisticsBtn.IsChecked = False
WaterJetBtn.IsChecked = True
Return
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
' passo alla pagina Dati Macchina
+1 -1
View File
@@ -36,7 +36,7 @@ Public Class StatisticsPageUC
DayTxBl.Text = sDay
' Leggo il numero della settimana
Dim nWeek As Integer = GetPrivateProfileInt(S_STATDATA, K_SD_WEEK, -1, m_MainWindow.GetIniFile())
WeekTxBl.Text = ( nWeek + 1).ToString()
WeekTxBl.Text = (nWeek).ToString()
' Leggo area pezzi del giorno
Dim dDayParts As Double = GetPrivateProfileDouble(S_STATDATA, K_SD_DAYPARTS, 0, m_MainWindow.GetIniFile())
+3 -3
View File
@@ -8,18 +8,18 @@ Public Class WaterJetPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_refWaterjetDbWindowVM As EgtWPFLib5.WaterjetDbWindowVM
Private m_refWaterjetDbWindowVM As WaterjetDbWindowVM_OmagCUT
Private m_sOrigNewMaterial As String = String.Empty
Private m_sOrigNewSubMaterial As String = String.Empty
Private Sub WaterJetPage_Initialized(sender As Object, e As EventArgs)
m_refWaterjetDbWindowVM = New EgtWPFLib5.WaterjetDbWindowVM(m_MainWindow.m_CurrentMachine.sMachDir)
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
Me.DataContext = m_refWaterjetDbWindowVM
EgtWPFLib.Utility.MainWindow = m_MainWindow
End Sub
Public Sub WaterJetPage_Reinitialize()
m_refWaterjetDbWindowVM = New EgtWPFLib5.WaterjetDbWindowVM(m_MainWindow.m_CurrentMachine.sMachDir)
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
Me.DataContext = m_refWaterjetDbWindowVM
End Sub
+61
View File
@@ -0,0 +1,61 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtWPFLib
' nuova libreria EgtWPFLib5 ver 2.4g1
Public Class WaterjetDbWindowVM_OmagCUT
Inherits EgtWPFLib5.WaterjetDbWindowVM
Public Function CloseWaterjetDb_OmagCut(MainWindow As Window) As SaveWndBtnEnum
If bIsModified Then
Dim SaveWjDbWnd As New EgtMsgBox(MainWindow, "", EgtMsg(31759), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
Select Case SaveWjDbWnd.m_nPressedBtn
Case 1 ' Yes
WriteWaterjetDb()
bIsModified = False
Return SaveWndBtnEnum.YES
Case 2 ' No
Return SaveWndBtnEnum.NO
Case Else ' Cancel
Return SaveWndBtnEnum.CANCEL
End Select
Else
Dim bExitFor As Boolean = False
For Each Material As EgtWPFLib5.WjMaterial In MaterialList
If Not IsNothing(Material.SubMaterialList) Then
For Each SubMaterial As EgtWPFLib5.WjSubMaterial In Material.SubMaterialList
If Not IsNothing(SubMaterial.ParamList) Then
For Each QParam As EgtWPFLib5.WjParam In SubMaterial.ParamList
bExitFor = QParam.IsModified()
If bExitFor Then Exit For
Next
End If
If bExitFor Then Exit For
Next
End If
If bExitFor Then Exit For
Next
If bExitFor Then
Dim SaveWjDbWnd As New EgtMsgBox(MainWindow, "", EgtMsg(31759), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
Select Case SaveWjDbWnd.m_nPressedBtn
Case 1 ' Yes
WriteWaterjetDb()
bIsModified = False
Return SaveWndBtnEnum.YES
Case 2 ' No
Return SaveWndBtnEnum.NO
Case Else ' Cancel
Return SaveWndBtnEnum.CANCEL
End Select
End If
End If
Return SaveWndBtnEnum.YES
End Function
Sub New(sMachDir As String)
MyBase.New(sMachDir)
End Sub
End Class
+111 -8
View File
@@ -2,6 +2,7 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib
Imports EgtPHOTOLib
Imports System.ComponentModel
Imports System.Threading
Imports System.Windows.Threading
@@ -323,8 +324,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2404, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2404, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2409, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2409, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -498,6 +499,64 @@ Class MainWindow
AddHandler m_ProdLineTimer.Tick, AddressOf OnProdLine
' Imposto riferimento a funzione delle textbox che disattiva scene in libreria
EgtWPFLib.EgtTextBox.m_refScenesIsEnabled = AddressOf IsEnabledScenes
' --------------------------------- SLAB DB -------------------------------------------------------
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\" & DB_FILENAME) Then
If Not ManageDb.ConnectToDb(PhotDir.Trim & "\" & DB_FILENAME) Then
EgtOutLog("Error connecting to DB: " & PhotDir.Trim & "\" & DB_FILENAME)
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrentProjectPageUC.ClearMessage()
m_CurrentProjectPageUC.SetErrorMessage("Denied connection SlabDB")
Else
' Impostazione direttorio per backup
Dim BackUpDir As String = m_sDataRoot & "\BackUp"
Directory.CreateDirectory(BackUpDir)
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
EgtPHOTOLib.MainData.SetPhotoDir(PhotDir)
EgtPHOTOLib.MainData.SetBackUpDir(BackUpDir)
EgtPHOTOLib.MainData.SetIsOMagCUT(True)
Dim sLastBlock As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_LASTBLOCK, "", sLastBlock, GetIniFile())
If Not String.IsNullOrEmpty(sLastBlock) Then
EgtPHOTOLib.MainData.SetLastBlock(sLastBlock)
End If
If GetPrivateProfileInt(S_SCRAPS, K_ENABLE_PRINTER, 0, GetIniFile()) = 1 Then
' leggo nome file prn (per stampante zebra)
Dim m_TemplateFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_TEMPLATE, m_sDataRoot & "\Label\Default.prn", m_TemplateFilePrinter, GetIniFile())
' leggo nome del direttorio in cui scrivere il file ini (per stampante zebra) -- solo se si desidera scrivere il file in un direttorio diverso
Dim m_DatFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_DAT, m_sDataRoot & "\Temp", m_DatFilePrinter, GetIniFile())
' leggo nome file exe (per stampante zebra)
Dim m_ZebraUtilitiesExe As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_ZEBRAUTILITIES, System.AppDomain.CurrentDomain.BaseDirectory & "ZebraPrinterUtilitiesR32.exe", m_ZebraUtilitiesExe, GetIniFile())
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
EgtPHOTOLib.MainData.SetDataFilePrinter(m_DatFilePrinter)
EgtPHOTOLib.MainData.SetZebraPrinterExe(m_ZebraUtilitiesExe)
EgtPHOTOLib.MainData.SetPrinterVisibility(True)
Else
EgtPHOTOLib.MainData.SetPrinterVisibility(False)
End If
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
End Sub
Private Sub ManageSingleIstance()
@@ -546,6 +605,16 @@ Class MainWindow
m_WorkInProgressPageUC.Prepare()
m_WorkInProgressPageUC.UpdateTools()
Dim sVal As String = String.Empty
If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, m_CurrentMachine.dFsevLength)
m_CurrentMachine.SetFsevLength(m_CurrentMachine.dFsevLength)
End If
If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, m_CurrentMachine.dFsevPerc)
m_CurrentMachine.SetFsevPerc(m_CurrentMachine.dFsevPerc)
End If
' Se macchina fotografica abilitata, ne inizializzo il gestore
#If Not TRIAL Then
If GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then
@@ -571,6 +640,10 @@ Class MainWindow
TestOff()
' disabilito DragRettangle
DragRettangleOff()
' disabilito SplitCurv
SplitCurvWJOff()
' disattivo StartCurv
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = True
@@ -628,6 +701,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -682,6 +757,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -735,6 +812,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -789,6 +868,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -838,6 +919,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -1078,10 +1161,10 @@ Class MainWindow
Case MachinePageUC.MachinePages.WaterJet
' Verifica ed eventuale salvataggio Db Waterjet
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Dim nPressedBtn As Integer = DirectCast(m_MachinePageUC.m_WaterJetPageUC.DataContext, EgtWPFLib5.WaterjetDbWindowVM).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.CANCEL Then
Dim nPressedBtn As Integer = DirectCast(m_MachinePageUC.m_WaterJetPageUC.DataContext, WaterjetDbWindowVM_OmagCUT).CloseWaterjetDb_OmagCut(m_MainWindow)
If nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.CANCEL Then
Return False
ElseIf nPressedBtn = EgtWPFLib5.WaterjetDbWindowVM.SaveWndBtnEnum.NO Then
ElseIf nPressedBtn = WaterjetDbWindowVM_OmagCUT.SaveWndBtnEnum.NO Then
m_MachinePageUC.m_WaterJetPageUC.WaterJetPage_Reinitialize()
End If
End Select
@@ -1144,10 +1227,15 @@ Class MainWindow
Private Sub OnIdle()
' Recupero il tipo di progetto
Dim nPrjType As Integer = m_CurrentProjectPageUC.GetCurrentProjectType()
' Verifico presenza testa H1 per lama/fresa (nel contesto principale)
Dim nCurrCtx As Integer = EgtGetCurrentContext()
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
EgtSetCurrentContext(nCurrCtx)
' Aggiorno interfaccia
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso (EgtGetHeadId("H1") <> GDB_ID.NULL)
' DirectCutBtn.IsEnabled = (EgtGetHeadId("H1") <> GDB_ID.NULL)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
' DirectCutBtn.IsEnabled = bHeadH1
End Sub
' Nomi dei file per OmagVIEW
@@ -1806,7 +1894,9 @@ Class MainWindow
m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(90327)) 'Inseriti Nuovi Pezzi Rovinati
Dim nPartId As Integer = EgtGetLastPart()
For nI As Integer = 1 To nRuPartsCnt
EgtRemoveInfo( nPartId, INFO_PARTOK)
EgtRemoveInfo(nPartId, INFO_PARTOK)
' ricreo la lista delle famiglie di pezzi presenti in parcheggio
m_CadCutPageUC.m_NestPage.GetFamilyGroupInPark()
m_CadCutPageUC.m_NestPage.StoreOnePart(nPartId, True)
nPartId = EgtGetPrevPart(nPartId)
Next
@@ -1905,4 +1995,17 @@ Class MainWindow
End Sub
Public Sub SplitCurvWJOff()
m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.IsChecked = False
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedSplitCurveWJ = False
m_CadCutPageUC.m_NestPage.ResetSplitCurvWJParam()
End Sub
Public Sub StartCurvWJOff()
m_CadCutPageUC.m_NestPage.StartCurveWJBtn.IsChecked = False
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedStartCurveWJ = False
m_CadCutPageUC.m_NestPage.ResetStartCurvWJParam()
End Sub
End Class
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.4.1")>
<Assembly: AssemblyFileVersion("2.4.4.1")>
<Assembly: AssemblyVersion("2.4.9.4")>
<Assembly: AssemblyFileVersion("2.4.9.4")>
+1 -1
View File
@@ -92,7 +92,7 @@ Namespace Num
Private Const TIMEOUT As Short = 99
Private Const SHORTSLEEPTIME As Short = 10
Private Const LONGSLEEPTIME As Short = 40
Private Const SHORTSLEEPCOUNT As Short = 20
Private Const SHORTSLEEPCOUNT As Short = 100
Private Const LONGSLEEPCOUNT As Short = 200
#End Region
+47
View File
@@ -115,6 +115,9 @@
<Reference Include="AxInterop.FXLib">
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
</Reference>
<Reference Include="EgtPHOTOLib">
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.3.4.5, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
@@ -143,6 +146,10 @@
</Reference>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
@@ -205,10 +212,20 @@
<Compile Include="Machine\ImportExportToolWD.xaml.vb">
<DependentUpon>ImportExportToolWD.xaml</DependentUpon>
</Compile>
<Compile Include="Machine\WaterjetDbWindowVM.vb" />
<Compile Include="Machine\WaterJetPageVM.vb" />
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
</Compile>
<Compile Include="Project\OmagPhotoWD.xaml.vb">
<DependentUpon>OmagPhotoWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\ScrapsWD.xaml.vb">
<DependentUpon>ScrapsWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\StartLauncheWD.xaml.vb">
<DependentUpon>StartLauncheWD.xaml</DependentUpon>
</Compile>
@@ -459,6 +476,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\AddToDataBaseUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\OmagPhotoWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\ScrapsWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\StartLauncheWD.xaml">
</Page>
<Page Include="Project\CicloStartWD.xaml">
@@ -1249,6 +1278,24 @@
<Resource Include="Resources\Spiral.png" />
<Resource Include="Resources\NewIcons\Drag_Rettangle.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\GenerateCN.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\GenerateCN.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\SPLIT-WJ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\START-WJ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+3
View File
@@ -46,6 +46,7 @@
<BitmapImage x:Key="DownArrowImg" UriSource="Resources/NewIcons/DownArrow.png"></BitmapImage>
<BitmapImage x:Key="DrawImg" UriSource="Resources/NewIcons/icone-tagli-3.png"></BitmapImage>
<BitmapImage x:Key="FrameMachiningImg" UriSource="Resources/NewIcons/FrameMachining.png"></BitmapImage>
<BitmapImage x:Key="GenerateCNImg" UriSource="Resources/NewIcons/GenerateCN.png"></BitmapImage>
<BitmapImage x:Key="GenericViewImg" UriSource="Resources/NewIcons/GenericView.png"></BitmapImage>
<BitmapImage x:Key="HalfTurnRotateImg" UriSource="Resources/Negative/HalfTurnRotate.png"></BitmapImage>
<BitmapImage x:Key="ImportImg" UriSource="Resources/NewIcons/icone-tagli-6.png"></BitmapImage>
@@ -106,6 +107,8 @@
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
+5
View File
@@ -116,6 +116,7 @@
<BitmapImage x:Key="DownArrowImg" UriSource="Resources/DownArrow.png"></BitmapImage>
<BitmapImage x:Key="DrawImg" UriSource="Resources/Draw.png"></BitmapImage>
<BitmapImage x:Key="FrameMachiningImg" UriSource="Resources/FrameMachining.png"></BitmapImage>
<BitmapImage x:Key="GenerateCNImg" UriSource="Resources/GenerateCN.png"></BitmapImage>
<BitmapImage x:Key="GenericViewImg" UriSource="Resources/GenericView.png"></BitmapImage>
<BitmapImage x:Key="HalfTurnRotateImg" UriSource="Resources/HalfTurnRotate.png"></BitmapImage>
<BitmapImage x:Key="ImportImg" UriSource="Resources/Import.png"></BitmapImage>
@@ -174,6 +175,8 @@
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
@@ -215,6 +218,8 @@
<!--Machinig-->
<BitmapImage x:Key="Allunga-AccorciaImg" UriSource="Resources/NewIcons/Allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="PonticelliWJImg" UriSource="Resources/NewIcons/Ponticelli.png"></BitmapImage>
<BitmapImage x:Key="PonticelliDeleteWJImg" UriSource="Resources/NewIcons/Ponticelli_delete.png"></BitmapImage>
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
+95
View File
@@ -0,0 +1,95 @@
<UserControl x:Class="AddToDataBaseUC"
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"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<!--Nome BLOCCO-->
<TextBlock Name="BlockTxBl" Grid.Column="1" Grid.Row="1" Text="Name block"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="BlockTxBx" Grid.Column="3" Grid.Row="1"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--Numero ID-->
<TextBlock Name="NbrIdTxBl" Grid.Column="1" Grid.Row="3" Text="ID"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="NbrIdTxBx" Grid.Column="3" Grid.Row="3"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--STATE-->
<TextBlock Name="StateTxBl" Grid.Column="1" Grid.Row="5" Text="State"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<ComboBox Name="StateCmBx" Grid.Column="3" Grid.Row="5" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--PROJECT-->
<TextBlock Name="ProjectNameTxBl" Grid.Column="1" Grid.Row="7" Text="Project"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ProjectTxBx" Grid.Column="3" Grid.Row="7"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--MATERIAL-->
<TextBlock Name="MatTxBl" Grid.Column="1" Grid.Row="9" Text="Mat"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="MatTxBx" Grid.Column="3" Grid.Row="9"
Style="{DynamicResource OmagCut_KeyboardTextBox}" IsEnabled="False"/>
<!--THICKNESS-->
<TextBlock Name="ThicknessTxBl" Grid.Column="1" Grid.Row="11" Text="Thickness"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ThicknessTxBx" Grid.Column="3" Grid.Row="11"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<!--WAREHOUSE-->
<TextBlock Name="WarehouseTxBl" Grid.Column="1" Grid.Row="13" Text="Warehouse position"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WarehouseTxBx" Grid.Column="3" Grid.Row="13"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--CANCEL-->
<Button Name="CacelBtn" Grid.Column="1" Grid.Row="15" Content="Delete"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--ADD-->
<Button Name="AddBtn" Grid.Column="3" Grid.Row="15" Content="Add"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--PRINT-->
<Button Name="PrintBtn" Grid.Column="1" Grid.Row="17" Content="Print"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Border>
</UserControl>
+121
View File
@@ -0,0 +1,121 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class AddToDataBaseUC
Private m_OmagPhotoWD As OmagPhotoWD
#Region "PROPERTY"
Private Sub BlockTxBx_EgtClosed(sender As Object, e As EventArgs) Handles BlockTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock = BlockTxBx.Text
' devo riasseganre il valore dell'indice
NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
EnableButtons()
End Sub
Private Sub NbrIdTxBx_EgtClosed(sender As Object, e As EventArgs) Handles NbrIdTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID = NbrIdTxBx.Text
EnableButtons()
End Sub
Private Sub StateCmBx_Changed() Handles StateCmBx.SelectionChanged
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.State = StateCmBx.SelectedIndex
EnableButtons()
End Sub
Private Sub ProjectTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ProjectTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo = ProjectTxBx.Text
EnableButtons()
End Sub
Private Sub ThicknessTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ThicknessTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness = ThicknessTxBx.Text
EnableButtons()
End Sub
Private Sub WarehouseTxBx_EgtClosed(sender As Object, e As EventArgs) Handles WarehouseTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.WarehousePosition = WarehouseTxBl.Text
EnableButtons()
End Sub
#End Region ' Property
Sub New(LocalOmagPhotoWD As OmagPhotoWD)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_OmagPhotoWD = LocalOmagPhotoWD
End Sub
' dopo la crezione della pagina imposto lo stato dei pulsanti
Private Sub PostLoaded() Handles Me.Loaded
If EgtPHOTOLib.MainData.bEnableTextId Then
BlockTxBx.Visibility = Visibility.Collapsed
BlockTxBl.Visibility = Visibility.Collapsed
Else
NbrIdTxBx.IsEnabled = False
End If
PrintBtn.IsEnabled = EgtPHOTOLib.MainData.bEnablePrinter
EnableButtons()
End Sub
#Region "COMMAND"
Private Sub CancelBtn_Click() Handles CacelBtn.Click
' se è stata inserita nel DB allora devo rimuoverla ed esco dalla pagina
EgtPHOTOLib.refOptionPanelVM.Delete()
' notifico che il grezzo è stato rimosso
OmagPhotoWD.m_IsDeleted = True
' notifico che il grezzo non è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = False
' elimino l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = ""
' esco dalla pagina
m_OmagPhotoWD.Close()
End Sub
Private Sub AddBtn_Click() Handles AddBtn.Click
' se non sono validi i campi allora attendo
If Not EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled Then Return
' modalità di funzionamento della libreria: ProjectSlabVM.ProjectModeOpt.NEWSLAB
EgtPHOTOLib.PhotoMap.refOptionPanelVM.Save()
' notifico che il grezzo è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = True
' salvo l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
' salvo il nome del blocco che è stato utilizzato
If Not EgtPHOTOLib.MainData.bEnableTextId Then
WritePrivateProfileString(S_SCRAPS, K_LASTBLOCK, EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock, m_OmagPhotoWD.m_MainWindow.GetIniFile())
End If
' aggiorno il testo del messaggio "Add" "Save"
AddBtn.Content = "Save"
' notifico che da ora la lastra inserita è in modalità di modifica (non salvo la lastra come nuova, ma la sovrascrivo come in modifica)
EgtPHOTOLib.PhotoMap.refProjectVM.SetSelProjectMode(ProjectSlabVM.ProjectModeOpt.DETAIL)
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.SetOrigValues()
' notifico che la lastra è in modifica da questo programma
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.IsSelected = EgtPHOTOLib.MainData.nKey
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
End Sub
Private Sub PrintBtn_Click() Handles PrintBtn.Click
EgtPHOTOLib.PhotoMap.refOptionPanelVM.PrintLabel()
End Sub
#End Region ' Command
#Region "METHODS"
Private Sub EnableButtons()
AddBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
' se la stampante non è abilitata allora non permetto assolutamente di abilitare il comando
If EgtPHOTOLib.MainData.bEnablePrinter Then
PrintBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
End If
End Sub
#End Region ' Methods
End Class
+15 -1
View File
@@ -508,6 +508,20 @@ Public Class CurrentProjectPageUC
UpdateHeightTxBx()
' aggiorno materiale
m_MainWindow.m_CurrentMachine.SetCurrMatByName(GetProjectMaterial())
' aggiorno altezza sovaratavola
If GetPrivateProfileInt(S_GENERAL, "AdditionalTableByProj", 0, m_sIniFile) = 1 Then
' leggo il valore OrigiAdditionalTable
Dim dValue As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable
Select Case GetCurrentTable()
Case 3
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
Case 2
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
Case Else
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
End Select
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
End If
' forzo visualizzazione eventuali dati su aree
SetAreasStatus( True)
' Dichiaro progetto non modificato
@@ -856,7 +870,7 @@ Public Class CurrentProjectPageUC
Friend Function UpdateSideAngCutProbeFlag() As Boolean
Dim bCurrSacProbe As Boolean =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_SACPROBE, 0, m_MainWindow.GetMachIniFile()) <> 0)
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_SACPROBE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso m_MainWindow.m_CurrentMachine.IsRawProbingPossible()
Dim bProjSacProbe As Boolean = GetSideAngCutProbeFlag()
If bCurrSacProbe <> bProjSacProbe Then Return SetSideAngCutProbeFlag(bCurrSacProbe)
Return True
+40
View File
@@ -0,0 +1,40 @@
<Window x:Class="OmagPhotoWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:OmagCUT="clr-namespace:OmagCUT"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="OmagPHOTO" Height="700" Width="1250" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" >
<Border Style="{DynamicResource OmagCut_Border}">
<Grid Name="OptionSLabGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<!-- nel codice mi occupo di riempire la griglia con gli UserControl -->
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<DockPanel Grid.Column="1" Grid.Row="1" Visibility="Hidden">
<!--StatusBar-->
<EgtWPFLib5:StatusBarV DataContext="{StaticResource StatusBarVM}" DockPanel.Dock="Bottom"/>
</DockPanel>
</Grid>
</Border>
</Window>
+171
View File
@@ -0,0 +1,171 @@
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtPHOTOLib
Imports System.IO
Public Class OmagPhotoWD
' Riferimento alla MainWindow
Friend m_MainWindow As MainWindow
Private m_AddToDataBaseUC As AddToDataBaseUC
Private m_StateList As New List(Of EgtWPFLib5.IdNameStruct)
' il contorno dell sfrido è definito a partire dai punti che rappresentano i vertici dello stesso
Private m_ContornScrap As New List(Of Point3d)
' se lo stato della lastra è "2" significa che è già stata inserita nel DB (non devo generare una nuova foto!)
Private m_nState As Integer = 1
' salvo il nome del file *.jpg
Private m_sFileImage As String = String.Empty
' definsce se il slavataggio è andato a buon fine (questa variabile deve esistere anche dopo la chiusura della finestra!)
Public Shared m_IsAdded As Boolean = False
Public Shared m_sDtBsId As String = ""
Public Shared m_bSlabIsSelected As Boolean = False
' definisce se il grezzo è stato eliminato dal DB
Public Shared m_IsDeleted As Boolean = False
Public Sub New(sImage As String, ContornScrap As List(Of Point3d), MnWindow As MainWindow, nState As Integer, DatabaseID As String)
InitializeComponent()
' salvo il riferimento della finestra principale
m_MainWindow = MnWindow
' leggo lo stato dello sfrido per decidere quale modalità di apertuta usare
m_nState = nState
'--------------- CARCICO lastra esistente ---------------
If m_nState = 2 Then
m_bSlabIsSelected = False
' ricerco l'elemento già inserito nel DB
For Each Item As Slab In EgtPHOTOLib.refProjectVM.SlabList
Dim CurrId As String = Item.GetCurrentID.Trim
If Item.GetCurrentID.Trim = DatabaseID.Trim Then
EgtPHOTOLib.refProjectVM.SelSlab = Item
m_bSlabIsSelected = True
Exit For
End If
Next
' se non trovo nessun elemento nel db allora esco
If IsNothing(EgtPHOTOLib.refProjectVM.SelSlab) Then
EgtOutLog("ID is not found in database: " & DatabaseID)
m_bSlabIsSelected = False
Return
End If
' procedo alla visualizzazione della pagina
EgtPHOTOLib.PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.DETAIL
' carico la lista degli stati letta dalla libreria
For Each Item As EgtWPFLib5.IdNameStruct In EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList
m_StateList.Add(Item)
Next
' notifico che la lastra è in modifica da questo programma
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.IsSelected = EgtPHOTOLib.MainData.nKey
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
' posiziono la finestra
Me.Top = 15
Me.Left = 15
Return
End If
'--------------- DEFINSCO nuova lastra esistente ---------------
' imposto come prima pagina sempre la lista (per inizializzare gli elementi della libreria) ACCELERARE il processo di creazione di questo oggetto!
EgtPHOTOLib.PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.NEWSLAB
' imposto il percoso della foto appena generato
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ImagePath = sImage
' carico la foto come texture
EgtPHOTOLib.PhotoMap.refOptionPanelVM.PostPhoto(sImage, "")
' carico l'elenco dei materiali (non serve...)
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SetMaterialFromDB()
' definisco la lista degli stati
For Each Item As EgtWPFLib5.IdNameStruct In EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList
m_StateList.Add(Item)
Next
' imposto i dati lastra
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness = m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight
' carico la lista degli stati letta dalla libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelState = EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList(0)
' ricorco il materiale corrente nell'elenco dei materiali presenti nel DB (se non presente nell'elenco?)
For Each MaterialItem As String In EgtPHOTOLib.PhotoMap.refOptionPanelVM.MaterialList
If MaterialItem.ToLower = m_MainWindow.m_CurrentMachine.CurrMat.sName.ToLower Then
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Material = MaterialItem
Exit For
End If
Next
' salvo in locale i punti che arrivano dal progetto
m_ContornScrap = ContornScrap
' avvio la finestra di modifica
Dim m_refImagePrevieV As New EgtPHOTOLib.ImagePreviewV()
' modifico l'immagine e salvo
m_refImagePrevieV.SetContourScraps(m_ContornScrap)
m_refImagePrevieV.Show()
m_refImagePrevieV.SaveImage()
m_refImagePrevieV.Close()
m_bSlabIsSelected = True
' posiziono la finestra
Me.Top = 15
Me.Left = 15
End Sub
' posizionamento degli UserControl all'interno della griglia
Private Sub OmagPhotoWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' definisco nella pagina la posizione dello UserControl e inizializzo le liste
m_AddToDataBaseUC = New AddToDataBaseUC(Me)
m_AddToDataBaseUC.SetValue(Grid.ColumnProperty, 0)
m_AddToDataBaseUC.SetValue(Grid.RowProperty, 1)
m_AddToDataBaseUC.SetValue(Grid.RowSpanProperty, 2)
Me.OptionSLabGrid.Children.Add(m_AddToDataBaseUC)
m_AddToDataBaseUC.StateCmBx.ItemsSource = m_StateList
' recupero la scena dalla libreria e la carico nel finestra
Dim MyScene As New EgtPHOTOLib.SceneHostSlabV(EgtPHOTOLib.PhotoMap.refSceneHostVM)
MyScene.SetValue(Grid.ColumnProperty, 1)
MyScene.SetValue(Grid.ColumnSpanProperty, 2)
MyScene.SetValue(Grid.RowProperty, 1)
Me.OptionSLabGrid.Children.Add(MyScene)
End Sub
' carcio i dati della lastra
Private Sub PostLoaded() Handles Me.Loaded
If Not m_bSlabIsSelected Then
Return
End If
' carico i campi con i dati letti da database
If m_nState = 2 Then
' provo ad eseguire la separazione dei campi
m_sDtBsId = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
m_AddToDataBaseUC.BlockTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock
m_AddToDataBaseUC.NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
m_AddToDataBaseUC.StateCmBx.SelectedIndex = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.State
m_AddToDataBaseUC.MatTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Material
m_AddToDataBaseUC.ThicknessTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness
m_AddToDataBaseUC.ProjectTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo
' aggiorno il testo del messaggio "Add" "Save"
m_AddToDataBaseUC.AddBtn.Content = "Save"
Return
End If
' inizializzo i campi
'm_AddToDataBaseUC.IdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
m_AddToDataBaseUC.BlockTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock
m_AddToDataBaseUC.NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
m_AddToDataBaseUC.StateCmBx.SelectedIndex = 0
m_AddToDataBaseUC.MatTxBx.Text = m_MainWindow.m_CurrentMachine.CurrMat.sName
m_AddToDataBaseUC.ThicknessTxBx.Text = LenToString(m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight, 4)
m_AddToDataBaseUC.ProjectTxBx.Text = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
' rendo in primo piano la finestra
Me.Activate()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' se esista una lastra corrente, notifico che deve essere deselezionata
If Not IsNothing(EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab) Then
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.IsSelected = 0
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
End If
Me.Close()
End Sub
End Class
+30 -9
View File
@@ -2,7 +2,8 @@
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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
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">
@@ -17,22 +18,42 @@
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<!-- 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" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<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*"/>
</Grid.RowDefinitions>
<ListBox Name="FileListBox" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<Grid Grid.Row="1" Margin="0,0,8,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="FindTxBx" Grid.Column="0"
Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}"/>
<Button Name="ClearFindBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Margin="0,6,2,6">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}" Width="30" />
</Button>
</Grid>
</Grid>
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
+31
View File
@@ -38,6 +38,7 @@ Public Class OpenPageUC
OpenSceneHost.SetValue(Grid.ColumnProperty, 1)
OpenSceneHost.SetValue(Grid.RowProperty, 2)
' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
Me.OpenPageGrid.Children.Add(OpenSceneHost)
' Definizione del collegamento tra ItemList e ListBox1
@@ -203,6 +204,36 @@ Public Class OpenPageUC
End If
End Sub
Private Sub FindTxBx_EgtClosed(sender As Object, e As EventArgs) Handles FindTxBx.EgtClosed
' Elimino spazi iniziali e finali
FindTxBx.Text = FindTxBx.Text.Trim()
' ricarico la lista dei file
LoadCurrDir()
Dim UpdateListFile As New List(Of IconListBoxItem)
' Se esiste un nome
If Not String.IsNullOrWhiteSpace(FindTxBx.Text) Then
For Each Item As IconListBoxItem In FileListBox.ItemsSource
If Item.Name.ToLower.Contains(FindTxBx.Text.ToLower) Then
UpdateListFile.Add(Item)
End If
Next
End If
If UpdateListFile.Count > 0 Then
FileListBox.ItemsSource = UpdateListFile
Else
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
End If
End Sub
Private Sub ClearFindBtn_Click() Handles ClearFindBtn.Click
' svuoto la text
FindTxBx.Text = ""
' ricarico la lista dei file
LoadCurrDir()
' e aggiorno la lista dei file
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
End Sub
Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
+114 -8
View File
@@ -252,6 +252,12 @@ Public Class ProjectMgrUC
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()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
@@ -353,6 +359,14 @@ Public Class ProjectMgrUC
Return
End If
' ---------------------------- Fine modalità test --------------------------------------------
' se esiste salvo il nome del progetto
Dim sCurrProjName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrProjName, m_MainWindow.GetIniFile())
If Not String.IsNullOrEmpty(sCurrProjName) Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME, sCurrProjName)
Else
EgtRemoveInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME)
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
@@ -470,20 +484,29 @@ Public Class ProjectMgrUC
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SIMPLESTATISTICS) And nPhaseRestart = 0 Then
m_MainWindow.ExecSentProgScript(False)
''-------------------Avvio il Ciclo-Start-------------------------
'Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
'MyCicloStartWD.ShowDialog()
''-------------------Avvio il Ciclo-Start-------------------------
End If
End If
'-------------------Avvio il Ciclo-Start-------------------------
If GetPrivateProfileInt(S_GENERAL, "StartProgram", 0, m_MainWindow.GetIniFile()) <> 0 Then
'------------------- INIZIO Avvio il Ciclo-Start-------------------------
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 Then
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
MyCicloStartWD.ShowDialog()
End If
'------------------- FINE Avvio il Ciclo-Start-------------------------
'-------------------Avvio il Ciclo-Start-------------------------
' ------------------ INIZIO gestione SCRAPS ---------------------------
Dim NewScrapsList As New List(Of Scrap)
' procedo all'aggiornamento della lista degli sfridi
UpDateScrapList(NewScrapsList)
' se esiste almeno uno sfrido da inserire come nuovo grezzo
If NewScrapsList.Count > 0 Then
' apro la finestra con l'elenco degli sfridi
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
MyScrapsWD.ShowDialog()
End If
' ------------------ FINE gestione SCRAPS -----------------------------
' Altrimenti linea di produzione
Else
@@ -656,6 +679,32 @@ Public Class ProjectMgrUC
#End If
End Sub
' aggiorno la lista dei grezzi/sfridi
Public Sub UpDateScrapList(ByRef NewScrapsList As List(Of Scrap))
If IsNothing(NewScrapsList) Then
NewScrapsList = New List(Of Scrap)
Else
NewScrapsList.Clear()
End If
' procedo all'aggiornamento della lista degli sfridi
Dim CurrRawId As Integer = EgtGetFirstRawPart()
Dim IsNewScraps As Integer = 0
Dim nCountScrap As Integer = 1
While CurrRawId <> GDB_ID.NULL
If EgtGetInfo(CurrRawId, K_ISNEWSCRAPS, IsNewScraps) Then
If IsNewScraps = 1 Or IsNewScraps = 2 Then
' deve essere aggiunto nel DB delle lastre come nuovo grezzo (l'indice è utilizzato per definire il nome della lastra)
NewScrapsList.Add(New Scrap(CurrRawId, "Scrap_" & nCountScrap.ToString, IsNewScraps))
nCountScrap += 1
' è già stato aggiunto al DB delle lastre come nuovo grezzo
Else
' non è stato definito come nuovo grezzo
End If
End If
CurrRawId = EgtGetNextRawPart(CurrRawId)
End While
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
@@ -746,7 +795,7 @@ Public Class ProjectMgrUC
Else
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
EgtDeselectObj(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
EgtDeselectObj(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
EgtResetMark(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
End If
' aggiorno il disegno
EgtDraw()
@@ -929,3 +978,60 @@ Public Class ProjectMgrUC
End Sub
End Class
Public Class Scrap
Private m_iPictureID As Integer
Private m_sName As String
Private m_IdRaw As Integer
Private m_nState As Integer
Public Property PictureID() As Integer
Get
Return m_iPictureID
End Get
Set(value As Integer)
m_iPictureID = value
End Set
End Property
Public Property Name() As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Public ReadOnly Property IdRaw() As Integer
Get
Return m_IdRaw
End Get
End Property
Public ReadOnly Property nState As Integer
Get
Return m_nState
End Get
End Property
Public ReadOnly Property PictureString() As String
Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
End Get
End Property
Sub New(IdScrap As Integer, NameScrap As String, State As Integer)
m_IdRaw = IdScrap
m_sName = NameScrap
m_nState = State
' immagine del grezzo
If m_nState = 2 Then
m_iPictureID = 5
Else
m_iPictureID = 4
End If
End Sub
End Class
+50
View File
@@ -0,0 +1,50 @@
<Window x:Class="ScrapsWD"
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="Scraps" Height="482.6" Width="226.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="3*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
</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>
+186
View File
@@ -0,0 +1,186 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class ScrapsWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_refProjectMgrUC As ProjectMgrUC
Private m_ScrapList As New List(Of Scrap)
Private m_CurrScrapId As Integer = GDB_ID.NULL
Private m_CurrScrapState As Integer = 2
Private m_sDatabaseId As String = ""
Private Sub Initalized()
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' inserisco il titolo della pagina aperta
TitleTxBl.Content = "Scraps List"
ScrapsListBox.ItemsSource = m_ScrapList
' definzione posizione finetra
Me.Left = 25
Me.Top = 25
End Sub
Public Sub New(Owner As Window, LocalProjectMgrUC As ProjectMgrUC, MyScrapList As List(Of Scrap))
Me.Owner = Owner
InitializeComponent()
m_ScrapList = MyScrapList
m_refProjectMgrUC = LocalProjectMgrUC
Initalized()
End Sub
' visualizzo la fase del pezzo selezionato
Private Sub ScrapListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ScrapsListBox.PreviewMouseUp
Dim vItems As Scrap = ScrapsListBox.SelectedItems(0)
' elimino l'utimo selzione
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' ricerco il grezzo associato a questo Id
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If nRawId = vItems.IdRaw Then
m_CurrScrapId = nRawId
m_CurrScrapState = vItems.nState
If m_CurrScrapState = 2 Then
EgtGetInfo(nRawId, K_DATABASEID, m_sDatabaseId)
Else
m_sDatabaseId = String.Empty
End If
Dim nCurrRawPhase As Integer = 0
' recupero la fase del grezzo corrente
EgtGetInfo(nRawId, "Ph", nCurrRawPhase)
If nCurrRawPhase <> 0 Then
' evidenzio lo sfrido selezionato all'interno della fase
EgtSetCurrPhase(nCurrRawPhase)
EgtSetMark(m_CurrScrapId)
EgtSelectObj(m_CurrScrapId)
EgtDraw()
Return
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
If m_CurrScrapId = GDB_ID.NULL Then Return
' creo una copia dell'immagine attuale (fotocamera 1)
Dim sImage As String = String.Empty
Dim sInfo As String = String.Empty
GetPrivateProfileString(S_CAMERA, K_CAM_IMAGE, "", sImage, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_CAMERA, K_CAM_INFO, "", sInfo, m_MainWindow.GetIniFile())
' recupero dalla libreria il percoso del database
Dim sPhotoDir As String = String.Empty
EgtPHOTOLib.GetPhotoDir(sPhotoDir)
' recupero l'ora corrente
Dim sDate As String = Date.Now.ToString
sDate = sDate.Replace("/", "_")
sDate = sDate.Replace(" ", "_")
sDate = sDate.Replace(":", "_")
Dim sNewPath As String = sPhotoDir & "\Scrap_" & sDate
Try
File.Copy(sImage, sNewPath & ".jpg", False)
File.Copy(sInfo, sNewPath & ".txt", False)
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
' se non esiste la classe StatusBar allora provo ad inizializzarla...
If IsNothing(EgtWPFLib5.LibMap.refStatusBarVM) Then
Dim objStatusBarVM As New EgtWPFLib5.StatusBarVM
End If
' salvo il contesto corrente del programma
Dim nCurrentContetxt As Integer = EgtGetCurrentContext()
' costruisco l'elenco ordinato dei punti che reppresentano il contorno del grezzo da salvare
Dim ContornScrapList As New List(Of Point3d)
Dim RefId As New Frame3d
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawSolid")
EgtGetTextureFrame(nRawSolidId, nRawSolidId, RefId)
Dim nCurveCompoId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawOutline")
Dim dStart As Double = 0
Dim dEnd As Double = 0
EgtCurveDomain(nCurveCompoId, dStart, dEnd)
Dim ptCurrPoint As Point3d
For dU As Integer = dStart To dEnd - 1
EgtAtParamPoint(nCurveCompoId, dU, m_CurrScrapId, ptCurrPoint)
ptCurrPoint.z = 0
ptCurrPoint.ToLoc(RefId)
ContornScrapList.Add(ptCurrPoint)
Next
MainData.SetPreviousContext(nCurrentContetxt)
'If Not IsNothing(MainData.ContextSTONELib) Or MainData.ContextSTONELib <> 0 Then
'If MainData.ContextSTONELib <> 0 Then
' EgtSetCurrentContext(MainData.ContextSTONELib)
'End If
' inizializzo PojectSlabV pechè si occupa di inizializzare le pagine Detail e Option
Dim MyProjectSlab As New EgtPHOTOLib.ProjectSlabV
' ACCELERARE il processo di creazione di questo oggetto!
MyProjectSlab.DataContext = New EgtPHOTOLib.ProjectSlabVM
' per ogni creazione della nuova pagina viene creata una nuova scena, ma non viene eliminata
Dim refProjectVMSceneContext As Integer = EgtGetCurrentContext()
' apro la finestra OmagPHOTO (passo il nome del file come copia dell'originale)
If ContornScrapList.Count > 2 Then
Dim MyOmagPhotoWD As New OmagPhotoWD(sNewPath & ".jpg", ContornScrapList, m_MainWindow, m_CurrScrapState, m_sDatabaseId)
OmagPhotoWD.m_IsAdded = False
OmagPhotoWD.m_sDtBsId = String.Empty
OmagPhotoWD.m_IsDeleted = False
MyOmagPhotoWD.ShowDialog()
Else
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Error loading contour scrap")
End If
' ripristino il contesto corrente dell'immagine
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
' se l'inserimento è andatoa buon fine allora procedo a notificarlo
If OmagPhotoWD.m_IsAdded AndAlso Not String.IsNullOrEmpty(OmagPhotoWD.m_sDtBsId) Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 2)
EgtSetInfo(m_CurrScrapId, K_DATABASEID, OmagPhotoWD.m_sDtBsId)
Else
' se è stato eliminato dal DB allora aggiorno la lista dei grezzi
If OmagPhotoWD.m_IsDeleted Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 1)
EgtRemoveInfo(m_CurrScrapId, K_DATABASEID)
End If
Try
File.Delete(sNewPath & ".jpg")
File.Delete(sNewPath & ".txt")
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
End If
'----------------INIZIO ELIMINAZIONE contesti generati da OmagPHOTOLib per la visualizzazione delle Texture
EgtDeleteContext(EgtPHOTOLib.MainData.ContextSTONELib)
EgtDeleteContext(refProjectVMSceneContext)
'---------------- FINE ELIMINAZIONE contesti
' aggiorno la lista degli scrap
m_refProjectMgrUC.UpDateScrapList(m_ScrapList)
ScrapsListBox.ItemsSource = m_ScrapList
ScrapsListBox.Items.Refresh()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' deseleziono l'oggetto corrente
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' reimposto la fase iniziale
EgtSetCurrPhase(1)
EgtDraw()
Me.Close()
End Sub
End Class
+393 -13
View File
@@ -45,9 +45,9 @@ Public Class RawPartPageUC
' Layer per crocette temporanee
Private m_nTempLay As Integer = GDB_ID.NULL
' Definizione lista modalità di definizione grezzo per ComboBox
Private m_RawModeList(2) As String
Private m_RawModeDamagedList(1) As String
Private m_RawModeListEx(3) As String
Private m_RawModeList(3) As String
Private m_RawModeDamagedList(2) As String
Private m_RawModeListEx(4) As String
' Variabile che indica la zona danneggiata selezionata
Private m_nSelDmg As Integer
' Array per modalità per punti
@@ -63,6 +63,8 @@ Public Class RawPartPageUC
Private m_CurveXDamagedAreaList As New List(Of Integer)
' Flag che indica se è in corso la definizione tramite laser o se il grezzo è già chiuso
Private m_bIsRawDefiningByLaser As Boolean = False
' Flag che indica se è in corso la definizione tramite lama o se il grezzo è già chiuso
Private m_bIsRawDefiningBySaw As Boolean = False
' Flag di tastatura in corso
Private m_bProbingOn As Boolean = False
' Flag inserimento punti laser da disegno
@@ -99,6 +101,8 @@ Public Class RawPartPageUC
FROM_PHOTO = 3
DAMAGED = 4
DAMAGED_BY_LASER = 5
DAMAGED_BY_SAW = 6
FROM_SAW = 7
End Enum
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
@@ -123,14 +127,32 @@ Public Class RawPartPageUC
m_RawModeList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 1) 'Rettangolo
m_RawModeList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
m_RawModeList(2) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
If m_MainWindow.m_CurrentMachine.bSaw Then
m_RawModeList(3) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24) 'Da Lama
Else
' se non insrisco "Lama" allora ridimensiono il vettore
ReDim Preserve m_RawModeList(2)
End If
m_RawModeListEx(0) = EgtMsg(MSG_RAWPARTPAGEUC + 1) 'Rettangolo
m_RawModeListEx(1) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
m_RawModeListEx(2) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
m_RawModeListEx(3) = EgtMsg(MSG_RAWPARTPAGEUC + 35) 'Da Fotografia
If m_MainWindow.m_CurrentMachine.bSaw Then
m_RawModeListEx(3) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24) 'Da Lama
m_RawModeListEx(4) = EgtMsg(MSG_RAWPARTPAGEUC + 35) 'Da Fotografia
Else
' se non insrisco "Lama" allora ridimensiono il vettore
m_RawModeListEx(3) = EgtMsg(MSG_RAWPARTPAGEUC + 35) 'Da Fotografia
ReDim Preserve m_RawModeListEx(3)
End If
RawModeCmBx.ItemsSource = m_RawModeList
' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
If m_MainWindow.m_CurrentMachine.bSaw Then
m_RawModeDamagedList(2) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24) 'Da Lama
Else
ReDim Preserve m_RawModeDamagedList(1)
End If
RawModeDamagedCmBx.ItemsSource = m_RawModeDamagedList
' Nascondo bottone tastatura lastra se disattivato da file .ini
@@ -142,7 +164,7 @@ Public Class RawPartPageUC
GetPrivateProfileInt(S_RAWPART, K_SLABID, 0, m_MainWindow.GetIniFile()) <> 0)
SlabIdBtn.Visibility = If(m_bSlabId, Windows.Visibility.Visible, Windows.Visibility.Collapsed)
m_SmartMachiningPage = GetPrivateProfileInt(S_GENERAL, "SmartMachiningPage", 0, m_MainWindow.GetIniFile()) <> 0
m_SmartMachiningPage = GetPrivateProfileInt(S_GENERAL, K_SMARTMACHININGPAGE, 0, m_MainWindow.GetIniFile()) <> 0
' Imposto i messaggi letti dal file dei messaggi
OutlineBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 33) 'Rectangle - Rettangolo
@@ -309,9 +331,10 @@ Public Class RawPartPageUC
' Verifico cosa selezionato
Dim nSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
'----------------------------------------- INIZIO ------------------ se decido di inserire i punti laser manualmente --------------------------------------------------
' se decido di inserire i punti laser manualmente
If m_bFromDraw And m_ActiveRawMode = RAWMODE.FROM_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Then
' se decido di inserire i punti laser manualmente (in assenza di collegamento con CN)
If m_bFromDraw AndAlso (m_ActiveRawMode = RAWMODE.FROM_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.FROM_SAW Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW) Then
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
EgtEmptyGroup(m_nTempLay)
' Acquisisco punto da disegno
@@ -336,6 +359,7 @@ Public Class RawPartPageUC
Return
End If
'----------------------------------------- FINE ------------------ se decido di inserire i punti laser manualmente --------------------------------------------------
' recupero elemento selezionato nella scena
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSel As Integer
EgtSelect(e.Location, 2 * Scene.DIM_SEL, 2 * Scene.DIM_SEL, nSel)
@@ -349,8 +373,7 @@ Public Class RawPartPageUC
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
m_nDragEnt = -1
m_dDragPar = -1
ElseIf sName = NAME_KERF And
(m_ActiveRawMode = RAWMODE.RECTANGLE Or m_ActiveRawMode = RAWMODE.BY_POINTS) Then
ElseIf sName = NAME_KERF And (m_ActiveRawMode = RAWMODE.RECTANGLE Or m_ActiveRawMode = RAWMODE.BY_POINTS) Then
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
Dim dDist, dU As Double
If Not EgtPointCurveDist(m_ptPrev.Loc(nKerfId), nKerfId, nKerfId, dDist, dU) Then
@@ -360,7 +383,7 @@ Public Class RawPartPageUC
m_dDragPar = dU
' Privilegio il kerf, pertanto esco
Exit While
ElseIf sName = NAME_DAMAGED And (m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER) Then
ElseIf sName = NAME_DAMAGED And (m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.BY_POINTS) Then
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
Dim dDist, dU As Double
If Not EgtPointCurveDist(m_ptPrev.Loc(nSelId), nSelId, nSelId, dDist, dU) Then
@@ -377,6 +400,7 @@ Public Class RawPartPageUC
End If
nSelId = EgtGetNextObjInSelWin()
End While
' se drag e modalità punti
If m_bDrag And m_ActiveRawMode = RAWMODE.BY_POINTS Then
' se aggiungi punto
@@ -413,7 +437,7 @@ Public Class RawPartPageUC
End If
End If
' se drag e modalità zona danneggiata
ElseIf m_bDrag And (m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER) Then
ElseIf m_bDrag And (m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW) Then
' se aggiungi zona rovinata
If m_nPtDmgMode = DMGMODE.ADD Then
AddNewDamagedArea()
@@ -489,6 +513,8 @@ Public Class RawPartPageUC
End Select
' Aggiorno il punto precedente
m_ptPrev = ptCurr
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
End Sub
Private Sub ModifyRectangle(ptCurr As Point3d)
@@ -665,6 +691,8 @@ Public Class RawPartPageUC
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
' Non è possibile uscire con tastatura in corso
If m_bProbingOn Then Return
' reimposto il comando OutLine
OutlineBtn_Click(Nothing, Nothing)
' Se confermata uscita
If ExitRawPart(True) Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
@@ -696,6 +724,16 @@ Public Class RawPartPageUC
CloseDamagedAreaByLaser()
End If
End If
If m_ActiveRawMode = RAWMODE.FROM_SAW Then
If m_bIsRawDefiningBySaw Then
CloseRawBySaw()
End If
End If
If m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
If m_bIsRawDefiningBySaw Then
CloseDamagedAreaBySaw()
End If
End If
' Apro pagina di selezione della lavorazione prima di chiudere il grezzo
m_ChooseMachiningPage = New ChooseMachining(m_MainWindow)
'--------------------------- SELEZIONE LAVORAZIONI ---------------------------------
@@ -779,6 +817,8 @@ Public Class RawPartPageUC
Case 0 ' Rettangolo
' Se ero in modalità da laser
VerifyLaserDefining()
' Se ero in modalità da Lama
VerifySawDefinig()
' Verificos e sto realmente cambiando modalità
Dim bChanging As Boolean = (m_ActiveRawMode <> RAWMODE.RECTANGLE)
' Imposto nuova modalità
@@ -790,6 +830,8 @@ Public Class RawPartPageUC
Case 1 ' Punti
' Se ero in modalità da laser
VerifyLaserDefining()
' Se ero in modalità da Lama
VerifySawDefinig()
' Imposto nuova modalità
m_ActiveRawMode = RAWMODE.BY_POINTS
' Riattivo i controlli in base a quale modalità di inserimento contorni è attiva
@@ -797,6 +839,8 @@ Public Class RawPartPageUC
UpdateCircles()
EgtDraw()
Case 2 ' Da laser
' Se ero in modalità da Lama
VerifySawDefinig()
' Imposto nuova modalità
m_ActiveRawMode = RAWMODE.FROM_LASER
RemoveCircles()
@@ -811,10 +855,44 @@ Public Class RawPartPageUC
' Disattivo il bottone
CloseBtn.IsEnabled = False
OkBtn.IsEnabled = False
Case 3 ' Da fotografia
Case 3 ' Da Lama
If Not m_MainWindow.m_CurrentMachine.bSaw Then ' Da fotografia
' Se ero in modalità da laser
VerifyLaserDefining()
' Se ero in modalità da Lama
VerifySawDefinig()
' Imposto nuova modalità
m_ActiveRawMode = RAWMODE.FROM_PHOTO
' Riattivo i controlli in base a quale modalità di inserimento contorni è attiva
RawModeView()
RemoveCircles()
' Creo il grezzo dal contorno riconosciuto nella fotografia
CreateRawFromPhotoContour()
EgtDraw()
Exit Select
End If
' Se ero in modalità da laser
VerifyLaserDefining()
' Imposto nuova modalità
m_ActiveRawMode = RAWMODE.FROM_SAW
RemoveCircles()
LoadFromMachine()
' Azzero lista e punto di partenza
m_CurveXKerfList.Clear()
m_bptLast = False
' Segno flag che indica definizione grezzo con laser in corso
m_bIsRawDefiningBySaw = True
' Riattivo i controlli in base a quale modalità di inserimento contorni è attiva
RawModeView()
' Disattivo il bottone
CloseBtn.IsEnabled = False
OkBtn.IsEnabled = False
Case 4 ' Da fotografia
' Se ero in modalità da laser
VerifyLaserDefining()
' Se ero in modalità da Lama
VerifySawDefinig()
' Imposto nuova modalità
m_ActiveRawMode = RAWMODE.FROM_PHOTO
' Riattivo i controlli in base a quale modalità di inserimento contorni è attiva
RawModeView()
@@ -822,6 +900,7 @@ Public Class RawPartPageUC
' Creo il grezzo dal contorno riconosciuto nella fotografia
CreateRawFromPhotoContour()
EgtDraw()
End Select
End Sub
@@ -831,6 +910,8 @@ Public Class RawPartPageUC
m_ActiveRawMode = RAWMODE.DAMAGED
Case 1 ' Da laser
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
Case 2 ' Da Lama
m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW
End Select
RawModeView()
EgtDraw()
@@ -927,11 +1008,43 @@ Public Class RawPartPageUC
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
Case RAWMODE.DAMAGED_BY_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Visible
LengthTxBx.IsEnabled = False
WidthTxBx.IsEnabled = False
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
' Visualizzo bottoni per laser
PointsGpBx.Visibility = Windows.Visibility.Visible
PointsGpBx.SetValue(Grid.RowSpanProperty, 2)
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
Case RAWMODE.FROM_SAW
RawModeCmBx.IsEnabled = True
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
LengthTxBx.IsEnabled = False
WidthTxBx.IsEnabled = False
OffsetXTxBx.IsEnabled = False
OffsetYTxBx.IsEnabled = False
' Visualizzo bottoni per lama
PointsGpBx.Visibility = Windows.Visibility.Visible
PointsGpBx.SetValue(Grid.RowSpanProperty, 2)
AddBtn.SetValue(Grid.RowSpanProperty, 1)
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
CloseBtn.Visibility = Windows.Visibility.Visible
' Disattivo bottoni zone rovinate e foto
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
End Select
End Sub
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Then
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
' m_ActiveRawMode = RAWMODE.BY_POINTS
m_ActiveRawMode = m_PrecActiveRawMode
RawModeCmBx.SelectedIndex = m_ActiveRawMode
@@ -946,6 +1059,9 @@ Public Class RawPartPageUC
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
RawModeDamagedCmBx.SelectedIndex = 1
ElseIf m_PrecActiveRawMode = RAWMODE.FROM_SAW Then
m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW
RawModeDamagedCmBx.SelectedIndex = 2
Else
m_ActiveRawMode = RAWMODE.DAMAGED
RawModeDamagedCmBx.SelectedIndex = 0
@@ -1010,6 +1126,54 @@ Public Class RawPartPageUC
End If
AddBtn.IsChecked = False
EgtDraw()
Case RAWMODE.FROM_SAW
Dim ptAcquired As Point3d
' Se inserimento manuale dei punti laser
If m_bFromDraw Then
If Not IsNothing(m_ptPrev) Then
ptAcquired = m_ptPrev
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90532)) ' Errore nell'acquisizione del punto
Return
End If
' altrimenti da macchina
Else
If Not AcquireSawPoint(ptAcquired) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90532)) ' Errore nell'acquisizione del punto
Return
End If
End If
' Limito il punto a stare nella tavola con franco pari al kerf
If ptAcquired.x < m_RawKerf Then ptAcquired.x = m_RawKerf + SAFE_RAW_DIST
If ptAcquired.y < m_RawKerf Then ptAcquired.y = m_RawKerf + SAFE_RAW_DIST
If ptAcquired.x > m_dTableLength - m_RawKerf Then ptAcquired.x = m_dTableLength - m_RawKerf - SAFE_RAW_DIST
If ptAcquired.y > m_dTableWidth - m_RawKerf Then ptAcquired.y = m_dTableWidth - m_RawKerf - SAFE_RAW_DIST
' Aggiusto Z punto movimentato (è in locale al tavolo)
ptAcquired.z = m_CurrentMachine.dAdditionalTable + m_RawHeight
'Porto il punto nel riferimento del grezzo
Dim frRaw As New Frame3d
EgtGetGroupGlobFrame(m_CurrProjPage.m_nRawId, frRaw)
ptAcquired.LocToLoc(New Frame3d(m_ptTableMin), frRaw)
m_ptPrev.LocToLoc(New Frame3d(m_ptTableMin), frRaw)
If m_bptLast Then
If Point3d.SameApprox(ptAcquired, m_ptLast) Then
AddBtn.IsChecked = False
Exit Sub
End If
Dim NewLine As Integer = EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptAcquired)
EgtSetColor(NewLine, m_KerfCol)
m_CurveXKerfList.Add(NewLine)
Else
m_bptLast = True
End If
m_ptLast = ptAcquired
If m_CurveXKerfList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
End If
AddBtn.IsChecked = False
EgtDraw()
Case RAWMODE.DAMAGED
' Verifico ci sia almeno una zona rovinata
If EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_DAMAGED) = GDB_ID.NULL Then
@@ -1068,6 +1232,54 @@ Public Class RawPartPageUC
End If
AddBtn.IsChecked = False
EgtDraw()
Case RAWMODE.DAMAGED_BY_SAW
Dim ptAcquired As Point3d
' Se inserimento manuale dei punti laser
If m_bFromDraw Then
If Not IsNothing(m_ptPrev) Then
ptAcquired = m_ptPrev
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90532)) ' Errore nell'acquisizione del punto
Return
End If
' altrimenti da macchina
Else
If Not AcquireSawPoint(ptAcquired) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90532)) ' Errore nell'acquisizione del punto
Return
End If
End If
' Limito il punto a stare nella tavola con franco pari al kerf
If ptAcquired.x < m_RawKerf Then ptAcquired.x = m_RawKerf + SAFE_RAW_DIST
If ptAcquired.y < m_RawKerf Then ptAcquired.y = m_RawKerf + SAFE_RAW_DIST
If ptAcquired.x > m_dTableLength - m_RawKerf Then ptAcquired.x = m_dTableLength - m_RawKerf - SAFE_RAW_DIST
If ptAcquired.y > m_dTableWidth - m_RawKerf Then ptAcquired.y = m_dTableWidth - m_RawKerf - SAFE_RAW_DIST
' Aggiusto Z punto movimentato (è in locale al tavolo)
ptAcquired.z = m_CurrentMachine.dAdditionalTable + m_RawHeight
'Porto il punto nel riferimento del grezzo
Dim frRaw As New Frame3d
EgtGetGroupGlobFrame(m_CurrProjPage.m_nRawId, frRaw)
ptAcquired.LocToLoc(New Frame3d(m_ptTableMin), frRaw)
m_ptPrev.LocToLoc(New Frame3d(m_ptTableMin), frRaw)
If m_bptLast Then
If Point3d.SameApprox(ptAcquired, m_ptLast) Then
AddBtn.IsChecked = False
Exit Sub
End If
Dim NewLine As Integer = EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptAcquired)
EgtSetColor(NewLine, m_KerfCol)
m_CurveXDamagedAreaList.Add(NewLine)
Else
m_bptLast = True
End If
m_ptLast = ptAcquired
If m_CurveXDamagedAreaList.Count > 1 Then
OkBtn.IsEnabled = True
CloseBtn.IsEnabled = True
End If
AddBtn.IsChecked = False
EgtDraw()
End Select
End Sub
@@ -1099,6 +1311,28 @@ Public Class RawPartPageUC
Return True
End Function
Private Function AcquireSawPoint(ByRef ptAcquired As Point3d) As Boolean
Dim ptTipP1 As Point3d
' Recupero la posizione macchina
Dim dL1, dL2, dL3, dR1, dR2 As Double
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
Return False
End If
' Recupero dati utensile e testa corrente
Dim sTool As String = ""
Dim sHead As String = ""
Dim nExit As Integer = 0
EgtGetCalcTool(sTool, sHead, nExit)
' Trasformo in posizione punta utensile in basso
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
Return False
End If
' Porto il tip nell'origine tavola
ptAcquired = ptTipP1
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
Return True
End Function
Private Sub RemoveBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveBtn.Click
Select Case m_ActiveRawMode
Case RAWMODE.RECTANGLE
@@ -1126,6 +1360,26 @@ Public Class RawPartPageUC
End If
RemoveBtn.IsChecked = False
EgtDraw()
Case RAWMODE.FROM_SAW
If m_CurveXKerfList.Count > 0 Then
If m_CurveXKerfList.Count = 1 Then
' Aggiorno ptLast con primo punto
EgtStartPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
' Cancello ultima linea
EgtErase(m_CurveXKerfList(m_CurveXKerfList.Count - 1))
m_CurveXKerfList.RemoveAt(m_CurveXKerfList.Count - 1)
Else
' Cancello ultima linea
EgtErase(m_CurveXKerfList(m_CurveXKerfList.Count - 1))
m_CurveXKerfList.RemoveAt(m_CurveXKerfList.Count - 1)
' Aggiorno ptLast
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
End If
Else
m_bptLast = False
End If
RemoveBtn.IsChecked = False
EgtDraw()
Case RAWMODE.DAMAGED
' Verifico ci sia almeno una zona rovinata
If EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_DAMAGED) = GDB_ID.NULL Then
@@ -1136,6 +1390,46 @@ Public Class RawPartPageUC
DeleteBtn.IsChecked = False
m_nPtMode = If(RemoveBtn.IsChecked(), PTMODE.REMOVE, PTMODE.MOVE)
m_nPtDmgMode = DMGMODE.NONE
Case RAWMODE.DAMAGED_BY_LASER
If m_CurveXDamagedAreaList.Count > 0 Then
If m_CurveXDamagedAreaList.Count = 1 Then
' Aggiorno ptLast con primo punto
EgtStartPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
' Cancello ultima linea
EgtErase(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1))
m_CurveXDamagedAreaList.RemoveAt(m_CurveXDamagedAreaList.Count - 1)
Else
' Cancello ultima linea
EgtErase(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1))
m_CurveXDamagedAreaList.RemoveAt(m_CurveXDamagedAreaList.Count - 1)
' Aggiorno ptLast
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
End If
Else
m_bptLast = False
End If
RemoveBtn.IsChecked = False
EgtDraw()
Case RAWMODE.DAMAGED_BY_SAW
If m_CurveXDamagedAreaList.Count > 0 Then
If m_CurveXDamagedAreaList.Count = 1 Then
' Aggiorno ptLast con primo punto
EgtStartPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
' Cancello ultima linea
EgtErase(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1))
m_CurveXDamagedAreaList.RemoveAt(m_CurveXDamagedAreaList.Count - 1)
Else
' Cancello ultima linea
EgtErase(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1))
m_CurveXDamagedAreaList.RemoveAt(m_CurveXDamagedAreaList.Count - 1)
' Aggiorno ptLast
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
End If
Else
m_bptLast = False
End If
RemoveBtn.IsChecked = False
EgtDraw()
End Select
End Sub
@@ -1976,6 +2270,26 @@ Public Class RawPartPageUC
End If
End Sub
Private Sub VerifySawDefinig()
If m_bIsRawDefiningBySaw Then
If m_CurveXKerfList.Count > 1 Then
CloseRawBySaw()
Else
' Elimino tutti i segmenti disegnati
For Each nEntityId As Integer In m_CurveXKerfList
If EgtGetType(nEntityId) = GDB_TY.CRV_LINE Then
EgtErase(nEntityId)
End If
Next
' Azzero lista e punto di partenza
m_CurveXKerfList.Clear()
' Creo rettangolo
UpdateRawPart()
End If
m_bIsRawDefiningBySaw = False
End If
End Sub
Private Sub LoadFromMachine()
' Elimino grezzo già presente
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID))
@@ -1993,6 +2307,10 @@ Public Class RawPartPageUC
Select Case m_ActiveRawMode
Case RAWMODE.DAMAGED_BY_LASER
CloseDamagedAreaByLaser()
Case RAWMODE.DAMAGED_BY_SAW
CloseDamagedAreaBySaw()
Case RAWMODE.FROM_SAW
CloseRawBySaw()
Case Else
CloseRawByLaser()
End Select
@@ -2036,6 +2354,42 @@ Public Class RawPartPageUC
CloseBtn.IsEnabled = False
End Sub
Private Sub CloseRawBySaw()
' Verifico ci siano punti
If m_CurveXKerfList.Count() = 0 Then Return
' Recupero punto iniziale prima linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXKerfList(0), ptStart)
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptStart))
' Trasformo lista di curve in un array
Dim CurveXKerfArray As Integer() = m_CurveXKerfList.ToArray
' Creo contorno kerf
Dim nKerfId As Integer = EgtCreateCurveCompoByChain(m_CurrProjPage.m_nRawId, m_CurveXKerfList.Count, CurveXKerfArray, ptStart, True)
EgtSetName(nKerfId, NAME_KERF)
EgtSetColor(nKerfId, m_KerfCol)
' Pulisco lista entità del grezzo
m_CurveXKerfList.Clear()
' Aggiorno il grezzo comprese dimensioni e posizione
UpdateRawPartKerf()
' Salvo il valore del kerf (sempre in mm)
Dim dKerf As Double = 0
StringToLen(KerfTxBx.Text, dKerf)
If dKerf < 0 Then
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_INVERT_KERF, -1)
Else
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_INVERT_KERF, 1)
End If
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_KERF, m_RawKerf)
' Segno flag che indica fine della definizione
m_bIsRawDefiningBySaw = False
' Elimino primo punto per prossimo grezzo
m_bptLast = False
' Aggiorno visualizzazione
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
End Sub
#Region "Damaged Area"
Private Sub AddNewDamagedArea()
@@ -2092,6 +2446,32 @@ Public Class RawPartPageUC
CloseBtn.IsEnabled = False
End Sub
Private Sub CloseDamagedAreaBySaw()
' Verifico ci siano punti
If m_CurveXDamagedAreaList.Count() = 0 Then Return
' Recupero punto iniziale prima linea del grezzo
Dim ptStart As Point3d
EgtStartPoint(m_CurveXDamagedAreaList(0), ptStart)
' creao la linea che va dal primo punto all'ultimo
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptStart))
' Trasformo lista di curve in un array
Dim CurveXDamagedAreaArray As Integer() = m_CurveXDamagedAreaList.ToArray
' Creo contorno kerf
Dim nDmgId As Integer = EgtCreateCurveCompoByChain(m_CurrProjPage.m_nRawId, m_CurveXDamagedAreaList.Count, CurveXDamagedAreaArray, ptStart, True)
EgtSetName(nDmgId, NAME_DAMAGED)
EgtSetColor(nDmgId, m_KerfCol)
' Pulisco lista entità del grezzo
m_CurveXDamagedAreaList.Clear()
' Segno flag che indica fine della definizione
m_bIsRawDefiningBySaw = False
' Elimino primo punto per prossimo grezzo
m_bptLast = False
' Aggiorno visualizzazione
EgtDraw()
' Disattivo il bottone chiudi grezzo
CloseBtn.IsEnabled = False
End Sub
Private Sub RemoveDamagedArea()
' Elimino area rovinata selezionata
EgtErase(m_nSelDmg)
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+3
View File
@@ -240,6 +240,9 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateXPIUC_Click">
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtnUC_Click">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
+112
View File
@@ -1,5 +1,6 @@
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Public Class SimulationPageUC
' Riferimenti a pagine
@@ -76,6 +77,12 @@ Public Class SimulationPageUC
End If
' Pulsante Play
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
' abilito la visualizzazione del pulsante per la sola generazione del codice CN
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
GenerateCN_Btn.Visibility = Visibility.Visible
Else
GenerateCN_Btn.Visibility = Visibility.Hidden
End If
End Sub
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -559,6 +566,111 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
EgtEraseCurrSetup()
' Verifico l'attrezzaggio degli utensili utilizzati
Dim sMissingTools As String = String.Empty
If Not VerifySetup(sMissingTools) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
Return
End If
' Costringo ad aggiornare UI
UpdateUI()
' Aggiorno flag per lavaggio
m_CurrProjPage.UpdateWashingFlag()
' Aggiorno flag per tastatura per tagli con angolo di fianco
m_CurrProjPage.UpdateSideAngCutProbeFlag()
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
Not bDirectCut And
Not m_CurrProjPage.GetOrderMachiningFlag() Then
ResetAllMachinings()
bOk = SortAllMachinings()
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
Else
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
End If
EgtDraw()
End If
End If
' Costringo ad aggiornare UI
UpdateUI()
' Disabilito impostazione modificato
EgtDisableModified()
' Aggiorno le lavorazioni
bOk = UpdateAllMachiningsToolpaths() And bOk
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
bOk = UpdateVacuumsForDrip() And bOk
' Costringo ad aggiornare UI
UpdateUI()
' Inserisco indice di progetto
m_CurrProjPage.SetProjectIndexFlag()
' Inserisco il materiale
m_CurrProjPage.SetProjectMaterial()
' Salvo il progetto con le lavorazioni
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\MachProj.nge"
m_CurrProjPage.SaveFile(sMchPath)
' Costringo ad aggiornare UI
UpdateUI()
' Se modalità Ufficio, copio il progetto ed esco
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
' Chiedo il nome del file esportato
Dim MySaveNameWD As New SaveNameWD(m_MainWindow, SaveNameWD.SAVE_TYPE.PRJ_COPY)
MySaveNameWD.ShowDialog()
Return
End If
' Se presente ripartenza, ne chiedo conferma
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
If nPhaseRestart <> 0 Then
' Confermi ripartenza dalla fase NNN ?
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
Select Case AskNcRestart.m_nPressedBtn
Case 1 ' YES
Case 2 ' NO
EgtEnableModified()
m_CurrProjPage.ResetProjectNcRestart()
nPhaseRestart = 0
EgtDisableModified()
Case Else ' CANCEL
Return
End Select
End If
' Se abilitate, eseguo le stime
If GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0 Then
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
End If
' Genero file CNC (lancio anche se errore in precedenza) -> recupero la tavola corrente! CamAuto.GetCurrentTable()
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
Dim sIndexTab As String = String.Empty
If nIndexTab > 0 Then
sIndexTab = nIndexTab.ToString
End If
Dim sFileName As String = "CadCut" & sIndexTab
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOk Then
m_CurrProjPage.SetInfoMessage("Genarato file " & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
End Sub
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
' Visualizzo assi
ShowCncData()