547 Commits

Author SHA1 Message Date
Riccardo Elitropi f8405a7970 EgtMachKernel :
- Aggiunto parametro per ottimizzazione Offset per percorsi di Pocketing
- Cambiata la gestione delle finiture Optimal
- Migliorati e Aggiunti controlli sui frame Locali in Finiture ZLevel e Optimal.
2025-02-21 11:15:08 +01:00
Riccardo Elitropi 5067af57e9 EgtMachKernel :
- migliorie forature.
2025-02-12 14:50:17 +01:00
Riccardo Elitropi 934a0f4be3 EgtMachKernel :
- in Drilling rimozione variabili di debug.
2025-02-11 16:57:27 +01:00
Riccardo Elitropi 46f51ae3fe Merge commit '6e3a82697cef8155ee38f4f73d084290c87b8fbd' into feature/Svuotature 2025-02-11 16:42:00 +01:00
Riccardo Elitropi 852183de0c EgtMachKernel :
- In Drilling, migliorati controlli per utensili selezionabili.
2025-02-11 16:41:42 +01:00
Dario Sassi 6e3a82697c EgtMachKernel 2.7a5 :
- in sgrossatura superficie, finitura superficie e fresatura 5assi Apply controlla di non essere già in esecuzione sulla stessa lavorazione.
2025-02-06 17:07:58 +01:00
Riccardo Elitropi 5b4636eab1 Merge commit '731843f877ef316ad6c46838bbc998fed24f9c04' into feature/Svuotature 2025-02-06 07:58:17 +01:00
SaraP 731843f877 EgtMachKernel :
- nella preview del waterjet separate le regioni della lavorazione da quelle di ingresso e uscita.
2025-02-05 10:53:02 +01:00
Riccardo Elitropi 17fee33ff6 Merge commit 'f25acd3870f964cbee9187d82222a88c9026698e' into feature/Svuotature 2025-02-05 07:45:45 +01:00
Dario Sassi f25acd3870 EgtMachkernel :
- alla funzione OnActivateDrillingUnit si passa anche la variabile EMC.VER.
2025-02-04 16:55:12 +01:00
Riccardo Elitropi 7193ff3ac4 Merge commit '0b5fe6a6190f52f24fabf6a9c7c2680d803ad9b5' into feature/Svuotature 2025-02-04 14:54:38 +01:00
Dario Sassi 0b5fe6a619 EgtMachKernel :
- aggiunta gestione gruppi a forare con uscite selezionabili per anteprima, simulazione, stima e generazione.
2025-02-04 14:52:06 +01:00
Dario Sassi 4d1757ae30 Merge commit 'a5a020d19b03de52068bec59f444cc8f51bb05ba' 2025-01-31 14:36:07 +01:00
Riccardo Elitropi a5a020d19b EgtMachKernel :
- correzione link verticali per finiture ZConst.
2025-01-31 14:34:27 +01:00
Riccardo Elitropi cac0af10c7 Merge commit 'fd672325b07fa1b8d7e3aaf8b80890568822a9ff' into feature/Svuotature 2025-01-31 13:09:33 +01:00
Dario Sassi fd672325b0 EgtMachKernel :
- forzato prossimo ricarico utensili su testa all'aggiornamento setup.
2025-01-31 11:15:16 +01:00
Dario Sassi 333673005f EgtMachKernel 2.7a4 :
- modifiche per aggiunta SetFixtureLink per collegamento tra bloccaggio ed asse tavola.
2025-01-31 08:59:58 +01:00
Dario Sassi 6613639f96 Merge commit '5d77408018aa0c4088577770e8bca60d24cfe833' 2025-01-30 19:35:11 +01:00
Riccardo Elitropi 5d77408018 EgtMachKernel :
- prima implementazione forature con utensili selezionabili.
2025-01-30 16:54:30 +01:00
Riccardo Elitropi 70f2df2e0a Merge commit 'b74f0d407d67c5a70ab2a9176bd8d67c116f7268' into feature/Svuotature 2025-01-29 07:48:17 +01:00
Dario Sassi b74f0d407d EgtMachKernel 2.7a3 :
- aggiunta a PostProc la chiamata a OnTableAxisData e a Estimator la chiamata a OnEstimTableAxisData per ogni asse di tavola su quella corrente
- modifiche varie a Machine per rendere possibile la modifica precedente
- piccolo aggiustamento a inizializzazione di dZConstOverlap.
2025-01-28 19:45:11 +01:00
Dario Sassi 0c27684785 Merge remote-tracking branch 'origin/feature/Svuotature' 2025-01-28 18:31:09 +01:00
Riccardo Elitropi 232ebbc833 Merge commit '72fbae9bf7dd6d9bfde6fa35a703d92fc63819d9' into feature/Svuotature 2025-01-28 17:44:31 +01:00
Riccardo Elitropi 2362548413 EgtMachKernel :
- Migliorie in finiture ZConst e Optimal.
2025-01-28 17:43:59 +01:00
Dario Sassi 92d1e443a4 Merge commit 'eb48c9f9a05b7038fc9007bbdc57b1e46aff1ed8' 2025-01-27 14:28:26 +01:00
Riccardo Elitropi eb48c9f9a0 EgtMachKernel :
- in Finiture Optimal e ZLevel, rimozione memory Leaks.
2025-01-27 12:39:45 +01:00
Dario Sassi 72fbae9bf7 EgtMachKernel :
- aggiustamenti in Taglio Con Lama per tipo ToAndFrom (se impostato ora è forzato e i parametri di affondamento sono opportunamente aggiustati).
2025-01-27 12:02:14 +01:00
Riccardo Elitropi ca2d2a142b Merge commit 'f15e91e3f16f83d82ce327c560e251059c5655e8' into feature/Svuotature 2025-01-27 08:17:43 +01:00
Dario Sassi f15e91e3f1 EgtMachKernel :
- migliorata segnalazione errori per script lua lanciati da Operation (OnSpecialGetMaxZ, OnSpecialTestCollisionAvoid, OnSpecialMoveZup e OnSpecialMoveRapid).
2025-01-26 17:51:42 +01:00
Dario Sassi 3a2c18bf86 EgtMachKernel :
- sostituite FromString( ExtractInfo(sUn,"QQQ="),dQQQ) con GetValInNotes(sUn,"QQQ"),dQQQ), cosa possibile solo quando la chiave finisce con '='.
2025-01-26 11:39:39 +01:00
Dario Sassi c165d552c2 Merge commit '47f8df92f4a3311dd647a8f60f1fc29d56006675' 2025-01-24 20:42:36 +01:00
Riccardo Elitropi 47f8df92f4 EgtMachKernel :
- In Sgrossature rimozione memory Leaks
- Aggiunto parametro ZConstOverlap per finiture Optimal.
2025-01-24 17:06:15 +01:00
Riccardo Elitropi 422eb260d5 Merge commit '7507919ce7b127d8df4ffd988cb66ada4f809508' into feature/Svuotature 2025-01-24 08:11:56 +01:00
Dario Sassi 7507919ce7 EgtMachKernel 2.7a2 :
- correzioni in FinituraSuperfici per impostazione utensili avanzati (a V, ...) a Collision Avoid
- correzione in FinituraSuperfici/Proiezione per recupero lunghezza utensile da fare nel riferimento locale.
2025-01-22 15:46:33 +01:00
Dario Sassi e75b186dd8 Merge commit '65ef32a368e97c6132214d49b32ab28f44f84384' 2025-01-22 10:13:59 +01:00
Riccardo Elitropi 65ef32a368 EgtMachKernel :
- in Sgrossature aggiunto controllo sull'elevazione ed eventuale parametro MaxElev.
2025-01-22 09:24:17 +01:00
Riccardo Elitropi 8d248dc776 Merge commit '84c4a80cab80d9614fc06903a9b7264b72dd936e' into feature/Svuotature 2025-01-22 07:42:44 +01:00
Dario Sassi 84c4a80cab EgtMachKernel :
- correzione a SurfFinishing/Projection per gestione massimo affondamento.
2025-01-21 13:37:35 +01:00
Dario Sassi e5e51f0be0 Merge commit 'a6c568f3cc3313b8325b4a4f8dd90853c36537cb' 2025-01-21 12:57:53 +01:00
Riccardo Elitropi a6c568f3cc Merge commit '390724ff3fa9c2cce166fd778f7e7ca7238efc66' into feature/Svuotature 2025-01-21 12:50:30 +01:00
Riccardo Elitropi f756dc4a7e EgtMachKernel :
- Aggiunta finitura Projection.
2025-01-21 12:50:10 +01:00
Dario Sassi 390724ff3f EgtMachKernel :
- in sgrossatura superfici eliminato crash con affondamento zero e substep non nullo.
2025-01-21 12:05:49 +01:00
Dario Sassi 7e9285b55d Merge commit 'af244eb59fac242923901832e42f9b6c4e521e0d' 2025-01-20 11:53:36 +01:00
Riccardo Elitropi af244eb59f EgtMachKernel :
- in finiture Optimal aggiunto controllo per bSkipMaxDown.
2025-01-20 11:52:35 +01:00
Riccardo Elitropi 7b02dd3887 Merge commit 'b64b1d3cf0d6fe988934eada417f04219ba30948' into feature/Svuotature 2025-01-20 11:40:42 +01:00
Riccardo Elitropi 4f2c322af8 EgtMachKernel :
- aggiunta finitura Optimal.
2025-01-20 11:40:13 +01:00
Dario Sassi b64b1d3cf0 EgtMachKernel :
- aggiunta gestione nuovo sottotipo di finitura superficie (SURFFIN_SUB_PROJECT), manca relativo calcolo.
2025-01-20 10:51:53 +01:00
Dario Sassi b03aad7ecf EgtMachKernel :
- in fresatura aggiunta gestione speciale attacchi e uscite con elevazione per utensili flottanti (due movimenti consecutivi)
- in generazione/stima e simulazione aggiunto flag EMT.TFLOAT a OnToolSelect/OnSimulToolSelect per indicare utensile flottante.
2025-01-20 08:34:41 +01:00
Dario Sassi 57ec816f06 Merge commit '7a864d95034b894ba832ff41e0f5e775389293dd' 2025-01-10 17:00:00 +01:00
Riccardo Elitropi 7a864d9503 EgtMachKernel :
- in Sgrossature migliorate le gestioni delle Silhouette rispettando la geometria del Tool
- In Finiture, migliorati i controlli per finiture ZConst.
2025-01-10 16:43:59 +01:00
Riccardo Elitropi 25b11fa3cf Merge commit 'f09e1874dfbc3bb1b3a201cc35facadde924a994' into feature/Svuotature 2025-01-10 14:31:34 +01:00
Dario Sassi f09e1874df EgtMachKernel 2.7a1 :
- cambio annuale di versione
- compilazione 32bit senza più limiti per Windows XP.
2025-01-09 18:00:47 +01:00
Dario Sassi 3df067059b EgtMachKernel :
- correzione per consentire verifica aree protette anche in Disposizione per movimento pezzi (marmo).
2025-01-07 09:52:18 +01:00
Riccardo Elitropi a13eb42b3a Merge commit '7d7e3209c0f9b5e0839e739caa55010b7e374f6b' into feature/Svuotature 2025-01-07 08:09:02 +01:00
Dario Sassi 7d7e3209c0 EgtMachKernel :
- aggiustamenti per modifiche a FromString (in caso di errore non inizializza più a 0 il valore di ritorno)
2025-01-06 18:18:00 +01:00
Dario Sassi cb20faa0cc EgtMachKernel :
- piccole migliorie a finitura superfici.
2025-01-02 17:04:41 +01:00
Dario Sassi a60e8e2da7 EgtMachKerenel :
- modifiche a NewLinkMgr, ora con codice 1 controlla le aree protette solo sui link mentre con codice 2 le controlla anche nelle lavorazione (con codice 0 come prima le controlla sempre).
2024-12-31 15:50:57 +01:00
Dario Sassi dee87d0889 Merge commit 'a43a4cb9ac50aff82ba3b7e1e32682a2d96b73bb' 2024-12-31 14:52:02 +01:00
Riccardo Elitropi a43a4cb9ac EgtMachKernel :
- Correzione frame per finiture ZConst.
2024-12-31 14:32:52 +01:00
Dario Sassi bd744a710c EgtMachKernel 2.6l4 :
- quando si applica una lavorazione se non si trova l'utensile con UUID ora lo si cerca con il nome.
2024-12-31 10:48:34 +01:00
Dario Sassi e8664f6cab Merge commit 'e7c2d101117679ea58c315b2673e7bbbd6b68dda' 2024-12-30 19:13:54 +01:00
Riccardo Elitropi e7c2d10111 EgtMachKernel :
- In Sgrossature, aggiunto controllo per piccoli Chunks.
2024-12-30 18:03:14 +01:00
Dario Sassi e8853d1023 Merge commit '0a56d76535d3f45a6218aa0d1aa3bbf7aa8af009' 2024-12-30 16:23:41 +01:00
Riccardo Elitropi 0a56d76535 EgtMachKernel :
- in finiture, migliorie varie.
2024-12-30 16:14:45 +01:00
Riccardo Elitropi 89ed5eeb2f Merge commit '265bce38faf838a05f85c8a23eefceed43e76fa8' into feature/Svuotature 2024-12-24 08:42:58 +01:00
Dario Sassi 265bce38fa EgtMachKernel :
- riportate correzioni a SurfRoughing di RiccardoE
- ulterirori modifiche per NewLinkMgr.
2024-12-23 19:13:55 +01:00
Dario Sassi 14b99c473b EgtMachkernel :
- agli script di ToolMakers ora si passano anche le note utente (TOOL.USERNOTES)
- anche nel movimento manuale assi in simulazione si tiene conto dei limiti di corsa assi eventualmente aggiunti dalla testa
- notevoli migliorie alla nuova gestione dei link tra lavorazioni.
2024-12-23 12:09:11 +01:00
Riccardo Elitropi 4cad8af916 Merge commit 'd08a7b20359a0461a10ade9b264ba9494420bae4' into feature/Svuotature 2024-12-23 08:38:14 +01:00
Dario Sassi d08a7b2035 EgtMachKernel :
- migliorie e correzioni a nuova gestione collegamenti tra lavorazioni.
2024-12-17 10:22:00 +01:00
Dario Sassi 6c90189051 EgtMachKernel 2.6l3 :
- prima versione nuova gestione collegamenti tra lavorazioni (NewLinkMgr=1).
2024-12-13 16:42:31 +01:00
Dario Sassi 2c44adf99c Merge commit '87666ea59c0dc3ecd043d940ec32072a38cd4365' 2024-12-13 15:34:27 +01:00
Riccardo Elitropi 87666ea59c EgtMachKernel :
- migliorata gestione sgrossature
- aggiunta lavorazione di finitura ZConst.
2024-12-12 11:49:50 +01:00
Dario Sassi 409ba0d5db EgtMachKernel :
- a OnVerifyProtectedAreas ora vengono passati anche testa, uscita e utensile.
2024-12-11 13:21:44 +01:00
Riccardo Elitropi 9759656f80 Merge commit '646f5cf02f38cf6698967ff90e63cded154756e9' into feature/Svuotature 2024-12-11 11:26:50 +01:00
Dario Sassi 646f5cf02f EgtMachKernel :
- corretta gestione approccio/retrazione frese notip da sotto con testa da sopra e viceversa
- prima versione della nuova gestione dei collegamenti tra lavorazioni e con cambio utensile.
2024-12-10 17:31:46 +01:00
Riccardo Elitropi 5110f70253 Merge commit 'd0b78e58254a806b2db47a65f0e82e5f89ed7b56' into feature/Svuotature 2024-12-05 08:30:05 +01:00
Dario Sassi d0b78e5825 EgtMachKernel :
- aggiunto a MachMgr/IMachMgr il metodo GetClEntAxesStatus.
2024-12-04 15:08:05 +01:00
Dario Sassi 0095847b41 EgtMachKernel 2.6l2 :
- modifiche a tagli con lama per eliminare approcci/retrazioni con attacco e uscita fuori grezzo e tipologia ToAndFrom
- aggiunte gestione nuove costanti (SURFFIN_SUB_Z_CONST e SURFFIN_SUB_OPTIMAL) per tipo finitura superfici.
2024-12-04 10:11:14 +01:00
Dario Sassi 9feb8b584c EgtMachKernel 2.6l1 :
- ricompilazione con cambio versione.
2024-11-29 18:55:26 +01:00
Dario Sassi be78774e05 Merge commit '70f32557aca7d41cb9cf906556ce85a7fb4d31d0' 2024-11-27 16:57:58 +01:00
Riccardo Elitropi 70f32557ac EgtMachKernel :
- in SurfRoughing, rilassamento dei vincoli di approssimazione di curve e superfici.
2024-11-27 16:04:44 +01:00
Riccardo Elitropi 6ad07c2443 Merge commit '9f7ba94811dd621b8a38378b3c22f0c0f09601ce' into feature/Svuotature 2024-11-27 11:50:32 +01:00
Dario Sassi 9f7ba94811 EgtMachKernel :
- correzione foratura multipla (Riccardo E.)
- aggiunta gestione fori non lavorati per foratura multipla (GetMachiningSkippedGeometry).
2024-11-25 15:02:41 +01:00
Dario Sassi 1d20f9afe0 EgtMachKernel 2.6k5 :
- in fresatura corretto approccio/retrazione per utensili tipo lama (distanza iniziale da inizializzare).
2024-11-20 12:16:48 +01:00
Dario Sassi f095d6caaf EgtMachKernel 2.6k4 :
- modifiche a SimulatorMP per file stima speciale con path specifica (EMT.MPSEST) per poter funzionare in modalità multitask.
2024-11-18 10:56:43 +01:00
Riccardo Elitropi 61fa524332 Merge commit '3c241080d03db56f3b300155af897189764eac0a' into feature/Svuotature 2024-11-18 08:24:18 +01:00
Dario Sassi 3c241080d0 EgtMachKernel :
- ulteriori correzioni a Simulatore MP.
2024-11-16 13:05:37 +01:00
Dario Sassi 3aab2b94fc EgtMachKernel :
- migliorie a simulazione MP.
2024-11-16 11:04:49 +01:00
Dario Sassi 50c19b2ea3 Merge commit '271db2371756ddc60dd99566b70efe677a275a2c' 2024-11-16 10:10:24 +01:00
Riccardo Elitropi 271db23717 EgtMachKernel :
- migliorate le forature multiple.
2024-11-15 17:06:25 +01:00
Riccardo Elitropi 0868600687 Merge commit '33701162bf14c622d81f71bc5ed9740fc0c4791d' into feature/Svuotature 2024-11-11 09:52:36 +01:00
Dario Sassi 33701162bf EgtMachKernel 2.6k3 :
- modifiche per simulazione multi-processo.
2024-11-11 00:44:31 +01:00
Dario Sassi 77a61447c6 EgtMachKernel 2.6k2 :
- correzione in Drilling per multiforatura con tre assi rotanti di cui uno bloccato.
2024-11-09 10:34:47 +01:00
Dario Sassi b6f96e3d37 EgtMachKernel 2.6k1 :
- in simulatore MP lancio stima speciale prima di avvio.
2024-11-07 12:25:38 +01:00
Dario Sassi 6d936dede4 EgtMachKernel :
- aggiunta funzione SetFixtureMobile
- migliorato controllo movimento morse (introdotti minimo e massimo).
2024-10-31 18:31:49 +01:00
Dario Sassi b157cc66ec EgtMachKernel 2.6j4 :
- corretto sistema di aggiornamento automatico lavorazioni.
2024-10-31 08:38:01 +01:00
Riccardo Elitropi 130093561e Merge commit '47baf33ac2955f9865fa3285731fba22ec818a96' into feature/Svuotature 2024-10-28 08:24:34 +01:00
Dario Sassi 47baf33ac2 EgtMachKernel :
- in fresatura 5 assi ora le lame sono gestite sul punto di contatto come percorso di lavoro (come in fresature standard).
2024-10-27 18:39:03 +01:00
Dario Sassi 422d30e44d EgtMachKernel :
- consentito utilizzo lame in lavorazioni 5assi (per la pietra).
2024-10-25 17:18:02 +02:00
Dario Sassi 8cc41bd495 Merge remote-tracking branch 'origin/feature/Svuotature' 2024-10-25 17:02:05 +02:00
Riccardo Elitropi ca81e7e5ab EgtMachKernel :
- in sgrossature di superfici, aggiunta gestione note utenti per PlaneZ.
2024-10-25 15:15:25 +02:00
Riccardo Elitropi f1b66dc020 EgtMachKernel :
- in sgrossature di superfici, correzione errori su PlaneZ.
2024-10-25 13:28:27 +02:00
Riccardo Elitropi 3df4b5a210 Merge commit '47f442921eb64f15e3abafaa0e34fb3f2b8433cf' into feature/Svuotature 2024-10-21 08:22:27 +02:00
Dario Sassi 47f442921e EgtMachKernel :
- piccola modifica per evitare crash (da verificare bene),
2024-10-19 17:59:02 +02:00
Dario Sassi 7f0e30a8ec Merge commit 'd5ba4958509b8e040d7d711162e81eb0d106347e' 2024-10-19 17:08:19 +02:00
Riccardo Elitropi d5ba495850 EgtMachKernel :
- in Sgrossature aggiunto PlaneZDetection.
2024-10-18 11:28:35 +02:00
Riccardo Elitropi fd084c55f5 Merge commit '1497d7bb257d099a78f37b4b95853b4a97934204' into feature/Svuotature 2024-10-18 09:14:00 +02:00
Dario Sassi 1497d7bb25 EgtMachKernel :
- modifiche e migliorie per gestione assi di disposizione dipendenti dalla tavola.
2024-10-16 19:49:10 +02:00
Dario Sassi ab63e1908c EgtMachKernel :
- aggiunto controllo che gli assi mossi in Disposition siano assi dipendenti dalla tavola (MachMgr::IsDispositionAxis).
2024-10-16 17:11:50 +02:00
Riccardo Elitropi 505a8bd7b2 Merge commit 'e39426da0a7b2236409d08e4a0aec4b3eb77a1d1' into feature/Svuotature 2024-10-16 12:12:30 +02:00
Dario Sassi e39426da0a EgtMachKernel 2.6j3 :
- aggiunta in interfaccia funzione GetAxisDir.
2024-10-15 17:34:35 +02:00
Riccardo Elitropi 373c3ef7f4 Merge commit 'd2bf6a4cec275c4abca01f90fe6083fc99ee02f9' into feature/Svuotature 2024-10-11 08:35:55 +02:00
Dario Sassi d2bf6a4cec EgtMachKernel 2.6j2 :
- aggiunta gestione assi ausiliari di tavola da comandi Disp (MoveDispAxis e RemoveDispAxis)
- aggiunta funzione per avere dati eventuali utensile, testa e uscita associato a disposizione.
2024-10-10 15:45:05 +02:00
Dario Sassi 2d2f44f9aa Merge commit 'f9a496b41022dbad95699b10d6dfdcc29a0172d2' 2024-10-10 15:04:50 +02:00
Riccardo Elitropi f9a496b410 EgtMachKernel :
- in sgrossature, aggiunto ulteriore controllo su MaxOffs per i Chunk.
2024-10-10 13:00:06 +02:00
Dario Sassi 8be11025e7 Merge commit '36db2d068c3cf16ef8720cc1de566711d945903c' 2024-10-09 10:55:03 +02:00
Riccardo Elitropi 36db2d068c EgtMachKernel :
- prima modifica per PocketingNT.
2024-10-09 08:34:29 +02:00
Riccardo Elitropi 329d588eeb Merge commit '96d7edc513e9ce3f5923259a764b49ffc88b8278' into feature/Svuotature 2024-10-07 08:22:09 +02:00
Dario Sassi 96d7edc513 EgtMachKernel :
- corretto assegnamento codici di errore 1000 (No Nc generation), 1001 (No Advanced Machinings), 1002 (Error with Setup) e 1003 (Error opening Nc file).
2024-10-06 18:13:14 +02:00
Dario Sassi 3d420918f4 Merge commit '977e22a02f9463dbfcdf3307b92383736b178783' 2024-10-04 17:14:30 +02:00
Riccardo Elitropi 977e22a02f EgtMachKernel :
- In sgrossature sostituti i movimenti rapidi per collisioni nei collegamenti tra steps.
2024-10-04 12:59:19 +02:00
Dario Sassi c6f6f54009 Merge commit 'fb7ee5e7c1d0f20d591eb4de6201dcad93d097e6' 2024-10-03 11:10:26 +02:00
Riccardo Elitropi fb7ee5e7c1 EgtMachKernel :
- in Sgrossature corretta la Feed per approcci.
2024-10-03 10:46:56 +02:00
Dario Sassi 45bd5d64e6 Merge commit 'df1d21356f1bb9e7822327ef4b74ed176aa33cc0' 2024-10-03 10:16:21 +02:00
Riccardo Elitropi df1d21356f EgtMachKernel :
- in Sgrossature piccola modifica alle Elevazioni.
2024-10-03 10:09:24 +02:00
Riccardo Elitropi 0406a5b330 Merge commit 'ae24d97c6ebd7ae561a0f809e9950637ea6781e1' into feature/Svuotature 2024-10-03 09:08:02 +02:00
Dario Sassi ae24d97c6e EgtMachKernel :
- corretto controllo bit licenza per generazione CN e per lavorazioni avanzate.
2024-10-02 18:03:45 +02:00
Dario Sassi edd3f623c7 Merge commit '2a2b0e5d7eb846e93cf590d8d91d0a5e17317797' 2024-10-02 17:40:11 +02:00
Riccardo Elitropi 2a2b0e5d7e EgtMachKernel :
- Modifica del calcolo della superficie limite in Sgrossature.
2024-10-02 13:16:07 +02:00
Dario Sassi 93598217a4 EgtMachKernel 2.6j1 :
- foro con profondità non nulla ma con MaxElev=0; ora viene lavorato lo stesso.
2024-10-02 09:00:54 +02:00
Dario Sassi 05f96209f7 EgtMachKernel :
- aggiunto controllo abilitazione lavorazioni avanzate in simulazione, stima e generazione.
2024-10-01 13:11:39 +02:00
Riccardo Elitropi 06d591cc8f EgtMachKernel :
- In Sgrossature, migliorie sulla gestione dei lati chiusi e degli Step.
2024-10-01 12:44:56 +02:00
Riccardo Elitropi 4d709418e5 EgtMachKernel :
- modifica nomi delle strutture per evitare conflitti.
2024-09-27 08:15:12 +02:00
Riccardo Elitropi f22954bf63 Merge commit '2e6abe561d494f86e419efa1fefffdea4ccb3f05' into feature/Svuotature 2024-09-27 08:13:47 +02:00
Dario Sassi 2e6abe561d EgtMachKernel 2.6i3 :
- riportata in PocketingNT da Pocketing la correzione per caso limite dimensione tasca quasi uguale a dimensione utensile
- ricompilato con POCKETING_NT 0 per abilitare vecchio Pocketing.
2024-09-26 20:00:17 +02:00
Dario Sassi 3b5b1211a3 Merge commit 'e2e246f3f4b4077626ea0695eadf5077f67ac896' 2024-09-26 18:43:26 +02:00
Dario Sassi 3df6059071 EgtMachKernel :
- miglioria a svuotature per caso limite dimensione tasca quasi uguale a dimensione utensile.
2024-09-25 10:44:55 +02:00
Dario Sassi 425c24ef4c EgtMachKernel :
- modifiche per simulazione MP.
2024-09-24 18:24:22 +02:00
Riccardo Elitropi e2e246f3f4 EgtMachKernel :
- definizione di PocketingNT.
2024-09-23 11:16:08 +02:00
Dario Sassi 361eb44236 EgtMachKernel :
- in sgrossatura superfici VerifySubType ora accetta anche SURFROU_SUB_CONFORMAL_ONEWAY
- in svuotatura VerifySubType ora accetta aanche POCKET_SUB_CONFORMAL_ZIGZAG e POCKET_SUB_CONFORMAL_ONEWAY e li rimanda sui tipi standard.
2024-09-20 14:21:52 +02:00
SaraP 037e3281a5 EgtMachKernel :
- in fresatura con lama nel calcolo ingressi e uscite utilizzata anche info OutRaw.
2024-09-19 15:49:33 +02:00
Dario Sassi 096a890c42 EgtMachKernel :
- in svuotatura con aggregato da sotto corretta la verifica della distanza limite dal bordo
- nelle simulazioni migliorata visualizzazione collisioni con fixtures
- in fresatura standard di singola curva e in centro fresa con variazioni su geometria di lavorazione (info MVar) si emette l'indice EMT.IDX riferito alla geometria originale (1-based).
2024-09-19 12:48:15 +02:00
Dario Sassi e779f874fc Merge commit '0ee84b1d1ae174054977df5c7e9a192ab8352d1b' 2024-09-19 12:34:04 +02:00
Riccardo Elitropi 0ee84b1d1a EgtMachKernel :
- piccole migliorie.
2024-09-19 09:04:55 +02:00
Riccardo Elitropi ddf18390a6 Merge commit 'b951536dfbbbb249acec08e71c4e042d37759364' into Sgrossature 2024-09-18 08:53:46 +02:00
SaraP b951536dfb EgtMachKernel :
- in svuotature a spirale corretti i casi in cui il valore dell'offset è pari al valore limite per la curva.
2024-09-17 10:43:51 +02:00
Dario Sassi 8e196fbfc6 EgtMachKernel 2.6i2 :
- per aggregato da sotto aggiunta gestione approcci/retrazione di tipo 3 (prima parallelo al grezzo poi ruota a perpendicolare stando sotto e viceversa)
- ai punti aggiunti per garantire la precisione lineare con assi rotanti in movimento tolto flag 401 e impostato flag2 a -1
- nelle forature aggiustati i fori a step con i foratori multipli rotanti.
2024-09-14 12:37:41 +02:00
Riccardo Elitropi fa6ae61eef Merge commit '431246b4724ae6ded129590a0e2a9fec19f1195d' into Sgrossature 2024-09-11 09:26:49 +02:00
Dario Sassi 431246b472 EgtMachKernel :
- in svuotature chiuse migliorata scelta lato ottimale di inizio
- altri sviluppi in SimulatorMP.
2024-09-09 09:30:14 +02:00
Dario Sassi 4b835a27be EgtMachKernel 2.6i1 :
- introduzione secondo simulatore sperimentale per macchine multiprocesso.
2024-09-05 08:29:20 +02:00
Riccardo Elitropi 3bfb6e3ffb Merge commit 'ac72518e4415e2bb79a2e90b3034018651d5ab54' into Sgrossature 2024-09-02 09:19:38 +02:00
Dario Sassi ac72518e44 EgtMachKernel :
- corretti alcuni commenti.
2024-08-30 16:34:08 +02:00
Dario Sassi b3895266a1 Merge commit 'f6afb6ac9c377b04b20ae81dc9887cc79b2c52c4' 2024-08-29 16:02:44 +02:00
Riccardo Elitropi f6afb6ac9c EgtMachKernel :
- LeadIn/LeadOut mediante SafeZ.
2024-08-29 10:41:17 +02:00
Dario Sassi b2b1206df1 Merge commit '5247e2d09706e7226c4823776bd3cdb62f4a4e26' 2024-08-23 09:19:49 +02:00
Riccardo Elitropi 5247e2d097 EgtMachKernel :
- Aggiunta gestione punti iniziali in Sgrossature e Finiture.
2024-08-22 12:56:42 +02:00
Riccardo Elitropi 3c48318ebe Merge commit '532746cf840522a9810551b9e3072c7d28522474' into Sgrossature 2024-08-22 12:55:12 +02:00
Dario Sassi 532746cf84 EgtMachKernel :
- in simulazione ora si marcano con tipo diverso le parti che vanno in collisione.
2024-08-22 09:13:11 +02:00
Riccardo Elitropi 7b0e3ddba2 Merge commit '45cf4129850edebba6862ec1e9eedc0b61d156d9' into Sgrossature 2024-08-22 08:21:38 +02:00
Dario Sassi 45cf412985 EgtMachKernel :
- ore ZSAFEDELTA di testa per sole mortasature accetta un secondo valore che viene applicato quando l'inclinazione dall'orizzontale è minore di 45deg (default primo valore).
2024-08-20 12:55:38 +02:00
Riccardo Elitropi 83366e8d33 Merge commit 'b1d0f10b55daef70fe556bc435c9f51c7287eb72' into Sgrossature 2024-08-19 08:08:22 +02:00
Dario Sassi b1d0f10b55 EgtMachKernel :
- inserite diverse modalità di movimento assi nei link tra lavorazioni, per ora impostato sempre tutti interpolati tra loro.
2024-08-07 14:28:14 +02:00
Dario Sassi 114c13d781 EgtMachKernel :
- in sgrossatura superfici correzioni nell'applicazione dell'offset longitudinale.
2024-08-07 09:42:47 +02:00
Dario Sassi a26846ed4f Merge commit 'c55962ae9b5edd05a13ad14ba3bb8f66cffabb41' 2024-08-06 18:44:51 +02:00
Riccardo Elitropi c55962ae9b EgtMachKernel :
- piccola modifica.
2024-08-06 15:05:48 +02:00
Riccardo Elitropi f9e121af32 Merge commit '450a37e4f3a0f124867165c6945ff8ad7e1db5fe' into Sgrossature 2024-08-06 15:05:14 +02:00
Dario Sassi 450a37e4f3 EgtMachKernel 2.6h1 :
- aggiunta gestione SpecialEstimate (stima speciale lanciata in automatico prima di generare).
2024-08-06 14:43:36 +02:00
Dario Sassi 5a4f77030c EgtMachKernel :
- aggiunto flag in Ini macchina [Machinings] RapidOnOut=1 per abilitare approcci e retrazioni in rapido diretti su estremi fresature 1 passata fuori dal grezzo
- migliorata precisione nella verifica collisioni per link tra lavorazioni con vere geometrie utensile con nome Tool_* (Tool_C, Tool_S,...).
2024-07-31 20:30:13 +02:00
Dario Sassi 5d945b983d Merge commit '0dee26360c567c18a2800dfb4ba077d06b69a54a' 2024-07-31 08:46:38 +02:00
Riccardo Elitropi 0dee26360c EgtMachKernel :
- aggiunto parametro SURFROU_SUB_CONFORMAL_ZIGZAG.
2024-07-30 18:35:22 +02:00
Riccardo Elitropi d0be3ec4dd EgtMachKernel :
- aggiunto controllo per POCKET_CONFORMAL_ZIGZAG.
2024-07-30 14:02:51 +02:00
Riccardo Elitropi 21e398cef7 Merge commit '46e52e09950db882602fdf54b0f4f676f900cbbf' into Sgrossature 2024-07-30 14:02:03 +02:00
Dario Sassi 46e52e0995 EgtMachKernel 2.6g8 :
- minimo step per fori abbassato a 1mm.
2024-07-30 11:45:24 +02:00
Dario Sassi 6348a40e18 EgtMachKernel 2.6g7 :
- prime modifiche per gestire link tra lavorazioni con diverse modalità (per ora rimane la standard).
2024-07-30 09:28:05 +02:00
Dario Sassi 68a92f942c EgtMachKerenel :
- ulteriore modifica per controllo punto medio in calcolo assi macchina di tipo centro di lavoro.
2024-07-29 10:15:38 +02:00
Riccardo Elitropi 8156cf92e5 Merge commit '82e464c481a4a3eb5ee8da89a073d12ae233d2c1' 2024-07-25 12:35:34 +02:00
Riccardo Elitropi 82e464c481 EgtMachKernel :
- aggiunti percorsi di Bordo per Sgrossature ZigZag e OneWay.
- migliorie varie.
2024-07-25 12:32:48 +02:00
Riccardo Elitropi 23d29eec0a Merge commit 'c8fe978a9669e2a506e74b5c316f6113c61dda85' into Sgrossature 2024-07-25 12:15:41 +02:00
SaraP c8fe978a96 EgtMachKernel 2.6g6 :
- modifica provvisoria per problema in progetto marmo.
2024-07-25 11:48:15 +02:00
Dario Sassi 6d742580fa EgtMachKernel :
- in simulazione, generazione e stima aggiunti alcuni dati del movimento successivo.
2024-07-23 16:31:36 +02:00
Dario Sassi c4ee2661b0 Merge remote-tracking branch 'origin/Sgrossature' 2024-07-23 12:38:41 +02:00
Dario Sassi c68d841b46 EgtMachKernel :
- in simulazione migliorata scelta oggetti da visualizzare per collisione.
2024-07-23 12:02:09 +02:00
Riccardo Elitropi 73f189e59d Merge commit 'db580f95d23c4efa3059c8158f401b6882449cd2' into Sgrossature 2024-07-23 11:54:07 +02:00
Riccardo Elitropi 34488601f2 EgtMachKernel :
- migliorie varie.
2024-07-23 11:53:46 +02:00
Dario Sassi db580f95d2 EgtMachKernel :
- in simulazione dopo una collisione si evidenziano i gruppi che l'hanno prodotta, al riavvio del movimento si torna alla visualizzazione standard.
2024-07-22 16:13:39 +02:00
Dario Sassi b1232ac9d3 Merge commit '4af6caf657ede99d3dc1507cad110d55936e827c' 2024-07-22 14:58:50 +02:00
Riccardo Elitropi 4af6caf657 EgtMachKernel :
- migliorie LeadIn ed Entrate
- Semplificazione codice con funzioni in classe SurfFlatRegion.
2024-07-22 11:44:45 +02:00
Dario Sassi 0ab121d217 Merge commit '4a2f6fa43980530393a28617d0b230f106150edd' 2024-07-19 12:04:59 +02:00
Riccardo Elitropi 4a2f6fa439 EgtMachKernel :
- pulizia codice dopo il merge con ramo master.
2024-07-19 12:04:00 +02:00
Riccardo Elitropi 1396303d5f Merge commit '8950f2aca1e4f7292dd46ccfd6e279a0a9a1f3ee' into Sgrossature 2024-07-19 10:18:52 +02:00
Riccardo Elitropi c3552d411f EgtMachKernel :
- aggiunti controlli per limitazione percorsi alla curva di Pocketing
- migliorati i controlli LeadIn per Helix e ZigZag.
2024-07-19 10:18:34 +02:00
Dario Sassi 8950f2aca1 EgtMachKernel 2.6g5 :
- ricompilazione con cambio versione.
2024-07-18 20:20:08 +02:00
SaraP 325482d50c EgtMachKernel 2.6g4 :
- correzioni nuova modalità WaterJet.
2024-07-18 09:53:44 +02:00
Dario Sassi 38b9433a97 EgtMachKernel :
- raggio minimo per tab su fresatura portato da 100 a 50 mm.
2024-07-17 17:20:12 +02:00
SaraP 9640415ff7 EgtMachKernel 2.6g3 :
- in WaterJet aggiunta nuova modalità per angoli interni WJET_IC_SLOW_FULL.
2024-07-17 14:22:38 +02:00
Dario Sassi b5682b4185 EgtMachKernel :
- al salvataggio utensile per sole frese verifico e aggiusto corrispondenza tra feed di testa e sottotipo ( TT_MILL_STD o TT_MILL_NOTIP).
2024-07-17 11:27:28 +02:00
Dario Sassi cd323ec583 EgtMachKernel :
- piccola modifica a sgrossatura superfici.
2024-07-16 08:39:23 +02:00
Dario Sassi 6333707386 Merge commit 'ff9a1dd55b9683a920fbb55a1af10691a101b3e7' 2024-07-15 17:04:46 +02:00
Riccardo Elitropi ff9a1dd55b EgtMachKernel :
- Correzione OffsetL per superfici di Pocketing.
2024-07-15 13:30:38 +02:00
Riccardo Elitropi 4048e2f09e Merge commit '3745da80c1f00ce0f8c63bda532177190c2a4fa2' into Sgrossature 2024-07-15 11:27:30 +02:00
Dario Sassi 3745da80c1 EgtMachKernel :
- in sgrossatura superfici corretto calcolo P1 sopra elica di attacco per area successiva alla prima.
2024-07-15 10:18:14 +02:00
Dario Sassi 068a1c9fb7 EgtMachkernel :
- in finitura superfici silhouette approssimate con archi e reset proprietà curve dei contorni risultanti
- in sgrossatura superfici silhouette approssimate con archi e migliorie stilistiche.
2024-07-15 07:10:26 +02:00
Dario Sassi abd9855823 Merge commit '05baa2f0fc33100a7b2d0e6165671436140b92dd' 2024-07-12 19:48:18 +02:00
Riccardo Elitropi 05baa2f0fc EgtMachKernel :
- aggiunta la possibilità di non calcolare i percorsi ottinimizzati in lavorazioni che richiamano CalcPocketing.
2024-07-12 17:37:52 +02:00
Riccardo Elitropi 7aa4e5ac32 Merge commit '846412f2561f2f7002d349e97bb7f0b12663abaa' into Sgrossature 2024-07-12 16:06:13 +02:00
Dario Sassi 846412f256 EgtMachKerenel :
- ora SurfFinishing non calcola più le svuotature ma usa CalcPocketing.
2024-07-12 08:47:20 +02:00
Dario Sassi bcfc71d5b9 Merge commit '6cfe0a2178d4bdb012e2a026816ea7be3f4a62e4' 2024-07-11 15:10:17 +02:00
Riccardo Elitropi 6cfe0a2178 EgtMachKernel :
- correzione errore in RemoveChunksUnderTolerance.
2024-07-11 12:48:59 +02:00
Riccardo Elitropi c0f84c1909 Merge commit '5ecfe9ec58f7d82bf98fca21773a1dba49f8cda7' into Sgrossature 2024-07-11 09:02:14 +02:00
Dario Sassi 5ecfe9ec58 EgtMachKernel :
- modifiche a finiture di superficie.
2024-07-11 09:00:48 +02:00
Dario Sassi f53bf7a7ce Merge commit 'f81bff5254339c1d64eb8873df2488784ba40ff6' 2024-07-10 13:21:38 +02:00
Riccardo Elitropi f81bff5254 EgtMachKernel :
- Aggiunta inversione dei percorsi.
2024-07-10 12:36:24 +02:00
Dario Sassi 6c3a7e7dbb Merge commit 'ee7b9c9562a8ab1ebb440e7b9152900a0498f546' 2024-07-10 12:07:02 +02:00
Riccardo Elitropi ee7b9c9562 EgtMachKernel :
- aggiornamento Feed tra steps.
2024-07-10 10:28:10 +02:00
Riccardo Elitropi b65a119731 Merge commit '7a51dae75351087736aaa5f5219f8d96801db5fd' into Sgrossature 2024-07-10 08:03:32 +02:00
Dario Sassi 7a51dae753 EgtMachKernel :
- in finitura superfici corretto calcolo esterno di inizio e fine per movimento ortogonale di attacco e uscita.
2024-07-09 20:19:01 +02:00
Riccardo Elitropi 658018bed8 EgtMachKernel :
- rimozione memory Leak.
2024-07-09 11:07:28 +02:00
Riccardo Elitropi 9d68ea5057 Merge commit 'de5782f2a520bf718fcbb076798b3b8e9513d11f' into Sgrossature 2024-07-09 08:35:50 +02:00
Dario Sassi de5782f2a5 EgtMachkernel :
- corretto errore in taglio con lama prodotto dall'aggiunta di vtFaceUse (24/06/24).
2024-07-08 18:51:52 +02:00
Dario Sassi 375a7f4636 EgtMachKernel 2.6g2 :
- in sgrossatura superfici corretti approcci ai vari step e feed di discesa in aria
- in calcolo movimenti 5assi corretto controllo punto medio (sbagliato con tavole mobili).
2024-07-08 17:04:14 +02:00
Dario Sassi 6755753509 Merge commit '608918b619896f868c1a4eb5ce0313a3d39d7125' 2024-07-08 13:20:13 +02:00
Riccardo Elitropi 608918b619 EgtMachKernel :
- migliorie su SubSteps per aggiornamento regioni di Pocket.
2024-07-08 13:02:55 +02:00
Riccardo Elitropi 1b00139b8a Merge commit '8af2794f87927e4ca715f795beb877ccea72311b' into Sgrossature 2024-07-08 10:21:17 +02:00
Dario Sassi 8af2794f87 EgtMachKernel :
- in sgrossatura superfici piccole migliorie.
2024-07-08 10:18:33 +02:00
Dario Sassi 38635cade4 EgtMachKerenl :
- in sgrossatura superfici piccola modifica su ENABLE_DEBUG.
2024-07-08 09:10:22 +02:00
Dario Sassi bc373d2e33 EgtMachKernel :
- in sgrossatura superfici piccola modifica per Zloc attacchi dei vari livelli con eliche e similari.
2024-07-08 08:58:16 +02:00
Dario Sassi bc2baf17a7 Merge remote-tracking branch 'origin/Sgrossature' 2024-07-05 15:09:42 +02:00
Riccardo Elitropi 2017d45b99 Merge commit 'ce827dc0f3fcdcaf6d1f65b251dc9758835a88f2' into Sgrossature 2024-07-05 10:52:46 +02:00
Riccardo Elitropi d02422474c EgtMachKernel :
- Aggiunta Progress Bar in Sgrossature.
2024-07-05 10:52:21 +02:00
Dario Sassi ce827dc0f3 Merge commit '7ff79c295a6ead6a95cee805fc0aa38dd700e013' 2024-07-05 09:33:35 +02:00
Riccardo Elitropi 7ff79c295a Merge commit '37d602c6d95d3d3918cadc4a69466e130b1212e4' into Sgrossature 2024-07-04 08:45:20 +02:00
Dario Sassi 37d602c6d9 EgtMachKerenl :
- in sgrossatura superfici inglobato ramo "Riccardo" e aggiunto utilizzo della riduzione di feed.
2024-07-03 17:09:13 +02:00
Riccardo Elitropi 2cea265ce3 EgtMachKernel :
- Aggiunte Feed e migliorie su lati aperti per Sgrossature.
2024-07-03 13:25:06 +02:00
Dario Sassi 7269e97a70 EgtMachKernel :
- in svuotatura il limite per fare trapezi ottimizzati è dato dallo step di lato se non è dato "MaxOptSize=" nelle note utente.
2024-07-03 12:15:10 +02:00
Dario Sassi 02a0928b06 Revert "Merge commit '6f7adce5e22f8102ce4948e1e1be09cf386bbddd'"
This reverts commit 462832fa8f, reversing
changes made to e6a74d0b45.
2024-07-03 11:22:31 +02:00
Dario Sassi 462832fa8f Merge commit '6f7adce5e22f8102ce4948e1e1be09cf386bbddd' 2024-07-03 11:09:41 +02:00
Dario Sassi e6a74d0b45 EgtMachKernel :
- modifica a drilling per impostazione geometria senza con create anzichè add.
2024-07-01 14:46:20 +02:00
Dario Sassi 9c5b90858f EgtMachKernel 2.6g1 :
- ricompilazione con cambio versione.
2024-07-01 12:46:55 +02:00
Riccardo Elitropi 6f7adce5e2 Merge commit '1badb47d71f9451753f128e12492750ceed3203a' into Sgrossature 2024-07-01 08:57:28 +02:00
Riccardo Elitropi b43700909b EgtMachKernel :
- codice di test per Feed.
2024-07-01 08:57:07 +02:00
Dario Sassi 1badb47d71 EgtMachKernel :
- in sgrossatura superfici migliorie e semplificazioni.
2024-06-29 18:47:27 +02:00
Dario Sassi c2bb3bc43b Merge remote-tracking branch 'origin/Sgrossature' 2024-06-27 14:37:12 +02:00
Dario Sassi 07f75b3994 EgtMachKernel :
- correzione in fresatura e svuotatura di approccio/retrazione rinvio da sotto per ingombro di lato.
2024-06-27 12:52:35 +02:00
Riccardo Elitropi 50ebe36cd1 EgtMachKernel :
- migliorie entrate Elica e ZigZag.
2024-06-27 12:34:37 +02:00
Dario Sassi 70a9aeed15 Merge commit '83aa3824630fec1ea808a9adc38b4b9f14e5905e' 2024-06-27 10:26:22 +02:00
Riccardo Elitropi 83aa382463 EgtMachKernel :
- migliorata funzione per scelta lati Aperti/Chiusi.
2024-06-27 09:08:34 +02:00
Dario Sassi fcca2706c3 Merge commit 'c917f6bb4e6f01543f3cb4aa9656570858aa32aa' 2024-06-25 19:14:40 +02:00
Riccardo Elitropi c917f6bb4e EgtMachKernel :
- Aggiunta gestione della superficie limite
- aggiunte funzioni per SubSteps
- correzioni varie.
2024-06-25 13:30:41 +02:00
Riccardo Elitropi 63ca83fa01 Merge commit '6ccfaa76519a02735f715df8390d7c8b6a22be5a' into Sgrossature 2024-06-25 13:19:28 +02:00
Dario Sassi 6ccfaa7651 EgtMachKernel 2.6f4 :
- in fresatura aggiunta possibilità in FaceUse di dare direzione di riferimento con un vettore di chiave VtFaceUse nelle note utente.
2024-06-24 16:20:20 +02:00
Dario Sassi e379c216b8 Merge commit 'f51cfd089f7dfd7c678fdb49dc2d77bf91537d5c' 2024-06-18 18:18:04 +02:00
Riccardo Elitropi f51cfd089f EgtMachKernel :
- Se lavorazione Spiral, gli Step extra sono lavorati sempre in SpiralIN.
2024-06-18 11:18:56 +02:00
Riccardo Elitropi 3e3a31051e Merge commit '9b47b777d4f837d696d3855d82ab1d88d0f8c8ac' into Sgrossature 2024-06-18 11:16:21 +02:00
Dario Sassi 9b47b777d4 EgtMachKernel :
- piccola miglioria in simulazione per robot.
2024-06-18 07:34:02 +02:00
Dario Sassi 95d26a9c11 Merge commit '0449d9fe8cc266fb08e08ad6b7e973a8ce0e5105' 2024-06-17 12:22:42 +02:00
Riccardo Elitropi 0449d9fe8c EgtMachKernel :
- Offset radiale applicato alla Silhouette.
2024-06-17 11:49:13 +02:00
Riccardo Elitropi a6a9ab5bba Merge commit 'fdf4326f3aeb49265c82059e835df40ece20670f' into Sgrossature 2024-06-17 09:17:20 +02:00
Dario Sassi fdf4326f3a EgtMachKernel :
- aggiustamenti per modifiche a CollisionAvoid e calcolo silhouette che lo sfrutta.
2024-06-17 07:13:05 +02:00
Dario Sassi e81290308d Merge remote-tracking branch 'origin/Sgrossature' 2024-06-16 20:22:55 +02:00
Riccardo Elitropi 469b2a0935 Merge commit 'd098e4bcbc0995b608ce6bd46533ddbdb7ffd423' into Sgrossature 2024-06-14 16:46:12 +02:00
Riccardo Elitropi 1bd74a3c3c EgtMachKernel :
- gestione SubSteps
- migliorie varie.
2024-06-14 16:45:57 +02:00
Dario Sassi d098e4bcbc EgtMachKernel :
- in foratura con teste con uscite multiple ammesse anche frese che lavorano di testa.
2024-06-13 12:21:53 +02:00
Dario Sassi fbf91fcafa EgtMachKernel :
- in foratura con teste con uscite multiple non si considerano gli utensili diversi da punta a forare.
2024-06-13 12:09:39 +02:00
Riccardo Elitropi 78b67c1527 Merge commit '3d46b4b41b6887cae66afcff1d83730f1e488cef' into Sgrossature 2024-06-13 08:20:59 +02:00
Dario Sassi 3d46b4b41b EgtMachKernel :
- in sgrossatura superfici aggiunto controllo massimo arco al centro archi (come nelle altre lavorazioni)
- in sgrossatura superfici semplificata impostazione lati aperti di regioni grazie a nuove funzioni.
2024-06-13 08:02:38 +02:00
Dario Sassi 9e5dbcf5fb EgtMachKernel 2.6f3 :
- in sgrossatura superfici ridotto step di campionamento per silhouette a 0.5.
2024-06-12 14:34:45 +02:00
Dario Sassi ab6a0db22d EgtMachKernel :
- inserimento in sgrossatura superfici di nuovo metodo per calcolo silhouettte.
2024-06-11 09:32:08 +02:00
Dario Sassi 7929a41d5f EgtMachKernel :
- in SurfRoughing corretto passaggio parametro IntersParPlanesSurfTm (deve essere per riferimento).
2024-06-07 19:02:49 +02:00
Riccardo Elitropi a26a1fa546 Merge commit 'a9d57c8021822c594764091dba1fdae0e1093739' into Sgrossature 2024-06-07 12:52:47 +02:00
Dario Sassi a9d57c8021 EgtMachKernel :
- in sgrossatura superfici corretto GetParam e SetParam per substep.
2024-06-07 12:48:26 +02:00
Dario Sassi 931083217c Merge commit '86853914b24936604cec6ad5695dd611b55e339f' 2024-06-07 11:22:32 +02:00
Riccardo Elitropi 86853914b2 EgtMachKernel :
- Correzioni LeadIn/LeadOut.
- Gestione lati aperti.
2024-06-07 10:22:06 +02:00
Riccardo Elitropi 679ce5bcbc Merge commit '310acbdb6410ec65a714b9b9ae88e91aca3baabd' into Sgrossature 2024-06-06 18:35:42 +02:00
Dario Sassi 310acbdb64 EgtMachKernel :
- miglioria a riconoscimento curve non adatte per foratura.
2024-06-06 17:44:15 +02:00
Riccardo Elitropi bfc52671cd Merge commit '731e698404f6b0b60748fab95f65d47b9418c62c' into Sgrossature 2024-06-06 14:49:36 +02:00
Riccardo Elitropi 4ac0de990e EgtMachKernel :
- Aggiunta gestione lati aperti.
2024-06-06 14:49:06 +02:00
Dario Sassi 731e698404 EgtMachKernel :
- tolti parametri inutili da sgrossatura superfici
- razionalizzato uso parametri globali da BD lavorazioni.
2024-06-06 12:25:03 +02:00
Dario Sassi a07c76377e Merge commit '60ce7627938e3489c15474fc75fe67a6ef400263' 2024-06-06 09:54:54 +02:00
Riccardo Elitropi 60ce762793 EgtMachKernel :
- LeadIn/LeadOut.
2024-06-06 09:52:08 +02:00
Dario Sassi 3959ab60a3 EgtmachKernel :
- in fresatura corretto caso di circonferenza con due step in oneway e attacco glide che generava un arco di 360deg con conseguenti errori vari.
2024-06-05 20:06:38 +02:00
Dario Sassi 516a85a950 EgtMachKernel 2.6f2 :
- nei tagli di lama a passate OneWay ora i ritorni sono in rapido (come già era nelle fresature).
2024-06-05 19:08:34 +02:00
Dario Sassi c7cd7dfea8 EgtMachKernel :
- aggiustamento parametri per sgrossatura superfici.
2024-06-05 17:17:07 +02:00
Dario Sassi c6d500174e EgtMachKernel :
- correzione a sgrossatura superfici per caso lavandino.
2024-06-05 10:50:50 +02:00
Dario Sassi 920dcb502f EgtMachKernel :
- correzione a fresatura standard per approcci/retrazioni di frese con lunghezza totale diversa da lunghezza di lavoro
- piccola modifica a sgrossatura superfici.
2024-06-04 15:55:12 +02:00
Dario Sassi b001f26339 EgtMachKernel :
- modifiche a sgrossatura superfici.
2024-06-03 09:11:08 +02:00
Dario Sassi 8c4c606ee1 EgtMachKernel 2.6f1 :
- modifiche per sgrossatura superfici.
2024-06-03 08:16:08 +02:00
Dario Sassi 9c73479441 RgtMachKernel :
- resa funzionante GetToolPreviewStepCount.
2024-05-31 07:58:27 +02:00
Dario Sassi 719bb994bd EgtMachKernel :
- aggiunta funzione GetPreviewMachiningToolStepCount
- nella funzione PreviewMachiningTool il secondo parametro non è più un flag ma il numero di passi con il verso.
2024-05-30 15:24:50 +02:00
Dario Sassi e61dd3d17b EgtMachKernel 2.6e6 :
- in Finitura Superfici aggiunto sottotipo OneWay
- in Finitura Superfici aggiunta verifica utensile con superfici in attacchi e uscite
- nelle lavorazioni di Superficie escluso utilizzo di rinvio da sotto
- corretto Dump di svuotature per stringhe chiave-valore vuote
- prime modifiche a Sgrossatura Supefici.
2024-05-29 19:02:10 +02:00
Dario Sassi 9e52787c8b EgtMachKernel :
- correzione in operazioni FiveAxisMilling e SurfRoughing per tipo restituito nella GetParam.
2024-05-27 08:43:11 +02:00
Dario Sassi 92fba6f1d4 EgtMachKernel :
- aggiunta lavorazione sgrossatura superfici (per ora solo una copia della finitura).
2024-05-24 18:59:55 +02:00
Dario Sassi a3511ba89d EgtMachKernel :
- correzioni per calcolo posizione utensile fuori pezzo in fresatura
- ora GetElevation può gestire un offset della superficie utensile tramite il parametro dSafeDist.
2024-05-24 12:47:03 +02:00
Dario Sassi a31dfa3378 EgtMachKernel 2.6e5 :
- aggiunta gestione lavorazione fresatura a 5 assi.
2024-05-23 11:48:51 +02:00
Dario Sassi 171c473e5b EgtMachKernel :
- nel calcolo degli assi macchina su percorsi ora si infittiscono opportunamente i punti quando necessario a 5 assi.
2024-05-22 08:20:56 +02:00
Dario Sassi 9c38fcd015 EgtMachKernel :
- aggiunta gestione attacchi e uscite in finitura di superfici (per ora senza Collision Avoid).
2024-05-20 10:53:24 +02:00
Dario Sassi 6986c01fba EgtMachKernel 2.6e4 :
- in lavorazioni generiche ora si imposta l'utensile per il calcolo prima di chiamare lo script
- in lavorazioni generiche si passa allo script anche la variabile EMC.ISROBOT (flag che indica se la catena cinematica è di tipo robot).
2024-05-16 12:51:11 +02:00
Dario Sassi 68a6a544c6 EgtMachKernel :
- piccola miglioria a lavorazione finitura superfici per riconoscimento parti a massimo affondamento da eliminare.
2024-05-13 07:58:54 +02:00
Dario Sassi fece411fa7 EgtMachKernel :
- piccola correzione nei collegamenti tra le passate delle Fresature OneWay.
2024-05-09 20:22:50 +02:00
Dario Sassi 103c5d0388 EgtMachKernel :
- in finitura superficie aggiunta gestione SkipMaxDown=1 per eliminare i movimenti a massimo affondamento.
2024-05-07 12:03:59 +02:00
Dario Sassi 2e1d247e27 EgtMachKernel 2.6e1 :
- ricompilazione per modifiche a gestione chiave di rete.
2024-04-30 16:55:23 +02:00
Dario Sassi 888cc604b5 EgtMachKernel :
- piccola miglioria a simulazione (aumentato limite massimo dello step).
2024-04-29 12:47:06 +02:00
Dario Sassi c191d6d831 EgtMachKernel :
- in simulazione sistemato richiamo OnEndMove dopo errore di collisione alla fine del movimento.
2024-04-29 08:43:10 +02:00
Dario Sassi e97b9df6d4 EgtMachKernel :
- in simulazione a funzione SimSetToolForVmill aggiunti parametri nFlag, dPar1 e dPar2 per additive ( modificate EmtSetToolForVmill e EmtAddToolForVmill)
- in simulazione aggiunta funzione SimEnableToolsForVmill per abilitare/disabilitare le operazioni virtual (aggiunta EmtEnableToolsForVmill).
2024-04-26 11:44:37 +02:00
Dario Sassi e6a03b0b2e EgtMachKernel :
- correzioni a collegamenti tra passate ZigZag di Fresature con Utensili NoTip
- aggiunta in interfaccia MachMgr funzione GetExitId
- in simulazione VirtualMilling aggiunta gestione utensile Chisel.
2024-04-22 15:29:23 +02:00
Dario Sassi bafb8f55ed EgtMachKernel :
- correzioni a collegamenti tra passate OneWay di Fresature con Utensili NoTip.
2024-04-22 10:53:43 +02:00
Dario Sassi d1406baa2e EgtMachKernel :
- corretto passaggio parametri spezzatura in pocketing e milling (correzione #1765).
2024-04-17 11:39:10 +02:00
Dario Sassi 89d46baf43 EgtMachKernel 2.6d4 :
- aggiunta gestione riferimento canonico per calcolo cinematica robot comunque disposto nello spazio
- adattamento funzioni di calcolo posizione, direzione utensile e ausiliaria da questi angoli
- in svuotatura corretta mancata esplosione di archi in rette sui percorsi di ritorno quando richiesta.
2024-04-17 06:58:27 +02:00
Dario Sassi 1f57693da8 EgtMachKernel :
- in foratura corretta segnalazione di errore fuorviante
- in fresatura sistemata gestione direzioni inizio e fine con percorrenze in direzione inversa
- in link tra percorsi di lavorazione per robot aggiunta posizione iniziale a Zmax dopo inserimento di risalita a Zmax in percorso immediatamente precedente.
2024-04-13 17:44:30 +02:00
Dario Sassi 010f676234 EgtMachKernel :
- modifiche a fresature per direzioni di riferimento di attacchi e uscite come inizio e fine dei percorsi originali
- migliorata in fresatura visualizzazione movimento lame quando interessano 2 o 3 curve di lavoro.
2024-04-11 00:24:09 +02:00
SaraP 1839b45e96 EgtMachKernel 2.6d3 :
- in WaterJet modificati anelli per angoli esterni
- spezzatura movimenti per robot.
2024-04-10 12:04:10 +02:00
Dario Sassi 9bc699be18 EgtMachKernel 2.6d2 :
- ricompilazione per modifiche a EgtLock.
2024-04-09 14:49:50 +02:00
Dario Sassi f701828a25 EgtMachKernel :
- aggiunta a MachMgr funzione GetClEntAxesMask
- gestione emissione in generazione/simulazione/stima di tutti gli assi rotanti del robot.
2024-04-03 08:14:20 +02:00
Dario Sassi f8d2f26692 EgtMachKernel 2.6d1 :
- se robot sempre spezzatura
- spezzatura movimenti per robot
- in tagli con lama, tolto da Apply preview.
2024-04-02 15:37:22 +02:00
Dario Sassi 4e3079e504 EgtMachKernel :
- in fresature aggiunte inserzioni ed estrazioni su link di percorsi OneWay con lame o utensili che non tagliano di testa.
2024-03-26 17:32:56 +01:00
Dario Sassi 0d0f195d8b EgtMachKernel :
- modifiche a fresature per approcci/retrazioni con frese che non lavorano di testa.
2024-03-26 13:32:13 +01:00
Dario Sassi 7fbce2b593 EgtMachKernel :
- aggiunta gestione oggetti per verifica collisioni nei link tra lavorazioni anche nelle tavole
- in fresatura standard migliorati approcci e retrazioni per frese che non lavorano di testa
- in simulazione migliorata gestione comandi ausiliari di start in Disposizioni senza movimenti.
2024-03-19 18:11:50 +01:00
Dario Sassi 74b2874f56 EgtMachKernel :
- correzione a gestione visualizzazione tavola corrente.
2024-03-16 10:32:57 +01:00
SaraP 9540563a87 EgtMachKernel 2.6c3 :
- modifiche allo split nei grezzi con lavorazioni per gestire tagli inclinati
- introdotte regioni up e down per i grezzi
- nelle preview di sawing e milling aggiunte superfici di lavorazione in corrispondenza delle facce del grezzo.
2024-03-14 10:30:37 +01:00
Dario Sassi 8eeca04757 EgtMachKernel 2.6c2 :
- ricompilazione con cambio versione.
2024-03-10 10:26:06 +01:00
Dario Sassi db6ae7538f EgtMachKernel 2.6c1 :
- migliorato calcolo collegamento tra passate di fresature a step OneWay.
2024-03-05 08:57:15 +01:00
Dario Sassi 839639fcc8 EgtMachKernel :
- eliminate alcune variabili non usate.
2024-02-27 18:36:32 +01:00
Dario Sassi c3729befbb EgtMachKernel :
- modifiche e correzioni per flag di fine passata (301) in fresatura con lama a ZigZag e OneWay.
2024-02-27 10:36:52 +01:00
Dario Sassi a79d9c9fe8 EgtMachKernel :
- piccola correzione a fresature con attacco/uscita a scivolo.
2024-02-26 18:06:22 +01:00
Dario Sassi d3b281a858 EgtMachKernel :
- migliorata fresatura di lato con lama con più passaggi (ZigZag e OneWay) con note utente
      SideElev anche negativa per avere controllo MaxMat con Step
      TrimExt=nClosedStmId per definire superficie chiusa con cui estendere/trimmare il percorso di lavoro.
2024-02-26 15:15:07 +01:00
Dario Sassi 37d0b8f552 EgtMachKernel :
- in Milling corretto calcolo punto inizio attacco nel caso percorso invertito per ZigZag o similare.
2024-02-22 16:59:14 +01:00
Dario Sassi 737124b0bd EgtMachKernel :
- modifiche per configurazione canonica robot da ZYY-ZYZ a ZYY-XYX.
2024-02-20 10:52:23 +01:00
Dario Sassi 09bdd4852d EgtMachKernel :
- corretto controllo catena cinematica in assenza di assi lineari (eliminato anche possibile crash).
2024-02-19 17:16:14 +01:00
Dario Sassi 1d3c722fd3 EgtMachKernel 2.6b4 :
- in simulazione aggiunti eventi Init e Exit a cui possono rispondere le funzioni lua OnSimulInit e OnSimulExit.
2024-02-19 14:54:50 +01:00
Dario Sassi 3ca2db72e9 EgtMachKernel 2.6b3 :
- adattamenti per modifiche a funzioni di Collision Detection.
2024-02-16 08:47:33 +01:00
Dario Sassi 028a5b7bba EgtMachKernel :
- aggiunta gestione macchine di tipo Robot, le altre sono ora definite di tipo Center.
2024-02-13 11:45:05 +01:00
Dario Sassi 1179ad7e84 EgtMachKernel 2.6b1 :
- migliorato controlli su testa e suo attrezzaggio per MultipleDrill.
2024-02-02 16:20:05 +01:00
Dario Sassi d8c5fe0ea7 EgtMachkernel :
- ora vengono restituiti ThDiam e ThLength anche per le mortasatrici/seghe a catena (ovviamente vanno considerati nella direzione dell'utensile).
2024-01-29 19:54:17 +01:00
Dario Sassi a21be79df8 EgtMachKernel 2.6a2 :
- modificato controllo parametri in LuaEmtMoveAxes per evitare crash in R64
- piccole migliorie.
2024-01-25 08:35:26 +01:00
Dario Sassi d66cc47936 EgtMachKernel :
- aggiunta funzione ChangeMachGroupName di MachMgr.
2024-01-16 19:44:30 +01:00
Dario Sassi cd2315af46 EgtMachKernel 2.6a1 :
- ricompilazione con cambio versione.
2024-01-16 15:50:38 +01:00
Dario Sassi 204d63b7c9 EgtMachKernel :
- modifiche per gestione teste multiple in foratura con modalità fissa, singola o multipla.
2024-01-16 09:35:21 +01:00
Dario Sassi 5a5b48326f EgtMachKernel :
- in foratura con testa multiuscite senza assi rotanti tolta necessità di presenza Asse Ausiliario.
2024-01-15 17:21:54 +01:00
Dario Sassi bd448babd9 EgtMachKernel 2.5l6 :
- aggiunta gestione script opzionale OnSpecialTestCollisionAvoid per avere un test custom di verifica collisione nei movimenti link tra le lavorazioni.
2024-01-15 15:06:50 +01:00
Dario Sassi 73ba4eb93a EgtMachKernel :
- allo script di aggiornamento utensili custom ora viene passata anche la SPEED (per permettere di sistemare il senso di rotazione indicato)
- nelle fresature in approccio e retrazione aggiunta gestione extra tra lunghezza di lavoro e lunghezza totale.
2024-01-06 15:47:57 +01:00
Dario Sassi 268fa05cc0 EgtMachKernel 2.5l5 :
- correzioni per forature semplici con rinvii
- correzioni per forature con aggregato da sotto.
2024-01-05 19:09:39 +01:00
Dario Sassi b5ef9ae6dc EgtMachKernel :
- aggiunto nuovo calcolo elevazione per un segmento dati gli estremi
- in fresatura migliorato approccio e retrazione per lame e frese che non lavorano di testa e non considerate fuori completamente dal pezzo.
2024-01-02 16:00:59 +01:00
Dario Sassi fcaf15cbe1 EgtMachKernel :
- in generazione CN e stima si imposta fase a 1 prima dell'inizio e al termine
- in simulazione aggiunta gestione errore in evento OnToolSelect.
2023-12-29 13:08:21 +01:00
Dario Sassi ab84757a80 EgtMachKernel 2.5l4 :
- piccole migliorie e correzioni a forature multiple con aggregato.
2023-12-20 17:37:34 +01:00
Dario Sassi 0fab073568 Merge remote-tracking branch 'origin/Drilling' 2023-12-20 08:22:21 +01:00
Dario Sassi 4d29452c2d EgtMachKernel :
- in fresatura aggiunta gestione movimento compensazione raggio utensile in ingressi e uscite lineari e tangenti anche senza correzione raggio fresa in macchina.
2023-12-19 16:47:43 +01:00
Dario Sassi 1bcff0eb79 EgtMachKernel :
- in svuotatura cambiato calcolo elevazione.
2023-12-18 09:31:31 +01:00
Dario Sassi 52bcc69023 EgtMachKernel 2.5l3 :
- in fresature migliorato calcolo di retrazione orizzontale quando quasi sotto il pezzo con utensile lama o fresa notip.
2023-12-15 19:57:55 +01:00
Dario Sassi 18ccead437 EgtMachKernel 2.5l2 :
- rimossa costante non più utilizzata.
2023-12-11 10:28:31 +01:00
Dario Sassi d49f198720 EgtMachKernel :
- ulteriori migliorie nel calcolo dell'elevazione.
2023-12-07 11:00:26 +01:00
Dario Sassi 368721dcaa EgtMachKernel 2.5l1 :
- elevation ora viene calcolato più precisamente tramite Collision Avoid.
2023-12-01 16:51:48 +01:00
Dario Sassi c8c8d9e2a5 EgtMachKernel :
- preparazione nuova gestione calcolo elevazioni.
2023-11-28 09:39:06 +01:00
Dario Sassi d5c39485ea EgtMachKernel 2.5k3 :
- aggiunta la possibilità di forzare sempre la visualizzazione del versore fresa negli oggetti CamData
- le funzioni lua EmtAddRapidStart, EmtAddRapidMove, EmtAddLinearMove e EmtAddArcMove ora hanno un parametro opzionale in più per forzare la visualizzazione della direzione utensile
- agli script per Lavorazioni Generiche ora sono passati parecchi dati geometrici e non dell'utensile utilizzato
- in visualizzazione dei percorsi in Doppio ora si tiene conto anche del parametro opzionale DeltaZ.
2023-11-22 20:31:38 +01:00
Dario Sassi e14c8eb8b3 EgtMachKernel 2.5k2 :
- correzioni a CalculateClPathAxesValues per lavorazioni 5 assi in continuo.
2023-11-16 18:59:46 +01:00
Dario Sassi d5638e192c EgtMachKernel :
- corretta GetDistanceFromRawSide per sapere quanto una posizione è all'interno del grezzo (sbagliava se posizione sul bordo e direzione di fuga tangente al bordo).
2023-11-06 11:10:41 +01:00
Dario Sassi 85cdb84a5a EgtMachKernel :
- corretto crash in simulazione con posizione Tc vuota dovuto a modifiche commit precedente.
2023-11-06 09:33:17 +01:00
Dario Sassi 63a71db7ff EgtMachKernel :
- modifiche per gestire aggregati di utensili su tool changer.
2023-11-06 08:49:27 +01:00
Dario Sassi aa369739c9 EgtMachKernel 2.5k1 :
- ricompilazione con cambio versione.
2023-11-03 17:24:28 +01:00
Dario Sassi d19dfc5f8f EgtMachKernel 2.5j5 :
- migliorato calcolo approcci di fresature e svuotature
- in fresatura e svuotatura ora attacchi elica, zigzag e inseguimento partono 2mm sopra il materiale
- in fresatura migliorato passaggio ad inseguimento tra uno step e il successivo.
2023-11-01 19:21:28 +01:00
Dario Sassi d874e30288 EgtMachKernel 2.5j4 :
- aggiunte a interfaccia di MachMgr le funzioni GetClEntAxesVal, GetToolSetupPosInCurrSetup e GetAllCurrAxesName.
2023-10-28 18:13:56 +02:00
Dario Sassi 4047b8385e EgtMachKernel :
- aggiunto messaggio di log nel caso di utensile non caricato perchè l'insieme tavola-testa non ha tre assi lineari.
2023-10-24 11:52:23 +02:00
Dario Sassi 63e95ab2fe EgtMachKernel 2.5j3 :
- migliorata simulazione con assi principali che non fanno movimento mentre lo fanno gli ausiliari (per controllo collisioni)
- la funzione EmtMoveAxes base per SimulMoveAxes ora gestisce fino a 10 assi in contemporanea.
2023-10-22 15:58:36 +02:00
Dario Sassi 93a5bd72c7 EgtMachKernel 2.5j2 :
- in creazione disegno utensile si nascondono eventuali Carter se è per visualizzazione in gestione DB utensili
- in OnToolData per generazione aggiunto parametro tipo utensile EMT.TTYPE
- in simulazione si lancia UpdateCurrSetup solo al primo avvio.
2023-10-16 16:10:24 +02:00
Dario Sassi b3a1ee8e6c EgtMachKernel 2.5j1 :
- ricompilazione con cambio versione.
2023-10-09 13:02:22 +02:00
Dario Sassi 562e8342c3 EgtMachKernel 2.5i6 :
- in fresatura e svuotatura modificati approcci e retrazioni per macchine con TiltingTable (TURN) per stare più lontani dal materiale.
2023-09-27 21:11:18 +02:00
Dario Sassi 8c821750ba EgtMachKernel 2.5i5 :
- ricompilazione a 64bit con Enable Enhanced Instruction Set = Not Set.
2023-09-21 15:26:02 +02:00
Dario Sassi 6669fdc7a9 EgtMachKernel :
- migliorato log di virtual  milling in simulazione.
2023-09-18 08:15:19 +02:00
Dario Sassi e2043a7e3a EgtMachKerenl :
- piccole migliorie a simulazione (aumento velocità in rapidi e log).
2023-09-14 17:25:44 +02:00
Dario Sassi f92cec9d3d EgtMachKernel 2.5i1 :
- aggiunta visualizzazione geometria di lavorazione in doppio per Drill, Pocketing e Milling
- a OnSetHead passata anche variabile globale EMC.USERNOTES con note utente dell'utensile
- in Simulazione corretto richiamo impostazione virtual milling su utensili con raggio maggiore del massimo gambo ammesso dal portautensile.
2023-09-11 10:47:42 +02:00
Dario Sassi f30f028b17 EgtMachKernel 2.5h3 :
- aggiunta possibilità di copiare un gruppo di lavoro.
2023-08-27 18:30:01 +02:00
Dario Sassi 1adcb2991c EgtMachKernel :
- in SurfFinishing possibilità di invertire anche percorso di lavorazione a ZigZag.
2023-08-25 10:42:53 +02:00
Dario Sassi 285e0ce910 EgtMachKernel 2.5h2 :
- aggiunta definizione EMC.VER con versione della dll a OnSetTable, OnSetHead e OnVerifyProtectedAreas
- alla modifica di posizione o direzione di un asse si sistema anche la geometria per la simulazione
- alla modifica della posizione di una uscita si sistema anche la geometria per la simulazione
- corretto carico uscite di una testa per direzioni poco discoste da quelle canoniche non correttamente assegnate.
2023-08-19 11:53:38 +02:00
Dario Sassi 652aa35aaa EgtMachKernel 2.5h1 :
- alla info di testa ZMAXONROT aggiunto parametro opzionale (3°) che indica lo spessore dei pezzi oltre il quale applicare la prescrizione.
2023-08-02 20:02:50 +02:00
DarioS 2b5aacc160 EgtMachKernel 2.5g3 :
- corretta fresatura zigzag con attacco con componente in direzione utensile (poteva risultare movimento nullo con conseguente erore)
- modificato controllo indeterminazione angoli su primo asse rotante per gestire correttamente macchina Multiax C1522 con rinvio da sotto.
2023-07-27 09:31:59 +02:00
DarioS 1097f2a19f EgtMachKernel :
- semplificazioni con utilizzo di ConvertCurveToComposite.
2023-07-21 15:12:35 +02:00
DarioS 8c1b61b6b8 EgtMachKernel 2.5g2 :
- prima di fare il calcolo degli assi nell'update delle lavorazioni si cancellano le entità di tipo CLIMB, RISE e HOME che potrebbero dare errori come extra-corse e che in ogni caso verrebbero cancellate e ricalcolate subito dopo con la funzione AdjustStartEndMovements.
2023-07-20 20:43:33 +02:00
DarioS 80363af1f6 EgtMachKernel :
- piccola miglioria stilistica.
2023-07-19 09:54:12 +02:00
DarioS 9b5adeaeb3 EgtMachKernel :
- i movimenti in rapido sono disegnati tratteggiati.
2023-07-10 11:17:59 +02:00
DarioS 01854f30ed EgtMachKernel 2.5g1 :
- in svuotatura corretta gestione forzatura contorni chiusi (Open=0 in UserNotes della lavorazione) con i casi ottimizzati.
2023-07-07 17:08:56 +02:00
DarioS cdb35b4c38 EgtMachKernel 2.5f3 :
- dove possibile e sicuro sostituiti dynamic_cast con static_cast.
2023-06-30 11:51:03 +02:00
DarioS 994658da16 EgtMachKernel :
- in simulazione aggiunta gestione collisione anche con poliedri.
2023-06-19 08:12:03 +02:00
DarioS 135c0bda51 EgtMachKernel 2.5f2 :
- correzione in fresatura per approccio con lame/frese notip.
2023-06-14 15:05:46 +02:00
DarioS d927848815 EgtMachKernel :
- in milling corretto approccio/retrazione di frese che non lavorano di testa.
2023-06-09 16:05:28 +02:00
DarioS 7b91c17cb3 EgtMachKernel :
- nell'interpretazione degli assi rotanti bloccati e degli angoli suggeriti dal token asse si toglie eventuale '=' finale che non può essere gestito nelle note utente della lavorazione.
2023-06-08 10:16:57 +02:00
DarioS 3851bdcecb EgtMachKernel 2.5f1 :
- in svuotature modificata gestione lati aperti, ora vengono lavorati con affondo laterali pari al passo di lato.
2023-06-08 08:17:54 +02:00
Riccardo Elitropi d2965af836 Merge commit 'df86ffdee340b33c359d7e6b57598a70c1a1c006' into Drilling 2023-06-05 08:27:00 +02:00
DarioS df86ffdee3 EgtMachKernel :
- migliorato controllo gestione chiave di rete.
2023-05-30 10:29:13 +02:00
DarioS 05a6f56cfe EgtMachKernel 2.5e5 :
- in fresatura modifiche a retrazione di frese NoTip e lame per allontanarsi quanto necessario dal pezzo in tutti i casi.
2023-05-29 15:53:50 +02:00
DarioS 8f7fdc3a80 EgtMachKernel 2.5e4 :
- negli angoli macchina suggeriti ora si tiene conto di Invert e di Offset (quindi per l'utente sono i valori che vede in simulazione e sul CN).
2023-05-26 08:43:48 +02:00
DarioS 90dbb068a9 EgtMachKernel 2.5e3 :
- correzzioni a svuotature ottimizzate per attacchi e sucite sui lati aperti (distanze).
2023-05-20 12:04:46 +02:00
DarioS 577143d176 EgtMachKernel 2.5e2 :
- correzione a Disposizione per gestire correttamente errori in casi senza testa equivalente.
2023-05-18 18:34:34 +02:00
DarioS c6aa83ccd5 EgtMachKernel 2.5e1 :
- ricompilazione per aggiornamento lua.
2023-05-03 09:46:50 +02:00
DarioS 9e12f9d3b6 EgtMachKernel :
- corretto Virtual Milling in Simulazione per frese che non lavorano di testa ma che si muovono con un piccolo angolo verso il basso (max 5deg).
2023-04-18 09:47:45 +02:00
DarioS fc6af5de55 EgtMachKernel :
- in svuotature con utensili che non possono lavorare di testa aggiunto controllo che effettivamente gli ingressi siano fatti a spirale o zigzag
- aggiunti controlli su Set di Frame3d con due versori per verificare non siano allineati.
2023-04-18 08:00:55 +02:00
DarioS 8afece4a6c EgtMachKernel :
- corretto errore visualizzazione Versori di oggetti CamData quando allineati
- nel calcolo angoli alzata tolleranza direzione richiesta allineata a direzione singolare a 0.001deg (tramite GetRotation con tolleranza SIN_EPS_ANG_SMALL).
2023-04-17 09:32:20 +02:00
DarioS dc3ed5ea0a EgtMachKernel :
- correzione in fresature a ZigZag per passaggio da uno step al successivo.
2023-04-14 10:00:04 +02:00
DarioS 27a23bcdaa EgtMachKernel 2.5d3 :
- ricompilazione con cambio versione.
2023-04-11 19:38:44 +02:00
DarioS 7d554efe60 EgtMachKernel 2.5d2 :
- in taglio con lama modificato riconsocimento Fsta e Fend ora devono essere del tipo "Key=F,PuRed;" .
2023-04-06 18:03:24 +02:00
DarioS 075c0f4e95 EgtMachKernel :
- in svuotatura aggiunta gestione minima sicurezza su ingresso da lato aperto tramite nota "OpenMinSafe=Val" in Note utente.
2023-04-04 12:58:27 +02:00
DarioS 6378dddcdf EgtMachKernel 2.5d1 :
- eliminata la necessità di testa dummy per disposizioni con comandi StartAux o EndAux e senza movimenti diretti.
2023-04-03 08:50:46 +02:00
DarioS 025eea9c0f EgtMachKernel :
- aggiustamenti per PtrOwner nuova funzione Set.
2023-03-27 20:42:33 +02:00
DarioS 4b93557efe EgtMachKernel 2.5c2 :
- nelle lavorazioni all'aggiornamento utensile si prendono i dati opportuni anche dall'attrezzaggio corrente.
2023-03-23 19:08:44 +01:00
DarioS 04cf5a69a8 EgtMachKernel :
- migliorata gestione approcci/retrazione in fresature di utensili che non lavorano di testa
- corretta gestione passaggio da aperto a chiuso (curve a J) in svuotature.
- corretta gestione angolo di fianco in tagli con lama con variazioni di Z sulla linea da seguire.
2023-03-20 08:29:18 +01:00
DarioS 7d819a9500 EgtMachKernel :
- modifiche a fresature per approcci e retrazioni di lame e frese che non lavorano di testa
- in simulatore migliorati controlli per frese che non lavorano di testa.
2023-03-13 08:14:28 +01:00
DarioS a0da9d4e7d EgtMachKernel 2.5c1 :
- cambiato nome parametro a Operation::GetExtraZ per renderlo piùsignificativo.
2023-03-05 20:27:02 +01:00
DarioS dd960cb8a4 EgtMachKernel :
- modifiche in svuotature per gestione di lati aperti concatenati con rientranze.
2023-03-01 13:16:47 +01:00
DarioS 44af4a5bf4 EgtMachKernel 2.5b6 :
- ricompilazione con cambio versione.
2023-02-27 08:18:32 +01:00
DarioS 8ac85f6754 EgtMachKernel :
- in fresatura e svuotatura corretto calcolo direzione di approccio per testa da sopra con aggregato da sotto in presenza di geometria che esce dal grezzo.
2023-02-23 17:04:14 +01:00
DarioS e3cfe48da3 EgtMachKernel 2.5b5 :
- correzione in ApproxWithArcsIfUseful di Operation (non riconosceva i percorsi piani su piani diversi da XY).
2023-02-23 15:33:12 +01:00
DarioS 068e99df97 EgtMachKernel 2.5b4 :
- ricompilazione con cambio versione.
2023-02-20 09:17:12 +01:00
DarioS e3121ff553 EgtMachKernel 2.5b3 :
- modifiche quote approccio e retrazione
2023-02-17 12:08:10 +01:00
Riccardo Elitropi 0e8c41192d EgtMachKernel :
- Fori con più tools.
2023-02-16 15:11:47 +01:00
DarioS 15931dc304 EgtMachKernel 2.5b2 :
- nel calcolo spostamenti in disposizioni (movimenti di pezzi con ventose) è ora possibile fare rotazioni non minime pur di stare nelle corse.
2023-02-10 16:28:00 +01:00
DarioS c97cc00cdc EgtMachKernel 2.5b1 :
- modifiche per gestione gambo utensile in calcolo MaxDepth e in disegno dello stesso.
2023-02-09 10:39:27 +01:00
DarioS 8b0bbe4ab0 EgtMachKernel 2.5a4 :
- corretto controllo e modifica approcci e retrazioni lame in milling.
2023-01-31 19:53:35 +01:00
DarioS 4f264ee64e EgtMachKernel 2.5a3 :
- correzione calcolo assi rotanti nel caso indeterminato con corsa asse che non comprende lo zero.
2023-01-26 10:07:05 +01:00
DarioS 4e8953e864 EgtMachKernel :
- ritorno a stato pre svuotature con isole.
2023-01-23 17:26:31 +01:00
Riccardo Elitropi bca5dbb6dd Merge remote-tracking branch 'origin/master' 2023-01-23 08:14:14 +01:00
Riccardo Elitropi e009429d93 EgtmachKernel:
- svuotature con isole ( Spiral In, Out, ZigZag, OneWay)
- piccola modifica funzione GetDistanceFromRawBottom.
2023-01-23 08:12:27 +01:00
DarioS c3fa0bad11 EgtMachKernel :
- correzione di Operation::CalculateAxesValues per ricalcolo assi rotanti con testa 4 assi.
2023-01-18 11:20:01 +01:00
DarioS b2dacc0cef EgtMachKernel :
- aggiunto flag bToolOn a EmtAddCollisionObjEx per dichiarare che è utensile in lavoro (necessario quando si usano più utensili contemporaneamente).
2023-01-18 08:43:12 +01:00
DarioS 4af09db198 EgtMachKernel :
- miglioria alla funzione EmtMoveAxes per gestire anche rappresentazioni simboliche delle feed (con interi negativi).
2023-01-17 18:19:49 +01:00
DarioS 1507f18b88 EgtMachKernel :
- aggiunta gestione Vmill a EmtMoveAxes.
2023-01-17 16:30:23 +01:00
DarioS abbc7ee12b EgtMachKernel 2.5a2 :
- in simulazione corretta gestione collisione rilevata durante ToolDeselect che non deve far saltare le successive operazioni
- aggiunta funzione lua EmtMoveAxes per consentire movimento assi in simulazione da esterno.
2023-01-17 11:33:37 +01:00
DarioS 3375e316bd EgtMachKernel :
- nella scelta angoli quando delta dal precedente vale +/-180 si privilegia 180.
2023-01-10 08:38:06 +01:00
DarioS 961fce5aa4 EgtMachKernel :
- corretto errore in assegnazione versione 2.5a1 di R32
- reso più stabile ingresso in tasche con lati aperti.
2023-01-09 10:15:52 +01:00
DarioS e076e09ab3 EgtMachKernel 2.5a1 :
- ricompilazione con cambio versione.
2023-01-03 08:55:51 +01:00
DarioS e5a072c896 EgtMachKernel 2.4l4 :
- modifiche per virtual milling con più utensili in simulazione.
2022-12-28 19:40:24 +01:00
DarioS f0b00ea95e EgtMachKernel :
- in fresature ammesso step negativo con utensili che lavorano di lato( frese non di testa e lame).
2022-12-22 15:17:50 +01:00
DarioS 3ef50b6a90 EgtMachKernel 2.4l3 :
- modifiche a fesature per spostare punto di attacco su percorsi chiusi (sovrapposizione > 0.001 e allungamento attacco diventa spostamento inizio).
2022-12-21 09:44:49 +01:00
DarioS 992249f687 EgtMachKernel :
- modifiche estetiche.
2022-12-12 07:57:52 +01:00
DarioS dfa857c533 EgtMachKernel 2.4l2 :
- ottimizzazione movimenti tra passate di lavorazione fresatura a step di tipo OneWay.
2022-12-08 18:52:40 +01:00
DarioS 84455e27db EgtMachKernel :
- in milling con fresa capovolta rispetto alla faccia tolto spessore utensile da calcoli (ha significato solo per la forma dell'utensile e non per il punto di lavoro).
2022-12-07 15:53:57 +01:00
DarioS 748845e4a8 EgtMachKernel 2.4l1 :
- ricompilazione con cambio versione.
2022-12-05 08:13:23 +01:00
DarioS 1c78841664 EgtMachkernel :
- in fresature sistemazione approcci/retrazioni per macchine con TiltingTable.
2022-11-30 09:51:34 +01:00
DarioS 4d19a52590 EgtMachKernel 2.4k4 :
- migliorato calcolo elevazione in fresature con utensili di grosso diametro.
2022-11-29 09:04:59 +01:00
DarioS caf2176a3c EgtMachKernel 2.4k3 :
- aggiunto ricalcolo di AuxDir (se necessario) dopo modifiche di SpecialMoveZup.
2022-11-09 13:14:22 +01:00
DarioS 7f1e0ac8d8 EgtMachKernel 2.4k2 :
- migliorati log in Apply e Update di disposizioni e lavorazioni
- aggiunta funzione GetName a Operation.
2022-11-07 16:37:34 +01:00
DarioS 4f22c9c578 EgtMachKernel 2.4k1 :
- migliorati messaggi di log su Apply lavorazioni.
2022-11-03 15:52:26 +01:00
DarioS b4fba50c15 EgtMachKernel 2.4j3 :
- in tutte le lavorazioni ora Apply esegue sempre Update (aggiornamento assi macchina e collegamento con operazione precedente) anche se non è necessario il ricalcolo della lavorazione.
2022-10-27 11:06:22 +02:00
DarioS b6b0432721 EgtMachKernel :
- modifiche per calcolo approccio/retrazione in fresatura per macchine con tavola tilting o similare.
2022-10-20 10:21:28 +02:00
SaraP 877215969e EgtMachKernel 2.4j2 :
- in Pocketing correzioni per svuotatura a zigzag ottimizzata.
2022-10-19 11:26:30 +02:00
DarioS f70218a432 EgtMachKernel 2.4j1 :
- aggiunta possibilità di definire direzione principale di approccio per rinvio da sotto con massima deviazione angolare di 95deg.
2022-10-14 10:47:40 +02:00
DarioS b47a32c628 EgtMachKernel 2.4i6 :
- corretta GetMachines di MachMgr per evitare di inserire in lista due volte la stessa macchina.
2022-10-04 11:12:55 +02:00
DarioS 677a8466dd EgtMachKernel 2.4i5 :
- aggiunta gestione flag MaxDeltaR2OnFirst su testa per disabilitare controllo massimo delta su secondo asse rotante all'inizio di una lavorazione.
2022-10-03 08:56:46 +02:00
DarioS f8f23ed713 EgtMachKerenel :
- per simulazione AXESMASK portato a MASK come in generazione.
2022-09-26 07:45:45 +02:00
DarioS ff6aae071a EgtMachKernel 2.4i :
- aggiunta gestione offset assi per visualizzazione
- correzioni in Milling e Pocketing per approcci e retrazioni con TiltingTab (comprende asse rotante tipo ralla).
2022-09-24 18:53:47 +02:00
DarioS dffc7ec956 EgtMachKernel 2.4i3 :
- in lavorazione WaterJet aggiunta gestione ponticelli.
2022-09-20 07:50:41 +02:00
DarioS b5d15e4a11 EgtMachKernel 2.4h2 :
- aggiunta gestione più direttori di base per le macchine (in MachMgr::Init sono tutti nella stessa stringa separati da "|")
- aggiunta funzione GetMachines di MachMgr per restituire elenco nome/direttorio di tutte le macchine trovate
- sistemazioni varie per le modifiche sopra indicate.
2022-09-13 08:15:14 +02:00
DarioS cf6c628876 EgtMachKernel :
- modifiche per permettere assi lineari controversi con assi principali XYZ.
2022-08-29 07:24:34 +02:00
DarioS 6399c41598 EgtMachKernel 2.4h2 :
- correzioni e migliorie a VerifyPathFromBottom di Milling e Pocketing.
2022-08-24 17:39:47 +02:00
DarioS 49854f8045 EgtMachKernel :
- modifiche a svuotatura per regressione nella gestione del caso slot con ingresso e uscita aperti di larghezza pari al diametro utensile.
2022-08-17 19:20:18 +02:00
DarioS c5c0503018 EgtMachKernel :
- correzioni in mortasatura quando inclinata per calcolo massimo affondamento.
2022-08-08 18:16:00 +02:00
SaraP ee513969fa EgtMachKernel :
- correzioni per svuotatura a spirale ottimizzata.
2022-08-08 17:44:25 +02:00
SaraP 22933e6f3d EgtMachKernel 2.4h1 :
- corretto caso di pulizia angoli per svuotatura a spirale ottimizzata.
2022-08-08 12:02:56 +02:00
DarioS 5cde54467a EgtMachKernel :
- in mortasatura sistemato calcolo affondamento quando inclinata rispetto al movimento
- corretto calcolo spessore da associare a curva derivata da contorno superficie con TOOL_PAR_SLANT.
2022-08-05 07:25:45 +02:00
DarioS 6b3343a98e EgtMachKernel 2.4g7 :
- in Mortising si considerano concatenabili lati di facce con delta angolare non oltre 31 gradi (prima il limite era di 46).
2022-08-04 19:58:05 +02:00
DarioS 4d158ec9fd EgtMachKernel 2.4g6 :
- in Mortising plunge corretta gestione affondamento.
2022-08-01 12:30:20 +02:00
DarioS d48b1c969e EgtMachKernel 2.4g5 :
- corretto calcolo elevazione in forature.
2022-07-29 15:12:44 +02:00
DarioS 3e33be0552 EgtMachKernel 2.4g4 :
- modifica a ApproxWithArcsIfUseful per evitare problemi con percorsi piani su piani diversi da XY.
2022-07-21 07:02:04 +02:00
DarioS 0ec3726fc6 EgtMachKernel 2.4g3 :
- altra correzione per asse rotante con corsa nulla.
2022-07-15 07:40:16 +02:00
DarioS 91005b36ba EgtMachKernel 2.4g2 :
- correzione calcolo angolo di asse rotante con corsa nulla.
2022-07-13 18:29:36 +02:00
DarioS 8f224a6b61 EgtMachkernel :
- in lavorazione Mortising calcolo degli step con più tolleranza.
2022-07-05 08:54:30 +02:00
DarioS 0e38ae1f66 EgtMachKernel 2.4g1 :
- modifiche a forature per gestione precisa MaxElev.
2022-07-04 11:02:46 +02:00
DarioS 2142ebda4e EgtMachKernel 2.4f5 :
- in svuotature corretta gestione casi speciali che falliscono e rimandano al caso standard.
2022-06-29 16:07:19 +02:00
DarioS 16a283e1bc EgtMachKernel :
- modifiche varie per plunge di Mortising.
2022-06-19 11:07:07 +02:00
SaraP ddc91c60e9 EgtMachKernel :
- aggiunta lavorazione a tuffo su tutto il percorso in mortasatura.
2022-06-17 17:55:47 +02:00
DarioS d61450cf20 EgtMachKernel 2.4f4 :
- aggiunta lavorazione a tuffo (su inizio o fine) in mortasatura
- aggiunta Distanza (per mortasatrici) a dati utensili.
2022-06-17 07:39:24 +02:00
DarioS 2db7bcaefa EgtMachKernel :
- in fresatura OneWay più passate l'affondamento alla successiva è ora con feed di attacco.
2022-06-13 07:57:35 +02:00
DarioS f674c50f89 EgtMachKernel 2.4f3 :
- migliorata gestione parametri porta-utensile in DB utensili.
2022-06-10 11:55:28 +02:00
DarioS 7ab0f5c4a2 EgtMachKernel 2.4f2 :
- modifiche a fresature per caso con tavola tilting/asse a ralla
- corretta in simulazione gestione errore collisione.
2022-06-08 11:41:32 +02:00
DarioS 83c399215d EgtMachKernel 2.4f1 :
- alle macro di disegno utensile si passa anche TipFeed per sapere se taglia in testa.
2022-06-06 07:03:10 +02:00
SaraP 7b0258205f EgtMachKernel 2.4e8 :
- nelle svuotature a zigzag agguinto nuovo caso ottimizzato con 3 lati chiusi.
2022-05-31 11:52:59 +02:00
DarioS f901adadab EgtMachKernel 2.4e7 :
- in WaterJet possibilità di definire inizio lavoraziona anche tramite coordinate punto vicino in note utente (START=x,y,z).
2022-05-31 00:31:03 +02:00
DarioS cdbc4bfb63 EgtMachKernel :
- aggiunta gestione quota di base del tool holder ( se negativa indica spazio libero su testa).
2022-05-29 16:40:26 +02:00
DarioS bc7a89856d EgtMachKernel :
- modifiche a svuotature SpiralIn per ingresso su lato aperto da considerare fuori grezzo anche se dentro (da OpenOutRaw=1 in Note Utente).
2022-05-27 09:12:10 +02:00
DarioS de2539388c EgtMachKernel :
- corretta gestione ventose utilizzate e rimosse.
2022-05-26 10:57:58 +02:00
SaraP a0f655a767 EgtMachKernel :
- piccola correzione svuotature ottimizzate.
2022-05-25 09:48:01 +02:00
DarioS a1a4c85024 EgtMachKernel 2.4e6 :
- correzione calcolo lunghezza attacchi/uscite di svuotature ottimizzate.
2022-05-25 08:35:12 +02:00
DarioS 8a780e6fc7 EgtMachKernel 2.4e5 :
- aggiunti dati EMT.MOVEID e EMT.MOVEIND ai parametri passati agli script di movimento in Generazione e Stima.
2022-05-20 15:56:08 +02:00
DarioS 9bb22b11bd EgtMachKernel 2.4e4 :
- piccole migliorie nell'approccio e retrazione delle svuotature.
2022-05-19 08:37:05 +02:00
DarioS 156f0f8ef8 EgtMachKernel 2.4e3 :
- modifiche per prima versione chiave di rete.
2022-05-17 08:26:38 +02:00
DarioS 88912bf524 EgtMachKernel :
- aggiunta gestione lunghezza ingombro portautensile negativa per indicare spazio libero sulla testa.
2022-05-16 18:35:15 +02:00
DarioS a677bb991f EgtMachKernel 2.4e2 :
- corretta GetPartDirFromAngles per asse rotante di testa speciale (ralla).
2022-05-14 12:11:40 +02:00
DarioS b7bfccdfeb EgtMachKernel :
- in svuotature ZigZag consentite con utensili che non lavorano di testa se iniziano dall'esterno (quindi anche ottimizzate).
2022-05-05 00:00:56 +02:00
DarioS 5869f8ab01 EgtMachKernel 2.4e1 :
- ricompilazione con cambio versione.
2022-05-04 08:07:32 +02:00
DarioS a4fa53a7e9 EgtMachKernel 2.4d4 :
- ricompilate versioni a 32bit con v141_xp (VisualStudio 2017 C++ per XP).
2022-04-24 17:09:39 +02:00
DarioS dc0b055480 EgtMachKernel :
- migliorie su approcci eretrazioni di fresature con lame.
2022-04-22 08:53:59 +02:00
DarioS 6bb714e581 EgtMachKernel 2.4d2 :
- modifiche per gestire macchina con asse rotante tipo ralla che porta due assi lineari ad esso perpendicolare (terzo lineare diretto come ralla).
2022-04-19 11:24:41 +02:00
SaraP 33090bc9e0 EgtMachKernel 2.4d1 :
- in Pocketing corretti errori nella svuotatura a spirale ottimizzata.
2022-04-15 10:48:27 +02:00
DarioS c18b4deef2 EgtMachKernel 2.4c2 :
- modifica a simulatore per gestire correttamente gli assi ausiliari dipendenti da assi principali.
2022-03-22 08:25:41 +01:00
DarioS d3922eb897 EgtMachKernel :
- migliorata gestione approcci e retrazioni in fresature con lame.
2022-03-20 18:51:56 +01:00
SaraP d8f72d02f7 EgtMachKernel 2.4c1 :
- in svuotatura a spirale ottimizzata per trapezoidi aggiunta rimozione di materiale residuo negli angoli.
2022-03-16 09:26:21 +01:00
DarioS b059fe9486 EgtMachKernel 2.4b8 :
- migliorata gestione direzione utensile da lavorazione faccia in parallelo.
2022-03-08 11:19:52 +01:00
DarioS b82cdd0bc7 EgtMachKernel :
- corretto link tra lavorazioni quando HomeZ standard non va bene ma serve GetExtraZ
- disabilitate svuotature a spirale ottimizzate per problemi quando ci sono tre lati aperti
- sistemate maiuscole/minuscole nei nomi dei file inclusi.
2022-02-26 17:53:11 +01:00
SaraP d18b15f209 EgtMachKernel :
- in Pocketing correzione per svuotature a spirale ottimizzate.
2022-02-25 17:29:14 +01:00
SaraP a4b462d6ab EgtMachKernel 2.4b7 :
- in Pocketing aggiunta svuotatura a spirale ottimizzata nel caso di trapezoidi.
2022-02-25 12:51:05 +01:00
DarioS 869b9e0ebe EgtMachKernel 2.4b6 :
- in taglio con lama quando si prende il percorso da superficie si limita la deviazione angolare a 16.1 gradi
- in fresatura la direzione utensile parallela da parte di contorno superficie si calcola nel punto medio (per favorire il lato lungo).
2022-02-23 10:51:54 +01:00
DarioS 0905ebebc7 EgtMachKernel 2.4b5 :
- migliorato CalcOffset di WaterJet.
2022-02-20 19:32:19 +01:00
DarioS d66fdb0e5e EgtMachKernel :
- corretto collegamento tra lavorazioni per problemi macchine tipo PF con pezzi alti.
2022-02-17 22:25:55 +01:00
DarioS 516679bc3b EgtMachKernel :
- modifica calcolo miglior lato aperto per svuotatura SpiralIn.
2022-02-17 16:23:46 +01:00
DarioS 0074ab9003 EgtMachKernel :
- migliorie in Pocketing per zigzag ottimizzato.
2022-02-17 14:41:40 +01:00
DarioS b0cb253299 EgtMachKernel 2.4b4 :
- altre correzioni su svuotature a zigzag ottimizzate.
2022-02-15 19:13:05 +01:00
SaraP 9ef40618f9 EgtMachKernel :
- rimozione aree residue nelle svuotature a zigzag ottimizzate
- altre modifiche per le svuotature a zigzag ottimizzate.
2022-02-15 13:10:55 +01:00
DarioS 360d116eab EgtMachKernel 2.4b3 :
- altre modifiche a svuotature zigzag ottimizzate.
2022-02-15 08:20:11 +01:00
DarioS ea0ab12521 EgtMachKernel :
- altre modifiche alle svuotature ZigZag ottimizzate.
2022-02-14 17:46:24 +01:00
DarioS 78d717cb39 EgtMachKernel :
- modifiche a Pocketing per svuotature a ZigZag ottimizzate.
2022-02-14 12:56:09 +01:00
DarioS bdb7234fbb EgtMachKernel 2.4b2 :
- corretto salvataggio lavorazioni con nuovi parametri opzionali da non salvare se coincidono con default.
2022-02-09 09:50:28 +01:00
SaraP 170d3f7638 EgtMachKernel :
- in Pocketing corretti attacchi e raccordi per lucidature con epicicli.
2022-02-08 14:42:55 +01:00
DarioS 75669fdfc0 EgtMachKernel :
- in Pocketing corretto salvataggio parametri opzionali.
2022-02-06 17:24:13 +01:00
DarioS c47095e52b EgtMachKernel :
- sistemata gestione nuovi parametri per svuotature con epicicli di lucidatura.
2022-02-04 18:31:35 +01:00
SaraP 9edecc23c3 EgtMachKernel 2.4b1 :
- in Pocketing aggiunto percorso a spirale con epicicli per lucidatura.
2022-02-01 10:25:19 +01:00
DarioS ca1aa4c9ac EgtMachKernel 2.4a4 :
- aggiunti massimi e minimi di posizioni e assi anche a gruppi CL e suoi sottogruppi di Disposizioni
- si esegue la scrittura di questi estremi per lavorazioni e disposizioni solo quando definiti.
2022-01-31 18:43:17 +01:00
DarioS 798e0bcb70 EgtMachKernel 2.4a3 :
- corretto controllo attacchi di svuotature con utensili che non lavorano di testa.
2022-01-17 16:27:02 +01:00
DarioS 9ceb1759b5 EgtMachKernel :
- in Sawing su tratti lineari aumentato ingombro lama per calcolo elevazione.
2022-01-14 18:56:38 +01:00
DarioS a5c8d50c55 EgtMachKernel :
- piccole modifiche estetiche.
2022-01-14 16:45:07 +01:00
DarioS c59164f0fb EgtMachKernel :
- migliorato calcolo PreView di tagli di lama lineari inclinati.
2022-01-10 09:41:47 +01:00
DarioS 25473ff787 EgtMachKernel :
- inserita opzione in compilazioni 64bit per evitare Warning su verifica riferimenti non nulli.
2022-01-09 15:50:55 +01:00
DarioS 0c8fec9146 EgtMachKernel 2.4a2 :
- ricompilazione con cambio versione.
2022-01-07 10:02:37 +01:00
DarioS 6df3b2dace EgtMachKernel 2.4a1 :
- ricompilazione per cambio versione.
2022-01-04 08:08:55 +01:00
DarioS 339c0260f8 EgtMachKernel 2.3l3 :
- sicurezza minima di collisione ridotta a 5 mm nelle verifiche dei link.
2021-12-29 20:39:07 +01:00
DarioS 46d433296b EgtMachKernel 2.3l2 :
- in simulazione aggiunta gestione assi linkati ad altri assi.
2021-12-28 08:39:00 +01:00
DarioS 7ee1253b3c EgtMachKernel :
- eliminato prototipo inutile.
2021-12-17 09:00:13 +01:00
DarioS f535ed5a9b EgtMachKernel :
- correzione in import lavorazioni.
2021-12-12 10:37:43 +01:00
DarioS 25c382aa71 EgtMachKernel :
- aggiunte in interfaccia funzioni per export/import lavorazioni
- modifiche varie in export/import utensili e lavorazioni.
2021-12-08 16:43:32 +01:00
SaraP 75b4601ecc EgtMachKernel :
- aggiunte funzioni per esportazione e importazione lavorazioni.
2021-12-07 17:35:23 +01:00
SaraP a136631c94 EgtMachKernel 2.3l1 :
- in Pocketing aggiunto caso ottimizzato per svuotature a zigzag.
2021-12-07 11:47:48 +01:00
DarioS 8483c1609a EgtMachKernel 2.3k3 :
- ricompilazione per cambio versione.
2021-11-27 12:08:35 +01:00
DarioS 17c7be3a56 EgtMachKernel 2.3k2 :
- nella gestione link tra lavorazioni aggiunta possibilità di utilizzo script OnSpecialGetMaxZ che determina la Zmassima raggiungibile nel collegamento in funzione delle posizioni testa iniziale e finale.
2021-11-22 11:10:03 +01:00
DarioS cfb2fea0bd EgtMachKernel 2.3k1 :
- modifiche a Mortising per ricalcolo elevazione su attacco uscita indipendente da MaxElev.
2021-11-15 09:53:18 +01:00
DarioS ac17810065 EgtMachKernel 2.3j8 :
- aggiunta funzione lua EmtGetAllLinkedRawParts
- corretto calcolo GetPointUnderRaw.
2021-11-02 08:21:07 +01:00
DarioS 543afd4c7a EgtMachKernel 2.3j6 :
- adattamenti per modifiche a GeomKernel.
2021-10-24 18:10:31 +02:00
DarioS 73ce1f1018 EgtMachKernel 2.3j5 :
- aggiunta funzione EmtModifyHeadAuxDirection
- corretto scambio parametri attacco/uscita in fresatura cquando percorso invertito
- assi bloccati ora impostabili da lavorazione con nome asse oppure con suo token.
2021-10-14 11:07:49 +02:00
DarioS 23c0e1c8d5 EgtMachKernel 2.3j4 :
- in fresatura corretta gestione elevazione di attacco e uscita con OneWay.
2021-10-10 20:04:54 +02:00
DarioS 8e64f0ad00 EgtMachKernel 2.3j3 :
- in svuotature con lati aperti corretta elevazione attacco con testa da sotto.
2021-10-07 06:54:49 +02:00
DarioS 5a8fb790b0 EgtMachKernel 2.3j2 :
- corretto aggiornamento disegni utensili e dimensioni portautensili.
2021-10-05 20:19:21 +02:00
DarioS fa6928c593 EgtMachKernel :
- in Svuotature Oneway corretto errore con contorno esterno circonferenza.
2021-10-05 11:42:03 +02:00
DarioS 52a26ceb52 EgtMachKernel 2.3j1 :
- corretto controlli attacchi/uscite lame in fresature con testa da sotto.
2021-10-04 09:15:29 +02:00
DarioS bb8b6b9fc1 EgtMachKernel :
- aggiustamento per nuovo parametro richiesto da ISurfTriMesh::GetSilhouette.
2021-09-26 16:29:34 +02:00
DarioS 7b90e2b152 EgtMachKernel 2.3i7 :
- in fresature aggiunto Attacco Tang+Perp e Uscita Perp+Tang.
2021-09-25 12:50:10 +02:00
DarioS 5c6ad44bb5 EgtMachKernel 2.3i6 :
- aggiunta gestione anima per lame (CORE in SysNotes).
2021-09-16 12:44:41 +02:00
DarioS af688d4fb7 EgtMachKernel 2.3i5 :
- a MachMgr e sua interfaccia IMachMgr aggiunta funzione ChangeTable.
2021-09-13 15:50:39 +02:00
DarioS 01cb04ac96 EgtMachKernel 2.3i4 :
- migliorato controllo risalita tra percorsi di lavorazione e migliorata assegnazione Flag2 (se 1 allora a MaxZ).
2021-09-09 15:49:08 +02:00
DarioS 0c3ad1ebe5 EgtMachKernel 2.3i3 :
- corretta recente modifica per calcolo Zsafe in link tra lavorazioni.
2021-09-07 18:44:54 +02:00
DarioS 7b3a544c9f EgtMachKernel 2.3i2 :
- modifiche alla verifica Z sicura per link tra lavorazioni.
2021-09-07 18:04:02 +02:00
DarioS b3a13a94bb EgtMachKernel 2.3i1 :
- link tra lavorazioni con maggiori sicurezze
- corretta gestione svuotature da sotto con testa da sotto.
2021-09-06 10:24:14 +02:00
DarioS 8318dcc2a8 EgtMachKernel :
- nella lavorazione di Finitura Superfici è ora specificare quali superfici considerare (se non si specificano sono considerate tutte).
2021-08-29 19:31:35 +02:00
DarioS b18c309344 EgtMachKernel 2.3h2 :
- correzioni a Milling per lavorazioni con fresa inclinata rispetto ad un percorso piano.
2021-08-25 15:06:01 +02:00
112 changed files with 36212 additions and 6934 deletions
+21 -16
View File
@@ -17,9 +17,11 @@
#include "Axis.h"
#include "MachConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkGeoVector3d.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EGkUiUnits.h"
#include "/EgtDev/Include/EgtNumUtils.h"
using namespace std ;
@@ -46,6 +48,7 @@ Axis::Clone( void) const
pAx->m_sName = m_sName ;
pAx->m_sToken = m_sToken ;
pAx->m_bInvert = m_bInvert ;
pAx->m_dOffset = m_dOffset ;
pAx->m_nType = m_nType ;
pAx->m_ptPos = m_ptPos ;
pAx->m_vtDir = m_vtDir ;
@@ -109,19 +112,20 @@ Axis::GetGeomDB( void) const
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Axis::Axis( void)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr),
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_bInvert( false), m_dOffset( 0),
m_nType( MCH_AT_NONE), m_Stroke( {{0,0}}), m_dHomeVal( 0), m_dCurrVal( 0)
{
}
//----------------------------------------------------------------------------
bool
Axis::Set( const string& sName, const string& sToken, bool bInvert, int nType,
const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke, double dHome)
Axis::Set( const string& sName, const string& sToken, bool bInvert, double dOffset,
int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke, double dHome)
{
m_sName = sName ;
m_sToken = sToken ;
m_bInvert = bInvert ;
m_dOffset = dOffset ;
m_nType = nType ;
m_ptPos = ptPos ;
m_vtDir = vtDir ;
@@ -135,9 +139,8 @@ Axis::Set( const string& sName, const string& sToken, bool bInvert, int nType,
bool
Axis::Modify( const Point3d& ptPos, double dAxisMaxAdjust)
{
// Verifico che lo spostamento non superi il massimo ammesso
Vector3d vtDelta = ptPos - m_ptPos ;
Vector3d vtDeltaPerp = vtDelta - ( vtDelta * m_vtDir) * m_vtDir ;
// Verifico che lo spostamento perpendicolare alla sua direzione non superi il massimo ammesso
Vector3d vtDeltaPerp = OrthoCompo( ptPos - m_ptPos, m_vtDir) ;
if ( vtDeltaPerp.Len() > dAxisMaxAdjust) {
string sOut = " Modify Axis " + m_sName + " Position (" + ToString( ptPos) + ") failed" ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
@@ -145,6 +148,11 @@ Axis::Modify( const Point3d& ptPos, double dAxisMaxAdjust)
}
// Assegno la nuova posizione
m_ptPos = ptPos ;
// Sistemo la geometria dell'asse
int nV = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, m_sName) ;
IGeoVector3d* pGV = GetGeoVector3d( m_pGeomDB->GetGeoObj( nV)) ;
if ( pGV != nullptr)
pGV->ChangeBase( m_ptPos) ;
return true ;
}
@@ -162,6 +170,11 @@ Axis::Modify( const Vector3d& vtDir, double dAxisMaxRotAdj)
}
// Assegno la nuova direzione
m_vtDir = vtDirN ;
// Sistemo la geometria dell'asse
int nV = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, m_sName) ;
IGeoVector3d* pGV = GetGeoVector3d( m_pGeomDB->GetGeoObj( nV)) ;
if ( pGV != nullptr)
pGV->ChangeVector( m_vtDir) ;
return true ;
}
@@ -170,10 +183,7 @@ bool
Axis::Modify( const STROKE& Stroke)
{
m_Stroke = Stroke ;
if ( m_dHomeVal < m_Stroke.Min)
m_dHomeVal = m_Stroke.Min ;
else if ( m_dHomeVal > m_Stroke.Max)
m_dHomeVal = m_Stroke.Max ;
m_dHomeVal = Clamp( m_dHomeVal, m_Stroke.Min, m_Stroke.Max) ;
return true ;
}
@@ -181,12 +191,7 @@ Axis::Modify( const STROKE& Stroke)
bool
Axis::Modify( double dHome)
{
if ( dHome < m_Stroke.Min)
m_dHomeVal = m_Stroke.Min ;
else if ( dHome > m_Stroke.Max)
m_dHomeVal = m_Stroke.Max ;
else
m_dHomeVal = dHome ;
m_dHomeVal = Clamp( dHome, m_Stroke.Min, m_Stroke.Max) ;
return true ;
}
+7 -4
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2022
//----------------------------------------------------------------------------
// File : Axis.h Data : 24.05.15 Versione : 1.6e7
// File : Axis.h Data : 21.09.22 Versione : 2.4i
// Contenuto : Dichiarazione della classe Axis.
//
//
@@ -30,8 +30,8 @@ class Axis : public IUserObj
public :
Axis( void) ;
bool Set( const std::string& sName, const std::string& sToken, bool bInvert, int nType,
const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke, double dHome) ;
bool Set( const std::string& sName, const std::string& sToken, bool bInvert, double dOffset,
int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke, double dHome) ;
bool Modify( const Point3d& ptPos, double dAxisMaxAdjust) ;
bool Modify( const Vector3d& vtDir, double dAxisMaxRotAdj) ;
bool Modify( const STROKE& Stroke) ;
@@ -44,6 +44,8 @@ class Axis : public IUserObj
{ return m_sToken ; }
bool GetInvert( void) const
{ return m_bInvert ; }
double GetOffset( void) const
{ return m_dOffset ; }
int GetType( void) const
{ return m_nType ; }
const Point3d& GetPos( void) const
@@ -63,6 +65,7 @@ class Axis : public IUserObj
std::string m_sName ;
std::string m_sToken ;
bool m_bInvert ;
double m_dOffset ;
int m_nType ;
Point3d m_ptPos ;
Vector3d m_vtDir ;
+29 -8
View File
@@ -1,13 +1,14 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2016
// EgalTech 2015-2023
//----------------------------------------------------------------------------
// File : CamData.cpp Data : 24.02.16 Versione : 1.6n8
// File : CamData.cpp Data : 22.11.23 Versione : 2.5k3
// Contenuto : Implementazione informazioni Cam di ogni movimento.
//
//
//
// Modifiche : 10.06.15 DS Creazione modulo.
// 24.02.16 DS Versione 2 (aggiunti m_nMove e m_ptCen).
// 22.11.23 DS Aggiunto flag ToolShow (forza in ogni caso la visualizzazione della direzione utensile).
//
//----------------------------------------------------------------------------
@@ -53,7 +54,9 @@ static int CAM_PARAM_V7 = 22 ;
static string CAM_ORIGFEED = "OrFeed" ;
static int CAM_PARAM_V8 = 23 ;
static string CAM_FLAG2 = "Flg2" ;
static int CAM_TOTPARAM =CAM_PARAM_V8 ;
static int CAM_PARAM_V9 = 24 ;
static string CAM_TOOLSHOW = "TSh" ;
static int CAM_TOTPARAM = CAM_PARAM_V9 ;
//----------------------------------------------------------------------------
@@ -79,6 +82,7 @@ CamData::Clone( void) const
pCam->m_pGeomDB = nullptr ;
pCam->m_nMove = m_nMove ;
pCam->m_nCorre = m_nCorre ;
pCam->m_bToolShow = m_bToolShow ;
pCam->m_vtTool = m_vtTool ;
pCam->m_vtCorr = m_vtCorr ;
pCam->m_vtAux = m_vtAux ;
@@ -139,6 +143,7 @@ CamData::Dump( string& sOut, bool bMM, const char* szNewLine) const
sOut += CAM_AXND + "=" + ToString( m_vtMachN) + szNewLine ;
sOut += CAM_NDLT + "=" + ToString( m_dDeltaN) + szNewLine ;
sOut += CAM_BDIR + "=" + ToString( m_vtBackAux) + szNewLine ;
sOut += CAM_TOOLSHOW + "=" + ToString( m_bToolShow) + szNewLine ;
return true ;
}
@@ -149,6 +154,8 @@ CamData::SetOwner( int nId, IGeomDB* pGDB)
{
m_nOwnerId = nId ;
m_pGeomDB = pGDB ;
if ( m_pGeomDB != nullptr)
m_pGeomDB->SetStipple( m_nOwnerId, ( m_nMove == 0 ? 3 : 0), 0x8C8C) ;
return ( m_nOwnerId != GDB_ID_NULL && m_pGeomDB != nullptr) ;
}
@@ -203,6 +210,8 @@ CamData::Save( int nBaseId, STRVECTOR& vString) const
vString[++k] = CAM_ORIGFEED + "=" + ToString( m_dOrigFeed) ;
// parametri aggiunti V8
vString[++k] = CAM_FLAG2 + "=" + ToString( m_nFlag2) ;
// parametri aggiunti V9
vString[++k] = CAM_TOOLSHOW + "=" + ToString( m_bToolShow) ;
}
catch( ...) {
return false ;
@@ -295,6 +304,14 @@ CamData::Load( const STRVECTOR& vString, int nBaseGdbId)
else {
m_nFlag2 = 0 ;
}
// parametri aggiunti V9
if ( int( vString.size()) >= CAM_PARAM_V9) {
if ( ! GetVal( vString[++k], CAM_TOOLSHOW, m_bToolShow))
return false ;
}
else {
m_bToolShow = false ;
}
return true ;
}
@@ -311,7 +328,7 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const
PolyLine& PL = lstPL.back() ;
// dimensioni
const double TLEN = 40 ;
const double ALEN = 4 ;
const double ALEN = 1 ;
// inserisco disegno nella polilinea
PL.AddUPoint( 0, m_ptEnd) ;
Point3d ptTip = m_ptEnd + m_vtTool * TLEN ;
@@ -333,6 +350,9 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const
ptP6.ToGlob( frF) ;
PL.AddUPoint( 6, ptP6) ;
PL.AddUPoint( 6, ptTip) ;
// da visualizzare sempre se richiesto
if ( m_bToolShow)
PL.SetTempProp( 1) ;
}
// se vettore correzione non nullo
if ( ! m_vtCorr.IsSmall()) {
@@ -342,14 +362,14 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const
PolyLine& PL = lstPL.back() ;
// dimensioni
const double CLEN = 20 ;
const double ALEN = 2 ;
const double ALEN = 1 ;
// inserisco disegno nella polilinea
PL.AddUPoint( 0, m_ptEnd) ;
Point3d ptTip = m_ptEnd + m_vtCorr * CLEN ;
PL.AddUPoint( 1, ptTip) ;
// aggiungo simil-freccia
Frame3d frF ;
if ( m_vtTool. IsSmall())
if ( m_vtTool. IsSmall() || AreSameOrOppositeVectorApprox( m_vtTool, m_vtCorr))
frF.Set( ptTip, m_vtCorr) ;
else
frF.Set( ptTip, m_vtCorr, m_vtTool) ;
@@ -371,14 +391,14 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const
PolyLine& PL = lstPL.back() ;
// dimensioni
const double CLEN = 20 ;
const double ALEN = 2 ;
const double ALEN = 1 ;
// inserisco disegno nella polilinea
PL.AddUPoint( 0, m_ptEnd) ;
Point3d ptTip = m_ptEnd + m_vtAux * CLEN ;
PL.AddUPoint( 1, ptTip) ;
// aggiungo simil-freccia
Frame3d frF ;
if ( m_vtTool. IsSmall())
if ( m_vtTool. IsSmall() || AreSameOrOppositeVectorApprox( m_vtTool, m_vtAux))
frF.Set( ptTip, m_vtAux) ;
else
frF.Set( ptTip, m_vtAux, m_vtTool) ;
@@ -546,6 +566,7 @@ CamData::CamData( void)
m_pGeomDB = nullptr ;
m_nMove = 0 ;
m_nCorre = 0 ;
m_bToolShow = false ;
m_dAngCen = 0 ;
m_dDeltaN = 0 ;
m_dFeed = 0 ;
+10 -5
View File
@@ -68,11 +68,13 @@ class CamData : public IUserObj
bool SetAxesAngCen( double dAngCen) ;
bool SetAxesNormDir( const Vector3d& vtDir) ;
bool SetBackAuxDir( const Vector3d& vtDir) ;
const int GetMoveType( void) const
bool SetToolShow( bool bShow)
{ m_bToolShow = bShow ; return true ; }
int GetMoveType( void) const
{ return m_nMove ; }
const bool IsLine( void) const
bool IsLine( void) const
{ return ( m_nMove == 0 || m_nMove == 1) ; }
const bool IsArc( void) const
bool IsArc( void) const
{ return ( m_nMove == 2 || m_nMove == 3) ; }
const Vector3d& GetToolDir( void) const
{ return m_vtTool ; }
@@ -108,14 +110,16 @@ class CamData : public IUserObj
{ return m_vMachAxes ; }
const Point3d& GetAxesCen( void) const
{ return m_ptMachCen ; }
const double GetAxesRad( void) const
double GetAxesRad( void) const
{ return m_dMachRad ; }
const double GetAxesAngCen( void) const
double GetAxesAngCen( void) const
{ return m_dMachAngCen ; }
const Vector3d& GetAxesNormDir( void) const
{ return m_vtMachN ; }
const Vector3d& GetBackAuxDir( void) const
{ return m_vtBackAux ; }
bool GetToolShow( void) const
{ return m_bToolShow ; }
public :
enum { AS_NONE = 0,
@@ -139,6 +143,7 @@ class CamData : public IUserObj
IGeomDB* m_pGeomDB ;
int m_nMove ; // tipo movimento (0=rapido, 1=lineare, 2=arco CW, 3=arco CCW)
int m_nCorre ; // tipo correzione (0, 41, 42, 141, 142, 40)
bool m_bToolShow ; // flag per forzare la visualizzazione della direzione utensile in ogni caso
Vector3d m_vtTool ; // versore fresa
Vector3d m_vtCorr ; // versore correzione
Vector3d m_vtAux ; // versore ausiliario
+51 -21
View File
@@ -503,9 +503,17 @@ Chiseling::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nChisels = nCurrChisels ;
LOG_DBG_INFO( GetEMkLogger(), "Chiseling apply skipped : status already ok") ;
string sLog = string( "Chiseling apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -570,6 +578,8 @@ Chiseling::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "Chiseling apply done") ;
return true ;
}
@@ -587,15 +597,11 @@ Chiseling::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
@@ -763,15 +769,39 @@ Chiseling::UpdateToolData( bool* pbChanged)
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
if ( pTMgr == nullptr)
return false ;
// recupero l'utensile nel DB utensili
// recupero l'utensile nel DB utensili (se fallisce con UUID provo con il nome)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
if ( pTdata == nullptr) {
pTdata = pTMgr->GetTool( m_Params.m_sToolName) ;
if ( pTdata == nullptr)
return false ;
m_Params.m_ToolUuid = m_TParams.m_Uuid ;
}
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in Chiseling : tool name changed (" +
@@ -986,7 +1016,7 @@ Chiseling::GetCurves( SelData Id, ICURVEPLIST& lstPC)
// la porto in globale
pCrvCompo->ToGlob( frGlob) ;
// sistemazioni varie
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTHO, FACE_CONT, 0) ;
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTHO, FACE_CONT, V_NULL, 0) ;
// la restituisco
lstPC.emplace_back( Release( pCrvCompo)) ;
return true ;
@@ -1012,8 +1042,8 @@ Chiseling::GetCurves( SelData Id, ICURVEPLIST& lstPC)
for ( int nC = nCstart ; nC < nCend ; ++ nC) {
// recupero i contorni del chunk
for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) {
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL)))
PtrOwner<ICurveComposite> pCrvCompo ;
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL))))
return false ;
// assegno l'estrusione dalla normale alla regione
pCrvCompo->SetExtrusion( vtN) ;
@@ -1022,7 +1052,7 @@ Chiseling::GetCurves( SelData Id, ICURVEPLIST& lstPC)
// la porto in globale
pCrvCompo->ToGlob( frGlob) ;
// sistemazioni varie
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTHO, FACE_CONT, 0) ;
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTHO, FACE_CONT, V_NULL, 0) ;
// la restituisco
lstPC.emplace_back( Release( pCrvCompo)) ;
}
@@ -1493,7 +1523,7 @@ Chiseling::GenerateChiselingCl( const SqHole& hole, int nPathId)
SetAuxDir( hole.vtAux) ;
// 1 -> punto approccio
SetFlag( 1) ;
double dAppr = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dAppr = GetSafeZ() ;
Point3d ptP1 = hole.ptIni + hole.vtExtr * dAppr ;
if ( AddRapidStart( ptP1) == GDB_ID_NULL)
return false ;
+6 -2
View File
@@ -71,6 +71,10 @@ struct ChiselingData : public MachiningData
//----------------------------------------------------------------------------
inline const ChiselingData* GetChiselingData( const MachiningData* pMdata)
{ return (dynamic_cast<const ChiselingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_CHISELING)
return nullptr ;
return ( static_cast<const ChiselingData*>( pMdata)) ; }
inline ChiselingData* GetChiselingData( MachiningData* pMdata)
{ return (dynamic_cast<ChiselingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_CHISELING)
return nullptr ;
return ( static_cast<ChiselingData*>( pMdata)) ; }
+306 -56
View File
@@ -21,22 +21,24 @@
#include "/EgtDev/Include/EGkAngle.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EGnStringKeyVal.h"
#include "/EgtDev/Include/EGnFileUtils.h"
using namespace std ;
//------------------------------ Errors --------------------------------------
// 2001 = "Error adding fixture xx"
// 2002 = "Error placing fixture xx"
// 2003 = "Error in MoveToCornerRawPart xx"
// 2004 = "Error in MoveToCenterRawPart xx"
// 2005 = "Error in ApplyRotationToRawPart xx"
// 2006 = "Error in OnSpecialApplyDisposition (xxx)"
// 2007 = "Error in Disposition : axes values not calculable"
// 2008 = "Error in Disposition : outstroke xxx"
// 2009 = "Error in Disposition : link movements not calculable"
// 2010 = "Error in Disposition : link outstroke xxx"
// 2001 = "Error moving axis xx"
// 2002 = "Error adding fixture xx"
// 2003 = "Error placing fixture xx"
// 2004 = "Error in MoveToCornerRawPart xx"
// 2005 = "Error in MoveToCenterRawPart xx"
// 2006 = "Error in ApplyRotationToRawPart xx"
// 2007 = "Error in OnSpecialApplyDisposition (xxx)"
// 2008 = "Error in Disposition : axes values not calculable"
// 2009 = "Error in Disposition : outstroke xxx"
// 2010 = "Error in Disposition : link movements not calculable"
// 2011 = "Error in Disposition : link outstroke xxx"
// 2051 = "Table Ref1 changed : (xyz) -> (XYZ)"
// 2052 = "Warning in Disposition : No shifts"
// 2053 = "Warning in OnSpecialApplyDisposition (xxx)"
@@ -46,11 +48,15 @@ static string DIS_TABLE = "Tab" ;
static string DIS_PHASE = "Ph" ;
static string DIS_REF1 = "Ref1" ;
static string DIS_AREA1 = "Area1" ;
static string DIS_AXD_TOT = "AxT" ;
static string DIS_AXD_NAME = "AxN" ;
static string DIS_AXD_POS = "AxP" ;
static string DIS_FXD_TOT = "FxT" ;
static string DIS_FXD_NAME = "FxN" ;
static string DIS_FXD_POS = "FxP" ;
static string DIS_FXD_ANG = "FxA" ;
static string DIS_FXD_MOV = "FxM" ;
static string DIS_FXD_LINK = "FxL" ;
static string DIS_MVD_TOT = "MvT" ;
static string DIS_MVD_ID = "MvI" ;
static string DIS_MVD_TYPE = "MvT" ;
@@ -86,10 +92,13 @@ Disposition::Clone( void) const
// eseguo copia dei dati
if ( pDisp != nullptr) {
try { pDisp->m_sTabName = m_sTabName ;
pDisp->m_pMchMgr = m_pMchMgr ;
pDisp->m_nPhase = m_nPhase ;
pDisp->m_ptRef1 = m_ptRef1 ;
pDisp->m_b3Area1 = m_b3Area1 ;
pDisp->m_dAreaOffset = m_dAreaOffset ;
pDisp->m_bTabOk = m_bTabOk ;
pDisp->m_vAxData = m_vAxData ;
pDisp->m_vFixData = m_vFixData ;
pDisp->m_vMvrData = m_vMvrData ;
pDisp->m_sHead = m_sHead ;
@@ -118,12 +127,17 @@ Disposition::Dump( string& sOut, bool bMM, const char* szNewLine) const
sOut += DIS_REF1 + EQUAL + "(" + ToString( m_ptRef1, 3) + ")" + szNewLine ;
sOut += DIS_AREA1 + EQUAL + "(" + ToString( m_b3Area1, 3) + ")" + szNewLine ;
sOut += DIS_AREA1_OFFS + EQUAL + "(" + ToString( m_dAreaOffset) + ")" + szNewLine ;
for ( const auto& AxData : m_vAxData) {
sOut += "AxD=" + AxData.sName + "," +
ToString( AxData.dPos) + szNewLine ;
}
for ( const auto& FixData : m_vFixData) {
sOut += "FxD=" + FixData.sName + "," +
ToString( FixData.nId) + ",(" +
ToString( FixData.ptPos) + ")," +
ToString( FixData.dAng) + "," +
ToString( FixData.dMov) + szNewLine ;
ToString( FixData.dMov) + "," +
( IsEmptyOrSpaces( FixData.sTaLink) ? "__" : FixData.sTaLink) + szNewLine ;
}
for ( const auto& MvrData : m_vMvrData) {
sOut += "MvD=" + ToString( MvrData.nRawId) + "," ;
@@ -157,12 +171,14 @@ Disposition::Save( int nBaseId, STRVECTOR& vString) const
{
try {
int k = - 1 ;
int nAxdTot = int( m_vAxData.size()) ;
int nAxdLines = ( nAxdTot == 0 ? 0 : 1 + 2 * nAxdTot) ;
int nFxdTot = int( m_vFixData.size()) ;
int nFxdLines = 1 + 4 * nFxdTot ;
int nFxdLines = 1 + 5 * nFxdTot ;
int nMvdTot = int( m_vMvrData.size()) ;
int nMvdLines = 1 + 4 * nMvdTot ;
int nOther = 7 ;
vString.insert( vString.begin(), 4 + nFxdLines + nMvdLines + nOther, "") ;
vString.insert( vString.begin(), 4 + nAxdLines + nFxdLines + nMvdLines + nOther, "") ;
// Nome
if ( ! SetVal( DIS_TABLE, m_sTabName, vString[++k]))
return false ;
@@ -175,6 +191,16 @@ Disposition::Save( int nBaseId, STRVECTOR& vString) const
// Prima area
if ( ! SetVal( DIS_AREA1, m_b3Area1, vString[++k]))
return false ;
// Dati assi (se presenti)
if ( nAxdTot > 0) {
if ( ! SetVal( DIS_AXD_TOT, nAxdTot, vString[++k]))
return false ;
for ( const auto& AxData : m_vAxData) {
if ( ! SetVal( DIS_AXD_NAME, AxData.sName, vString[++k]) ||
! SetVal( DIS_AXD_POS, AxData.dPos, vString[++k]))
return false ;
}
}
// Dati sottopezzi
if ( ! SetVal( DIS_FXD_TOT, nFxdTot, vString[++k]))
return false ;
@@ -182,7 +208,8 @@ Disposition::Save( int nBaseId, STRVECTOR& vString) const
if ( ! SetVal( DIS_FXD_NAME, FixData.sName, vString[++k]) ||
! SetVal( DIS_FXD_POS, FixData.ptPos, vString[++k]) ||
! SetVal( DIS_FXD_ANG, FixData.dAng, vString[++k]) ||
! SetVal( DIS_FXD_MOV, FixData.dMov, vString[++k]))
! SetVal( DIS_FXD_MOV, FixData.dMov, vString[++k]) ||
! SetVal( DIS_FXD_LINK, FixData.sTaLink, vString[++k]))
return false ;
}
// Dati posizionamento grezzi
@@ -235,12 +262,27 @@ Disposition::Load( const STRVECTOR& vString, int nBaseGdbId)
// prima area
if ( ! GetVal( vString[++k], DIS_AREA1, m_b3Area1))
return false ;
// dati assi opzionali
int nAxdTot = 0 ;
if ( ! GetVal( vString[++k], DIS_AXD_TOT, nAxdTot))
-- k ;
int nAxdLines = ( nAxdTot == 0 ? 0 : 1 + 2 * nAxdTot) ;
if ( nAxdTot > 0) {
if ( int( vString.size()) < 3 + nAxdLines + 1)
return false ;
m_vAxData.insert( m_vAxData.begin(), nAxdTot, AxisData()) ;
for ( auto& AxData : m_vAxData) {
if ( ! GetVal( vString[++k], DIS_AXD_NAME, AxData.sName) ||
! GetVal( vString[++k], DIS_AXD_POS, AxData.dPos))
return false ;
}
}
// dati sottopezzi
int nFxdTot ;
if ( ! GetVal( vString[++k], DIS_FXD_TOT, nFxdTot))
return false ;
int nFxdLines = 1 + 3 * nFxdTot ;
if ( int( vString.size()) < 3 + nFxdLines + 1)
if ( int( vString.size()) < 3 + nAxdLines + nFxdLines + 1)
return false ;
m_vFixData.insert( m_vFixData.begin(), nFxdTot, FixtureData()) ;
for ( auto& FixData : m_vFixData) {
@@ -254,13 +296,17 @@ Disposition::Load( const STRVECTOR& vString, int nBaseGdbId)
if ( ! GetVal( vString[++k], DIS_FXD_MOV, FixData.dMov))
-- k ;
}
if ( k + 1 < int( vString.size())) {
if ( ! GetVal( vString[++k], DIS_FXD_LINK, FixData.sTaLink))
-- k ;
}
}
// dati posizionamento grezzi
int nMvdTot ;
if ( ! GetVal( vString[++k], DIS_MVD_TOT, nMvdTot))
return false ;
int nMvdLines = 1 + 4 * nMvdTot ;
if ( int( vString.size()) < 3 + nFxdLines + nMvdLines)
if ( int( vString.size()) < 3 + nAxdLines + nFxdLines + nMvdLines)
return false ;
m_vMvrData.insert( m_vMvrData.begin(), nMvdTot, MoveRawData()) ;
for ( auto& MvrData : m_vMvrData) {
@@ -306,7 +352,7 @@ Disposition::Load( const STRVECTOR& vString, int nBaseGdbId)
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Disposition::Disposition( void)
: m_bTabOk( false), m_nExit( 0), m_nStatus( MCH_ST_TO_VERIFY), m_nShifts( 0), m_bSomeByHand( false), m_dAreaOffset({{0,0,0,0}})
: m_bTabOk( false), m_dAreaOffset({{0,0,0,0}}), m_nExit( 0), m_nStatus( MCH_ST_TO_VERIFY), m_nShifts( 0), m_bSomeByHand( false)
{
}
@@ -433,6 +479,16 @@ Disposition::Apply( bool bVerifyTab)
if ( ( ! m_bTabOk || bVerifyTab) && ! SetTable( m_sTabName))
return false ;
bool bOk = true ;
// annullo movimento assi
m_pMchMgr->ResetAllAxesPos( false, true) ;
// aggiornamento movimenti assi
for ( auto& AxData : m_vAxData) {
if ( ! m_pMchMgr->SetAxisPos( AxData.sName, AxData.dPos)) {
string sOut = "Error moving axis " + AxData.sName ;
m_pMchMgr->SetLastError( 2001, sOut) ;
bOk = false ;
}
}
// aggiornamento sottopezzi
for ( auto& FixData : m_vFixData) {
// se sottopezzo da caricare
@@ -440,7 +496,7 @@ Disposition::Apply( bool bVerifyTab)
int nId = AddFixture( FixData.sName, GDB_ID_NULL, FixData.ptPos, FixData.dAng, FixData.dMov, false) ;
if ( nId == GDB_ID_NULL) {
string sOut = "Error adding fixture " + FixData.sName ;
m_pMchMgr->SetLastError( 2001, sOut) ;
m_pMchMgr->SetLastError( 2002, sOut) ;
bOk = false ;
}
else
@@ -450,7 +506,7 @@ Disposition::Apply( bool bVerifyTab)
else {
if ( ! PlaceFixture( FixData.nId, FixData.ptPos, FixData.dAng, FixData.dMov)) {
string sOut = "Error placing fixture " + ToString( FixData.nId) ;
m_pMchMgr->SetLastError( 2002, sOut) ;
m_pMchMgr->SetLastError( 2003, sOut) ;
bOk = false ;
}
}
@@ -472,21 +528,21 @@ Disposition::Apply( bool bVerifyTab)
case MoveRawData::COR :
if ( ! MoveToCornerRawPart( vMvrData.nRawId, vMvrData.ptP, vMvrData.nFlag, false, false)) {
string sOut = "Error in MoveToCornerRawPart " + ToString( vMvrData.nRawId) ;
m_pMchMgr->SetLastError( 2003, sOut) ;
m_pMchMgr->SetLastError( 2004, sOut) ;
bOk = false ;
}
break ;
case MoveRawData::CEN :
if ( ! MoveToCenterRawPart( vMvrData.nRawId, vMvrData.ptP, vMvrData.nFlag, false, false)) {
string sOut = "Error in MoveToCenterRawPart " + ToString( vMvrData.nRawId) ;
m_pMchMgr->SetLastError( 2004, sOut) ;
m_pMchMgr->SetLastError( 2005, sOut) ;
bOk = false ;
}
break ;
case MoveRawData::ROT :
if ( ! ApplyRotationToRawPart( vMvrData.nRawId, vMvrData.ptP.x, vMvrData.ptP.y, vMvrData.ptP.z, false)) {
string sOut = "Error in ApplyRotationToRawPart " + ToString( vMvrData.nRawId) ;
m_pMchMgr->SetLastError( 2005, sOut) ;
m_pMchMgr->SetLastError( 2006, sOut) ;
bOk = false ;
}
break ;
@@ -518,6 +574,69 @@ Disposition::IsInTable( const BBox3d& b3B)
return b3AllArea.EnclosesXY( b3B) ;
}
//----------------------------------------------------------------------------
bool
Disposition::MoveAxis( const string& sName, double dPos)
{
// verifico MachMgr e GeomDB
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// verifico tavola
if ( ! m_bTabOk && ! SetTable( m_sTabName))
return false ;
// verifico sia un asse di disposizione (ovvero dipendente dalla tavola)
if ( ! m_pMchMgr->IsDispositionAxis( sName, m_sTabName))
return false ;
// cerco eventuale movimento dello stesso asse già inserito
int nInd = -1 ;
for ( int i = 0 ; i < int( m_vAxData.size()) ; ++ i) {
if ( m_vAxData[i].sName == sName) {
nInd = i ;
break ;
}
}
// eseguo movimento
if ( ! m_pMchMgr->SetAxisPos( sName, dPos))
return false ;
// salvo movimento
if ( nInd < 0)
m_vAxData.emplace_back( sName, dPos) ;
else
m_vAxData[nInd].dPos = dPos ;
m_nStatus |= MCH_ST_GEO_MODIF ;
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::RemoveAxis( const string& sName)
{
// verifico MachMgr e GeomDB
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// verifico tavola
if ( ! m_bTabOk && ! SetTable( m_sTabName))
return false ;
// verifico sia un asse di disposizione (ovvero dipendente dalla tavola)
if ( ! m_pMchMgr->IsDispositionAxis( sName, m_sTabName))
return false ;
// cerco eventuale movimento dello stesso asse già inserito
int nInd = -1 ;
for ( int i = 0 ; i < int( m_vAxData.size()) ; ++ i) {
if ( m_vAxData[i].sName == sName) {
nInd = i ;
break ;
}
}
// se non trovato, non devo fare alcunché
if ( nInd < 0)
return true ;
// rimetto asse in home e rimuovo movimento dalla lista
m_pMchMgr->ResetAxisPos( sName) ;
m_vAxData.erase( m_vAxData.begin() + nInd) ;
return true ;
}
//----------------------------------------------------------------------------
int
Disposition::AddFixture( const string& sName, int nId, const Point3d& ptPos, double dAngDeg,
@@ -615,20 +734,26 @@ Disposition::AddFixture( const string& sName, int nId, const Point3d& ptPos, dou
return GDB_ID_NULL ;
}
// muovo eventuale parte mobile
double dMovEff = dMov ;
int nMobId = m_pGeomDB->GetFirstNameInGroup( nFixtId, FXT_MOBILE) ;
if ( nMobId != GDB_ID_NULL) {
double dMinVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MINPOS, dMinVal) ;
double dMaxVal = INFINITO ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MAXPOS, dMaxVal) ;
double dCurrVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_CPOS, dCurrVal) ;
if ( abs( dMov - dCurrVal) > EPS_SMALL) {
dMovEff = Clamp( dMov, dMinVal, dMaxVal) ;
if ( abs( dMovEff - dCurrVal) > EPS_SMALL) {
Vector3d vtDir = Z_AX ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MOVEDIR, vtDir) ;
m_pGeomDB->TranslateGroup( nMobId, (dMov - dCurrVal) * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, dMov) ;
m_pGeomDB->TranslateGroup( nMobId, ( dMovEff - dCurrVal) * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, dMovEff) ;
}
}
// se da aggiungere alla lista
if ( bAddToList) {
m_vFixData.emplace_back( sName, nFixtId, ptPos, dAngDeg, dMov) ;
m_vFixData.emplace_back( sName, nFixtId, ptPos, dAngDeg, dMovEff) ;
m_nStatus |= MCH_ST_GEO_MODIF ;
}
return nFixtId ;
@@ -732,6 +857,31 @@ Disposition::RotateFixture( int nId, double dDeltaAngDeg)
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::SetFixtureLink( int nId, const string& sTaLink)
{
// verifica validità sottopezzo
if ( m_pMchMgr == nullptr || ! m_pMchMgr->VerifyFixtureInGroup( nId, false))
return false ;
// verifico aggiornamento tavola
if ( ! m_bTabOk && ! SetTable( m_sTabName))
return false ;
// verifico ch eil link sia un asse di disposizione (ovvero dipendente dalla tavola)
if ( ! m_pMchMgr->IsDispositionAxis( sTaLink, m_sTabName))
return false ;
// aggiorno la posizione dell'oggetto nel vettore dei comandi
for ( auto& FixData : m_vFixData) {
if ( FixData.nId == nId) {
FixData.sTaLink = sTaLink ;
break ;
}
}
// imposto stato a modificato
m_nStatus |= MCH_ST_PARAM_MODIF ;
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::MoveFixtureMobile( int nId, double dDeltaMov)
@@ -742,22 +892,72 @@ Disposition::MoveFixtureMobile( int nId, double dDeltaMov)
// verifico aggiornamento tavola
if ( ! m_bTabOk && ! SetTable( m_sTabName))
return false ;
// muovo eventuale parte mobile
// recupero la parte mobile
int nMobId = m_pGeomDB->GetFirstNameInGroup( nId, FXT_MOBILE) ;
if ( nMobId != GDB_ID_NULL) {
double dCurrVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_CPOS, dCurrVal) ;
if ( abs( dDeltaMov) > EPS_SMALL) {
Vector3d vtDir = Z_AX ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MOVEDIR, vtDir) ;
m_pGeomDB->TranslateGroup( nMobId, dDeltaMov * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, ( dCurrVal + dDeltaMov)) ;
}
}
if ( nMobId == GDB_ID_NULL)
return false ;
// recupero limiti di corsa e posizione
double dMinVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MINPOS, dMinVal) ;
double dMaxVal = INFINITO ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MAXPOS, dMaxVal) ;
double dCurrVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_CPOS, dCurrVal) ;
// verifico movimento richiesto e fattibile non nullo
double dDeltaEff = Clamp( dCurrVal + dDeltaMov, dMinVal, dMaxVal) - dCurrVal ;
if ( abs( dDeltaEff) < EPS_SMALL)
return true ;
// eseguo il movimento
Vector3d vtDir = Z_AX ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MOVEDIR, vtDir) ;
m_pGeomDB->TranslateGroup( nMobId, dDeltaEff * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, ( dCurrVal + dDeltaEff)) ;
// aggiorno la posizione dell'oggetto nel vettore dei comandi
for ( auto& FixData : m_vFixData) {
if ( FixData.nId == nId) {
FixData.dMov += dDeltaMov ;
FixData.dMov += dDeltaEff ;
break ;
}
}
// imposto stato a modificato
m_nStatus |= MCH_ST_PARAM_MODIF ;
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::SetFixtureMobile( int nId, double dMov)
{
// verifica validità sottopezzo
if ( m_pMchMgr == nullptr || ! m_pMchMgr->VerifyFixtureInGroup( nId, false))
return false ;
// verifico aggiornamento tavola
if ( ! m_bTabOk && ! SetTable( m_sTabName))
return false ;
// recupero la parte mobile
int nMobId = m_pGeomDB->GetFirstNameInGroup( nId, FXT_MOBILE) ;
if ( nMobId == GDB_ID_NULL)
return false ;
// recupero limiti di corsa e posizione
double dMinVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MINPOS, dMinVal) ;
double dMaxVal = INFINITO ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MAXPOS, dMaxVal) ;
double dCurrVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_CPOS, dCurrVal) ;
// verifico movimento richiesto e fattibile non nullo
double dMovEff = Clamp( dMov, dMinVal, dMaxVal) ;
if ( abs( dMovEff - dCurrVal) < EPS_SMALL)
return true ;
// eseguo il movimento
Vector3d vtDir = Z_AX ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MOVEDIR, vtDir) ;
m_pGeomDB->TranslateGroup( nMobId, ( dMovEff - dCurrVal) * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, dMovEff) ;
// aggiorno la posizione dell'oggetto nel vettore dei comandi
for ( auto& FixData : m_vFixData) {
if ( FixData.nId == nId) {
FixData.dMov = dMovEff ;
break ;
}
}
@@ -805,15 +1005,21 @@ Disposition::PlaceFixture( int nId, const Point3d& ptPos, double dAngDeg, double
if ( abs( dAngDeg) > EPS_ANG_SMALL)
m_pGeomDB->RotateGroup( nId, ORIG, Z_AX, dAngDeg) ;
// muovo eventuale parte mobile
double dMovEff = dMov ;
int nMobId = m_pGeomDB->GetFirstNameInGroup( nId, FXT_MOBILE) ;
if ( nMobId != GDB_ID_NULL) {
double dMinVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MINPOS, dMinVal) ;
double dMaxVal = INFINITO ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MAXPOS, dMaxVal) ;
double dCurrVal = 0 ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_CPOS, dCurrVal) ;
if ( abs( dMov - dCurrVal) > EPS_SMALL) {
dMovEff = Clamp( dMov, dMinVal, dMaxVal) ;
if ( abs( dMovEff - dCurrVal) > EPS_SMALL) {
Vector3d vtDir = Z_AX ;
m_pGeomDB->GetInfo( nMobId, FXT_MOB_MOVEDIR, vtDir) ;
m_pGeomDB->TranslateGroup( nMobId, ( dMov - dCurrVal) * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, dMov) ;
m_pGeomDB->TranslateGroup( nMobId, ( dMovEff - dCurrVal) * vtDir) ;
m_pGeomDB->SetInfo( nMobId, FXT_MOB_CPOS, dMovEff) ;
}
}
// aggiorno la posizione dell'oggetto nel vettore dei comandi
@@ -821,7 +1027,7 @@ Disposition::PlaceFixture( int nId, const Point3d& ptPos, double dAngDeg, double
if ( FixData.nId == nId) {
FixData.ptPos = ptPos ;
FixData.dAng = dAngDeg ;
FixData.dMov = dMov ;
FixData.dMov = dMovEff ;
break ;
}
}
@@ -885,7 +1091,7 @@ Disposition::MoveToCornerRawPart( int nRawId, const Point3d& ptP, int nFlag, boo
case MCH_CR_TR :
vtMove = ( m_ptRef1 + ptP) - Point3d( b3Raw.GetMax().x, b3Raw.GetMax().y, b3Raw.GetMin().z) ;
break ;
default : // RPCP_BL
default : // MCH_CR_BL
vtMove = ( m_ptRef1 + ptP) - b3Raw.GetMin() ;
break ;
case MCH_CR_BR :
@@ -936,7 +1142,7 @@ Disposition::MoveToCenterRawPart( int nRawId, const Point3d& ptP, int nFlag, boo
case MCH_CE_TC :
vtMove = ( m_ptRef1 + ptP) - Point3d( ptCen.x, b3Raw.GetMax().y, ptCen.z) ;
break ;
default : // RPCE_ML
default : // MCH_CE_ML
vtMove = ( m_ptRef1 + ptP) - Point3d( b3Raw.GetMin().x, ptCen.y, ptCen.z) ;
break ;
case MCH_CE_MR :
@@ -1060,7 +1266,7 @@ Disposition::RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg)
case MCH_CR_TR :
vtCorr = Vector3d( b3Raw.GetMax().x - b3OriRaw.GetMax().x, b3Raw.GetMax().y - b3OriRaw.GetMax().y, b3Raw.GetMin().z - b3OriRaw.GetMin().z) ;
break ;
default : // RPCP_BL
default : // MCH_CR_BL
vtCorr = Vector3d( b3Raw.GetMin().x - b3OriRaw.GetMin().x, b3Raw.GetMin().y - b3OriRaw.GetMin().y, b3Raw.GetMin().z - b3OriRaw.GetMin().z) ;
break ;
case MCH_CR_BR :
@@ -1075,7 +1281,7 @@ Disposition::RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg)
case MCH_CE_TC :
vtCorr = Vector3d( ptCen.x - ptOriCen.x, b3Raw.GetMax().y - b3OriRaw.GetMax().y, ptCen.z - ptOriCen.z) ;
break ;
default : // RPCE_ML
default : // MCH_CE_ML
vtCorr = Vector3d( b3Raw.GetMin().x - b3OriRaw.GetMin().x, ptCen.y - ptOriCen.y, ptCen.z - ptOriCen.z) ;
break ;
case MCH_CE_MR :
@@ -1205,6 +1411,23 @@ Disposition::InsertMoveInfoInList( int nRawId, int nType, const Point3d& ptP, in
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::UpdateRawPartId( int nRawId, int nNewRawId)
{
// aggiorno i movimenti registrati per questo grezzo
while ( true) {
auto iIter = find_if( m_vMvrData.begin(), m_vMvrData.end(),
[ nRawId]( const MoveRawData& Mrv)
{ return ( Mrv.nRawId == nRawId) ; }) ;
if ( iIter == m_vMvrData.end())
break ;
else
iIter->nRawId = nNewRawId ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::RemoveRawPart( int nRawId)
@@ -1227,10 +1450,26 @@ Disposition::RemoveRawPart( int nRawId)
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::GetMoveAxisData( int nInd, string& sName, double& dPos) const
{
// verifico MachMgr e GeomDB
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// verifico l'indice
if ( nInd < 0 || nInd >= int( m_vAxData.size()))
return false ;
// recupero i dati
sName = m_vAxData[nInd].sName ;
dPos = m_vAxData[nInd].dPos ;
return true ;
}
//----------------------------------------------------------------------------
bool
Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos,
double& dAngDeg, double& dMov) const
double& dAngDeg, double& dMov, string& sTaLink) const
{
// verifico MachMgr e GeomDB
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
@@ -1244,6 +1483,7 @@ Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos,
ptPos = m_vFixData[nInd].ptPos ;
dAngDeg = m_vFixData[nInd].dAng ;
dMov = m_vFixData[nInd].dMov ;
sTaLink = m_vFixData[nInd].sTaLink ;
return true ;
}
@@ -1294,6 +1534,7 @@ Disposition::SpecialApply( bool bRecalc)
static const string ON_SPECIAL_APPLY = "OnSpecialApplyDisposition" ;
if ( ! pMch->LuaExistsFunction( ON_SPECIAL_APPLY)) {
m_nStatus = MCH_ST_OK ;
LOG_DBG_INFO( GetEMkLogger(), "Disposition special apply not provided") ;
return true ;
}
@@ -1304,7 +1545,7 @@ Disposition::SpecialApply( bool bRecalc)
m_nShifts = nCurrShifts ;
m_bSomeByHand = bCurrSomeByHand ;
m_sTcPos = sCurrTcPos ;
LOG_DBG_INFO( GetEMkLogger(), "Disposition postapply skipped : status already ok") ;
LOG_DBG_INFO( GetEMkLogger(), "Disposition special apply skipped : status already ok") ;
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -1352,11 +1593,12 @@ Disposition::SpecialApply( bool bRecalc)
bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ;
// segnalo errori ed esco
if ( ! bOk || nErr > 0) {
m_nShifts = - 1 ;
if ( m_nShifts != -1)
m_nShifts = -2 ;
string sOut = sMsg ;
if ( IsEmptyOrSpaces( sOut))
sOut = " Error in " + ON_SPECIAL_APPLY + " (" + ToString( nErr) + ")" ;
m_pMchMgr->SetLastError( 2006, sOut) ;
m_pMchMgr->SetLastError( 2007, sOut) ;
return false ;
}
// recupero eventuale warning
@@ -1367,6 +1609,10 @@ Disposition::SpecialApply( bool bRecalc)
m_pMchMgr->SetWarning( 2053, sOut) ;
}
// assegno ingombri dei vari percorsi di lavorazione e della lavorazione nel suo complesso
nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ;
CalcAndSetBBox( nClId) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! SpecialUpdate())
return false ;
@@ -1374,6 +1620,7 @@ Disposition::SpecialApply( bool bRecalc)
// aggiorno stato
m_nStatus = MCH_ST_OK ;
LOG_DBG_INFO( GetEMkLogger(), "Disposition special apply ok") ;
return true ;
}
@@ -1387,28 +1634,31 @@ Disposition::SpecialUpdate( void)
// se disposizione vuota, esco
if ( m_nShifts <= 0) {
if ( m_nShifts < 0)
if ( m_nShifts == -2)
m_pMchMgr->SetWarning( 2052, "Warning in Disposition : No shifts") ;
return true ;
}
// calcolo assi macchina
if ( ! CalculateAxesValues( "")) {
if ( ! CalculateAxesValues( "", false)) {
string sInfo = m_pMchMgr->GetOutstrokeInfo() ;
if ( sInfo.empty())
m_pMchMgr->SetLastError( 2007, "Error in Disposition : axes values not calculable") ;
m_pMchMgr->SetLastError( 2008, "Error in Disposition : axes values not calculable") ;
else
m_pMchMgr->SetLastError( 2008, "Error in Disposition : outstroke ") ;
m_pMchMgr->SetLastError( 2009, "Error in Disposition : outstroke ") ;
return false ;
}
// gestione movimenti all'inizio di ogni singolo percorso di lavorazione e alla fine di tutti
if ( ! AdjustStartEndMovements()) {
string sInfo = m_pMchMgr->GetOutstrokeInfo() ;
if ( sInfo.empty())
m_pMchMgr->SetLastError( 2009, "Error in Disposition : link movements not calculable") ;
m_pMchMgr->SetLastError( 2010, "Error in Disposition : link movements not calculable") ;
else
m_pMchMgr->SetLastError( 2010, "Error in Disposition : link outstroke ") ;
m_pMchMgr->SetLastError( 2011, "Error in Disposition : link outstroke ") ;
return false ;
}
// assegno estremi degli assi dei vari percorsi di lavorazione e della lavorazione nel suo complesso
CalcAndSetAxesBBox() ;
return true ;
}
+31 -9
View File
@@ -15,6 +15,18 @@
#include "Operation.h"
//----------------------------------------------------------------------------
struct AxisData
{
std::string sName ; // nome dell'asse ausiliario da muovere
double dPos ; // posizione dell'asse
AxisData( void)
: sName(), dPos( 0) {}
AxisData( const std::string& sN, double dP)
: sName( sN), dPos( dP) {}
} ;
typedef std::vector<AxisData> AXDATAVECTOR ;
//----------------------------------------------------------------------------
struct FixtureData
{
@@ -23,8 +35,9 @@ struct FixtureData
Point3d ptPos ; // posizione nel riferimento tavola
double dAng ; // angolo di rotazione attorno al centro
double dMov ; // posizione eventuale parte mobile
std::string sTaLink ; // eventuale asse di tavola a cui è fissata
FixtureData( void)
: sName(), nId( GDB_ID_NULL), ptPos(), dAng( 0), dMov( 0) {}
: sName(), nId( GDB_ID_NULL), ptPos(), dAng( 0), dMov( 0), sTaLink() {}
FixtureData( const std::string& sN, int nI, const Point3d& ptP, double dA, double dM)
: sName( sN), nId( nI), ptPos( ptP), dAng( dA), dMov( dM) {}
} ;
@@ -56,14 +69,14 @@ class Disposition : public Operation
{ return true ; }
bool Save( int nBaseId, STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
int GetType( void) const override
{ return OPER_DISP ; }
bool IsEmpty( void) const override
{ return ( m_nShifts == 0) ; }
int GetType( void) const override
{ return OPER_DISP ; }
bool IsEmpty( void) const override
{ return ( m_nShifts == 0) ; }
bool UpdateStatus( int nModif) override
{ m_nStatus |= nModif ; return true ; }
{ m_nStatus |= nModif ; return true ; }
protected : // Operation
const std::string& GetToolName( void) const override ;
@@ -71,7 +84,7 @@ class Disposition : public Operation
int GetExitNbr( void) const override ;
const std::string& GetToolTcPos( void) const override ;
int GetSolCh( void) const override
{ return 0 ; }
{ return 0 ; }
bool NeedPrevHome( void) const override ;
public :
@@ -88,13 +101,17 @@ class Disposition : public Operation
bool GetTableRef1( Point3d& ptRef1) const ;
bool GetTableArea1( BBox3d& b3Area1) const ;
bool GetTableAreaOffset1( BBox3d& b3AreaOffs1) const ;
bool MoveAxis( const std::string& sName, double dPos) ;
bool RemoveAxis( const std::string& sName) ;
int AddFixture( const std::string& sName, int nId, const Point3d& ptPos, double dAngDeg = 0,
double dMov = 0, bool bAddToList = true) ;
int GetFirstFixture( void) ;
int GetNextFixture( int nId) ;
bool MoveFixture( int nId, const Vector3d& vtMove) ;
bool RotateFixture( int nId, double dDeltaAngDeg) ;
bool SetFixtureLink( int nId, const std::string& sTaLink) ;
bool MoveFixtureMobile( int nId, double dDeltaMov) ;
bool SetFixtureMobile( int nId, double dMov) ;
bool PlaceFixture( int nId, const Point3d& ptPos, double dAngDeg, double dMov) ;
bool RemoveFixture( int nId) ;
bool MoveToCornerRawPart( int nRawId, const Point3d& ptP, int nFlag, bool bAddToList = true, bool bVerify = true) ;
@@ -102,15 +119,19 @@ class Disposition : public Operation
bool MoveRawPart( int nRawId, const Vector3d& vtMove) ;
bool RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg) ;
bool ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADeg, double dAngC1Deg, bool bAddToList = true) ;
bool UpdateRawPartId( int nRawId, int nNewRawId) ;
bool RemoveRawPart( int nRawId) ;
bool GetMoveAxisData( int nInd, std::string& sName, double& dPos) const ;
bool GetFixtureData( int nInd, std::string& sName, int& nId, Point3d& ptPos,
double& dAngDeg, double& dMov) const ;
double& dAngDeg, double& dMov, std::string& sTaLink) const ;
bool GetMoveRawData( int nInd, int& nRawId, int& nType, Point3d& ptPos, int& nFlag) const ;
bool SpecialApply( bool bRecalc) ;
bool SpecialUpdate( void) ;
bool GetToolData( std::string& sName, std::string& sHead, int& nExit, std::string& sTcPos) const ;
bool GetSomeByHand( void) const
{ return m_bSomeByHand ; }
bool IsWithTool( void)
{ return ( m_nShifts != -1) ;}
private :
bool InsertMoveInfoInList( int nRawId, int nType, const Point3d& ptP, int nFlag) ;
@@ -123,6 +144,7 @@ class Disposition : public Operation
Point3d m_ptRef1 ; // origine 1 della tavola
BBox3d m_b3Area1 ; // area utile 1 della tavola
std::array<double,4> m_dAreaOffset ; // eventuali allargamenti dell'area sui 4 lati (0=XP, 1=YP, 2=XM, 3=YM)
AXDATAVECTOR m_vAxData ; // elenco movimenti assi ausiliari
FIXDATAVECTOR m_vFixData ; // elenco posizionamento bloccaggi
MVRDATAVECTOR m_vMvrData ; // elenco movimenti grezzi
std::string m_sHead ; // eventuale testa usata per muovere i pezzi
+1
View File
@@ -21,3 +21,4 @@
std::string GetEMkVer( void) ;
ILogger* GetEMkLogger( void) ;
const std::string& GetEMkKey( void) ;
bool GetEMkNetHwKey( void) ;
+2103 -149
View File
File diff suppressed because it is too large Load Diff
+67 -15
View File
@@ -18,8 +18,23 @@
#include "ToolData.h"
#include "MachiningConst.h"
//----------------------------------------------------------------------------
// definizione strutture e vettori per fori, utensili e maschere
struct Hole ;
struct MHDrill ;
struct HoleInfo ;
struct ToolInfo ;
class ICurve ;
typedef std::vector<MHDrill> TABMHDRILL ;
typedef std::vector<HoleInfo> VECTORHOLE ;
typedef std::vector<ToolInfo> VECTORTOOL ;
//----------------------------------------------------------------------------
// definizione tipologia foratura
const int DRILL_TYPE_ERR = 0 ;
const int DRILL_TYPE_STD = 1 ; // 1 tool
const int DRILL_TYPE_MULTI_FIXED = 2 ; // più utensili fissi
const int DRILL_TYPE_MULTI_SEL = 3 ; // più utensili selezionabili
//----------------------------------------------------------------------------
class Drilling : public Machining
@@ -62,24 +77,57 @@ class Drilling : public Machining
bool UpdateToolData( bool* pbChanged = nullptr) override ;
const ToolData& GetToolData( void) const override ;
bool GetGeometry( SELVECTOR& vIds) const override ;
bool GetSkippedGeometry( SELVECTOR& vIds) const override ;
public :
Drilling( void) ;
private :
bool GetHoleData( SelData Id, Hole& hole) ;
bool StdandardProcess( bool bRecalc, int nPvId, int nClId) ;
bool StandardProcess( bool bRecalc, int nPvId, int nClId) ;
bool AlongCurveProcess( bool bRecalc, int nPvId, int nClId) ;
bool Chain( int nGrpDestId) ;
ICurve* GetCurve( SelData Id) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool GenerateHolePv( int nInd, const SelData& nCircId, const std::string& sPName, int nPvId) ;
bool GenerateHoleCl( int nInd, const SelData& nCircId, const std::string& sPName, int nClId) ;
bool GenerateHoleCl( int nInd, const SelData& nCircId, const std::string& sPName, int nClId,
double dMHOff = 0, const Vector3d& vtAux = V_NULL, int nDrillType = DRILL_TYPE_STD,
INTVECTOR* pvActiveExit = nullptr, ToolInfo* currToolData = nullptr) ;
bool AdapthPathToMainTool( int nInd, const SelData& nCircId, const std::string& sPName, int nClId,
double dMHOff, const Vector3d& vtAux, int nDrillType,
INTVECTOR* pvActiveExit, ToolData* currToolData) ;
bool GenerateHoleRegionPv( int nFirstId, int nCount, int nPvId) ;
bool VerifyDiameter( double dHdiam, double dTdiam, double ddiamTol) ;
bool VerifyHoleFromBottom( const Hole& hole, SelData Id) ;
bool DoStandardDrilling( const Hole& hole, SelData Id, int nPathId) ;
bool DoPeckDrilling( const Hole& hole, SelData Id, int nPathId) ;
bool DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double nMHOff, const Vector3d& vtA, const ToolData& currToolData) ;
bool DoPeckDrilling( const Hole& hole, SelData Id, int nPathId, double dMHOff, const Vector3d& vtA, const ToolData& currToolData) ;
bool MultiHeadDrilling( const SELVECTOR& vId, int nClId, bool bFixed, TABMHDRILL& vDrills, double& dMHOff) ;
bool CalcMask( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nIndMT, const Vector3d& vtTool, const Vector3d& vtAux) ;
bool CalcMaskSel( VECTORHOLE& vHoles, const VECTORTOOL& vTools, const Vector3d& vtTool, const Vector3d& vtAux) ;
bool CalcDrilledHolesByConfig( VECTORHOLE& vHoles, int nMyInd, int nIndConfig, INTVECTOR& vIndDrilled) ;
bool EraseDuplicatedConfigs( VECTORHOLE& vHoles) ;
bool KeepMinRotatedConfigs( VECTORHOLE& vHoles, const Vector3d& vtAux, const Vector3d& vtTool) ;
bool CalcMultiHeadUndrilledHoles( const VECTORHOLE& vHoles, INTVECTOR& vIdUndrilledHoles) ;
bool CalcMultiHeadPartialDrilledHoles( const TABMHDRILL& vDrills, const VECTORHOLE& vHoles, const VECTORTOOL& vTools,
const INTVECTOR& vIdUndrilledHoles, INTDBLVECTOR& vIdPartialdrilledHoles) ;
bool CheckBasedConfig( const VECTORHOLE& vHoles, int nHoleInd, int& nValidConfig, bool& bBaseCase) ;
bool GetClosestHolesToHole( const VECTORHOLE& vHoles, int nMyInd, bool bDrilled, INTVECTOR& vInds) ;
bool OrderConfigsForSelectableTools( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nIndToolMain, TABMHDRILL& vDrills) ;
bool GetConfigsWithMoreDrilledHoles( const VECTORHOLE& vHoles, INTVECTOR& vInds) ;
bool ChooseBestConfigForSelectableTools( const VECTORHOLE& vHoles, int nIndToolMain, INTVECTOR& vConfInds, int& nBestConf) ;
bool CheckOtherHolesWithTools( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nIndTM, int nIndHTM, Hole holeICP,
const Frame3d& frHTM, const Frame3d& frHMTOP, double dDiamToler, int& nDrills) ;
bool GetHoleBestConfig( VECTORHOLE& vHoles, const VECTORTOOL& vTools, int nInd, TABMHDRILL& tabDrills, const Vector3d& vtAux, const Vector3d& vtTool, int& nOkHole) ;
bool MultiHeadVerifyHole( Hole& hole, const ToolData* Tool, double dDiamToler, SelData Id) ;
bool MultiHeadOrderConfig( TABMHDRILL& tabDrills, const VECTORHOLE& vHoles, const Vector3d& vtTool, const Vector3d& vtAux) ;
bool MultiHeadHoleToolsConfig( const VECTORHOLE& vHoles, int nConfig, INTINTVECTOR& vConfMask) ;
int VerifyMultiParallelDrills( void) ;
/* debug functions */
void PrintConfigs( const VECTORHOLE& vHoles) ;
void PrintDescent( const MHDrill& myMHDescent) ;
/* end debug functions */
private :
double GetSpeed() const
@@ -94,15 +142,19 @@ class Drilling : public Machining
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
DrillingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nDrillings ; // numero di fori generati
bool m_bTiltingTab ; // flag utilizzo tavola basculante
bool m_bAboveHead ; // flag utilizzo testa da sopra
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
double m_dDistBottom ; // distanza del foro dal bordo del grezzo
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
DrillingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nDrillings ; // numero di fori generati
bool m_bTiltingTab ; // flag utilizzo tavola basculante
Vector3d m_vtTiltingAx ; // versore direzione eventuale asse basculante
bool m_bAboveHead ; // flag utilizzo testa da sopra
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
double m_dDistBottom ; // distanza del foro dal bordo del grezzo
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
INTVECTOR m_vUndrilledId ; // vettore degli identificativi dei fori non svuotati
INTDBLVECTOR m_vPartialDrilledId ; // vettore degli identificatii dei fori lavorati parzialmente
// con profodnità mancante
} ;
+6 -2
View File
@@ -75,6 +75,10 @@ struct DrillingData : public MachiningData
//----------------------------------------------------------------------------
inline const DrillingData* GetDrillingData( const MachiningData* pMdata)
{ return (dynamic_cast<const DrillingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_DRILLING)
return nullptr ;
return ( static_cast<const DrillingData*>( pMdata)) ; }
inline DrillingData* GetDrillingData( MachiningData* pMdata)
{ return (dynamic_cast<DrillingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_DRILLING)
return nullptr ;
return ( static_cast<DrillingData*>( pMdata)) ; }
+15
View File
@@ -98,6 +98,7 @@ GetEMkLogger( void)
//-----------------------------------------------------------------------------
static std::string s_sKey ;
static bool s_bNetHwKey = false ;
//-----------------------------------------------------------------------------
void
@@ -106,9 +107,23 @@ SetEMkKey( const std::string& sKey)
s_sKey = sKey ;
}
//-----------------------------------------------------------------------------
void
SetEMkNetHwKey( bool bNetHwKey)
{
s_bNetHwKey = bNetHwKey ;
}
//-----------------------------------------------------------------------------
const std::string&
GetEMkKey( void)
{
return s_sKey ;
}
//-----------------------------------------------------------------------------
bool
GetEMkNetHwKey( void)
{
return s_bNetHwKey ;
}
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.645
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EgtMachKernel", "EgtMachKernel.vcxproj", "{0BD58222-92F3-48B2-B656-4497D1956874}"
EndProject
+44 -7
View File
@@ -21,13 +21,13 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{0BD58222-92F3-48B2-B656-4497D1956874}</ProjectGuid>
<RootNamespace>EgtMachKernel</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
@@ -39,7 +39,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -102,9 +102,10 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EMK;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<OpenMPSupport>true</OpenMPSupport>
<OpenMPSupport>false</OpenMPSupport>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAs>CompileAsCpp</CompileAs>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -132,6 +133,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAs>CompileAsCpp</CompileAs>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -165,6 +167,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -192,7 +195,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<PreprocessorDefinitions>WIN32;_WINDOWS;I_AM_EMK;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<OpenMPSupport>false</OpenMPSupport>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAs>CompileAsCpp</CompileAs>
@@ -200,6 +203,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -233,6 +237,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="EMkDllMain.cpp" />
<ClCompile Include="Estimator.cpp" />
<ClCompile Include="Exit.cpp" />
<ClCompile Include="FiveAxisMilling.cpp" />
<ClCompile Include="FiveAxisMillingData.cpp" />
<ClCompile Include="Generator.cpp" />
<ClCompile Include="GenMachining.cpp" />
<ClCompile Include="GenMachiningData.cpp" />
@@ -269,6 +275,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="OperationCL.cpp" />
<ClCompile Include="Pocketing.cpp" />
<ClCompile Include="PocketingData.cpp" />
<ClCompile Include="PocketingNT.cpp" />
<ClCompile Include="Processor.cpp" />
<ClCompile Include="SawFinishing.cpp" />
<ClCompile Include="SawFinishingData.cpp" />
@@ -277,7 +284,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="SawRoughing.cpp" />
<ClCompile Include="SawRoughingData.cpp" />
<ClCompile Include="SetupMgr.cpp" />
<ClCompile Include="Simulator.cpp" />
<ClCompile Include="SimulatorSP.cpp" />
<ClCompile Include="SimulatorMP.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
@@ -287,6 +295,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClCompile Include="Head.cpp" />
<ClCompile Include="SurfFinishing.cpp" />
<ClCompile Include="SurfFinishingData.cpp" />
<ClCompile Include="SurfRoughing.cpp" />
<ClCompile Include="SurfRoughingData.cpp" />
<ClCompile Include="Table.cpp" />
<ClCompile Include="TcPos.cpp" />
<ClCompile Include="ToolData.cpp" />
@@ -299,7 +309,15 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkArcSpecial.h" />
<ClInclude Include="..\Include\EGkBBox1d.h" />
<ClInclude Include="..\Include\EGkBBox3d.h" />
<ClInclude Include="..\Include\EGkCDeBoxPolyhedron.h" />
<ClInclude Include="..\Include\EGkBiArcs.h" />
<ClInclude Include="..\Include\EGkCalcPocketing.h" />
<ClInclude Include="..\Include\EGkCAvSilhouetteSurfTm.h" />
<ClInclude Include="..\Include\EGkCAvToolSurfTm.h" />
<ClInclude Include="..\Include\EGkCDeBoxClosedSurfTm.h" />
<ClInclude Include="..\Include\EGkCDeClosedSurfTmClosedSurfTm.h" />
<ClInclude Include="..\Include\EGkCDeConeFrustumClosedSurfTm.h" />
<ClInclude Include="..\Include\EGkCDeCylClosedSurfTm.h" />
<ClInclude Include="..\Include\EGkCDeSpheClosedSurfTm.h" />
<ClInclude Include="..\Include\EGkChainCurves.h" />
<ClInclude Include="..\Include\EGkColor.h" />
<ClInclude Include="..\Include\EGkCurve.h" />
@@ -307,8 +325,11 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkCurveAux.h" />
<ClInclude Include="..\Include\EGkCurveComposite.h" />
<ClInclude Include="..\Include\EGkCurveLine.h" />
<ClInclude Include="..\Include\EGkCurveLocal.h" />
<ClInclude Include="..\Include\EGkCurvePointDiffGeom.h" />
<ClInclude Include="..\Include\EGkDistPointCurve.h" />
<ClInclude Include="..\Include\EGkDistPointLine.h" />
<ClInclude Include="..\Include\EGkDistPointSurfTm.h" />
<ClInclude Include="..\Include\EGkExtText.h" />
<ClInclude Include="..\Include\EGkFrame3d.h" />
<ClInclude Include="..\Include\EGkGdbConst.h" />
@@ -321,10 +342,13 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkGeoObjType.h" />
<ClInclude Include="..\Include\EGkGeoPoint3d.h" />
<ClInclude Include="..\Include\EGkGeoVector3d.h" />
<ClInclude Include="..\Include\EGkHashGrids1d.h" />
<ClInclude Include="..\Include\EGkHashGrids2d.h" />
<ClInclude Include="..\Include\EGkIntersCurves.h" />
<ClInclude Include="..\Include\EGkIntersCurveSurfTm.h" />
<ClInclude Include="..\Include\EGkIntersLineSurfTm.h" />
<ClInclude Include="..\Include\EGkIntersLineTria.h" />
<ClInclude Include="..\Include\EGkIntersPlaneSurfTm.h" />
<ClInclude Include="..\Include\EGkIntervals.h" />
<ClInclude Include="..\Include\EGkLuaAux.h" />
<ClInclude Include="..\Include\EGkMaterial.h" />
@@ -335,7 +359,10 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkPoint3d.h" />
<ClInclude Include="..\Include\EGkPointGrid3d.h" />
<ClInclude Include="..\Include\EGkPolyArc.h" />
<ClInclude Include="..\Include\EGkPolygon3d.h" />
<ClInclude Include="..\Include\EGkPolygonElevation.h" />
<ClInclude Include="..\Include\EGkPolyLine.h" />
<ClInclude Include="..\Include\EGkQuaternion.h" />
<ClInclude Include="..\Include\EGkSelection.h" />
<ClInclude Include="..\Include\EGkSfrCreate.h" />
<ClInclude Include="..\Include\EGkStmFromCurves.h" />
@@ -343,6 +370,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkStringUtils3d.h" />
<ClInclude Include="..\Include\EGkSurf.h" />
<ClInclude Include="..\Include\EGkSurfFlatRegion.h" />
<ClInclude Include="..\Include\EGkSurfLocal.h" />
<ClInclude Include="..\Include\EGkSurfTriMesh.h" />
<ClInclude Include="..\Include\EGkTriangle3d.h" />
<ClInclude Include="..\Include\EGkUiUnits.h" />
@@ -352,6 +380,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EGkVolZmap.h" />
<ClInclude Include="..\Include\EGnEgtUUID.h" />
<ClInclude Include="..\Include\EGnFileUtils.h" />
<ClInclude Include="..\Include\EGnGetKeyData.h" />
<ClInclude Include="..\Include\EGnGetModuleVer.h" />
<ClInclude Include="..\Include\EGnLuaAux.h" />
<ClInclude Include="..\Include\EGnLuaMgr.h" />
@@ -366,6 +395,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="..\Include\EgtLibVer.h" />
<ClInclude Include="..\Include\EgtNumCollection.h" />
<ClInclude Include="..\Include\EgtNumUtils.h" />
<ClInclude Include="..\Include\EgtPerfCounter.h" />
<ClInclude Include="..\Include\EgtPointerOwner.h" />
<ClInclude Include="..\Include\EgtStringBase.h" />
<ClInclude Include="..\Include\EgtStringConverter.h" />
@@ -393,6 +423,8 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="DrillingData.h" />
<ClInclude Include="Estimator.h" />
<ClInclude Include="Exit.h" />
<ClInclude Include="FiveAxisMilling.h" />
<ClInclude Include="FiveAxisMillingData.h" />
<ClInclude Include="Generator.h" />
<ClInclude Include="GenMachining.h" />
<ClInclude Include="GenMachiningData.h" />
@@ -417,6 +449,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="OutputConst.h" />
<ClInclude Include="Pocketing.h" />
<ClInclude Include="PocketingData.h" />
<ClInclude Include="PocketingNT.h" />
<ClInclude Include="Processor.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="SawFinishing.h" />
@@ -429,10 +462,14 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
<ClInclude Include="SetTempPhase.h" />
<ClInclude Include="SetupMgr.h" />
<ClInclude Include="Simulator.h" />
<ClInclude Include="SimulatorSP.h" />
<ClInclude Include="SimulatorMP.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="Head.h" />
<ClInclude Include="SurfFinishing.h" />
<ClInclude Include="SurfFinishingData.h" />
<ClInclude Include="SurfRoughing.h" />
<ClInclude Include="SurfRoughingData.h" />
<ClInclude Include="Table.h" />
<ClInclude Include="TcPos.h" />
<ClInclude Include="ToolData.h" />
+104 -5
View File
@@ -150,7 +150,7 @@
<ClCompile Include="MachMgrDBTools.cpp">
<Filter>Source Files\MachMgr</Filter>
</ClCompile>
<ClCompile Include="Simulator.cpp">
<ClCompile Include="SimulatorSP.cpp">
<Filter>Source Files\Output</Filter>
</ClCompile>
<ClCompile Include="MachMgrPhases.cpp">
@@ -234,6 +234,24 @@
<ClCompile Include="TcPos.cpp">
<Filter>Source Files\Machine</Filter>
</ClCompile>
<ClCompile Include="FiveAxisMillingData.cpp">
<Filter>Source Files\Machinings</Filter>
</ClCompile>
<ClCompile Include="FiveAxisMilling.cpp">
<Filter>Source Files\Operations</Filter>
</ClCompile>
<ClCompile Include="SurfRoughingData.cpp">
<Filter>Source Files\Machinings</Filter>
</ClCompile>
<ClCompile Include="SurfRoughing.cpp">
<Filter>Source Files\Operations</Filter>
</ClCompile>
<ClCompile Include="SimulatorMP.cpp">
<Filter>Source Files\Output</Filter>
</ClCompile>
<ClCompile Include="PocketingNT.cpp">
<Filter>Source Files\Operations</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="DllMain.h">
@@ -329,7 +347,7 @@
<ClInclude Include="..\Include\EMkDispositionConst.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="Simulator.h">
<ClInclude Include="SimulatorSP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Generator.h">
@@ -410,9 +428,6 @@
<ClInclude Include="..\Include\EGkBBox3d.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeBoxPolyhedron.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkChainCurves.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
@@ -668,6 +683,90 @@
<ClInclude Include="..\Include\EGkBBox1d.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="FiveAxisMillingData.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="FiveAxisMilling.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SurfRoughingData.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SurfRoughing.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkBiArcs.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCalcPocketing.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCAvSilhouetteSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCAvToolSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeBoxClosedSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeClosedSurfTmClosedSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeConeFrustumClosedSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeCylClosedSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCDeSpheClosedSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkCurveLocal.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkDistPointLine.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkDistPointSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkHashGrids1d.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkIntersCurveSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkIntersPlaneSurfTm.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkPolygon3d.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkPolygonElevation.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkQuaternion.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGkSurfLocal.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EGnGetKeyData.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="..\Include\EgtPerfCounter.h">
<Filter>Header Files\Include</Filter>
</ClInclude>
<ClInclude Include="SimulatorMP.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Simulator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="PocketingNT.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EgtMachKernel.rc">
+76 -12
View File
@@ -15,9 +15,12 @@
#include "stdafx.h"
#include "DllMain.h"
#include "Estimator.h"
#include "Machine.h"
#include "MachMgr.h"
#include "OutputConst.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EGnGetKeyData.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkKeyProc.h"
using namespace std ;
@@ -45,23 +48,75 @@ Estimator::Init( MachMgr* pMchMgr)
bool
Estimator::Run( const string& sCncFile, const string& sInfo)
{
// emetto info di log
{ string sOut = "Estimator Run : " + sCncFile ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ; }
// Controllo della licenza
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( ! GetEMkNetHwKey())
nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
// Verifica della abilitazione
bool bMinTime = false ;
if ( nOptExpDays >= GetMinDay())
bMinTime = true ;
bool bCurrTime = false ;
if ( nOptExpDays >= GetCurrDay())
bCurrTime = true ;
bool bKey = false ;
if ( nRet == KEY_OK)
bKey = true ;
bool bAdvMach = false ;
if ( ( nOpt1 & KEYOPT_EMK_ADV) != 0)
bAdvMach = true ;
// Esecuzione
if ( bMinTime && bCurrTime && bKey) {
// se non previste lavorazioni avanzate, verifico la loro assenza
if ( ! bAdvMach) {
int nOpId = m_pMchMgr->GetFirstActiveOperation() ;
while ( nOpId != GDB_ID_NULL) {
int nType = m_pMchMgr->GetOperationType( nOpId) ;
if ( nType == OPER_SURFROUGHING || nType == OPER_SURFFINISHING || nType == OPER_FIVEAXISMILLING) {
m_pMchMgr->SetLastError( 1001, "ADVANCED_MACH_OFF") ;
std::string sErr = "Warning on Key (MKC/AMO)" ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
nOpId = m_pMchMgr->GetNextActiveOperation( nOpId) ;
}
}
// emetto info di log
{ string sOut = "Estimator Run : " + sCncFile ;
LOG_INFO( GetEMkLogger(), sOut.c_str()) ; }
// cancello l'eventuale file di uscita (e anche il file errore)
EraseFile( sCncFile) ;
string sErrFile = ChangeFileExtension( sCncFile, ERR_EXT) ;
EraseFile( sErrFile) ;
// lancio il processore
bool bOk = Processor::Run( sCncFile, sInfo) ;
// in caso di errore rinomino il file di output
if ( ! bOk)
RenameFile( sCncFile, sErrFile) ;
return bOk ;
}
// cancello l'eventuale file di uscita (e anche il file errore)
EraseFile( sCncFile) ;
string sErrFile = ChangeFileExtension( sCncFile, ERR_EXT) ;
EraseFile( sErrFile) ;
// lancio il processore
bool bOk = Processor::Run( sCncFile, sInfo) ;
// in caso di errore rinomino il file di output
if ( ! bOk)
RenameFile( sCncFile, sErrFile) ;
return bOk ;
// Generazione non abilitata
m_pMchMgr->SetLastError( 1000, "NC_OFF") ;
std::string sErr = "Warning on Key (MKC/KYO)" ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
//----------------------------------------------------------------------------
@@ -124,6 +179,15 @@ Estimator::CallOnTableData( void)
return m_pMachine->LuaCallFunction( ON_ESTIM_TABLE_DATA) ;
}
//----------------------------------------------------------------------------
bool
Estimator::CallOnTableAxisData( void)
{
if ( ! m_pMachine->LuaExistsFunction( ON_ESTIM_TABLE_AXIS_DATA))
return true ;
return m_pMachine->LuaCallFunction( ON_ESTIM_TABLE_AXIS_DATA) ;
}
//----------------------------------------------------------------------------
bool
Estimator::CallOnFixtureData( void)
+1
View File
@@ -33,6 +33,7 @@ class Estimator : public Processor
bool CallOnDispositionStart( void) override ;
bool CallOnDispositionEnd( void) override ;
bool CallOnTableData( void) override ;
bool CallOnTableAxisData( void) override ;
bool CallOnFixtureData( void) override ;
bool CallOnRawMoveData( void) override ;
bool CallOnToolSelect( void) override ;
+3
View File
@@ -124,6 +124,9 @@ Exit::Modify( const Point3d& ptPos, double dExitMaxAdjust)
}
// Assegno la nuova posizione
m_ptPos = ptPos ;
// Sistemo la geometria dell'uscita
if ( ! vtDelta.IsZero())
m_pGeomDB->Translate( m_nOwnerId, vtDelta) ;
return true ;
}
+1021
View File
File diff suppressed because it is too large Load Diff
+97
View File
@@ -0,0 +1,97 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : FiveAxisMilling.h Data : 22.05.24 Versione : 2.6e5
// Contenuto : Dichiarazione della classe FiveAxisMilling.
//
//
//
// Modifiche : 22.05.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "FiveAxisMillingData.h"
#include "ToolData.h"
class ICurve ;
class ICurveComposite ;
//----------------------------------------------------------------------------
class FiveAxisMilling : public Machining
{
public : // IUserObj
FiveAxisMilling* Clone( void) const override ;
const std::string& GetClassName( void) const override ;
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
bool ToSave( void) const override
{ return true ; }
bool Save( int nBaseId, STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
int GetType( void) const override
{ return OPER_FIVEAXISMILLING ; }
bool IsEmpty( void) const override
{ return ( m_nMills == 0) ; }
bool UpdateStatus( int nModif) override
{ m_nStatus |= nModif ; return true ; }
protected : // Operation
int GetSolCh( void) const override
{ return m_Params.m_nSolCh ; }
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
public : // Machining
bool Prepare( const std::string& sMillName) override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool SetGeometry( const SELVECTOR& vIds) override ;
bool Preview( bool bRecalc) override ;
bool Apply( bool bRecalc, bool bPostApply) override ;
bool Update( bool bPostApply) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
bool UpdateToolData( bool* pbChanged = nullptr) override ;
const ToolData& GetToolData( void) const override ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
FiveAxisMilling( void) ;
private :
bool MyApply( bool bRecalc, bool bPostApply) ;
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
double GetApproxLinTol( void) const override ;
private :
double GetSpeed() const
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
double GetFeed() const
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetStartFeed() const
{ return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
double GetEndFeed() const
{ return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed() const
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetOffsL() const
{ return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetOffsR() const
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
FiveAxisMillingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nMills ; // numero di percorsi di lavoro generati
bool m_bRunning ; // flag di calcoli in corso
} ;
+557
View File
@@ -0,0 +1,557 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : FiveAxisMillingData.cpp Data : 22.05.24 Versione : 2.6e5
// Contenuto : Implementazione struttura dati fresatura a 5 assi.
//
//
//
// Modifiche : 22.05.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "FiveAxisMillingData.h"
#include "MachiningDataFactory.h"
#include "MachiningConst.h"
#include "/EgtDev/Include/EmkToolConst.h"
#include "/EgtDev/Include/EmkSimuGenConst.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include <array>
#include <cassert>
using namespace std ;
//----------------------------------------------------------------------------
enum nFiveAxisMillingKey {
KEY_AB = 0,
KEY_AI,
KEY_DH,
KEY_F,
KEY_FE,
KEY_FS,
KEY_FT,
KEY_INV,
KEY_NAME,
KEY_NNS,
KEY_NNU,
KEY_OL,
KEY_OR,
KEY_PS,
KEY_S,
KEY_SCC,
KEY_SUBTYPE,
KEY_TI,
KEY_TNAME,
KEY_TUUID,
KEY_UUID,
KEY_ZZZ} ; // rappresenta il numero di elementi
static const array<string,KEY_ZZZ> sFiveAxisMillingKey = {
"AB",
"AI",
"DH",
"F",
"FE",
"FS",
"FT",
"INV",
"NAME",
"NNS",
"NNU",
"OL",
"OR",
"PS",
"S",
"SCC",
"SUB",
"TI",
"TN",
"TU",
"UUID"} ;
//----------------------------------------------------------------------------
MCHDATA_REGISTER( MT_FIVEAXISMILLING, "FIVEAXISMILLING", FiveAxisMillingData) ;
//----------------------------------------------------------------------------
FiveAxisMillingData*
FiveAxisMillingData::Clone( void) const
{
// alloco oggetto
FiveAxisMillingData* pDdata = new(nothrow) FiveAxisMillingData ;
// copio i dati
if ( pDdata != nullptr) {
if ( ! pDdata->CopyFrom( this)) {
delete pDdata ;
return nullptr ;
}
}
return pDdata ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::CopyFrom( const MachiningData* pMdata)
{
// è inutile copiare se sorgente coincide con destinazione
if ( pMdata == this)
return true ;
// la sorgente deve essere dello stesso tipo
const FiveAxisMillingData* pFdata = GetFiveAxisMillingData( pMdata) ;
if ( pFdata == nullptr)
return false ;
// eseguo copia
m_Uuid = pFdata->m_Uuid ;
m_sName = pFdata->m_sName ;
m_ToolUuid = pFdata->m_ToolUuid ;
m_sToolName = pFdata->m_sToolName ;
m_sBlockedAxis = pFdata->m_sBlockedAxis ;
m_sInitAngs = pFdata->m_sInitAngs ;
m_nSolCh = pFdata->m_nSolCh ;
m_dSpeed = pFdata->m_dSpeed ;
m_dFeed = pFdata->m_dFeed ;
m_dEndFeed = pFdata->m_dEndFeed ;
m_dStartFeed = pFdata->m_dStartFeed ;
m_dTipFeed = pFdata->m_dTipFeed ;
m_dOffsL = pFdata->m_dOffsL ;
m_dOffsR = pFdata->m_dOffsR ;
m_bToolInvert = pFdata->m_bToolInvert ;
m_bInvert = pFdata->m_bInvert ;
m_sDepth = pFdata->m_sDepth ;
m_dStartPos = pFdata->m_dStartPos ;
m_nSubType = pFdata->m_nSubType ;
m_sSysNotes = pFdata->m_sSysNotes ;
m_sUserNotes = pFdata->m_sUserNotes ;
return true ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::SameAs(const MachiningData* pMdata) const
{
// se coincide con altro -> uguali
if ( pMdata == this)
return true ;
// se sono di tipo diverso -> diversi
const FiveAxisMillingData* pFdata = GetFiveAxisMillingData( pMdata) ;
if ( pFdata == nullptr)
return false ;
// confronto termine a termine
return ( m_Uuid == pFdata->m_Uuid &&
m_sName == pFdata->m_sName &&
m_ToolUuid == pFdata->m_ToolUuid &&
m_sToolName == pFdata->m_sToolName &&
m_sBlockedAxis == pFdata->m_sBlockedAxis &&
m_sInitAngs == pFdata->m_sInitAngs &&
m_nSolCh == pFdata->m_nSolCh &&
abs( m_dSpeed - pFdata->m_dSpeed) < EPS_MACH_ANG_PAR &&
abs( m_dFeed - pFdata->m_dFeed) < EPS_MACH_LEN_PAR &&
abs( m_dEndFeed - pFdata->m_dEndFeed) < EPS_MACH_LEN_PAR &&
abs( m_dStartFeed - pFdata->m_dStartFeed) < EPS_MACH_LEN_PAR &&
abs( m_dTipFeed - pFdata->m_dTipFeed) < EPS_MACH_LEN_PAR &&
abs( m_dOffsL - pFdata->m_dOffsL) < EPS_MACH_LEN_PAR &&
abs( m_dOffsR - pFdata->m_dOffsR) < EPS_MACH_LEN_PAR &&
m_bToolInvert == pFdata->m_bToolInvert &&
m_bInvert == pFdata->m_bInvert &&
m_sDepth == pFdata->m_sDepth &&
abs( m_dStartPos - pFdata->m_dStartPos) < EPS_MACH_LEN_PAR &&
m_nSubType == pFdata->m_nSubType &&
m_sSysNotes == pFdata->m_sSysNotes &&
m_sUserNotes == pFdata->m_sUserNotes) ;
}
//----------------------------------------------------------------------------
int
FiveAxisMillingData::GetSize( void) const
{
// in debug verifico validità ultimo campo
assert( sFiveAxisMillingKey[KEY_UUID] == "UUID") ;
return KEY_ZZZ ;
}
//----------------------------------------------------------------------------
string
FiveAxisMillingData::GetTitle( void) const
{
return MCHDATA_GETNAME( FiveAxisMillingData) ;
}
//----------------------------------------------------------------------------
int
FindFiveAxisMillingKey( const string& sKey)
{
auto TheRange = equal_range( sFiveAxisMillingKey.cbegin(), sFiveAxisMillingKey.cend(), sKey) ;
if ( TheRange.first == TheRange.second)
return - 1 ;
return int( TheRange.first - sFiveAxisMillingKey.cbegin()) ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::FromString( const string& sString, int& nKey)
{
// separo chiave da valore
string sKey, sVal ;
SplitFirst( sString, "=", sKey, sVal) ;
// riconosco la chiave
nKey = FindFiveAxisMillingKey( ToUpper( sKey)) ;
bool bOk = ( nKey >= 0) ;
switch ( nKey) {
case KEY_AB :
m_sBlockedAxis = sVal ;
break ;
case KEY_AI :
m_sInitAngs = sVal ;
break ;
case KEY_DH :
m_sDepth = sVal ;
if ( m_sDepth.empty())
m_sDepth = "0" ;
break ;
case KEY_F :
bOk = ::FromString( sVal, m_dFeed) ;
break ;
case KEY_FE :
bOk = ::FromString( sVal, m_dEndFeed) ;
break ;
case KEY_FS :
bOk = ::FromString( sVal, m_dStartFeed) ;
break ;
case KEY_FT :
bOk = ::FromString( sVal, m_dTipFeed) ;
break ;
case KEY_INV :
bOk = ::FromString( sVal, m_bInvert) ;
break ;
case KEY_NAME :
m_sName = sVal ;
bOk = ! m_sName.empty() ;
break ;
case KEY_NNS :
m_sSysNotes = sVal ;
break ;
case KEY_NNU :
m_sUserNotes = sVal ;
break ;
case KEY_OL :
bOk = ::FromString( sVal, m_dOffsL) ;
break ;
case KEY_OR :
bOk = ::FromString( sVal, m_dOffsR) ;
break ;
case KEY_PS :
bOk = ::FromString( sVal, m_dStartPos) ;
break ;
case KEY_S :
bOk = ::FromString( sVal, m_dSpeed) ;
break ;
case KEY_SCC :
bOk = ::FromString( sVal, m_nSolCh) ;
break ;
case KEY_SUBTYPE :
bOk = ::FromString( sVal, m_nSubType) ;
break ;
case KEY_TNAME :
m_sToolName = sVal ;
break ;
case KEY_TI :
bOk = ::FromString( sVal, m_bToolInvert) ;
break ;
case KEY_TUUID :
bOk = ::FromString( sVal, m_ToolUuid) ;
break ;
case KEY_UUID :
bOk = ::FromString( sVal, m_Uuid) ;
break ;
default :
bOk = false ;
break ;
}
return bOk ;
}
//----------------------------------------------------------------------------
string
FiveAxisMillingData::ToString( int nKey) const
{
switch ( nKey) {
case KEY_AB : return ( sFiveAxisMillingKey[KEY_AB] + "=" + m_sBlockedAxis) ;
case KEY_AI : return ( sFiveAxisMillingKey[KEY_AI] + "=" + m_sInitAngs) ;
case KEY_DH : return ( sFiveAxisMillingKey[KEY_DH] + "=" + m_sDepth) ;
case KEY_F : return ( sFiveAxisMillingKey[KEY_F] + "=" + ::ToString( m_dFeed)) ;
case KEY_FE : return ( sFiveAxisMillingKey[KEY_FE] + "=" + ::ToString( m_dEndFeed)) ;
case KEY_FS : return ( sFiveAxisMillingKey[KEY_FS] + "=" + ::ToString( m_dStartFeed)) ;
case KEY_FT : return ( sFiveAxisMillingKey[KEY_FT] + "=" + ::ToString( m_dTipFeed)) ;
case KEY_INV : return ( sFiveAxisMillingKey[KEY_INV] + "=" + ::ToString( m_bInvert)) ;
case KEY_NAME : return ( sFiveAxisMillingKey[KEY_NAME] + "=" + m_sName) ;
case KEY_NNS : return ( sFiveAxisMillingKey[KEY_NNS] + "=" + m_sSysNotes) ;
case KEY_NNU : return ( sFiveAxisMillingKey[KEY_NNU] + "=" + m_sUserNotes) ;
case KEY_OL : return ( sFiveAxisMillingKey[KEY_OL] + "=" + ::ToString( m_dOffsL)) ;
case KEY_OR : return ( sFiveAxisMillingKey[KEY_OR] + "=" + ::ToString( m_dOffsR)) ;
case KEY_PS : return ( sFiveAxisMillingKey[KEY_PS] + "=" + ::ToString( m_dStartPos)) ;
case KEY_S : return ( sFiveAxisMillingKey[KEY_S] + "=" + ::ToString( m_dSpeed)) ;
case KEY_SCC : return ( sFiveAxisMillingKey[KEY_SCC] + "=" + ::ToString( m_nSolCh)) ;
case KEY_SUBTYPE : return ( sFiveAxisMillingKey[KEY_SUBTYPE] + "=" + ::ToString( m_nSubType)) ;
case KEY_TI : return ( sFiveAxisMillingKey[KEY_TI] + "=" + ::ToString( m_bToolInvert)) ;
case KEY_TNAME : return ( sFiveAxisMillingKey[KEY_TNAME] + "=" + m_sToolName) ;
case KEY_TUUID : return ( sFiveAxisMillingKey[KEY_TUUID] + "=" + ::ToString( m_ToolUuid)) ;
case KEY_UUID : return ( sFiveAxisMillingKey[KEY_UUID] + "=" + ::ToString( m_Uuid)) ;
default : return "" ;
}
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::IsOptional( int nKey) const
{
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::VerifySolCh( int nVal) const
{
return IsValidOperationScc( nVal) ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::VerifyTool( const ToolsMgr* pToolsMgr, const string& sVal, const ToolData*& pTdata) const
{
if ( pToolsMgr == nullptr)
return false ;
pTdata = pToolsMgr->GetTool( sVal) ;
if ( pTdata == nullptr)
return false ;
if ( ( pTdata->m_nType & TF_MILL) == 0 && ( pTdata->m_nType & TF_SAWBLADE) == 0)
return false ;
return true ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::GetTool( const ToolsMgr* pToolsMgr, const ToolData*& pTdata) const
{
if ( pToolsMgr == nullptr)
return false ;
pTdata = pToolsMgr->GetTool( m_ToolUuid) ;
return ( pTdata != nullptr) ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::SetParam( int nType, bool bVal)
{
switch ( nType) {
case MPA_INVERT :
m_bInvert = bVal ;
return true ;
case MPA_TOOLINVERT :
m_bToolInvert = bVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::SetParam( int nType, int nVal)
{
switch ( nType) {
case MPA_SCC :
if ( ! VerifySolCh( nVal))
return false ;
m_nSolCh = nVal ;
return true ;
case MPA_SUBTYPE :
m_nSubType = nVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::SetParam( int nType, double dVal)
{
switch ( nType) {
case MPA_SPEED :
m_dSpeed = dVal ;
return true ;
case MPA_FEED :
m_dFeed = dVal ;
return true ;
case MPA_STARTFEED :
m_dStartFeed = dVal ;
return true ;
case MPA_ENDFEED :
m_dEndFeed = dVal ;
return true ;
case MPA_TIPFEED :
m_dTipFeed = dVal ;
return true ;
case MPA_OFFSL :
m_dOffsL = dVal ;
return true ;
case MPA_OFFSR :
m_dOffsR = dVal ;
return true ;
case MPA_DEPTH :
m_sDepth = ::ToString( dVal) ;
return true ;
case MPA_STARTPOS :
m_dStartPos = dVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::SetParam( int nType, const string& sVal)
{
switch ( nType) {
case MPA_NAME :
m_sName = sVal ;
return true ;
case MPA_TOOL :
m_sToolName = sVal ;
return true ;
case MPA_DEPTH_STR :
m_sDepth = sVal ;
return true ;
case MPA_TUUID :
return ::FromString( sVal, m_ToolUuid) ;
case MPA_UUID :
return ::FromString( sVal, m_Uuid) ;
case MPA_SYSNOTES :
m_sSysNotes = sVal ;
return true ;
case MPA_USERNOTES :
m_sUserNotes = sVal ;
return true ;
case MPA_INITANGS :
m_sInitAngs = sVal ;
return true ;
case MPA_BLOCKEDAXIS :
m_sBlockedAxis = sVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::ResetTool( void)
{
m_sToolName.clear() ;
m_ToolUuid.Clear() ;
return true ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::GetParam( int nType, bool& bVal) const
{
switch ( nType) {
case MPA_INVERT :
bVal = m_bInvert ;
return true ;
case MPA_TOOLINVERT :
bVal = m_bToolInvert ;
return true ;
}
bVal = false ;
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::GetParam( int nType, int& nVal) const
{
switch ( nType) {
case MPA_TYPE :
nVal = MT_FIVEAXISMILLING ;
return true ;
case MPA_SCC :
nVal = m_nSolCh ;
return true ;
case MPA_SUBTYPE :
nVal = m_nSubType ;
return true ;
}
nVal = 0 ;
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::GetParam( int nType, double& dVal) const
{
switch ( nType) {
case MPA_SPEED :
dVal = m_dSpeed ;
return true ;
case MPA_FEED :
dVal = m_dFeed ;
return true ;
case MPA_STARTFEED :
dVal = m_dStartFeed ;
return true ;
case MPA_ENDFEED :
dVal = m_dEndFeed ;
return true ;
case MPA_TIPFEED :
dVal = m_dTipFeed ;
return true ;
case MPA_OFFSL :
dVal = m_dOffsL ;
return true ;
case MPA_OFFSR :
dVal = m_dOffsR ;
return true ;
case MPA_STARTPOS :
dVal = m_dStartPos ;
return true ;
}
dVal = 0 ;
return false ;
}
//----------------------------------------------------------------------------
bool
FiveAxisMillingData::GetParam( int nType, string& sVal) const
{
switch ( nType) {
case MPA_NAME :
sVal = m_sName ;
return true ;
case MPA_TOOL :
sVal = m_sToolName ;
return true ;
case MPA_DEPTH_STR :
sVal = m_sDepth ;
return true ;
case MPA_TUUID :
sVal = ::ToString( m_ToolUuid) ;
return true ;
case MPA_UUID :
sVal = ::ToString( m_Uuid) ;
return true ;
case MPA_SYSNOTES :
sVal = m_sSysNotes ;
return true ;
case MPA_USERNOTES :
sVal = m_sUserNotes ;
return true ;
case MPA_INITANGS :
sVal = m_sInitAngs ;
return true ;
case MPA_BLOCKEDAXIS :
sVal = m_sBlockedAxis ;
return true ;
}
sVal = "" ;
return false ;
}
+76
View File
@@ -0,0 +1,76 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : FiveAxisMillingData.h Data : 22.05.24 Versione : 2.6e5
// Contenuto : Dichiarazione della struct FiveAxisMillingData e costanti associate.
//
//
//
// Modifiche : 22.05.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "MachiningData.h"
//----------------------------------------------------------------------------
struct FiveAxisMillingData : public MachiningData
{
EgtUUID m_ToolUuid ; // identificativo universale dell'utensile
std::string m_sToolName ; // nome dell'utensile
std::string m_sInitAngs ; // angoli iniziali suggeriti (Nome1=val1,Nome2=val2)
std::string m_sBlockedAxis ; // eventuale asse rotante bloccato (Nome=val)
int m_nSolCh ; // criterio scelta soluzione (quando possibili molteplici)
double m_dSpeed ; // velocità di rotazione (+ se CCW, - se CW) ( se 0 da utensile)
double m_dFeed ; // velocità di lavorazione normale ( se 0 da utensile)
double m_dStartFeed ; // velocità di lavorazione iniziale ( se 0 da utensile)
double m_dEndFeed ; // velocità di lavorazione finale ( se 0 da utensile)
double m_dTipFeed ; // velocità di lavorazione di sfondamento ( se 0 da utensile)
double m_dOffsR ; // offset radiale ( se UNKNOWN_PAR da utensile)
double m_dOffsL ; // offset longitudinale ( se UNKNOWN_PAR da utensile)
bool m_bToolInvert ; // flag per inversione direzione utensile da geometria
bool m_bInvert ; // flag di inversione direzione lavorazione
std::string m_sDepth ; // affondamento (espressione numerica)
double m_dStartPos ; // quota di inizio lavorazione (sempre >= 0)
int m_nSubType ; // da [GenMachining] di Ini di macchina
std::string m_sSysNotes ; // note interne
std::string m_sUserNotes ; // note dell'utente
FiveAxisMillingData( void)
: m_ToolUuid(), m_nSolCh( 0), m_dSpeed( 0), m_dFeed( 0), m_dStartFeed( 0), m_dEndFeed( 0), m_dTipFeed( 0),
m_dOffsR( 0), m_dOffsL( 0), m_bToolInvert( false), m_bInvert( false), m_dStartPos( 0), m_nSubType( 0) {}
FiveAxisMillingData* Clone( void) const override ;
bool CopyFrom( const MachiningData* pMdata) override ;
bool SameAs(const MachiningData* pMdata) const override ;
int GetType( void) const override
{ return MT_FIVEAXISMILLING ; }
int GetSize( void) const override ;
std::string GetTitle( void) const override ;
bool FromString( const std::string& sString, int& nKey) override ;
std::string ToString( int nKey) const override ;
bool IsOptional( int nKey) const override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool ResetTool( void) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
bool GetTool( const ToolsMgr* pToolsMgr, const ToolData*& pTdata) const override ;
bool VerifyTool( const ToolsMgr* pToolsMgr, const std::string& sVal, const ToolData*& pTdata) const override ;
bool VerifySolCh( int nVal) const ;
} ;
//----------------------------------------------------------------------------
inline const FiveAxisMillingData* GetFiveAxisMillingData( const MachiningData* pMdata)
{ if ( pMdata == nullptr || pMdata->GetType() != MT_FIVEAXISMILLING)
return nullptr ;
return ( static_cast<const FiveAxisMillingData*>( pMdata)) ; }
inline FiveAxisMillingData* GetFiveAxisMillingData( MachiningData* pMdata)
{ if ( pMdata == nullptr || pMdata->GetType() != MT_FIVEAXISMILLING)
return nullptr ;
return ( static_cast<FiveAxisMillingData*>( pMdata)) ; }
+115 -25
View File
@@ -20,7 +20,7 @@
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EgkArcSpecial.h"
#include "/EgtDev/Include/EGkArcSpecial.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
@@ -39,6 +39,7 @@ using namespace std ;
// 2806 = "Error in GenMachining : link movements not calculable"
// 2807 = "Error in GenMachining : link outstroke xx"
// 2808 = "Error in GenMachining : post apply not calculable"
// 2809 = "Error in GenMachining : Tool loading failed"
// 2851 = "Warning in GenMachining : Skipped entity (xx)"
// 2852 = "Warning in GenMachining : No machinable path"
// 2853 = "Warning in GenMachining : Tool name changed (xx)"
@@ -54,15 +55,27 @@ static const string EVAR_INVERT = ".INVERT" ; // IN (bool) flag di inversio
static const string EVAR_STARTPOS = ".STARTPOS" ; // IN (num) quota di inizio lavorazione (sempre >= 0)
static const string EVAR_OFFSR = ".OFFSR" ; // IN (num) offset radiale
static const string EVAR_OFFSL = ".OFFSL" ; // IN (num) offset longitudinale
static const string EVAR_SYSNOTES = ".SYSNOTES" ; // IN (string) note interne
static const string EVAR_USERNOTES = ".USERNOTES" ;// IN (string) note dell'utente
static const string EVAR_TOOL = ".TOOL" ; // IN (string) nome dell'utensile
static const string EVAR_HEAD = ".HEAD" ; // IN (string) nome testa
static const string EVAR_EXIT = ".EXIT" ; // IN (int) indice uscita
static const string EVAR_TTYPE = ".TTYPE" ; // IN (int) tipo utensile
static const string EVAR_TMAXMAT = ".TMAXMAT" ; // IN (num) massimo materiale
static const string EVAR_TDIAM = ".TDIAM" ; // IN (num) diametro utensile
static const string EVAR_TTOTDIAM = ".TTOTDIAM" ; // IN (num) diametro totale utensile
static const string EVAR_TLEN = ".TLEN" ; // IN (num) lunghezza utensile
static const string EVAR_TTOTLEN = ".TTOTLEN" ; // IN (num) lunghezza totale utensile
static const string EVAR_TTHICK = ".THICK" ; // IN (num) spessore per lame o altezza taglienti
static const string EVAR_TCORNRAD = ".TCORNRAD" ; // IN (num) raggio corner
static const string EVAR_TSIDEANG = ".TSIDEANG" ; // IN (num) angolo del fianco rispetto all'asse
static const string EVAR_FEED = ".FEED" ; // IN (num) feed dell'utensile
static const string EVAR_STARTFEED = ".STARTFEED" ;// IN (num) feed di inizio dell'utensile
static const string EVAR_ENDFEED = ".ENDFEED" ; // IN (num) feed di fine dell'utensile
static const string EVAR_TIPFEED = ".TIPFEED" ; // IN (num) feed di punta dell'utensile
static const string EVAR_SYSNOTES = ".SYSNOTES" ; // IN (string) note interne
static const string EVAR_USERNOTES = ".USERNOTES" ;// IN (string) note dell'utente
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok)
static const string EVAR_MILLS = ".MILLS" ; // OUT (int) numero di percorsi di lavoro
static const string EVAR_ISROBOT = ".ISROBOT" ; // IN (bool) flag per indicare che la cinematica è di tipo robot
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok)
static const string EVAR_MILLS = ".MILLS" ; // OUT (int) numero di percorsi di lavoro
static const string ON_PREVIEW = "OnPreview_" ;
static const string ON_APPLY = "OnApply_" ;
@@ -436,6 +449,12 @@ GenMachining::Preview( bool bRecalc)
return false ;
}
// rendo corrente l'utensile usato nella lavorazione
if ( ! m_pMchMgr->SetCalcTool( m_TParams.m_sName, m_TParams.m_sHead, m_TParams.m_nExit)) {
m_pMchMgr->SetLastError( 2809, "Error in GenMachining : Tool loading failed") ;
return false ;
}
// recupero gruppo per geometria di Preview
int nPvId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_PV) ;
// se non c'è, lo aggiungo
@@ -480,13 +499,25 @@ GenMachining::Preview( bool bRecalc)
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_STARTPOS, m_Params.m_dStartPos) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_OFFSR, GetOffsR()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_OFFSL, GetOffsL()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_SYSNOTES, m_Params.m_sSysNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_USERNOTES, m_Params.m_sUserNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TOOL, m_TParams.m_sName) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_HEAD, m_TParams.m_sHead) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_EXIT, m_TParams.m_nExit) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTYPE, m_TParams.m_nType) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TMAXMAT, m_TParams.m_dMaxMat) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TDIAM, m_TParams.m_dDiam) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTOTDIAM, m_TParams.m_dTDiam) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TLEN, m_TParams.m_dLen) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTOTLEN, m_TParams.m_dTLen) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTHICK, m_TParams.m_dThick) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TCORNRAD, m_TParams.m_dCornRad) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TSIDEANG, m_TParams.m_dSideAng) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_FEED, GetFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_STARTFEED, GetStartFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_ENDFEED, GetEndFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TIPFEED, GetTipFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_SYSNOTES, m_Params.m_sSysNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_USERNOTES, m_Params.m_sUserNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_ISROBOT, m_pMchMgr->GetCurrIsRobot()) ;
// eseguo
bOk = bOk && pMch->LuaCallFunction( sPreview, false) ;
// recupero valori parametri obbligatori
@@ -526,13 +557,27 @@ GenMachining::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nMills = nCurrMills ;
LOG_DBG_INFO( GetEMkLogger(), "GenMachining apply skipped : status already ok") ;
string sLog = string( "GenMachining apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
// rendo corrente l'utensile usato nella lavorazione
if ( ! m_pMchMgr->SetCalcTool( m_TParams.m_sName, m_TParams.m_sHead, m_TParams.m_nExit)) {
m_pMchMgr->SetLastError( 2809, "Error in GenMachining : Tool loading failed") ;
return false ;
}
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ;
// se non c'è, lo aggiungo
@@ -577,13 +622,25 @@ GenMachining::Apply( bool bRecalc, bool bPostApply)
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_STARTPOS, m_Params.m_dStartPos) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_OFFSR, GetOffsR()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_OFFSL, GetOffsL()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_SYSNOTES, m_Params.m_sSysNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_USERNOTES, m_Params.m_sUserNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TOOL, m_TParams.m_sName) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_HEAD, m_TParams.m_sHead) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_EXIT, m_TParams.m_nExit) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTYPE, m_TParams.m_nType) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TMAXMAT, m_TParams.m_dMaxMat) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TDIAM, m_TParams.m_dDiam) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTOTDIAM, m_TParams.m_dTDiam) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TLEN, m_TParams.m_dLen) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTOTLEN, m_TParams.m_dTLen) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TTHICK, m_TParams.m_dThick) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TCORNRAD, m_TParams.m_dCornRad) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TSIDEANG, m_TParams.m_dSideAng) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_FEED, GetFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_STARTFEED, GetStartFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_ENDFEED, GetEndFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_TIPFEED, GetTipFeed()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_SYSNOTES, m_Params.m_sSysNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_USERNOTES, m_Params.m_sUserNotes) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_ISROBOT, m_pMchMgr->GetCurrIsRobot()) ;
// eseguo
bOk = bOk && pMch->LuaCallFunction( sApply, false) ;
// recupero valori parametri obbligatori
@@ -611,6 +668,8 @@ GenMachining::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "GenMachining apply done") ;
return true ;
}
@@ -628,15 +687,11 @@ GenMachining::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
@@ -801,15 +856,39 @@ GenMachining::UpdateToolData( bool* pbChanged)
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
if ( pTMgr == nullptr)
return false ;
// recupero l'utensile nel DB utensili
// recupero l'utensile nel DB utensili (se fallisce con UUID provo con il nome)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
if ( pTdata == nullptr) {
pTdata = pTMgr->GetTool( m_Params.m_sToolName) ;
if ( pTdata == nullptr)
return false ;
m_Params.m_ToolUuid = m_TParams.m_Uuid ;
}
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in GenMachining : tool name changed (" +
@@ -891,3 +970,14 @@ GenMachining::VerifyGeometry( SelData Id, int& nSubs, int& nType)
else
return false ;
}
//----------------------------------------------------------------------------
double
GenMachining::GetApproxLinTol( void) const
{
double dLinTol ;
if ( GetValInNotes( m_Params.m_sUserNotes, "LinTol", dLinTol))
return dLinTol ;
else
return Operation::GetApproxLinTol() ;
}
+1
View File
@@ -67,6 +67,7 @@ class GenMachining : public Machining
private :
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
double GetApproxLinTol( void) const override ;
private :
double GetSpeed() const
+6 -2
View File
@@ -67,6 +67,10 @@ struct GenMachiningData : public MachiningData
//----------------------------------------------------------------------------
inline const GenMachiningData* GetGenMachiningData( const MachiningData* pMdata)
{ return (dynamic_cast<const GenMachiningData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_GENMACHINING)
return nullptr ;
return ( static_cast<const GenMachiningData*>( pMdata)) ; }
inline GenMachiningData* GetGenMachiningData( MachiningData* pMdata)
{ return (dynamic_cast<GenMachiningData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_GENMACHINING)
return nullptr ;
return ( static_cast<GenMachiningData*>( pMdata)) ; }
+57 -6
View File
@@ -17,8 +17,10 @@
#include "Generator.h"
#include "MachMgr.h"
#include "OutputConst.h"
#include "/EgtDev/Include/EMkDllMain.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EGnGetKeyData.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkKeyProc.h"
using namespace std ;
@@ -46,12 +48,49 @@ Generator::Init( MachMgr* pMchMgr)
bool
Generator::Run( const string& sCncFile, const string& sInfo)
{
// verifico sia abilitato dalla licenza
// Controllo della licenza
unsigned int nOpt1, nOpt2 ;
int nOptExpDays ;
int nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( nRet == KEY_OK && ( nOpt1 & KEYOPT_EMK_NC_OFF) == 0) {
int nRet = GetEGnKeyOptions( KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
if ( ! GetEMkNetHwKey())
nRet = GetKeyOptions( GetEMkKey(), KEY_BASELIB_PROD, KEY_BASELIB_VER, KEY_BASELIB_LEV,
nOpt1, nOpt2, nOptExpDays) ;
// Verifica della abilitazione
bool bMinTime = false ;
if ( nOptExpDays >= GetMinDay())
bMinTime = true ;
bool bCurrTime = false ;
if ( nOptExpDays >= GetCurrDay())
bCurrTime = true ;
bool bKey = false ;
if ( nRet == KEY_OK)
bKey = true ;
bool bNcOff = false ;
if ( ( nOpt1 & KEYOPT_EMK_NC_OFF) != 0)
bNcOff = true ;
bool bAdvMach = false ;
if ( ( nOpt1 & KEYOPT_EMK_ADV) != 0)
bAdvMach = true ;
// Esecuzione
if ( bMinTime && bCurrTime && bKey && ! bNcOff) {
// se non previste lavorazioni avanzate, verifico la loro assenza
if ( ! bAdvMach) {
int nOpId = m_pMchMgr->GetFirstActiveOperation() ;
while ( nOpId != GDB_ID_NULL) {
int nType = m_pMchMgr->GetOperationType( nOpId) ;
if ( nType == OPER_SURFROUGHING || nType == OPER_SURFFINISHING || nType == OPER_FIVEAXISMILLING) {
m_pMchMgr->SetLastError( 1001, "ADVANCED_MACH_OFF") ;
std::string sErr = "Warning on Key (MKC/AMO)" ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
nOpId = m_pMchMgr->GetNextActiveOperation( nOpId) ;
}
}
// emetto info di log
{ string sOut = "Generator Run : " + sCncFile ;
@@ -72,9 +111,14 @@ Generator::Run( const string& sCncFile, const string& sInfo)
return bOk ;
}
// cancello l'eventuale file di uscita (e anche il file errore)
EraseFile( sCncFile) ;
string sErrFile = ChangeFileExtension( sCncFile, ERR_EXT) ;
EraseFile( sErrFile) ;
// Generazione non abilitata
m_pMchMgr->SetLastError( 1000, "NC_OFF") ;
std::string sErr = "Warning on Key (MKC/NCO)" ;
std::string sErr = ( bNcOff ? "Warning on Key (MKC/NCO)" : "Warning on Key (MKC/KYO)") ;
LOG_ERROR( GetEMkLogger(), sErr.c_str()) ;
return false ;
}
@@ -137,6 +181,13 @@ Generator::CallOnTableData( void)
return m_pMachine->LuaCallFunction( ON_TABLE_DATA) ;
}
//----------------------------------------------------------------------------
bool
Generator::CallOnTableAxisData( void)
{
return m_pMachine->LuaCallFunction( ON_TABLE_AXIS_DATA) ;
}
//----------------------------------------------------------------------------
bool
Generator::CallOnFixtureData( void)
+1
View File
@@ -33,6 +33,7 @@ class Generator : public Processor
bool CallOnDispositionStart( void) override ;
bool CallOnDispositionEnd( void) override ;
bool CallOnTableData( void) override ;
bool CallOnTableAxisData( void) override ;
bool CallOnFixtureData( void) override ;
bool CallOnRawMoveData( void) override ;
bool CallOnToolSelect( void) override ;
+1 -1
View File
@@ -82,7 +82,7 @@ GetRotationComponent( const Vector3d& vtDir1, double dComp, const Vector3d& vtDi
double dDenom = dT0uv * dSinG ;
double dNumer = dComp - dT0w * dCosG ;
// due angoli possibili
if ( abs( dDenom) > abs( dNumer)) {
if ( abs( dDenom) > abs( dNumer) + SIN_EPS_ANG_ZERO) {
double dDeltaAngRad = acos( dNumer / dDenom) ;
dAng1Deg = ( dOffsAngRad + dDeltaAngRad) * RADTODEG ;
dAng2Deg = ( dOffsAngRad - dDeltaAngRad) * RADTODEG ;
+6 -1
View File
@@ -16,11 +16,16 @@
//----------------- Costanti generali ----------------------------------------
#include "/EgtDev/Include/EGkGeoConst.h"
//----------- Minima distanza di sicurezza ----------------------------------
const double MIN_SAFEDIST = 5.0 ;
//----------- Costanti per approssimazioni con polilinee o poliarchi --------
const double LIN_TOL_STD = 0.1 ;
const double LIN_TOL_MID = 0.05 ;
const double ANG_TOL_MAX_DEG = 90 ;
const double LIN_TOL_RAW = 0.5 ;
const double ANG_TOL_STD_DEG = 15 ;
const double ANG_TOL_MID_DEG = 45 ;
const double ANG_TOL_MAX_DEG = 90 ;
const double LIN_FEA_STD = 20 ;
//----------- Costante per offset salva spigoli di lama su cornici curve ----
+23 -5
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2017
// EgalTech 2015-2021
//----------------------------------------------------------------------------
// File : Head.cpp Data : 11.01.17 Versione : 1.6x6
// File : Head.cpp Data : 14.10.21 Versione : 2.3j5
// Contenuto : Oggetto testa per gruppo testa di macchina.
//
//
@@ -49,8 +49,10 @@ Head::Clone( void) const
pHead->m_vsHSet = m_vsHSet ;
pHead->m_vtADir = m_vtADir ;
pHead->m_dRot1W = m_dRot1W ;
pHead->m_bMaxDeltaR2On1 = m_bMaxDeltaR2On1 ;
pHead->m_Rot2Stroke = m_Rot2Stroke ;
pHead->m_nSolCh = m_nSolCh ;
pHead->m_vsOtherColl = m_vsOtherColl ;
}
catch( ...) {
delete pHead ;
@@ -72,6 +74,7 @@ Head::Dump( string& sOut, bool bMM, const char* szNewLine) const
sOut += "ExitCount=" + ToString( m_nExitCount) + szNewLine ;
sOut += "HSet=" + ToString( m_vsHSet) + szNewLine ;
sOut += "ADir=" + ToString( m_vtADir) + szNewLine ;
sOut += "OtherColl=" + ToString( m_vsOtherColl) + szNewLine ;
return true ;
}
@@ -102,7 +105,7 @@ Head::GetGeomDB( void) const
//----------------------------------------------------------------------------
Head::Head( void)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_nType( MCH_HT_NONE), m_nExitCount( 0),
m_dRot1W( 1), m_nSolCh( MCH_SCC_NONE)
m_nSelectType( MCH_SLT_FIXEDEXITS), m_dRot1W( 1), m_bMaxDeltaR2On1( true), m_nSolCh( MCH_SCC_NONE)
{
m_Rot2Stroke.Min = - INFINITO ;
m_Rot2Stroke.Max = INFINITO ;
@@ -110,8 +113,8 @@ Head::Head( void)
//----------------------------------------------------------------------------
bool
Head::Set( const string& sName, int nType, int nExitCount, const string& sHSet, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl)
Head::Set( const string& sName, int nType, int nExitCount, const string& sHSet, int nSelectType, const Vector3d& vtADir,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl)
{
m_sName = sName ;
m_nType = nType ;
@@ -121,8 +124,14 @@ Head::Set( const string& sName, int nType, int nExitCount, const string& sHSet,
m_nExitCount = 1 ;
m_vsHSet.clear() ;
m_vsHSet.push_back( sHSet) ;
if ( nSelectType == MCH_SLT_FIXEDEXITS || nSelectType == MCH_SLT_ONEEXIT || nSelectType == MCH_SLT_MULTIEXITS)
m_nSelectType = nSelectType ;
else
m_nSelectType = MCH_SLT_FIXEDEXITS ;
m_vtADir = vtADir ;
m_vtADir.Normalize() ;
m_dRot1W = dRot1W ;
m_bMaxDeltaR2On1 = bMaxDeltaR2On1 ;
m_Rot2Stroke = Rot2Stroke ;
if ( IsValidHeadScc( nSolCh))
m_nSolCh = nSolCh ;
@@ -142,3 +151,12 @@ Head::AddHeadToHSet( const string& sHead)
m_vsHSet.emplace_back( sHead) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Head::ModifyHeadAuxDirection( const Vector3d& vtADir)
{
m_vtADir = vtADir ;
m_vtADir.Normalize() ;
return true ;
}
+11 -4
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2021
//----------------------------------------------------------------------------
// File : Head.h Data : 25.05.15 Versione : 1.6e7
// File : Head.h Data : 14.10.21 Versione : 2.3j5
// Contenuto : Dichiarazione della classe Head.
//
//
@@ -30,10 +30,11 @@ class Head : public IUserObj
public :
Head( void) ;
bool Set( const std::string& sName, int nType, int nExitCount, const std::string& sHSet,
const Vector3d& vtADir, double dRot1W, const STROKE& Rot2Stroke, int nSolCh,
bool Set( const std::string& sName, int nType, int nExitCount, const std::string& sHSet, int nSelectType,
const Vector3d& vtADir, double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh,
const STRVECTOR& vsOthColl) ;
bool AddHeadToHSet( const std::string& sHead) ;
bool ModifyHeadAuxDirection( const Vector3d& vtADir) ;
const std::string& GetName( void) const
{ return m_sName ; }
int GetType( void) const
@@ -42,10 +43,14 @@ class Head : public IUserObj
{ return m_nExitCount ; }
const STRVECTOR& GetHSet(void) const
{ return m_vsHSet ; }
int GetSelectType( void) const
{ return m_nSelectType ; }
const Vector3d& GetADir( void) const
{ return m_vtADir ; }
double GetRot1W( void) const
{ return m_dRot1W ; }
bool GetMaxDeltaR2On1( void) const
{ return m_bMaxDeltaR2On1 ; }
const STROKE& GetRot2Stroke( void) const
{ return m_Rot2Stroke ; }
int GetSolCh( void) const
@@ -60,8 +65,10 @@ class Head : public IUserObj
int m_nType ;
int m_nExitCount ;
STRVECTOR m_vsHSet ;
int m_nSelectType ;
Vector3d m_vtADir ;
double m_dRot1W ;
bool m_bMaxDeltaR2On1 ;
STROKE m_Rot2Stroke ;
int m_nSolCh ;
STRVECTOR m_vsOtherColl ;
+22
View File
@@ -31,6 +31,8 @@ const std::string MACH_FIXT_GROUP = "Fixt" ;
const std::string MACH_SETUP_GROUP = "Setup" ;
// Gruppo dei grezzi in una macchinata
const std::string MACH_RAW_GROUP = "Raws" ;
// Gruppo dei collegamenti per waterjet in una macchinata
const std::string MACH_BRIDGES_GROUP = "Bridges" ;
// Gruppo delle operazioni in una macchinata
const std::string MACH_OPER_GROUP = "Opers" ;
// Chiave per info fase di appartenenza di una fixture
@@ -45,6 +47,10 @@ const std::string MACH_RAW_SOLID = "RawSolid" ;
const std::string MACH_RAW_CENTER = "RawCenter" ;
// Nome del contorno esterno del grezzo
const std::string MACH_RAW_OUTLINE = "RawOutline" ;
// Nome della regione superiore del grezzo
const std::string MACH_RAW_UP_REG = "RawUpReg" ;
// Nome della regione inferiore del grezzo
const std::string MACH_RAW_DOWN_REG = "RawDwnReg" ;
// Nome del kerf del grezzo
const std::string MACH_RAW_KERF = "Kerf" ;
@@ -78,6 +84,12 @@ const std::string GENMACHINING_SEC = "GenMachining" ;
// Chiave (radice) per nome lavorazione generica i-esima
const std::string GENMACHINING_SCRIPT_KEY = "GenScript" ;
//----------------------------------------------------------------------------
// Sezione fresature 5assi nel file INI di macchina
const std::string FIVEAXISMILLING_SEC = "5AxMilling" ;
// Chiave (radice) per nome lavorazione 5assi i-esima
const std::string FIVEAXISMILLING_SCRIPT_KEY = "5AxScript" ;
//----------------------------------------------------------------------------
// Sezione di attrezzaggio nel file INI di macchina
const std::string SETUP_SEC = "Setup" ;
@@ -110,6 +122,12 @@ const std::string MILLHOLDER_KEY = "MillHolder" ;
// Sezione portautensili nel file INI di macchina
const std::string TOOLHOLDER_SEC = "ToolHolder" ;
//----------------------------------------------------------------------------
// Sezione lavorazioni nel file INI di macchina
const std::string MACHININGS_SEC = "Machinings" ;
// Chiave per abilitare discesa e risalita in rapido da fresature con estremi fuori dal grezzo
const std::string RAPIDONOUT_KEY = "RapidOnOut" ;
//----------------------------------------------------------------------------
// Minimo spessore del grezzo
const double RAW_MIN_H = 1 ;
@@ -125,11 +143,15 @@ const double MAX_ANG_CEN = 150.001 ;
//----------------------------------------------------------------------------
// Tolleranza su elevazione per attacchi e uscite
const double LIO_ELEV_TOL = 2.0 ;
const double LIO_ELEV_FLOAT = 10.0 ;
//----------------------------------------------------------------------------
// Per FlatParts (vedi Nesting di EgtExecutor)
const std::string NST_EXT_LAYER = "OutLoop" ;
const std::string NST_PARTREG_LAYER = "Region" ;
//----------------------------------------------------------------------------
// Minima componente zeta di versore utensile per lavorazione da sopra (-45deg)
const double MIN_ZDIR_TOP_TOOL = -0.7072 ;
// Minima componente zeta di versose utensile èer mortasatura quasi verticale (45deg)
const double MIN_ZDIR_VERT_CHSAW = 0.7072 ;
+60 -14
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2021
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachMgr.h Data : 24.05.21 Versione : 2.3e3
// File : MachMgr.h Data : 25.11.24 Versione : 2.6k5
// Contenuto : Dichiarazione della classe MachMgr.
//
//
@@ -10,6 +10,13 @@
// 16.05.19 DS Aggiunto parametro sToolMakersDir a Init.
// 17.08.20 DS Aggiunte GetAxisMin e GetAxisMax.
// 17.03.21 DS Aggiunte funzioni per import/export utensili.
// 21.09.22 DS Aggiunta GetAxisOffset.
// 25.08.23 DS Aggiunta CopyMachGroup.
// 28.10.23 DS Aggiunte GetClEntAxesVal e GetToolSetupPosInCurrSetup.
// 30.03.24 DS Aggiunte GetAllAxesNames e GetCalcTable.
// 02.04.24 DS Aggiunta GetClEntAxesMask.
// 22.04.24 DS Aggiunta GetExitId.
// 25.11.24 DS Aggiunta GetMachiningSkippedGeometry.
//
//----------------------------------------------------------------------------
@@ -51,14 +58,15 @@ struct AxisBlock {
//----------------------------------------------------------------------------
struct MachineData {
std::string sName ;
std::string sName ;
std::string sDir ;
Machine* pMachine ;
ToolsMgr* pTsMgr ;
MachiningsMgr* pMsMgr ;
MachineData( void)
: pMachine( nullptr), pTsMgr( nullptr), pMsMgr( nullptr) {}
MachineData( const std::string& sN, Machine* pM, ToolsMgr* pTM, MachiningsMgr* pMM)
{ sName = sN ; pMachine = pM ; pTsMgr = pTM ; pMsMgr = pMM ; }
MachineData( const std::string& sN, const std::string& sD, Machine* pM, ToolsMgr* pTM, MachiningsMgr* pMM)
{ sName = sN ; sDir = sD ; pMachine = pM ; pTsMgr = pTM ; pMsMgr = pMM ; }
} ;
//----------------------------------------------------------------------------
@@ -80,6 +88,7 @@ class MachMgr : public IMachMgr
std::string GetWarningString( int nInd) const override
{ if ( nInd < 0 || nInd >= int( m_Warnings.size())) return "" ; return m_Warnings[ nInd].second ; }
// Machines
bool GetMachines( STRVECTOR& vsMachineNames, STRVECTOR& vsMachineDirs) const override ;
bool SetCurrMachine( const std::string& sMachineName) override ;
bool GetCurrMachineName( std::string& sMachineName) const override ;
bool GetCurrMachineDir( std::string& sMachineDir) const override ;
@@ -92,7 +101,9 @@ class MachMgr : public IMachMgr
int GetPrevMachGroup( int nId) const override ;
bool GetMachGroupNewName( std::string& sName) const override ;
int AddMachGroup( const std::string& sName, const std::string& sMachineName) override ;
int CopyMachGroup( const std::string& sSouName, const std::string& sName) override ;
bool RemoveMachGroup( int nId) override ;
bool ChangeMachGroupName( int nId, const std::string& sNewName) override ;
std::string GetMachGroupName( int nId) const override ;
std::string GetMachGroupMachineName( int nId) const override ;
int GetMachGroupId( const std::string& sName) const override ;
@@ -144,7 +155,11 @@ class MachMgr : public IMachMgr
bool GetTableRef( int nInd, Point3d& ptPos) const override ;
bool GetTableArea( int nInd, BBox3d& b3Area) const override ;
bool GetTableAreaOffset( int nInd, BBox3d& b3AreaOffs) const override ;
bool ChangeTable( const std::string& sTable, bool bUpdateDisp) override ;
bool ShowOnlyTable( bool bVal) override ;
bool MoveDispAxis( const std::string& sName, double dPos) override ;
bool RemoveDispAxis( const std::string& sName) override ;
bool KeepAllDispAxes( int nSouPhase) override ;
int AddFixture( const std::string& sName, const Point3d& ptPos, double dAngRotDeg, double dMov) override ;
bool KeepFixture( int nFxtId, int nSouPhase) override ;
bool RemoveFixture( int nFxtId) override ;
@@ -153,7 +168,9 @@ class MachMgr : public IMachMgr
int GetNextFixture( int nFxtId) const override ;
bool MoveFixture( int nId, const Vector3d& vtMove) override ;
bool RotateFixture( int nId, double dDeltaAngDeg) override ;
bool SetFixtureLink( int nId, const std::string& sTaLink) override ;
bool MoveFixtureMobile( int nId, double dDeltaMov) override ;
bool SetFixtureMobile( int nId, double dMov) override ;
// Tools DataBase
bool TdbGetToolNewName( std::string& sName) const override ;
bool TdbAddTool( const std::string& sName, int nType) override ;
@@ -199,6 +216,7 @@ class MachMgr : public IMachMgr
bool ImportSetup( const std::string& sName) override ;
bool VerifyCurrSetup( STRVECTOR& vsErrors) override ;
bool FindToolInCurrSetup( const std::string& sTool) override ;
bool GetToolSetupPosInCurrSetup( const std::string& sTool, std::string& sTcPos) override ;
bool GetToolsInCurrSetupPos( const std::string& sTcPos, STRVECTOR& vsTools) override ;
bool UpdateCurrSetup( void) override ;
bool EraseCurrSetup( void) override ;
@@ -230,6 +248,10 @@ class MachMgr : public IMachMgr
bool MdbReload( void) override ;
bool MdbSave( void) const override ;
bool MdbGetMachiningDir( std::string& sMchDir) const override ;
bool MdbExport( const STRVECTOR& vsMachiningsNames, const std::string& sOutFile) const override ;
bool MdbToBeImported( const std::string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const override ;
bool MdbImport( const std::string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames,
STRVECTOR& vsImported) override ;
// Operations : general
int GetOperationCount( void) const override ;
int GetFirstOperation( void) const override ;
@@ -263,6 +285,7 @@ class MachMgr : public IMachMgr
int GetPhaseDisposition( int nPhase) const override ;
bool DispositionSpecialApply( int nId, bool bRecalc) override ;
bool DispositionSpecialUpdate( int nId) override ;
bool GetDispositionToolData( int nId, std::string& sName, std::string& sHead, int& nExit, std::string& sTcPos) override ;
// Operations : machinings
int AddMachining( const std::string& sName, const std::string& sMachining) override ;
int AddMachining( const std::string& sName, int nMchType, const std::string& sTool) override ;
@@ -282,19 +305,24 @@ class MachMgr : public IMachMgr
bool MachiningUpdate( bool bPostApply = true) override ;
bool PreparePreviewMachiningTool( void) const override ;
bool RemovePreviewMachiningTool( void) const override ;
int PreviewMachiningTool( int nEntId, int nFlag) const override ;
int GetPreviewMachiningToolStepCount( void) const override ;
int PreviewMachiningTool( int nEntId, int nStep) const override ;
bool GetMachiningParam( int nType, bool& bVal) const override ;
bool GetMachiningParam( int nType, int& nVal) const override ;
bool GetMachiningParam( int nType, double& dVal) const override ;
bool GetMachiningParam( int nType, std::string& sVal) const override ;
bool GetMachiningGeometry( SELVECTOR& vIds) const override ;
bool GetMachiningSkippedGeometry( SELVECTOR& vIds) const override ;
bool IsMachiningEmpty( void) const override ;
bool GetMachiningStartPoint( Point3d& ptStart) const override ;
bool GetMachiningEndPoint( Point3d& ptEnd) const override ;
// CL Entities Interrogations
bool GetClEntMove( int nEntId, int& nMove) const override ;
bool GetClEntFlag( int nEntId, int& nFlag) const override ;
bool GetClEntFlag( int nEntId, int& nFlag, int& nFlag2) const override ;
bool GetClEntIndex( int nEntId, int& nIndex) const override ;
bool GetClEntAxesStatus( int nEntId, int& nStatus) const override ;
bool GetClEntAxesMask( int nEntId, int& nMask) const override ;
bool GetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) const override ;
// Simulation
bool SimInit( void) override ;
bool SimStart( bool bFirst) override ;
@@ -313,8 +341,10 @@ class MachMgr : public IMachMgr
// Machine Calc
bool SetCalcTable( const std::string& sTable) override ;
bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) override ;
bool GetAllCurrAxesNames( STRVECTOR& vAxName) const override ;
bool SetRotAxisBlock( const std::string& sAxis, double dVal) override ;
bool GetRotAxisBlocked( int nInd, std::string& sAxis, double& dVal) const override ;
bool GetCalcTable( std::string& sTable) const override ;
bool GetCalcTool( std::string& sTool) const override ;
bool GetCalcHead( std::string& sHead) const override ;
bool GetCalcExit( int& nExit) const override ;
@@ -342,10 +372,13 @@ class MachMgr : public IMachMgr
int GetAxisId( const std::string& sAxis) const override ;
int GetHeadId( const std::string& sHead) const override ;
int GetHeadExitCount( const std::string& sHead) const override ;
int GetExitId( const std::string& sHead, int nExit) const override ;
int GetTcPosId( const std::string& sTcPos) const override ;
bool GetAxisToken( const std::string& sAxis, std::string& sToken) const override ;
bool GetAxisType( const std::string& sAxis, bool& bLinear) const override ;
bool GetAxisDir( const std::string& sAxis, Vector3d& vtDir) const override ;
bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const override ;
bool GetAxisOffset( const std::string& sAxis, double& dOffset) const override ;
bool SetAxisPos( const std::string& sAxis, double dVal, double* pdNewVal = nullptr) override ;
bool GetAxisPos( const std::string& sAxis, double& dVal) const override ;
bool GetAxisMin( const std::string& sAxis, double& dMin) const override ;
@@ -354,6 +387,7 @@ class MachMgr : public IMachMgr
bool ResetAxisPos( const std::string& sAxis) override ;
bool ResetAllAxesPos( void) override ;
bool GetAllTablesNames( STRVECTOR& vNames) const override ;
bool GetAllAxesNames( STRVECTOR& vNames) const override ;
bool GetAllHeadsNames( STRVECTOR& vNames) const override ;
bool GetAllTcPosNames( STRVECTOR& vNames) const override ;
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) override ;
@@ -421,9 +455,13 @@ class MachMgr : public IMachMgr
// MachineCalc
int GetCurrLinAxes( void) const ;
int GetCurrRotAxes( void) const ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool GetCurrAxisMax( int nInd, double& dHome) const ;
bool GetCurrAxisMin( int nInd, double& dHome) const ;
const Frame3d& GetCurrLinAxesFrame( void) const ;
bool GetCurrIsCenter( void) const ;
bool GetCurrIsRobot( void) const ;
bool ApplyRotAxisBlock( void) ;
void ClearRotAxisBlock( void)
{ m_vAxisBlock.clear() ; }
@@ -432,6 +470,7 @@ class MachMgr : public IMachMgr
int GetCalcHead( void) const ;
int GetCalcExit( void) const ;
double GetCalcRot1W( void) const ;
bool GetCalcMaxDeltaR2OnFirst( void) const ;
bool GetCalcPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const ;
bool SetCalcSolCh( int nScc, bool bExact) ;
bool VerifyAngleOutstroke( int nInd, double dAng) const ;
@@ -441,12 +480,18 @@ class MachMgr : public IMachMgr
bool GetOperationNewName( std::string& sName) const ;
const ToolData* GetMachiningToolData( void) const ;
// Simulation
bool SimAddCollisionObj( int nInd, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) ;
bool SimAddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) ;
bool SimExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType) ;
bool SimOnCollision( int nCdInd, int nObjInd, int& nErr) ;
bool SimSetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag, double dPar1, double dPar2,
const INTVECTOR& vVmill, bool bFirst) ;
bool SimEnableToolsForVmill( bool bEnable) ;
int SimMoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) ;
bool SimSaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) ;
// Machine
bool ResetAllAxesPos( bool bStdAxes, bool bDispAxes) ;
bool IsDispositionAxis( const std::string& sAxis, const std::string& sTable = "") const ;
bool GetHeadAbove( const std::string& sHead) const ;
double GetDeltaSafeZ( const std::string& sHead) const ;
double GetAngDeltaMinForHome( void) const ;
private :
@@ -473,6 +518,7 @@ class MachMgr : public IMachMgr
// RawParts
int AddRawPart( int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol) ;
int AddRawPart( int nSurfId, Color cCol) ;
int AddRawPart( int nSurfUpId, int nSurfDownId, double dHeight, Color cCol) ;
bool SetRawPartCenter( int nRawId) ;
bool ResetRawPartCenter( int nRawId) ;
// Parts
@@ -483,11 +529,11 @@ class MachMgr : public IMachMgr
bool ShowRootParts( bool bShow) ;
// Tools DataBase
bool UpdateAllToolDraws( void) const ;
bool UpdateToolDraw( const EgtUUID& UuidTool) const ;
bool UpdateToolDraw( const EgtUUID& UuidTool, double& dTHoldBase, double& dTHoldLen, double& dTHoldDiam) const ;
int UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx, bool bToSave) const ;
int UpdateCustomToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx, bool bToSave) const ;
std::string GetToolMakerKeyFromType( int nType) const ;
std::string GetToolHolderPath( const std::string& sHeadName, int nExit, int nType) const ;
std::string GetToolHolderPath( const std::string& sHeadName, int nExit, int nType, const std::string& sUserNotes) const ;
// Operations : general
bool InitOperation( int nId) ;
// Operations : dispositions
@@ -500,7 +546,7 @@ class MachMgr : public IMachMgr
private :
int m_nContextId ; // indice contesto corrente (1-based)
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico del contesto corrente
std::string m_sMachinesDir ; // direttorio delle macchine
STRVECTOR m_vMachinesBaseDir ; // direttori di base delle macchine (ordine molto importante)
std::string m_sToolMakersDir ; // direttorio dei generatori di disegni utensili standard
std::string m_sLuaLibsDir ; // direttorio delle librerie lua
std::string m_sLuaLastRequire ; // nome ultima libreria caricata
@@ -519,5 +565,5 @@ class MachMgr : public IMachMgr
int m_nCurrDispId ; // identificativo della disposizione corrente
int m_nCurrMachiningId ; // identificativo della lavorazione corrente
AXBLOCKVECTOR m_vAxisBlock ; // elenco assi da bloccare
Simulator* m_pSimul ; // puntatore al simulatore attivo
ISimulator* m_pSimul ; // puntatore al simulatore attivo
} ;
+21 -5
View File
@@ -18,7 +18,7 @@
#include "DllMain.h"
#include "/EgtDev/Include/EMkDllMain.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EgnFileUtils.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EgtKeyCodes.h"
#include "/EgtDev/Include/SELkKeyProc.h"
#include <new>
@@ -30,7 +30,7 @@ IMachMgr*
CreateMachMgr( void)
{
// verifico la chiave e le opzioni
if ( ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger()))
if ( ! GetEMkNetHwKey() && ! TestKeyForEMk( GetEMkKey(), 0, GetEMkLogger()))
return nullptr ;
// creo il MachMgr
return static_cast<IMachMgr*> ( new(nothrow) MachMgr) ;
@@ -94,7 +94,19 @@ MachMgr::Init( const string& sMachinesDir, const string& sToolMakersDir, IGeomDB
{
m_nContextId = nContextId ;
m_pGeomDB = pGeomDB ;
m_sMachinesDir = sMachinesDir ;
STRVECTOR vsDir ;
Tokenize( sMachinesDir, "|", vsDir) ;
for ( int i = 0 ; i < int( vsDir.size()) ; ++ i) {
string sDir = vsDir[i] ;
TrimRight( sDir, " \\") ;
if ( ExistsDirectory( vsDir[i]) &&
find_if( m_vMachinesBaseDir.begin(), m_vMachinesBaseDir.end(),
[ sDir]( const string& sItem)
{ return ( EqualNoCase( sDir, sItem)) ; }) == m_vMachinesBaseDir.end()) {
m_vMachinesBaseDir.emplace_back( sDir) ;
}
}
m_sToolMakersDir = sToolMakersDir ;
m_sLuaLibsDir = sLuaLibsDir ;
m_sLuaLastRequire = sLuaLastRequire ;
@@ -103,7 +115,7 @@ MachMgr::Init( const string& sMachinesDir, const string& sToolMakersDir, IGeomDB
m_nCurrMGrpId = GDB_ID_NULL ;
m_nCurrMch = - 1 ;
m_stuMgr.Reset() ;
return ( m_nContextId > 0 && m_pGeomDB != nullptr && ExistsDirectory( m_sMachinesDir)) ;
return ( m_nContextId > 0 && m_pGeomDB != nullptr && ! m_vMachinesBaseDir.empty()) ;
}
//----------------------------------------------------------------------------
@@ -299,7 +311,11 @@ MachMgr::SetLastError( int nErr, const string& sErr)
{
m_nLastError = nErr ;
m_sLastError = sErr ;
string sInfo = m_sLastError + " (" + ToString( nErr) + ")" ;
string sInfo ;
if ( sErr._Starts_with( "Error"))
sInfo = m_sLastError + " (" + ToString( nErr) + ")" ;
else
sInfo = "Error " + ToString( nErr) + " : " + m_sLastError ;
LOG_ERROR( GetEMkLogger(), sInfo.c_str()) ;
return true ;
}
+61 -4
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2019-2019
// EgalTech 2019-2023
//----------------------------------------------------------------------------
// File : MachMgrClEntities.cpp Data : 15.10.19 Versione : 2.1j4
// File : MachMgrClEntities.cpp Data : 27.10.23 Versione : 2.5j4
// Contenuto : Implementazione interrogazione entità CL della classe MachMgr.
//
//
@@ -16,6 +16,7 @@
#include "DllMain.h"
#include "MachMgr.h"
#include "MachConst.h"
#include "CamData.h"
using namespace std ;
@@ -39,10 +40,11 @@ MachMgr::GetClEntMove( int nEntId, int& nMove) const
//----------------------------------------------------------------------------
bool
MachMgr::GetClEntFlag( int nEntId, int& nFlag) const
MachMgr::GetClEntFlag( int nEntId, int& nFlag, int& nFlag2) const
{
// default
nFlag = 0 ;
nFlag2 = 0 ;
// verifico validita GeomDB
if ( m_pGeomDB == nullptr)
return false ;
@@ -50,8 +52,9 @@ MachMgr::GetClEntFlag( int nEntId, int& nFlag) const
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
return false ;
// recupero il flag
// recupero i flag
nFlag = pCamData->GetFlag() ;
nFlag2 = pCamData->GetFlag2() ;
return true ;
}
@@ -72,3 +75,57 @@ MachMgr::GetClEntIndex( int nEntId, int& nIndex) const
nIndex = pCamData->GetIndex() ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetClEntAxesStatus( int nEntId, int& nStatus) const
{
// default
nStatus = 0 ;
// verifico validita GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero l'oggetto CamData
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
return false ;
// recupero il tipo di movimento
nStatus = pCamData->GetAxesStatus() ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetClEntAxesMask( int nEntId, int& nMask) const
{
// default
nMask = 0 ;
// verifico validita GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero l'oggetto CamData
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
return false ;
// recupero il tipo di movimento
nMask = pCamData->GetAxesMask() ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) const
{
// default
vAxes.clear() ;
// verifico validita GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero l'oggetto CamData
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
return false ;
// recupero i valori degli assi
vAxes = pCamData->GetAxesVal() ;
return true ;
}
+66 -5
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachMgrDBMachinings.cpp Data : 11.11.15 Versione : 1.6k5
// File : MachMgrDBMachinings.cpp Data : 29.03.24 Versione : 2.6d1
// Contenuto : Implementazione gestione DB lavorazioni della classe MachMgr.
//
//
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "DllMain.h"
#include "MachMgr.h"
#include "/EgtDev/Include/EGnFileUtils.h"
using namespace std ;
@@ -303,6 +304,8 @@ MachMgr::MdbSetGeneralParam( int nType, double dVal)
return pMsMgr->SetSafeAggrBottZ( dVal) ;
case MGP_MAXDEPTHSAFE :
return pMsMgr->SetMaxDepthSafe( dVal) ;
case MGP_APPROXLINTOL :
return pMsMgr->SetApproxLinTol( dVal) ;
}
return false ;
}
@@ -378,6 +381,9 @@ MachMgr::MdbGetGeneralParam( int nType, double& dVal) const
case MGP_MAXDEPTHSAFE :
dVal = pMsMgr->GetMaxDepthSafe() ;
return true ;
case MGP_APPROXLINTOL :
dVal = pMsMgr->GetApproxLinTol() ;
return true ;
}
return false ;
}
@@ -410,9 +416,64 @@ MachMgr::MdbSave( void) const
bool
MachMgr::MdbGetMachiningDir( string& sMchDir) const
{
string sMachineName ;
if ( ! GetCurrMachineName( sMachineName))
string sMachineDir, sMachineName ;
if ( ! GetCurrMachineDir( sMachineDir) || ! GetCurrMachineName( sMachineName))
return false ;
sMchDir = m_sMachinesDir + "\\" + sMachineName + "\\" + MACHININGS_DIR ;
sMchDir = sMachineDir + "\\" + MACHININGS_DIR ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MdbExport( const STRVECTOR& vsMachiningsNames, const string& sOutFile) const
{
if ( vsMachiningsNames.empty())
return true ;
// recupero il gestore di lavorazioni della macchina corrente
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
if ( pMsMgr == nullptr)
return false ;
return pMsMgr->Export( vsMachiningsNames, sOutFile) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MdbToBeImported( const string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const
{
if ( ! ExistsFile( sFile)) {
LOG_ERROR( GetEMkLogger(), "MdbToBeImported Error : File does not exist") ;
return false ;
}
// recupero il gestore di lavorazioni della macchina corrente
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
if ( pMsMgr == nullptr)
return false ;
return pMsMgr->ToBeImported( sFile, vsMachiningsNames, vMachiningsTypes) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MdbImport( const string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported)
{
if ( vsMachiningsToImport.empty())
return true ;
if ( ! ExistsFile( sFile)) {
LOG_ERROR( GetEMkLogger(), "MdbImport Error : File does not exist") ;
return false ;
}
if ( vsMachiningsToImport.size() != vsMachiningsNames.size())
return false ;
// recupero il gestore di lavorazioni della macchina corrente
MachiningsMgr* pMsMgr = GetCurrMachiningsMgr() ;
if ( pMsMgr == nullptr)
return false ;
return pMsMgr->Import( sFile, vsMachiningsToImport, vsMachiningsNames, vsImported) ;
}
+63 -23
View File
@@ -481,10 +481,10 @@ MachMgr::TdbSave( void) const
bool
MachMgr::TdbGetToolDir( string& sToolDir) const
{
string sMachineName ;
if ( ! GetCurrMachineName( sMachineName))
string sMachineDir, sMachineName ;
if ( ! GetCurrMachineDir( sMachineDir) || ! GetCurrMachineName( sMachineName))
return false ;
sToolDir = m_sMachinesDir + "\\" + sMachineName + "\\" + TOOLS_DIR ;
sToolDir = sMachineDir + "\\" + TOOLS_DIR ;
return true ;
}
@@ -492,10 +492,10 @@ MachMgr::TdbGetToolDir( string& sToolDir) const
bool
MachMgr::TdbGetToolHolderDir( string& sToolHolderDir) const
{
string sMachineName ;
if ( ! GetCurrMachineName( sMachineName))
string sMachineDir, sMachineName ;
if ( ! GetCurrMachineDir( sMachineDir) || ! GetCurrMachineName( sMachineName))
return false ;
sToolHolderDir = m_sMachinesDir + "\\" + sMachineName + "\\" + TOOLHOLDERS_DIR ;
sToolHolderDir = sMachineDir + "\\" + TOOLHOLDERS_DIR ;
return true ;
}
@@ -526,9 +526,15 @@ MachMgr::UpdateAllToolDraws( void) const
// verifico se non esiste il disegno associato
string sDraw ; pTdata->GetParam( TPA_DRAW, sDraw) ;
bool bNoDraw = ( ! sDraw.empty() && ! ExistsFile( sToolDir + "\\" + sDraw)) ;
// se modificato o senza disegno, ne lancio la creazione
if ( bModif || bNoDraw)
UpdateToolDraw( UuidTool) ;
// se modificato o senza disegno, ne lancio la creazione e aggiorno dati portautensile
if ( bModif || bNoDraw) {
double dTHoldBase = 0, dTHoldLen = 0, dTHoldDiam = 0 ;
UpdateToolDraw( UuidTool, dTHoldBase, dTHoldLen, dTHoldDiam) ;
pTsMgr->SetCurrTool( sName) ;
pTsMgr->UpdateCurrToolHolderData( dTHoldBase, dTHoldLen, dTHoldDiam) ;
pTsMgr->SaveCurrTool() ;
pTsMgr->SetCurrTool( "") ;
}
// passo al successivo
bNext = pTsMgr->GetNextTool( TF_ALL, sName, nType) ;
}
@@ -542,7 +548,7 @@ MachMgr::UpdateAllToolDraws( void) const
//----------------------------------------------------------------------------
bool
MachMgr::UpdateToolDraw( const EgtUUID& UuidTool) const
MachMgr::UpdateToolDraw( const EgtUUID& UuidTool, double& dTHoldBase, double& dTHoldLen, double& dTHoldDiam) const
{
// recupero il gestore di utensili della macchina corrente
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
@@ -581,6 +587,14 @@ MachMgr::UpdateToolDraw( const EgtUUID& UuidTool) const
// Salvo il disegno
ExeSetCurrentContext( nToolCtx) ;
bOk = bOk && ExeSaveFile( sDrawPath, GDB_SV_BIN) ;
// Recupero i dati del portautensile
int nToolId = ExeGetFirstGroupInGroup( GDB_ID_ROOT) ;
if ( ! ExeGetInfo( nToolId, TTH_BASE, dTHoldBase))
dTHoldBase = 0 ;
if ( ! ExeGetInfo( nToolId, TTH_LEN, dTHoldLen))
dTHoldLen = 0 ;
if ( ! ExeGetInfo( nToolId, TTH_DIAM, dTHoldDiam))
dTHoldDiam = 0 ;
// Ripristino il contesto originale
ExeSetCurrentContext( nGenCtx) ;
ExeDeleteContext( nToolCtx) ;
@@ -617,6 +631,8 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
pTdata->GetParam( TPA_TOTDIAM, dTotDiam) ;
double dDist = 0 ;
pTdata->GetParam( TPA_DIST, dDist) ;
double dStemDiam = 0 ;
pTdata->GetParam( TPA_STEMDIAM, dStemDiam) ;
double dMaxMat = 0 ;
pTdata->GetParam( TPA_MAXMAT, dMaxMat) ;
double dCornRad = 0 ;
@@ -625,10 +641,18 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
pTdata->GetParam( TPA_SIDEANG, dSideAng) ;
double dThick = 0 ;
pTdata->GetParam( TPA_THICK, dThick) ;
double dCore = 0 ;
pTdata->GetParam( TPA_CORE, dCore) ;
if ( dCore < EPS_SMALL && ( nType == TT_SAW_STD || nType == TT_SAW_FLAT))
dCore = ( dLen >= dThick ? dThick - 1 : 2 * dLen - dThick) ;
double dSpeed = 0 ;
pTdata->GetParam( TPA_SPEED, dSpeed) ;
double dTipFeed = 0 ;
pTdata->GetParam( TPA_TIPFEED, dTipFeed) ;
string sUserNotes ;
pTdata->GetParam( TPA_USERNOTES, sUserNotes) ;
// Recupero la path dell'eventuale portautensile
string sThPath = GetToolHolderPath( sHeadName, nExit, nType) ;
string sThPath = GetToolHolderPath( sHeadName, nExit, nType, sUserNotes) ;
// Carico generatore disegno utensile
string sMaker = GetPrivateProfileStringUtf8( TOOLS_SEC.c_str(), GetToolMakerKeyFromType( nType).c_str(), "", sMachIni.c_str()) ;
if ( sMaker.empty())
@@ -642,6 +666,8 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
// Assegno i dati utensile
bool bOk = ExeLuaSetGlobIntVar( "TOOL.TYPE", nType) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.SPEED", dSpeed) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.TIPFEED", dTipFeed) ;
bOk = bOk && ExeLuaSetGlobStringVar( "TOOL.USERNOTES", sUserNotes) ;
switch ( nType) {
case TT_DRILL_STD :
case TT_DRILL_LONG :
@@ -657,7 +683,7 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
bOk = bOk && ExeLuaSetGlobStringVar( "TOOL.TOOLHOLDER", sThPath) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.LEN", dLen) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.DIAM", dDiam) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORE", ( dLen >= dThick ? dThick - 1 : 2 * dLen - dThick)) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORE", dCore) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.THICK", dThick) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.MAXMAT", dMaxMat) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.CORNRAD", dCornRad) ;
@@ -671,6 +697,7 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.LEN", dLen) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.TOTDIAM", dTotDiam) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.DIAM", dDiam) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.STEMDIAM", dStemDiam) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.MAXMAT", dMaxMat) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.HEIGHT", dThick) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.SIDEANG", dSideAng) ;
@@ -695,7 +722,7 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
if ( ! ExeLuaGetGlobIntVar( "TOOL.ERR", &nErr) || nErr != 0)
return nErr ;
// Se per salvataggio
if ( bOk && bToSave) {
if ( bOk && bToSave) {
// Nascondo layer ausiliario
int nAuxId = ExeGetFirstNameInGroup( ExeGetFirstGroupInGroup( GDB_ID_ROOT), "AUX") ;
ExeSetStatus( { nAuxId}, GDB_ST_OFF) ;
@@ -705,6 +732,16 @@ MachMgr::UpdateStandardToolDraw( const ToolData* pTdata, int nGenCtx, int nToolC
ExeRotate( { nPartId}, ORIG, Z_AX, -90, RTY_GLOB) ;
}
}
// altrimenti per visualizzazione
else if ( bOk) {
// Nascondo oggetto/i Carter
int nSolidId = ExeGetFirstNameInGroup( ExeGetFirstGroupInGroup( GDB_ID_ROOT), "SOLID") ;
int nCarterId = ExeGetFirstNameInGroup( nSolidId, "Carter") ;
while ( nCarterId != GDB_ID_NULL) {
ExeSetStatus( { nCarterId}, GDB_ST_OFF) ;
nCarterId = ExeGetNextName( nCarterId, "Carter") ;
}
}
return ( bOk ? 0 : TD_INT_ERR) ;
}
@@ -724,9 +761,10 @@ MachMgr::UpdateCustomToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx
pTdata->GetParam( TPA_DIAM, dDiam) ;
double dDist = 0 ;
pTdata->GetParam( TPA_DIST, dDist) ;
// Non più limitato alle sole frese
//if ( nType != TT_MILL_STD && nType != TT_MILL_NOTIP && nType != TT_MILL_POLISHING)
// return TD_INT_ERR ;
double dSpeed = 0 ;
pTdata->GetParam( TPA_SPEED, dSpeed) ;
string sUserNotes ;
pTdata->GetParam( TPA_USERNOTES, sUserNotes) ;
// Imposto contesto per il disegno utensile
if ( ! ExeSetCurrentContext( nToolCtx))
return TD_INT_ERR ;
@@ -736,6 +774,8 @@ MachMgr::UpdateCustomToolDraw( const ToolData* pTdata, int nGenCtx, int nToolCtx
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.LEN", dLen) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.DIAM", dDiam) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.DIST", dDist) ;
bOk = bOk && ExeLuaSetGlobNumVar( "TOOL.SPEED", dSpeed) ;
bOk = bOk && ExeLuaSetGlobStringVar( "TOOL.USERNOTES", sUserNotes) ;
// Eseguo aggiornamento utensile
bOk = bOk && ExeLuaCallFunction( "AdjustCustomTool") ;
// Recupero errore
@@ -774,7 +814,7 @@ MachMgr::GetToolMakerKeyFromType( int nType) const
//----------------------------------------------------------------------------
string
MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType) const
MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType, const std::string& sUserNotes) const
{
// Verifiche su testa e uscita
if ( sHeadName.empty() || nExit == 0)
@@ -821,9 +861,9 @@ MachMgr::GetToolHolderPath( const string& sHeadName, int nExit, int nType) const
sToolHolder = GetPrivateProfileStringUtf8( TOOLS_SEC.c_str(), MILLHOLDER_KEY.c_str(), "", sMachIni.c_str()) ;
}
// Verifico se sovrascritto da nota dell'utensile
string sNotes, sVal ;
if ( TdbGetCurrToolParam( TPA_USERNOTES, sNotes) &&
GetValInNotes( sNotes, "TH", sVal) &&
string sVal ;
if ( ! sUserNotes.empty() &&
GetValInNotes( sUserNotes, "TH", sVal) &&
ExistsFile( sToolHolderDir + "\\" + sVal))
sToolHolder = sVal ;
// Se non trovato ancora, esco
@@ -840,7 +880,7 @@ MachMgr::TdbExport( const STRVECTOR& vsToolsNames, const string& sOutFile) const
if ( vsToolsNames.empty())
return true ;
// recupero il gestore di utensili della macchina corrente
// recupero il gestore di utensili della macchina corrente
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
if ( pTsMgr == nullptr)
return false ;
@@ -875,7 +915,7 @@ MachMgr::TdbImport( const string& sFile, const STRVECTOR& vsToolsToImport, const
if ( vsToolsToImport.empty())
return true ;
if ( ! ExistsFile( sFile)){
if ( ! ExistsFile( sFile)) {
LOG_ERROR( GetEMkLogger(), "TdbImport Error : File does not exist") ;
return false ;
}
@@ -884,7 +924,7 @@ MachMgr::TdbImport( const string& sFile, const STRVECTOR& vsToolsToImport, const
return false ;
ToolsMgr* pTsMgr = GetCurrToolsMgr() ;
if ( pTsMgr == nullptr){
if ( pTsMgr == nullptr) {
LOG_ERROR( GetEMkLogger(), "TdbImport Error : no current ToolsMgr") ;
return false ;
}
+99 -11
View File
@@ -44,6 +44,26 @@ MachMgr::GetTable( string& sTable) const
return pDisp->GetTable( sTable) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ChangeTable( const string& sTable, bool bUpdateDisp)
{
bool bOk = true ;
// imposto la tavola per tutte le disposizioni ( e il calcolo)
for ( int nPhase = 1 ; nPhase <= GetPhaseCount() && bOk ; ++ nPhase) {
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nPhase))) ;
if ( pDisp != nullptr && pDisp->Init( this) && pDisp->SetTable( sTable) && pDisp->ResetAreaOffset()) {
if ( bUpdateDisp)
bOk = SetCurrPhase( nPhase, true) && bOk ;
}
else
bOk = false ;
}
SetCurrPhase( 1) ;
return bOk ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetTableRef( int nInd, Point3d& ptPos) const
@@ -115,6 +135,52 @@ MachMgr::ShowOnlyTable( bool bVal)
return pMch->SetLook( bVal ? MCH_LOOK_TAB : MCH_LOOK_ALL) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MoveDispAxis( const string& sName, double dPos)
{
// recupero l'oggetto disposizione corrente
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( m_nCurrDispId)) ;
if ( pDisp == nullptr)
return GDB_ID_NULL ;
// eseguo l'operazione
return pDisp->MoveAxis( sName, dPos) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveDispAxis( const string& sName)
{
// recupero l'oggetto disposizione corrente
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( m_nCurrDispId)) ;
if ( pDisp == nullptr)
return GDB_ID_NULL ;
// eseguo l'operazione
return pDisp->RemoveAxis( sName) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::KeepAllDispAxes( int nSouPhase)
{
// se fase di origine non definita o uguale alla corrente, esco con successo
if ( nSouPhase == 0 || nSouPhase == m_nCurrPhase)
return true ;
// copio il posizionamento
Disposition* pSouDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nSouPhase))) ;
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( m_nCurrPhase))) ;
if ( pSouDisp == nullptr || pDisp == nullptr)
return false ;
for ( int i = 0 ; ; ++ i) {
string sName ; double dPos ;
if ( pSouDisp->GetMoveAxisData( i, sName, dPos))
pDisp->MoveAxis( sName, dPos) ;
else
break ;
}
return true ;
}
//----------------------------------------------------------------------------
int
MachMgr::AddFixture( const string& sName, const Point3d& ptPos, double dAngRotDeg, double dMov)
@@ -138,8 +204,8 @@ MachMgr::KeepFixture( int nFxtId, int nSouPhase)
// se fase corrente già presente, non devo fare alcunché
if ( find( vPhase.begin(), vPhase.end(), m_nCurrPhase) != vPhase.end())
return true ;
// se fase di origine non definita, esco con successo
if ( nSouPhase == 0)
// se fase di origine non definita o uguale alla corrente, esco con successo
if ( nSouPhase == 0 || nSouPhase == m_nCurrPhase)
return true ;
// copio il posizionamento
Disposition* pSouDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nSouPhase))) ;
@@ -147,10 +213,11 @@ MachMgr::KeepFixture( int nFxtId, int nSouPhase)
if ( pSouDisp == nullptr || pDisp == nullptr)
return false ;
for ( int i = 0 ; ; ++ i) {
string sName ; int nId ; Point3d ptPos ; double dAngDeg ; double dMov ;
if ( pSouDisp->GetFixtureData( i, sName, nId, ptPos, dAngDeg, dMov)) {
string sName ; int nId ; Point3d ptPos ; double dAngDeg ; double dMov ; string sTaLink ;
if ( pSouDisp->GetFixtureData( i, sName, nId, ptPos, dAngDeg, dMov, sTaLink)) {
if ( nId == nFxtId) {
pDisp->AddFixture( sName, nId, ptPos, dAngDeg, dMov) ;
pDisp->SetFixtureLink( nId, sTaLink) ;
break ;
}
}
@@ -234,6 +301,18 @@ MachMgr::RotateFixture( int nId, double dDeltaAngDeg)
return pDisp->RotateFixture( nId, dDeltaAngDeg) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetFixtureLink( int nId, const string& sTaLink)
{
// recupero l'oggetto disposizione corrente
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( m_nCurrDispId)) ;
if ( pDisp == nullptr)
return false ;
// eseguo l'operazione
return pDisp->SetFixtureLink( nId, sTaLink) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::MoveFixtureMobile( int nId, double dDeltaMov)
@@ -246,6 +325,18 @@ MachMgr::MoveFixtureMobile( int nId, double dDeltaMov)
return pDisp->MoveFixtureMobile( nId, dDeltaMov) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetFixtureMobile( int nId, double dMov)
{
// recupero l'oggetto disposizione corrente
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( m_nCurrDispId)) ;
if ( pDisp == nullptr)
return false ;
// eseguo l'operazione
return pDisp->SetFixtureMobile( nId, dMov) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::VerifyFixtureInGroup( int nFxtId, bool bLinkedAllowed) const
@@ -273,9 +364,8 @@ MachMgr::GetFixturePhases( int nFxtId, INTVECTOR& vPhase) const
// verifica validità bloccaggio
if ( ! VerifyFixtureInGroup( nFxtId))
return false ;
// recupero le fasi in cui è presente la fixture (se manca è fase 1)
if ( ! m_pGeomDB->GetInfo( nFxtId, MACH_FXT_PHASE, vPhase) || vPhase.empty())
vPhase.emplace_back( 1) ;
// recupero le fasi in cui è presente la fixture (se manca è non usata)
m_pGeomDB->GetInfo( nFxtId, MACH_FXT_PHASE, vPhase) ;
return true ;
}
@@ -293,8 +383,7 @@ MachMgr::GetUnusedFixture( const string& sName, int nPhase) const
while ( nId != GDB_ID_NULL) {
// recupero le fasi in cui è già usato
INTVECTOR vPhase ;
if ( ! m_pGeomDB->GetInfo( nId, MACH_FXT_PHASE, vPhase) || vPhase.empty())
vPhase.emplace_back( 1) ;
m_pGeomDB->GetInfo( nId, MACH_FXT_PHASE, vPhase) ;
// se non c'è la fase corrente, è libero
if ( find( vPhase.begin(), vPhase.end(), nPhase) == vPhase.end())
return nId ;
@@ -317,8 +406,7 @@ MachMgr::IsUnusedFixture( int nId, int nPhase) const
// Verifico non sia usata nella fase indicata
// recupero le fasi in cui è già usato
INTVECTOR vPhase ;
if ( ! m_pGeomDB->GetInfo( nId, MACH_FXT_PHASE, vPhase) || vPhase.empty())
vPhase.emplace_back( 1) ;
m_pGeomDB->GetInfo( nId, MACH_FXT_PHASE, vPhase) ;
// se non c'è la fase corrente, è libero
if ( find( vPhase.begin(), vPhase.end(), nPhase) == vPhase.end())
return true ;
+10 -2
View File
@@ -18,6 +18,7 @@
#include "MachConst.h"
#include "Generator.h"
#include "Estimator.h"
#include "/EgtDev/Include/EGnFileUtils.h"
using namespace std ;
@@ -25,6 +26,13 @@ using namespace std ;
bool
MachMgr::Generate( const string& sCncFile, const string& sInfo)
{
// se macchina multiprocesso è necessaria stima speciale
if ( GetCurrMachine() != nullptr && GetCurrMachine()->GetMultiProcess()) {
string sEstFile = ChangeFileExtension( sCncFile, "sest") ;
if ( ! Estimate( sEstFile, sInfo))
return false ;
}
// inizializzazione generatore
Generator genPP ;
if ( ! genPP.Init( this)) {
@@ -44,13 +52,13 @@ MachMgr::Generate( const string& sCncFile, const string& sInfo)
bool
MachMgr::Estimate( const string& sEstFile, const string& sInfo)
{
// inizializzazione generatore
// inizializzazione stimatore
Estimator estPP ;
if ( ! estPP.Init( this)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Init")
return false ;
}
// esecuzione della generazione
// esecuzione della stima
if ( ! estPP.Run( sEstFile, sInfo)) {
LOG_ERROR( GetEMkLogger(), "Error on Estimate Run")
return false ;
+80 -21
View File
@@ -182,6 +182,52 @@ MachMgr::AddMachGroup( const string& sName, const string& sMachineName)
return nNewId ;
}
//----------------------------------------------------------------------------
int
MachMgr::CopyMachGroup( const string& sSouName, const string& sName)
{
// recupero il gruppo sorgente
int nSouMGrpId = GetMachGroupId( sSouName) ;
if ( nSouMGrpId == GDB_ID_NULL)
return GDB_ID_NULL ;
// verifico esista la sua macchina
string sMachineName ;
m_pGeomDB->GetInfo( nSouMGrpId, MACH_MACHINE_KEY, sMachineName) ;
if ( sMachineName.empty() || ! LoadMachine( sMachineName))
return GDB_ID_NULL ;
// verifico nome nuovo gruppo (non deve essere vuoto e non deve esserci già un gruppo con questo nome)
if ( &sName == nullptr || sName.empty() || GetMachGroupId( sName) != GDB_ID_NULL)
return GDB_ID_NULL ;
// reset gruppo corrente
ResetCurrMachGroup() ;
// eseguo la copia del gruppo sorgente e la metto in coda
int nNewMGrpId = m_pGeomDB->Copy( nSouMGrpId, GDB_ID_NULL, m_nMachBaseId) ;
if ( nNewMGrpId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome
m_pGeomDB->SetName( nNewMGrpId, sName) ;
// converto opportunamente gli indicativi dei grezzi nelle disposizioni
int nSouRawPartId = m_pGeomDB->GetFirstGroupInGroup( m_pGeomDB->GetFirstNameInGroup( nSouMGrpId, MACH_RAW_GROUP)) ;
int nNewRawPartId = m_pGeomDB->GetFirstGroupInGroup( m_pGeomDB->GetFirstNameInGroup( nNewMGrpId, MACH_RAW_GROUP)) ;
while ( nSouRawPartId != GDB_ID_NULL && nNewRawPartId != GDB_ID_NULL) {
// ciclo sulle disposizioni del nuovo gruppo di lavoro
int nOperId = m_pGeomDB->GetFirstGroupInGroup( m_pGeomDB->GetFirstNameInGroup( nNewMGrpId, MACH_OPER_GROUP)) ;
while ( nOperId != GDB_ID_NULL) {
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( nOperId)) ;
if ( pDisp != nullptr)
pDisp->UpdateRawPartId( nSouRawPartId, nNewRawPartId) ;
nOperId = m_pGeomDB->GetNextGroup( nOperId) ;
}
// passo alla coppia successiva
nSouRawPartId = m_pGeomDB->GetNextGroup( nSouRawPartId) ;
nNewRawPartId = m_pGeomDB->GetNextGroup( nNewRawPartId) ;
}
// lo rendo corrente
SetCurrMachGroup( nNewMGrpId) ;
// restituisco l'identificativo del gruppo
return nNewMGrpId ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveMachGroup( int nId)
@@ -222,44 +268,60 @@ MachMgr::VerifyMachGroup( int nId, MachGrp& mgData) const
// verifica della macchina
bool bMName = m_pGeomDB->GetInfo( nId, MACH_MACHINE_KEY, mgData.MGeoName) ;
// scansiono i sottogruppi
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
if ( IsNull( pIter))
return false ;
bool bSetup = false ;
bool bFixt = false ;
bool bRaw = false ;
bool bOper = false ;
bool bIter = pIter->GoToFirstGroupInGroup( nId) ;
while ( bIter) {
int nGrpId = m_pGeomDB->GetFirstGroupInGroup( nId) ;
while ( nGrpId != GDB_ID_NULL) {
string sName ;
if ( pIter->GetName( sName)) {
if ( m_pGeomDB->GetName( nGrpId, sName)) {
if ( sName == MACH_SETUP_GROUP) {
if ( ! bSetup)
mgData.SetupGroupId = pIter->GetId() ;
mgData.SetupGroupId = nGrpId ;
bSetup = true ;
}
else if ( sName == MACH_FIXT_GROUP) {
if ( ! bFixt)
mgData.FixtGroupId = pIter->GetId() ;
mgData.FixtGroupId = nGrpId ;
bFixt = true ;
}
else if ( sName == MACH_RAW_GROUP) {
if ( ! bRaw)
mgData.RawGroupId = pIter->GetId() ;
mgData.RawGroupId = nGrpId ;
bRaw = true ;
}
else if ( sName == MACH_OPER_GROUP) {
if ( ! bOper)
mgData.OperGroupId = pIter->GetId() ;
mgData.OperGroupId = nGrpId ;
bOper = true ;
}
}
// passo al successivo
bIter = pIter->GoToNextGroup() ;
nGrpId = m_pGeomDB->GetNextGroup( nGrpId) ;
}
return ( bMName && bSetup && bRaw && bOper) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ChangeMachGroupName( int nId, const string& sNewName)
{
// verifica del gruppo base per le lavorazioni
if ( ! VerifyMachBase())
return false ;
// verifico che il gruppo ricevuto sia corretto
if ( m_pGeomDB->GetParentId( nId) != m_nMachBaseId)
return false ;
// verifico nome non vuoto e non esista già un gruppo con lo stesso nome
if ( &sNewName == nullptr || sNewName.empty() || GetMachGroupId( sNewName) != GDB_ID_NULL)
return false ;
// cambio il nome del gruppo di lavoro
if ( ! m_pGeomDB->SetName( nId, sNewName))
return false ;
return true ;
}
//----------------------------------------------------------------------------
string
MachMgr::GetMachGroupName( int nId) const
@@ -298,22 +360,19 @@ MachMgr::GetMachGroupId( const string& sName) const
{
// verifica dei parametri
if ( &sName == nullptr || sName.empty())
return false ;
return GDB_ID_NULL ;
// verifica del gruppo base per le lavorazioni
if ( ! VerifyMachBase())
return false ;
return GDB_ID_NULL ;
// recupero l'identificativo del gruppo con il nome indicato
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
if ( IsNull( pIter))
return false ;
bool bIter = pIter->GoToFirstGroupInGroup( m_nMachBaseId) ;
while( bIter) {
int nGrpId = m_pGeomDB->GetFirstGroupInGroup( m_nMachBaseId) ;
while ( nGrpId != GDB_ID_NULL) {
// verifico il nome
string sMGroupName ;
if ( pIter->GetName( sMGroupName) && EqualNoCase( sMGroupName, sName))
return pIter->GetId() ;
if ( m_pGeomDB->GetName( nGrpId, sMGroupName) && EqualNoCase( sMGroupName, sName))
return nGrpId ;
// passo al successivo
bIter = pIter->GoToNextGroup() ;
nGrpId = m_pGeomDB->GetNextGroup( nGrpId) ;
}
return GDB_ID_NULL ;
}
+186 -58
View File
@@ -19,12 +19,43 @@
#include "MachiningsMgr.h"
#include "SawingData.h"
#include "/EgtDev/Include/EGkGdbIterator.h"
#include "/EgtDev/Include/EgnStringUtils.h"
#include "/EgtDev/Include/EgnFileUtils.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
using namespace std ;
//----------------------------------------------------------------------------
bool
MachMgr::GetMachines( STRVECTOR& vsMachineNames, STRVECTOR& vsMachineDirs) const
{
// pulisco elenco delle macchine
vsMachineNames.clear() ;
// eseguo ricerca delle macchine nei direttori base
for ( int i = 0 ; i < int( m_vMachinesBaseDir.size()) ; ++ i) {
STRVECTOR vsDirNames ;
if ( FindAllDirectories( m_vMachinesBaseDir[i] + "\\*", vsDirNames)) {
for ( int j = 0 ; j < int( vsDirNames.size()) ; ++ j) {
// nome e direttorio della macchina
string sMachName = vsDirNames[j] ;
string sMachDir = m_vMachinesBaseDir[i] + "\\" + vsDirNames[j] ;
// verifico esista il file mlde ( o mde) della macchina
string sMachineMlde = sMachDir + "\\" + sMachName + ".Mlde" ;
string sMachineMde = sMachDir + "\\" + sMachName + ".Mde" ;
if ( ( ExistsFile( sMachineMlde) || ExistsFile( sMachineMde)) &&
find_if( vsMachineNames.begin(), vsMachineNames.end(),
[ &sMachName]( const string& sName)
{ return EqualNoCase( sName, sMachName) ; }) == vsMachineNames.end()) {
vsMachineNames.emplace_back( sMachName) ;
vsMachineDirs.emplace_back( sMachDir) ;
}
}
}
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::LoadMachine( const string& sMachineName)
@@ -35,14 +66,25 @@ MachMgr::LoadMachine( const string& sMachineName)
// se macchina già caricata, non devo fare alcunchè
if ( GetMachine( sMachineName) != - 1)
return true ;
// cerco il direttorio della macchina
string sMachDir ;
for ( int i = 0 ; i < int( m_vMachinesBaseDir.size()) ; ++ i) {
string sTemp = m_vMachinesBaseDir[i] + "\\" + sMachineName ;
if ( ExistsDirectory( sTemp)) {
sMachDir = sTemp ;
break ;
}
}
if ( IsEmptyOrSpaces( sMachDir))
return false ;
// verifico esista il file mlde ( o mde) della macchina
string sMachineMlde = m_sMachinesDir + "\\" + sMachineName + "\\" + sMachineName + ".Mlde" ;
string sMachineMlde = sMachDir + "\\" + sMachineName + ".Mlde" ;
if ( ! ExistsFile( sMachineMlde))
sMachineMlde = ChangeFileExtension( sMachineMlde, ".Mde") ;
if ( ! ExistsFile( sMachineMlde))
return false ;
// salvo nel vettore
m_vMachines.emplace_back( sMachineName, nullptr, nullptr, nullptr) ;
m_vMachines.emplace_back( sMachineName, sMachDir, nullptr, nullptr, nullptr) ;
return true ;
}
@@ -97,7 +139,7 @@ MachMgr::GetCurrMachineDir( string& sMachineDir) const
if ( m_nCurrMch < 0 || m_nCurrMch >= int( m_vMachines.size()))
return false ;
// assegno il direttorio
sMachineDir = m_sMachinesDir + "\\" + m_vMachines[m_nCurrMch].sName ;
sMachineDir = m_vMachines[m_nCurrMch].sDir ;
return true ;
}
@@ -126,7 +168,7 @@ MachMgr::GetCurrMachine( void) const
return nullptr ;
// creo e carico la macchina
PtrOwner<Machine> pMch( new( nothrow) Machine) ;
if ( IsNull( pMch) || ! pMch->Init( m_sMachinesDir, m_vMachines[m_nCurrMch].sName, const_cast<MachMgr*>(this)))
if ( IsNull( pMch) || ! pMch->Init( m_vMachines[m_nCurrMch].sName, m_vMachines[m_nCurrMch].sDir, const_cast<MachMgr*>(this)))
return nullptr ;
// nascondo la macchina
if ( m_pGeomDB != nullptr)
@@ -148,7 +190,7 @@ MachMgr::GetCurrToolsMgr( void) const
// se DB utensili non esiste, provo a crearlo e caricarlo
if ( m_vMachines[m_nCurrMch].pTsMgr == nullptr) {
PtrOwner<ToolsMgr> pTsMgr( new( nothrow) ToolsMgr) ;
string sToolsDir = m_sMachinesDir + "\\" + m_vMachines[m_nCurrMch].sName + "\\" + TOOLS_DIR ;
string sToolsDir = m_vMachines[m_nCurrMch].sDir + "\\" + TOOLS_DIR ;
if ( IsNull( pTsMgr) || ! pTsMgr->Load( sToolsDir, TOOLS_FILE))
return nullptr ;
// salvo nel vettore
@@ -168,7 +210,7 @@ MachMgr::GetCurrMachiningsMgr( void) const
// se DB lavorazioni non esiste, provo a crearlo e caricarlo
if ( m_vMachines[m_nCurrMch].pMsMgr == nullptr) {
PtrOwner<MachiningsMgr> pMsMgr( new( nothrow) MachiningsMgr) ;
string sMachsFile = m_sMachinesDir + "\\" + m_vMachines[m_nCurrMch].sName + "\\" + MACHININGS_DIR + "\\" + MACHININGS_FILE ;
string sMachsFile = m_vMachines[m_nCurrMch].sDir + "\\" + MACHININGS_DIR + "\\" + MACHININGS_FILE ;
if ( IsNull( pMsMgr) || ! pMsMgr->Load( sMachsFile, GetCurrToolsMgr()))
return nullptr ;
// salvo nel vettore
@@ -232,6 +274,15 @@ MachMgr::GetHeadExitCount( const string& sHead) const
return ( ( pMch != nullptr) ? pMch->GetHeadExitCount( sHead) : 0) ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetExitId( const string& sHead, int nExit) const
{
Machine* pMch = GetCurrMachine() ;
// recupero identificativo dell'uscita della testa indicata nella macchina corrente
return ( ( pMch != nullptr) ? pMch->GetExitId( sHead, nExit) : GDB_ID_NULL) ;
}
//----------------------------------------------------------------------------
int
MachMgr::GetTcPosId( const string& sTcPos) const
@@ -252,18 +303,6 @@ MachMgr::GetHeadAbove( const string& sHead) const
return ( ! m_pGeomDB->GetInfo( GetHeadId( sHead), MCH_ABOVE, bAbove) || bAbove) ;
}
//----------------------------------------------------------------------------
double
MachMgr::GetDeltaSafeZ( const string& sHead) const
{
if ( m_pGeomDB == nullptr)
return 0 ;
// Leggo da testa Info ZSAFEDELTA
double dDeltaSafeZ = 0 ;
m_pGeomDB->GetInfo( GetHeadId( sHead), MCH_ZSAFEDELTA, dDeltaSafeZ) ;
return dDeltaSafeZ ;
}
//----------------------------------------------------------------------------
double
MachMgr::GetAngDeltaMinForHome( void) const
@@ -291,6 +330,15 @@ MachMgr::GetAxisType( const string& sAxis, bool& bLinear) const
return ( ( pMch != nullptr) ? pMch->GetAxisType( sAxis, bLinear) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetAxisDir( const string& sAxis, Vector3d& vtDir) const
{
Machine* pMch = GetCurrMachine() ;
// restituisco la direzione dell'asse indicato nella macchina corrente
return ( ( pMch != nullptr) ? pMch->GetAxisDir( sAxis, vtDir) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetAxisInvert( const string& sAxis, bool& bInvert) const
@@ -300,12 +348,21 @@ MachMgr::GetAxisInvert( const string& sAxis, bool& bInvert) const
return ( ( pMch != nullptr) ? pMch->GetAxisInvert( sAxis, bInvert) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetAxisOffset( const string& sAxis, double& dOffset) const
{
Machine* pMch = GetCurrMachine() ;
// restituisco il valore di offset asse in visualizzazione
return ( ( pMch != nullptr) ? pMch->GetAxisOffset( sAxis, dOffset) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SetAxisPos( const string& sAxis, double dVal, double* pdNewVal)
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->SetAxisPos( sAxis, dVal, pdNewVal) : false) ;
return ( ( pMch != nullptr) ? pMch->SetAxisPos( sAxis, dVal, true, pdNewVal) : false) ;
}
//----------------------------------------------------------------------------
@@ -350,10 +407,25 @@ MachMgr::ResetAxisPos( const string& sAxis)
//----------------------------------------------------------------------------
bool
MachMgr::ResetAllAxesPos( void)
MachMgr::IsDispositionAxis( const string& sAxis, const string& sTable) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->ResetAllAxesPos() : false) ;
return ( ( pMch != nullptr) ? pMch->IsDispositionAxis( sAxis, sTable) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ResetAllAxesPos( void)
{
return ResetAllAxesPos( true, false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ResetAllAxesPos( bool bStdAxes, bool bDispAxes)
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->ResetAllAxesPos( bStdAxes, bDispAxes) : false) ;
}
//----------------------------------------------------------------------------
@@ -483,6 +555,14 @@ MachMgr::SetCalcSolCh( int nScc, bool bExact)
return pMch->SetSolCh( nScc, bExact) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcTable( string& sTable) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrTable( sTable) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcTool( string& sTool) const
@@ -536,7 +616,15 @@ double
MachMgr::GetCalcRot1W( void) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrRot1W() : false) ;
return ( ( pMch != nullptr) ? pMch->GetCurrRot1W() : 1) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcMaxDeltaR2OnFirst( void) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrMaxDeltaR2OnFirst() : true) ;
}
//----------------------------------------------------------------------------
@@ -545,12 +633,20 @@ MachMgr::GetAllTablesNames( STRVECTOR& vNames) const
{
// pulisco il vettore
vNames.clear() ;
// recupero la macchina corrente
// richiedo elenco tavole alla macchina corrente
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
// richiedo elenco tavole alla macchina
return pMch->GetAllTablesNames( vNames) ;
return ( ( pMch != nullptr) ? pMch->GetAllTablesNames( vNames) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetAllAxesNames( STRVECTOR& vNames) const
{
// pulisco il vettore
vNames.clear() ;
// richiedo elenco assi alla macchina corrente
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAllAxesNames( vNames) : false) ;
}
//----------------------------------------------------------------------------
@@ -559,12 +655,9 @@ MachMgr::GetAllHeadsNames( STRVECTOR& vNames) const
{
// pulisco il vettore
vNames.clear() ;
// recupero la macchina corrente
// richiedo elenco teste alla macchina corrente
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
// richiedo elenco teste alla macchina
return pMch->GetAllHeadsNames( vNames) ;
return ( ( pMch != nullptr) ? pMch->GetAllHeadsNames( vNames) : false) ;
}
//----------------------------------------------------------------------------
@@ -573,12 +666,9 @@ MachMgr::GetAllTcPosNames( STRVECTOR& vNames) const
{
// pulisco il vettore
vNames.clear() ;
// recupero la macchina corrente
// richiedo elenco posizioni cambio utensile alla macchina corrente
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
// richiedo elenco posizioni cambio utensile alla macchina
return pMch->GetAllTcPosNames( vNames) ;
return ( ( pMch != nullptr) ? pMch->GetAllTcPosNames( vNames) : false) ;
}
//----------------------------------------------------------------------------
@@ -599,10 +689,10 @@ MachMgr::GetCurrRotAxes( void) const
//----------------------------------------------------------------------------
bool
MachMgr::GetAllCurrAxesName( STRVECTOR& vAxName) const
MachMgr::GetAllCurrAxesNames( STRVECTOR& vAxName) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetAllCurrAxesName( vAxName) : false) ;
return ( ( pMch != nullptr) ? pMch->GetAllCurrAxesNames( vAxName) : false) ;
}
//----------------------------------------------------------------------------
@@ -621,6 +711,54 @@ MachMgr::GetCurrAxisHomePos( int nInd, double& dHome) const
return ( ( pMch != nullptr) ? pMch->GetCurrAxisHomePos( nInd, dHome) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCurrAxisMax( int nInd, double& dMax) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrAxisMax( nInd, dMax) : false) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCurrAxisMin( int nInd, double& dMin) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetCurrAxisMin( nInd, dMin) : false) ;
}
//----------------------------------------------------------------------------
const Frame3d&
MachMgr::GetCurrLinAxesFrame( void) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr) {
static Frame3d frDummy ;
return frDummy ;
}
return pMch->GetCurrLinAxesFrame() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCurrIsCenter( void) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
return ( pMch->GetCurrKinematicChainType() == KIN_CHAIN_CENTER) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCurrIsRobot( void) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
return ( pMch->GetCurrKinematicChainType() == KIN_CHAIN_ROBOT) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
@@ -665,7 +803,7 @@ MachMgr::GetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA,
{
DBLVECTOR vAng( 2) ; vAng[0] = dAngA ; vAng[1] = dAngB ;
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetTipFromPositions( dX, dY, dZ, vAng, bOverall, bBottom, ptTip) : false) ;
return ( ( pMch != nullptr) ? pMch->GetTipFromPositions( dX, dY, dZ, vAng, bOverall, bBottom, false, ptTip) : false) ;
}
//----------------------------------------------------------------------------
@@ -674,7 +812,7 @@ MachMgr::GetCalcTipFromPositions( double dX, double dY, double dZ, const DBLVECT
bool bOverall, bool bBottom, Point3d& ptTip) const
{
Machine* pMch = GetCurrMachine() ;
return ( ( pMch != nullptr) ? pMch->GetTipFromPositions( dX, dY, dZ, vAng, bOverall, bBottom, ptTip) : false) ;
return ( ( pMch != nullptr) ? pMch->GetTipFromPositions( dX, dY, dZ, vAng, bOverall, bBottom, false, ptTip) : false) ;
}
//----------------------------------------------------------------------------
@@ -682,9 +820,7 @@ bool
MachMgr::GetCalcToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
return pMch->GetToolDirFromAngles( vAng, vtDir) ;
return ( ( pMch != nullptr) ? pMch->GetToolDirFromAngles( vAng, vtDir) : false) ;
}
//----------------------------------------------------------------------------
@@ -692,9 +828,7 @@ bool
MachMgr::GetCalcAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
return pMch->GetAuxDirFromAngles( vAng, vtDir) ;
return ( ( pMch != nullptr) ? pMch->GetAuxDirFromAngles( vAng, vtDir) : false) ;
}
//----------------------------------------------------------------------------
@@ -702,9 +836,7 @@ bool
MachMgr::GetCalcPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
return pMch->GetPartDirFromAngles( vtPart, vAng, vtDir) ;
return ( ( pMch != nullptr) ? pMch->GetPartDirFromAngles( vtPart, vAng, vtDir) : false) ;
}
//----------------------------------------------------------------------------
@@ -760,9 +892,7 @@ string
MachMgr::GetOutstrokeInfo( bool bMM) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return "" ;
return pMch->GetOutstrokeInfo( bMM) ;
return ( ( pMch != nullptr) ? pMch->GetOutstrokeInfo( bMM) : "") ;
}
//----------------------------------------------------------------------------
@@ -778,7 +908,5 @@ int
MachMgr::GetMachineLook( void) const
{
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return MCH_LOOK_NONE ;
return pMch->GetLook() ;
return ( ( pMch != nullptr) ? pMch->GetLook() : MCH_LOOK_NONE) ;
}
+59 -2
View File
@@ -601,6 +601,7 @@ MachMgr::AddDisposition( const string& sName)
m_pGeomDB->SetUserObj( nId, pDisp) ;
pDisp->Init( this) ;
pDisp->SetPhase( m_nCurrPhase) ;
ResetAllAxesPos( false, true) ;
return nId ;
}
@@ -642,6 +643,9 @@ MachMgr::DispositionSpecialApply( int nId, bool bRecalc)
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
if ( pDisp == nullptr)
return false ;
// Eventuale log
string sOut = "DispositionSpecialApply start --> " + pDisp->GetName() ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
// lancio l'azione
return pDisp->SpecialApply( bRecalc) ;
}
@@ -662,10 +666,25 @@ MachMgr::DispositionSpecialUpdate( int nId)
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
if ( pDisp == nullptr)
return false ;
// Eventuale log
string sOut = "DispositionSpecialUpdate start --> " + pDisp->GetName() ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
// lancio l'azione
return pDisp->SpecialUpdate() ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetDispositionToolData( int nId, string& sName, string& sHead, int& nExit, string& sTcPos)
{
// recupero la disposizione
Disposition* pDisp = ::GetDisposition( m_pGeomDB->GetUserObj( nId)) ;
if ( pDisp == nullptr)
return false ;
// recupero i dati utensile
return pDisp->GetToolData( sName, sHead, nExit, sTcPos) ;
}
//----------------------------------------------------------------------------
// Machinings
//----------------------------------------------------------------------------
@@ -1041,6 +1060,9 @@ MachMgr::MachiningApply( bool bRecalc, bool bPostApply)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// Log
string sOut = "MachiningApply start --> " + pMch->GetName() ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
// imposto fase della lavorazione come temporaneamente corrente
SetTempPhase TmpPhase( this, pMch->GetPhase()) ;
// imposto visualizzazione completa della macchina come temporaneamente corrente
@@ -1069,6 +1091,9 @@ MachMgr::MachiningUpdate( bool bPostApply)
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// Log
string sOut = "MachiningUpdate start --> " + pMch->GetName() ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
// imposto fase della lavorazione come temporaneamente corrente
SetTempPhase TmpPhase( this, pMch->GetPhase()) ;
// imposto visualizzazione completa della macchina come temporaneamente corrente
@@ -1110,7 +1135,23 @@ MachMgr::RemovePreviewMachiningTool( void) const
//----------------------------------------------------------------------------
int
MachMgr::PreviewMachiningTool( int nEntId, int nFlag) const
MachMgr::GetPreviewMachiningToolStepCount( void) const
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return 0 ;
// ne recupero il gestore
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return 0 ;
// eseguo
return pMch->GetToolPreviewStepCount() ;
}
//----------------------------------------------------------------------------
int
MachMgr::PreviewMachiningTool( int nEntId, int nStep) const
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
@@ -1121,7 +1162,7 @@ MachMgr::PreviewMachiningTool( int nEntId, int nFlag) const
if ( pMch == nullptr)
return GDB_ID_NULL ;
// eseguo
return pMch->ToolPreview( nEntId, nFlag) ;
return pMch->ToolPreview( nEntId, nStep) ;
}
//----------------------------------------------------------------------------
@@ -1220,6 +1261,22 @@ MachMgr::GetMachiningGeometry( SELVECTOR& vIds) const
return pMch->GetGeometry( vIds) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetMachiningSkippedGeometry( SELVECTOR& vIds) const
{
// recupero la lavorazione corrente
int nCurrMchId = GetCurrMachining() ;
if ( nCurrMchId == GDB_ID_NULL)
return false ;
// ne recupero il gestore
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
if ( pMch == nullptr)
return false ;
// restituisco la geometria non lavorata
return pMch->GetSkippedGeometry( vIds) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::IsMachiningEmpty( void) const
+414 -138
View File
@@ -24,11 +24,12 @@
#include "/EgtDev/Include/EGkGeoPoint3d.h"
#include "/EgtDev/Include/EGkCurveAux.h"
#include "/EgtDev/Include/EGkOffsetCurve.h"
#include "/EgtDev/Include/EgkDistPointCurve.h"
#include "/EgtDev/Include/EGkDistPointCurve.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EGkStmStandard.h"
#include "/EgtDev/Include/EGkStmFromCurves.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include "/EgtDev/Include/EXeConst.h"
using namespace std ;
@@ -96,7 +97,7 @@ MachMgr::AddRawPart( const Point3d& ptOrig, double dLen, double dWidth, double d
m_pGeomDB->SetInfo( nRawId, MACH_RAW_PHASE, m_nCurrPhase) ;
// creo solido e outline
bOk = bOk && ModifyRawPart( nRawId, ptOrig, dLen, dWidth, dHeight, cCol) ;
// se qualcosa è andato storto, cancello tutto
// se qualcosa è andato storto, cancello tutto
if ( ! bOk) {
m_pGeomDB->Erase( nRawId) ;
return GDB_ID_NULL ;
@@ -112,7 +113,7 @@ MachMgr::ModifyRawPart( int nRawId, const Point3d& ptOrig, double dLen, double d
// le dimensioni non possono essere nulle
if ( dLen < EPS_SMALL || dWidth < EPS_SMALL || dHeight < EPS_SMALL)
return false ;
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// creo il solido
@@ -171,7 +172,7 @@ MachMgr::AddRawPartWithPart( int nPartId, int nCrvSrfId, double dOverMat, Color
// verifico il gruppo dei grezzi nella macchinata corrente
if ( GetCurrRawGroupId() == GDB_ID_NULL)
return GDB_ID_NULL ;
// verifico che il pezzo non sia già usato nella macchinata corrente
// verifico che il pezzo non sia già usato nella macchinata corrente
if ( m_pGeomDB->GetParentId( nPartId) != GDB_ID_ROOT)
return GDB_ID_NULL ;
// recupero il tipo di oggetto per definire il grezzo
@@ -180,7 +181,7 @@ MachMgr::AddRawPartWithPart( int nPartId, int nCrvSrfId, double dOverMat, Color
Point3d ptRef ;
// costruzione del grezzo
int nRawId = GDB_ID_NULL ;
// se grezzo da superficie (per ora senza possibilità di offset)
// se grezzo da superficie (per ora senza possibilità di offset)
if ( ( nGtype & GEO_SURF) != 0) {
// inserisco il grezzo
nRawId = AddRawPart( nCrvSrfId, cCol) ;
@@ -284,7 +285,7 @@ MachMgr::AddRawPart( int nCrvId, double dOverMat, double dZmin, double dHeight,
m_pGeomDB->SetInfo( nRawId, MACH_RAW_PHASE, m_nCurrPhase) ;
// creo solido e outline
bOk = bOk && ModifyRawPart( nRawId, nCrvId, dOverMat, dZmin, dHeight, cCol) ;
// se qualcosa è andato storto, cancello tutto
// se qualcosa è andato storto, cancello tutto
if ( ! bOk) {
m_pGeomDB->Erase( nRawId) ;
return GDB_ID_NULL ;
@@ -297,7 +298,7 @@ MachMgr::AddRawPart( int nCrvId, double dOverMat, double dZmin, double dHeight,
bool
MachMgr::ModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dZmin, double dHeight, Color cCol)
{
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// recupero il riferimento della curva
@@ -321,7 +322,7 @@ MachMgr::ModifyRawPart( int nRawId, int nCrvId, double dOverMat, double dZmin, d
// la schiaccio a Z = 0
if ( ! pMyCrv->Scale( Frame3d(), 1, 1, 0))
return false ;
// se non è chiusa, la chiudo
// se non è chiusa, la chiudo
pMyCrv->Close() ;
// la oriento in senso CCW
double dAreaXY ;
@@ -375,11 +376,11 @@ MachMgr::AddRawPart( int nSurfId, Color cCol)
if ( nRawGroupId == GDB_ID_NULL)
return GDB_ID_NULL ;
// recupero l'ingombro della superficie in globale
BBox3d b3Crv ;
if ( ! m_pGeomDB->GetGlobalBBox( nSurfId, b3Crv))
BBox3d b3Surf ;
if ( ! m_pGeomDB->GetGlobalBBox( nSurfId, b3Surf))
return GDB_ID_NULL ;
// inserisco il gruppo del grezzo nella macchinata
Frame3d frRaw( b3Crv.GetMin()) ;
Frame3d frRaw( b3Surf.GetMin()) ;
int nRawId = m_pGeomDB->AddGroup( GDB_ID_NULL, nRawGroupId, frRaw) ;
if ( nRawId == GDB_ID_NULL)
return GDB_ID_NULL ;
@@ -414,7 +415,7 @@ MachMgr::AddRawPart( int nSurfId, Color cCol)
// ne calcolo la silhouette secondo Z+
POLYLINEVECTOR vPL ;
bool bSilh = false ;
if ( pStm->GetSilhouette( Z_AX, vPL) && vPL.size() > 0) {
if ( pStm->GetSilhouette( Z_AX, 10.0, vPL) && vPL.size() > 0) {
// cerco il contorno esterno
int nInd = - 1 ;
double dMaxArea = 0 ;
@@ -456,11 +457,11 @@ MachMgr::AddRawPart( int nSurfId, Color cCol)
int nCrvId = ( bOk ? m_pGeomDB->AddGeoObj( GDB_ID_NULL, nRawId, Release( pCrvCompo)) : GDB_ID_NULL) ;
bOk = bOk && ( nCrvId != GDB_ID_NULL) ;
// assegno il nome alla curva
bOk = bOk && m_pGeomDB->SetName( nCrvId, MACH_RAW_SOLID) ;
bOk = bOk && m_pGeomDB->SetName( nCrvId, MACH_RAW_OUTLINE) ;
// assegno il colore alla curva
bOk = bOk && m_pGeomDB->SetMaterial( nCrvId, cCol) ;
bOk = bOk && m_pGeomDB->SetMaterial( nCrvId, cCol) ;
}
// se qualcosa è andato storto, cancello tutto
// se qualcosa è andato storto, cancello tutto
if ( ! bOk) {
m_pGeomDB->Erase( nRawId) ;
return GDB_ID_NULL ;
@@ -471,6 +472,156 @@ MachMgr::AddRawPart( int nSurfId, Color cCol)
return nRawId ;
}
//----------------------------------------------------------------------------
int
MachMgr::AddRawPart( int nSfrUpId, int nSfrDownId, double dHeight, Color cCol)
{
// recupero il gruppo dei grezzi nella macchinata corrente
int nRawGroupId = GetCurrRawGroupId() ;
if ( nRawGroupId == GDB_ID_NULL)
return GDB_ID_NULL ;
// recupero l'ingombro della superficie up in globale
BBox3d b3Surf ;
if ( ! m_pGeomDB->GetGlobalBBox( nSfrUpId, b3Surf))
return GDB_ID_NULL ;
// inserisco il gruppo del grezzo nella macchinata
Frame3d frRaw( b3Surf.GetMin()) ;
int nRawId = m_pGeomDB->AddGroup( GDB_ID_NULL, nRawGroupId, frRaw) ;
if ( nRawId == GDB_ID_NULL)
return GDB_ID_NULL ;
// assegno il nome al gruppo
bool bOk = m_pGeomDB->SetName( nRawId, MACH_RAW_PART) ;
// assegno la fase al gruppo
bOk = bOk && m_pGeomDB->SetInfo( nRawId, MACH_RAW_PHASE, m_nCurrPhase) ;
// recupero il frame originale della superficie up ( deve essere lo stesso della down)
Frame3d frSurf ;
bOk = bOk && m_pGeomDB->GetGlobFrame( nSfrUpId, frSurf) ;
// creo il volume in modo approssimativo a partire dalle due superfici considerando soltanto un'approssimazione dei bordi esterni
// regione up
PtrOwner<ISurfFlatRegion> pSurfUp( CloneSurfFlatRegion( m_pGeomDB->GetGeoObj( nSfrUpId))) ;
bOk = bOk && ( ! IsNull( pSurfUp)) ;
// calcolo offset e contro-offset per unificare i chunk ed eliminare eventuali rientranze nella superficie
double dOffs = 8 ;
bOk = bOk && pSurfUp->Offset( dOffs, ICurve::OFF_FILLET) ;
bOk = bOk && pSurfUp->Offset( -dOffs, ICurve::OFF_FILLET) ;
// recupero il chunk di area maggiore
int nKMax = 0 ;
if ( bOk && pSurfUp->GetChunkCount() > 1) {
double dAreaMax = -1 ;
for ( int k = 0 ; k < pSurfUp->GetChunkCount() ; k ++) {
PtrOwner<ISurfFlatRegion> pSfrChunk( pSurfUp->CloneChunk( k)) ;
double dArea = -1 ; pSfrChunk->GetGrossArea( dArea) ;
if ( dArea > dAreaMax) {
nKMax = k ;
dAreaMax = dArea ;
}
}
}
PtrOwner<ICurve> pCrvUp ;
bOk = bOk && pCrvUp.Set( pSurfUp->GetLoop( nKMax, 0)) ;
bOk = bOk && ( ! IsNull( pCrvUp)) ;
// regione down
PtrOwner<ISurfFlatRegion> pSurfDown( CloneSurfFlatRegion( m_pGeomDB->GetGeoObj( nSfrDownId))) ;
bOk = bOk && ( ! IsNull( pSurfDown)) ;
bOk = bOk && pSurfDown->Offset( dOffs, ICurve::OFF_FILLET) ;
bOk = bOk && pSurfDown->Offset( -dOffs, ICurve::OFF_FILLET) ;
nKMax = 0 ;
if ( bOk && pSurfDown->GetChunkCount() > 1) {
double dAreaMax = -1 ;
for ( int k = 0 ; k < pSurfDown->GetChunkCount() ; k ++) {
PtrOwner<ISurfFlatRegion> pSfrChunk( pSurfDown->CloneChunk( k)) ;
double dArea = -1 ; pSfrChunk->GetGrossArea( dArea) ;
if ( dArea > dAreaMax) {
nKMax = k ;
dAreaMax = dArea ;
}
}
}
PtrOwner<ICurveComposite> pCrvDown ;
bOk = bOk && pCrvDown.Set( ConvertCurveToComposite( pSurfDown->GetLoop( nKMax, 0))) ;
bOk = bOk && ( ! IsNull( pCrvDown)) ;
// sposto il punto di inizio il più vicino possibile a quello della curva up per migliorare il calcolo della rigata
if ( bOk) {
Point3d ptS ; pCrvUp->GetStartPoint( ptS) ;
DistPointCurve distPC( ptS, *pCrvDown) ;
double dPar ; int nFlag ;
bOk = bOk && distPC.GetParamAtMinDistPoint( 0, dPar, nFlag) ;
bOk = bOk && pCrvDown->ChangeStartPoint( dPar) ;
}
// volume
PtrOwner<ISurfTriMesh> pStmRaw ;
bOk = bOk && pStmRaw.Set( GetSurfTriMeshByFlatContour( pCrvUp)) ;
bOk = bOk && ( ! IsNull( pStmRaw)) ;
PtrOwner<ISurfTriMesh> pStmLat ;
bOk = bOk && pStmLat.Set( GetSurfTriMeshRuled( pCrvDown, pCrvUp, ISurfTriMesh::RLT_MINDIST)) ;
bOk = bOk && ( ! IsNull( pStmLat)) ;
bOk = bOk && pStmRaw->DoSewing( *pStmLat) ;
PtrOwner<ISurfTriMesh> pStmDown ;
bOk = bOk && pStmDown.Set( GetSurfTriMeshByFlatContour( pCrvDown)) ;
bOk = bOk && pStmDown->Invert() ;
bOk = bOk && pStmRaw->DoSewing( *pStmDown) ;
bOk = bOk && pStmRaw->DoCompacting() ;
bOk = bOk && pStmRaw->Repair() ;
bOk = bOk && pStmRaw->LocToLoc( frSurf, frRaw) ;
int nId = bOk ? m_pGeomDB->AddGeoObj( GDB_ID_NULL, nRawId, Release( pStmRaw)) : GDB_ID_NULL ;
bOk = bOk && ( nId != GDB_ID_NULL) ;
// assegno il nome al solido
bOk = bOk && m_pGeomDB->SetName( nId, MACH_RAW_SOLID) ;
// assegno il colore al solido
bOk = bOk && m_pGeomDB->SetMaterial( nId, cCol) ;
// rendo visibile il solido
bOk = bOk && m_pGeomDB->SetStatus( nId, GDB_ST_ON) ;
// calcolo il punto centro del solido
bOk = bOk && SetRawPartCenter( nRawId) ;
if ( bOk) {
// costruisco la curva di contorno
PtrOwner<ISurfFlatRegion> pSfrUp( CloneSurfFlatRegion( m_pGeomDB->GetGeoObj( nSfrUpId))) ;
PtrOwner<ISurfFlatRegion> pSfrDown( CloneSurfFlatRegion( m_pGeomDB->GetGeoObj( nSfrDownId))) ;
bOk = bOk && ( ! IsNull( pSfrUp)) && ( ! IsNull( pSfrDown)) ;
if ( bOk)
pSfrUp->Add( *pSfrDown) ;
PtrOwner<ICurve> pCrv ;
bOk = bOk && pCrv.Set( pSfrUp->GetLoop( 0, 0)) ;
bOk = bOk && ( ! IsNull( pCrv)) ;
bOk = bOk && pCrv->LocToLoc( frSurf, frRaw) ;
int nLoop = bOk ? m_pGeomDB->AddGeoObj( GDB_ID_NULL, nRawId, Release( pCrv)) : GDB_ID_NULL ;
bOk = bOk && ( nLoop != GDB_ID_NULL) ;
bOk = bOk && ExeMove( {nLoop}, -dHeight * Z_AX, RTY_LOC) ;
// assegno il nome alla curva
bOk = bOk && m_pGeomDB->SetName( nLoop, MACH_RAW_OUTLINE) ;
// assegno il colore alla curva
bOk = bOk && m_pGeomDB->SetMaterial( nLoop, cCol) ;
// recupero le superfici up e down
int nSurfUpId = ( bOk ? m_pGeomDB->CopyGlob( nSfrUpId, GDB_ID_NULL, nRawId) : GDB_ID_NULL) ;
bOk = bOk && ( nSurfUpId != GDB_ID_NULL) ;
bOk = bOk && m_pGeomDB->SetName( nSurfUpId, MACH_RAW_UP_REG) ;
bOk = bOk && m_pGeomDB->SetMaterial( nSurfUpId, cCol) ;
bOk = bOk && m_pGeomDB->SetStatus( nSurfUpId, GDB_ST_OFF) ;
int nSurfDownId = ( bOk ? m_pGeomDB->CopyGlob( nSfrDownId, GDB_ID_NULL, nRawId) : GDB_ID_NULL) ;
bOk = bOk && ( nSurfDownId != GDB_ID_NULL) ;
bOk = bOk && m_pGeomDB->SetName( nSurfDownId, MACH_RAW_DOWN_REG) ;
bOk = bOk && m_pGeomDB->SetMaterial( nSurfDownId, cCol) ;
bOk = bOk && m_pGeomDB->SetStatus( nSurfDownId, GDB_ST_OFF) ;
}
// se qualcosa è andato storto, cancello tutto
if ( ! bOk) {
m_pGeomDB->Erase( nRawId) ;
return GDB_ID_NULL ;
}
// tutto ok
return nRawId ;
}
//----------------------------------------------------------------------------
bool
MachMgr::ModifyRawPartSize( int nRawId, double dLength, double dWidth, double dHeight)
@@ -478,7 +629,7 @@ MachMgr::ModifyRawPartSize( int nRawId, double dLength, double dWidth, double dH
// le nuove dimensioni non possono essere nulle
if ( dLength < EPS_SMALL || dWidth < EPS_SMALL || dHeight < EPS_SMALL)
return false ;
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// recupero il solido del grezzo
@@ -520,10 +671,10 @@ MachMgr::ModifyRawPartSize( int nRawId, double dLength, double dWidth, double dH
bool
MachMgr::ModifyRawPartHeight( int nRawId, double dHeight)
{
// la nuova altezza non può essere nulla
// la nuova altezza non può essere nulla
if ( dHeight < EPS_SMALL)
return false ;
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// recupero il solido del grezzo
@@ -552,10 +703,10 @@ MachMgr::GetRawPartPhases( int nRawId, INTVECTOR& vPhase) const
{
// pulisco parametro di ritorno
vPhase.clear() ;
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// recupero le fasi in cui è presente il grezzo (se manca è fase 1)
// recupero le fasi in cui è presente il grezzo (se manca è fase 1)
if ( ! m_pGeomDB->GetInfo( nRawId, MACH_RAW_PHASE, vPhase) || vPhase.empty())
vPhase.emplace_back( 1) ;
return true ;
@@ -565,11 +716,11 @@ MachMgr::GetRawPartPhases( int nRawId, INTVECTOR& vPhase) const
bool
MachMgr::KeepRawPart( int nRawId, int nSouPhase)
{
// verifico validità e recupero fasi in cui è presente
// verifico validità e recupero fasi in cui è presente
INTVECTOR vPhase ;
if ( ! GetRawPartPhases( nRawId, vPhase))
return false ;
// se fase corrente già presente, non devo fare alcunché
// se fase corrente già presente, non devo fare alcunché
if ( find( vPhase.begin(), vPhase.end(), m_nCurrPhase) != vPhase.end())
return true ;
// aggiungo la fase corrente
@@ -586,8 +737,8 @@ MachMgr::KeepRawPart( int nRawId, int nSouPhase)
return false ;
if ( ! SwapRawPartParts( nRawId, true))
return false ;
// se fase di origine non definita, esco con successo
if ( nSouPhase == 0)
// se fase di origine non definita o uguale alla corrente, esco con successo
if ( nSouPhase == 0 || nSouPhase == m_nCurrPhase)
return true ;
// copio il posizionamento
Disposition* pSouDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nSouPhase))) ;
@@ -621,10 +772,11 @@ MachMgr::KeepRawPart( int nRawId, int nSouPhase)
bool
MachMgr::VerifyRawPartPhase( int nRawId, int nPhase) const
{
// verifico validità e recupero fasi in cui è presente
// verifico validità e recupero fasi in cui è presente
INTVECTOR vPhase ;
if ( ! GetRawPartPhases( nRawId, vPhase))
return false ;
// verifico presenza nella fase indicata
return ( find( vPhase.begin(), vPhase.end(), nPhase) != vPhase.end()) ;
}
@@ -632,11 +784,11 @@ MachMgr::VerifyRawPartPhase( int nRawId, int nPhase) const
bool
MachMgr::RemoveRawPartFromCurrPhase( int nRawId)
{
// verifico validità e recupero fasi in cui è presente
// verifico validità e recupero fasi in cui è presente
INTVECTOR vPhase ;
if ( ! GetRawPartPhases( nRawId, vPhase))
return false ;
// se non appartiene alla fase corrente, non devo fare alcunché
// se non appartiene alla fase corrente, non devo fare alcunché
auto iIter = find( vPhase.begin(), vPhase.end(), m_nCurrPhase) ;
if ( iIter == vPhase.end())
return true ;
@@ -663,7 +815,7 @@ MachMgr::RemoveRawPartFromCurrPhase( int nRawId)
bool
MachMgr::RemoveRawPart( int nRawId)
{
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// tolgo dalle disposizioni in cui compare gli eventuali movimenti registrati di questo grezzo
@@ -687,7 +839,7 @@ MachMgr::VerifyRawPart( int nRawId, bool bLinkedAllowed) const
int nRawGroupId = GetCurrRawGroupId() ;
if ( nRawGroupId != GDB_ID_NULL && m_pGeomDB->GetParentId( nRawId) == nRawGroupId)
return true ;
// se consentito linkaggio ed il grezzo è linkato ad un gruppo della macchina corrente, va bene
// se consentito linkaggio ed il grezzo è linkato ad un gruppo della macchina corrente, va bene
if ( bLinkedAllowed) {
Machine* pMch = GetCurrMachine() ;
if ( pMch != nullptr && pMch->IsLinkedRawPart( nRawId))
@@ -807,12 +959,12 @@ MachMgr::ResetRawPartCenter( int nRawId)
bool
MachMgr::GetRawPartCenter( int nRawId, Point3d& ptCen)
{
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// cerco di recuperare l'oggetto
int nGPntId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_CENTER) ;
// ne verifico la validità
// ne verifico la validità
int nMode ;
if ( nGPntId == GDB_ID_NULL ||
! m_pGeomDB->GetMode( nGPntId, nMode) || nMode != GDB_MD_STD) {
@@ -840,7 +992,7 @@ MachMgr::GetRawPartCenter( int nRawId, Point3d& ptCen)
bool
MachMgr::GetRawPartBBox( int nRawId, BBox3d& b3Raw)
{
// verifica validità grezzo
// verifica validità grezzo
if ( ! VerifyRawPart( nRawId))
return false ;
// recupero solido del grezzo
@@ -848,6 +1000,103 @@ MachMgr::GetRawPartBBox( int nRawId, BBox3d& b3Raw)
return m_pGeomDB->GetGlobalBBox( nRawSolidId, b3Raw) ;
}
//---------------------------------------------------------------------------
static bool
AssociateSurfs( IGeomDB* pGeomDB, int nSurfUpId, int nSurfDownId, vector<pair<int,int>>& vRawSurfs)
{
// vRawSurfs contiene tutte le coppie ( id regioneUp, id regioneDown) che definiscono i nuovi grezzi
vRawSurfs.clear() ;
int nUpCnt = ExeSurfFrChunkCount( nSurfUpId) ;
int nDownCnt = ExeSurfFrChunkCount( nSurfDownId) ;
// se non sono stati creati più grezzi
if ( nUpCnt == 1 || nDownCnt == 1) {
vRawSurfs.emplace_back( nSurfUpId, nSurfDownId) ;
return true ;
}
int nUpFirstId = ExeExplodeSurface( nSurfUpId, &nUpCnt) ;
int nDownFirstId = ExeExplodeSurface( nSurfDownId, &nDownCnt) ;
// ad ogni chunk della regione up associo i chunk corrispondenti della regione down
INTVECTOR vChunks( nUpCnt, GDB_ID_NULL) ;
for ( int nIdD = nDownFirstId ; nIdD < nDownFirstId + nDownCnt ; nIdD ++) {
ISurfFlatRegion* pSfrD = GetSurfFlatRegion( pGeomDB->GetGeoObj( nIdD)) ;
if ( pSfrD == nullptr)
return false ;
BBox3d bBoxD ; ExeGetBBox( nIdD, BBF_STANDARD, bBoxD) ;
// inidividuo il chunk della superficie up che interagisce maggiormente con il chunk corrente della superficie down
int k = -1 ;
double dMaxArea = -1 ;
for ( int j = 0 ; j < nUpCnt ; j ++) {
BBox3d bBoxU ; ExeGetBBox( nUpFirstId + j, BBF_STANDARD, bBoxU) ;
if ( bBoxU.OverlapsXY( bBoxD)) {
PtrOwner<ISurfFlatRegion> pSfrU( CloneSurfFlatRegion( pGeomDB->GetGeoObj( nUpFirstId + j))) ;
if ( IsNull( pSfrU))
return false ;
// le due superfici sono nello stesso frame
pSfrU->Intersect( *pSfrD) ;
double dArea = -1 ; pSfrU->GetArea( dArea) ;
if ( dArea > dMaxArea) {
k = j ;
dMaxArea = dArea ;
}
}
}
// aggiorno le superfici con l'associazione trovata
if ( k == -1)
return false ;
if ( vChunks[k] == GDB_ID_NULL)
vChunks[k] = nIdD ;
else {
ExeSurfFrAdd( vChunks[k], nIdD) ;
ExeErase( {nIdD}) ;
}
}
// controllo per ogni chunk della superficie up il corrispondente della nuova superficie down
for ( int i = 0 ; i < nUpCnt ; i ++) {
ISurfFlatRegion* pSfrU = GetSurfFlatRegion( pGeomDB->GetGeoObj( nUpFirstId + i)) ;
if ( pSfrU == nullptr)
return false ;
BBox3d bBoxU ; ExeGetBBox( nUpFirstId + i, BBF_STANDARD, bBoxU) ;
// individuo il chunk della superficie down che interagisce maggiormente con il chunk corrente della superficie up
int k = -1 ;
double dMaxArea = -1 ;
for ( int j = 0 ; j < int( vChunks.size()) ; j ++) {
BBox3d bBoxD ; ExeGetBBox( vChunks[j], BBF_STANDARD, bBoxD) ;
// se i box interferiscono allora verifico di quanto si sovrappongono le due regioni
if ( bBoxD.OverlapsXY( bBoxU)) {
PtrOwner<ISurfFlatRegion> pSfrD( CloneSurfFlatRegion( pGeomDB->GetGeoObj( vChunks[j]))) ;
if ( IsNull( pSfrD))
return false ;
pSfrD->Intersect( *pSfrU) ;
double dArea = -1 ; pSfrD->GetArea( dArea) ;
if ( dArea > dMaxArea) {
k = j ;
dMaxArea = dArea ;
}
}
}
if ( k == -1)
return false ;
// se è la stessa associazione individuata da vChunks allora aggiorno il vettore finale dei grezzi
if ( k == i)
vRawSurfs.emplace_back( nUpFirstId + i, vChunks[i]) ;
else {
// altrimenti unisco le regioni associate appena individuate sia per la superficie up sia per la down
ExeSurfFrAdd( nUpFirstId + k, nUpFirstId + i) ;
ExeErase( {nUpFirstId + i}) ;
ExeSurfFrAdd( vChunks[k], vChunks[i]) ;
ExeErase( {vChunks[i]}) ;
}
}
return true ;
}
//----------------------------------------------------------------------------
int
MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
@@ -871,7 +1120,6 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
BBox3d b3Raw ;
if ( ! m_pGeomDB->GetGlobalBBox( nRawSolId, b3Raw))
return GDB_ID_NULL ;
double dZmin = b3Raw.GetMin().z ;
double dHeight = b3Raw.GetMax().z - b3Raw.GetMin().z ;
// il colore del grezzo
Color cCol = AQUA ;
@@ -880,19 +1128,31 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
Frame3d frRaw ;
if ( ! m_pGeomDB->GetGroupGlobFrame( nRawId, frRaw))
return GDB_ID_NULL ;
// creo la regione del grezzo a partire dal suo contorno
// recupero il contorno
int nOutCrvId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_OUTLINE) ;
if ( nOutCrvId == GDB_ID_NULL)
return GDB_ID_NULL ;
// creo la regione
INTVECTOR vCrvIds ;
vCrvIds.emplace_back( nOutCrvId) ;
int nSfrId = ExeCreateSurfFlatRegion( nRawId, vCrvIds, nullptr) ;
if ( nSfrId == GDB_ID_NULL)
return GDB_ID_NULL ;
m_pGeomDB->SetLevel( nSfrId, GDB_LV_TEMP) ;
// creo le regioni inferiore e superiore del grezzo da aggiornare con le lavorazioni
int nSfrDownId = GDB_ID_NULL, nSfrUpId = GDB_ID_NULL ;
int nSfrDownOrigId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_DOWN_REG) ;
int nSfrUpOrigId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_UP_REG) ;
if ( nSfrDownOrigId == GDB_ID_NULL || nSfrUpOrigId == GDB_ID_NULL) {
// se le regioni del grezzo di partenza non sono definite, le creo a partire dall'outline
nSfrDownId = ExeCreateSurfFlatRegion( nRawId, {nOutCrvId}, nullptr) ;
if ( nSfrDownId == GDB_ID_NULL)
return GDB_ID_NULL ;
nSfrUpId = ExeCopyGlob( nSfrDownId, nRawId, GDB_LAST_SON) ;
if ( nSfrUpId == GDB_ID_NULL)
return GDB_ID_NULL ;
ExeMove( { nSfrUpId}, dHeight * Z_AX, RTY_LOC) ;
}
else {
nSfrDownId = ExeCopyGlob( nSfrDownOrigId, nRawId, GDB_LAST_SON) ;
nSfrUpId = ExeCopyGlob( nSfrUpOrigId, nRawId, GDB_LAST_SON) ;
if ( nSfrDownId == GDB_ID_NULL || nSfrUpId == GDB_ID_NULL)
return GDB_ID_NULL ;
}
// se esiste il kerf, ne creo la regione
PtrOwner<ISurfFlatRegion> pSfrKerf ;
@@ -907,7 +1167,8 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
}
// recupero le regioni delle lavorazioni
INTVECTOR vMchRReg ;
INTVECTOR vMchRRegUp ;
INTVECTOR vMchRRegDown ;
for ( auto nMchId : vMchId) {
// recupero gruppo preview lavorazioni nella lavorazione
int nPVGrp = m_pGeomDB->GetFirstNameInGroup( nMchId, MCH_PV) ;
@@ -915,94 +1176,110 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
return GDB_ID_NULL ;
// se vuoto, cerco il rimando al preview nel pezzo
if ( m_pGeomDB->GetGroupObjs( nPVGrp) == 0 &&
! m_pGeomDB->GetInfo( nPVGrp, MCH_PV_KEY_RELOCATE, nPVGrp))
! m_pGeomDB->GetInfo( nPVGrp, MCH_PV_KEY_RELOCATE, nPVGrp))
return GDB_ID_NULL ;
// ciclo sui percorsi utensile (CL)
int nClId = m_pGeomDB->GetFirstGroupInGroup( nPVGrp) ;
while ( nClId != GDB_ID_NULL) {
// tagli ridotti
int nCrId = m_pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_RRCUT) ;
while ( nCrId != GDB_ID_NULL) {
vMchRReg.emplace_back( nCrId) ;
nCrId = m_pGeomDB->GetNextName( nCrId, MCH_PV_RRCUT) ;
}
// lavorazioni per regione inferiore
int nCrDownId = m_pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_DOWN_RAWCUT) ;
// se non esiste la regione inferiore la lavorazione non è passante quindi può essere ignorata
if ( nCrDownId != GDB_ID_NULL) {
while ( nCrDownId != GDB_ID_NULL) {
vMchRRegDown.emplace_back( nCrDownId) ;
nCrDownId = m_pGeomDB->GetNextName( nCrDownId, MCH_PV_DOWN_RAWCUT) ;
}
// lavorazioni per regione superiore
int nCrUpId = m_pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_UP_RAWCUT) ;
while ( nCrUpId != GDB_ID_NULL) {
vMchRRegUp.emplace_back( nCrUpId) ;
nCrUpId = m_pGeomDB->GetNextName( nCrUpId, MCH_PV_UP_RAWCUT) ;
}
}
// passo al successivo percorso utensile
nClId = m_pGeomDB->GetNextGroup( nClId) ;
}
}
// sottraggo queste regioni a quella del grezzo
for ( auto nMchRReg : vMchRReg) {
ExeSurfFrSubtract( nSfrId, nMchRReg) ;
}
// sottraggo le lavorazioni alle superfici del grezzo
for ( auto nMchRReg : vMchRRegUp)
ExeSurfFrSubtract( nSfrUpId, nMchRReg) ;
for ( auto nMchRReg : vMchRRegDown)
ExeSurfFrSubtract( nSfrDownId, nMchRReg) ;
// classifico i chunks della regione up e down per individuare le regioni che definiscono i nuovi grezzi
vector<pair<int,int>> vSurfRaws ;
AssociateSurfs( m_pGeomDB, nSfrUpId, nSfrDownId, vSurfRaws) ;
// creo i grezzi risultanti
// creo i nuovi grezzi
INTVECTOR vNewIds ;
int nCount ;
int nChunk = 0 ;
int nFirstLoopId = ExeExtractSurfFrChunkLoops( nSfrId, nChunk, nRawId, &nCount) ;
while ( nFirstLoopId != GDB_ID_NULL) {
// !!! in attesa di gestire i grezzi con i buchi !!!
// cancello le eventuali curve successive (sono i loop interni ovvero i buchi)
for ( int i = 1 ; i < nCount ; ++ i) {
m_pGeomDB->Erase( nFirstLoopId + i) ;
}
// dichiaro temporanea la curva
m_pGeomDB->SetLevel( nFirstLoopId, GDB_LV_TEMP) ;
// creo il grezzo
int nId = AddRawPart( nFirstLoopId, 0, dZmin, dHeight, cCol) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
vNewIds.emplace_back( nId) ;
// imposto lo stato del contorno di questo grezzo come quello del grezzo di partenza
int nStat = GDB_ST_ON ;
if ( m_pGeomDB->GetStatus( nOutCrvId, nStat) && nStat == GDB_ST_OFF)
m_pGeomDB->SetStatus( m_pGeomDB->GetFirstNameInGroup( nId, MACH_RAW_OUTLINE), nStat) ;
// assegno la fase al gruppo
m_pGeomDB->SetInfo( nId, MACH_RAW_PHASE, m_nCurrPhase) ;
// se esiste il kerf uso questa curva per creare il kerf del nuovo grezzo
if ( ! IsNull( pSfrKerf)) {
// creo la regione con la curva
SurfFlatRegionByContours SfrCntr ;
SfrCntr.AddCurve( GetCurve( m_pGeomDB->RemoveGeoObjAndErase( nFirstLoopId))) ;
PtrOwner<ISurfFlatRegion> pSfrNewKerf( SfrCntr.GetSurf()) ;
if ( IsNull( pSfrNewKerf))
return GDB_ID_NULL ;
// la limito con la regione di kerf precedente (va bene anche se fallisce)
pSfrNewKerf->Intersect( *pSfrKerf) ;
// se risultato non vuoto
if ( pSfrNewKerf->IsValid()) {
// riferimento del nuovo grezzo
Frame3d frNewRaw ;
if ( ! m_pGeomDB->GetGroupGlobFrame( nId, frNewRaw))
return GDB_ID_NULL ;
// la porto dal riferimento del grezzo originale al riferimento di questo grezzo
pSfrNewKerf->LocToLoc( frRaw, frNewRaw) ;
// la porto sulla faccia sopra del grezzo
pSfrNewKerf->Translate( Vector3d( 0, 0, dHeight)) ;
// recupero il contorno e lo inserisco come kerf del nuovo grezzo
PtrOwner<ICurve> pCrv( pSfrNewKerf->GetLoop( 0, 0)) ;
int nNewKerfId = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nId, Release( pCrv)) ;
if ( nNewKerfId == GDB_ID_NULL)
return GDB_ID_NULL ;
m_pGeomDB->CopyMaterial( nKerfId, nNewKerfId) ;
m_pGeomDB->SetName( nNewKerfId, MACH_RAW_KERF) ;
}
}
// altrimenti la cancello
else
m_pGeomDB->Erase( nFirstLoopId) ;
// passo alla prossima curva
++ nChunk ;
nFirstLoopId = ExeExtractSurfFrChunkLoops( nSfrId, nChunk, nRawId, &nCount) ;
}
// cancello la regione
m_pGeomDB->Erase( nSfrId) ;
// verifico esista almeno un nuovo grezzo
if ( vNewIds.empty())
return GDB_ID_NULL ;
INTVECTOR vNewIds ;
for ( int i = 0 ; i < int( vSurfRaws.size()) ; i++) {
// aggiungo il grezzo
int nId = AddRawPart( vSurfRaws[i].first, vSurfRaws[i].second, dHeight, cCol) ;
m_pGeomDB->Erase( vSurfRaws[i].first) ;
m_pGeomDB->Erase( vSurfRaws[i].second) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
vNewIds.emplace_back( nId) ;
// imposto lo stato del contorno di questo grezzo come quello del grezzo di partenza
int nStat = GDB_ST_ON ;
if ( m_pGeomDB->GetStatus( nOutCrvId, nStat) && nStat == GDB_ST_OFF)
m_pGeomDB->SetStatus( m_pGeomDB->GetFirstNameInGroup( nId, MACH_RAW_OUTLINE), nStat) ;
// assegno la fase al gruppo
m_pGeomDB->SetInfo( nId, MACH_RAW_PHASE, m_nCurrPhase) ;
// se esiste il kerf uso questa curva per creare il kerf del nuovo grezzo
if ( ! IsNull( pSfrKerf)) {
// riferimento del nuovo grezzo
Frame3d frNewRaw ;
if ( ! m_pGeomDB->GetGroupGlobFrame( nId, frNewRaw))
return GDB_ID_NULL ;
// considero il nuovo kerf come la regione superiore del nuovo grezzo
int nSfrUpId = m_pGeomDB->GetFirstNameInGroup( nId, MACH_RAW_UP_REG) ;
if ( nSfrUpId == GDB_ID_NULL)
return GDB_ID_NULL ;
PtrOwner<ISurfFlatRegion> pSfrNewKerf( CloneSurfFlatRegion( m_pGeomDB->GetGeoObj( nSfrUpId))) ;
if ( IsNull( pSfrNewKerf))
return GDB_ID_NULL ;
// porto nello stesso riferimento del grezzo originale
pSfrNewKerf->LocToLoc( frNewRaw, frRaw) ;
// la limito con la regione di kerf precedente ( va bene anche se fallisce)
pSfrNewKerf->Intersect( *pSfrKerf) ;
// se risultato non vuoto
if ( pSfrNewKerf->IsValid()) {
// la porto dal riferimento del grezzo originale al riferimento di questo grezzo
pSfrNewKerf->LocToLoc( frRaw, frNewRaw) ;
// recupero il contorno esterno del chunk più grande e lo inserisco come kerf del nuovo grezzo
double dAreaMax = -1 ;
int nKMax = 0 ;
for ( int k = 0 ; k < pSfrNewKerf->GetChunkCount() ; k ++) {
PtrOwner<ISurfFlatRegion> pSfrChunk( pSfrNewKerf->CloneChunk( k)) ;
double dArea = -1 ; pSfrChunk->GetGrossArea( dArea) ;
if ( dArea > dAreaMax) {
nKMax = k ;
dAreaMax = dArea ;
}
}
PtrOwner<ICurve> pCrv( pSfrNewKerf->GetLoop( nKMax, 0)) ;
if ( IsNull( pCrv))
return GDB_ID_NULL ;
int nNewKerfId = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nId, Release( pCrv)) ;
if ( nNewKerfId == GDB_ID_NULL)
return GDB_ID_NULL ;
m_pGeomDB->CopyMaterial( nKerfId, nNewKerfId) ;
m_pGeomDB->SetName( nNewKerfId, MACH_RAW_KERF) ;
}
}
}
// cancello le regioni usate per i conti
m_pGeomDB->Erase( nSfrUpId) ;
m_pGeomDB->Erase( nSfrDownId) ;
// verifico esista almeno un nuovo grezzo
if ( vNewIds.empty())
return GDB_ID_NULL ;
// inserisco i pezzi del grezzo originale nei nuovi grezzi
int nGroupId = m_pGeomDB->GetFirstGroupInGroup( nRawId) ;
while ( nGroupId != GDB_ID_NULL) {
@@ -1012,32 +1289,31 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
// scambio con pezzo
int nPartId = SwapRawPartPart( nNewGroupId, true) ;
// verifico se il pezzo sta nel grezzo
int nLayerId = m_pGeomDB->GetFirstNameInGroup( nPartId, NST_EXT_LAYER) ;
int nLayerId = m_pGeomDB->GetFirstNameInGroup( nPartId, NST_PARTREG_LAYER) ;
if ( nLayerId == GDB_ID_NULL || m_pGeomDB->GetGdbType( nLayerId) != GDB_TY_GROUP)
nLayerId = m_pGeomDB->GetFirstGroupInGroup( nPartId) ;
int nEntId = m_pGeomDB->GetFirstInGroup( nLayerId) ;
int nEntGeoType = m_pGeomDB->GetGeoType( nEntId) ;
Point3d ptTest ;
if ( ( ( nEntGeoType & GEO_CURVE) != 0 && ExeMidPoint( nEntId, nNewId, ptTest)) ||
( ( nEntGeoType & GEO_CURVE) == 0 && ExeCenterPoint( nEntId, nNewId, ptTest))) {
// cerco la regione del pezzo
int nEntId = m_pGeomDB->GetFirstInGroup( nLayerId) ;
while ( nEntId != GDB_ID_NULL) {
int nEntGeoType = m_pGeomDB->GetGeoType( nEntId) ;
if ( nEntGeoType == SRF_FLATRGN)
break ;
nEntId = m_pGeomDB->GetNext( nEntId) ;
}
if ( nEntId != GDB_ID_NULL) {
// verifico se è interna al grezzo
int nOutCrvId = m_pGeomDB->GetFirstNameInGroup( nNewId, MACH_RAW_OUTLINE) ;
BBox3d b3Raw ; m_pGeomDB->GetGlobalBBox( nOutCrvId, b3Raw) ;
double dRawDiam = 0 ; b3Raw.GetDiameter( dRawDiam) ;
BBox3d b3Part ; m_pGeomDB->GetGlobalBBox( nEntId, b3Part) ;
double dPartDiam = 0 ; b3Part.GetDiameter( dPartDiam) ;
if ( dRawDiam > 0.9 * dPartDiam) {
ICurve* pCurve = GetCurve( m_pGeomDB->GetGeoObj( nOutCrvId)) ;
if ( pCurve != nullptr) {
int nSide ;
double dDist ;
DistPointCurve distPC( ptTest, *pCurve) ;
if ( distPC.GetDist( dDist) &&
( dDist < 100 * EPS_SMALL ||
( distPC.GetSideAtMinDistPoint( 0, Z_AX, nSide) && nSide != MDS_RIGHT)))
break ;
}
}
}
int nSfrUp = m_pGeomDB->GetFirstNameInGroup( nNewId, MACH_RAW_UP_REG) ;
if ( ! ExeSurfFrTestExternal( nSfrUp, nEntId, EPS_SMALL))
break ;
}
}
// altrimenti scambio pezzo ed elimino gruppo
nNewGroupId = SwapRawPartPart( nPartId, false) ;
m_pGeomDB->Erase( nNewGroupId) ;
@@ -1045,5 +1321,5 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
nGroupId = m_pGeomDB->GetNextGroup( nGroupId) ;
}
return vNewIds[0] ;
return vNewIds[0] ;
}
+8
View File
@@ -130,6 +130,13 @@ MachMgr::FindToolInCurrSetup( const string& sTool)
return m_stuMgr.FindTool( sTool) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetToolSetupPosInCurrSetup( const string& sTool, string& sTcPos)
{
return m_stuMgr.GetToolSetupPos( sTool, sTcPos) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::GetToolsInCurrSetupPos( const string& sTcPos, STRVECTOR& vsTools)
@@ -148,6 +155,7 @@ MachMgr::UpdateCurrSetup( void)
Machine* pMch = GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
pMch->ResetCurrTool() ;
return pMch->LoadAllTools() ;
}
+57 -6
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2023
//----------------------------------------------------------------------------
// File : MachMgrSimulation.cpp Data : 20.10.15 Versione : 1.6j2
// File : MachMgrSimulation.cpp Data : 16.01.23 Versione : 2.5a2
// Contenuto : Implementazione gestione simulazione della classe MachMgr.
//
//
@@ -16,7 +16,8 @@
#include "DllMain.h"
#include "MachMgr.h"
#include "MachConst.h"
#include "Simulator.h"
#include "SimulatorSP.h"
#include "SimulatorMP.h"
using namespace std ;
@@ -27,7 +28,12 @@ MachMgr::SimInit( void)
// alloco o rialloco il simulatore
if ( m_pSimul != nullptr)
delete m_pSimul ;
m_pSimul = new( nothrow) Simulator ;
if ( GetCurrMachine() == nullptr)
return false ;
if ( GetCurrMachine()->GetMultiProcess( 2))
m_pSimul = CreateSimulatorMP() ;
else
m_pSimul = CreateSimulatorSP() ;
if ( m_pSimul == nullptr)
return false ;
// lo inizializzo
@@ -150,13 +156,13 @@ MachMgr::SimExit( void)
//----------------------------------------------------------------------------
bool
MachMgr::SimAddCollisionObj( int nInd, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3)
MachMgr::SimAddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// aggiungo un oggetto da verificare per la collisione con il grezzo
return m_pSimul->AddCollisionObj( nInd, nFrameId, nType, vtMove, dPar1, dPar2, dPar3) ;
return m_pSimul->AddCollisionObj( nInd, bToolOn, nFrameId, nType, vtMove, dPar1, dPar2, dPar3) ;
}
//----------------------------------------------------------------------------
@@ -180,3 +186,48 @@ MachMgr::SimOnCollision( int nCdInd, int nObjInd, int& nErr)
// lancio funzione di gestione collisione
return m_pSimul->OnCollision( nCdInd, nObjInd, nErr) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SimSetToolForVmill( const string& sTool, const string& sHead, int nExit, int nFlag, double dPar1, double dPar2,
const INTVECTOR& vVmill, bool bFirst)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// imposto utensile per Vmill
return m_pSimul->SetToolForVmill( sTool, sHead, nExit, nFlag, dPar1, dPar2, vVmill, bFirst) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SimEnableToolsForVmill( bool bEnable)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// imposto abilitazione Vmill
return m_pSimul->EnableToolsForVmill( bEnable) ;
}
//----------------------------------------------------------------------------
int
MachMgr::SimMoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return SIM_AXMV_RES_ERR ;
// lancio movimento assi
return m_pSimul->MoveAxes( nMoveType, vAxNaEpSt) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::SimSaveCmd( int nType, int nPar, const string& sPar, const string& sPar2)
{
// verifico simulatore
if ( m_pSimul == nullptr)
return false ;
// salvo il comando
return m_pSimul->SaveCmd( nType, nPar, sPar, sPar2) ;
}
+126 -25
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2021
//----------------------------------------------------------------------------
// File : Machine.cpp Data : 06.05.15 Versione : 1.6e3
// File : Machine.cpp Data : 14.10.21 Versione : 2.3j5
// Contenuto : Implementazione gestione macchina.
//
//
@@ -41,16 +41,27 @@ Machine::Machine( void)
m_dExitMaxAdjust = EPS_SMALL ;
m_dExitMaxRotAdj = 10 * EPS_ANG_SMALL ;
m_dAngDeltaMinForHome = INFINITO ;
m_nMultiProcess = 0 ;
m_nNewLinkMgr = 0 ;
m_nCalcTabId = GDB_ID_NULL ;
m_nCalcHeadId = GDB_ID_NULL ;
m_nCalcExitId = GDB_ID_NULL ;
m_nCalcToolId = GDB_ID_NULL ;
m_dCalcRot1W = 1 ;
m_bCalcMaxDeltaR2On1 = true ;
m_nCalcSolCh = MCH_SCC_NONE ;
m_dCalcTLen = 0 ;
m_dCalcTRad = 0 ;
m_dCalcTOvLen = 0 ;
m_dCalcTOvRad = 0 ;
m_nTabLinAxes = 0 ;
m_nTabRotAxes = 0 ;
m_nHeadLinAxes = 0 ;
m_nHeadRotAxes = 0 ;
m_nHeadSpecRotAxis = -1 ;
m_frLinAx.Reset( false) ;
m_frRobot.Reset( false) ;
m_nCalcChainType = KIN_CHAIN_NONE ;
m_nMachineLook = MCH_LOOK_NONE ;
}
@@ -86,7 +97,7 @@ Machine::Clear( void)
//----------------------------------------------------------------------------
bool
Machine::Init( const string& sMachinesDir, const string& sMachineName, MachMgr* pMchMgr)
Machine::Init( const string& sMachineName, const string& sMachineDir, MachMgr* pMchMgr)
{
// pulisco
Clear() ;
@@ -96,7 +107,7 @@ Machine::Init( const string& sMachinesDir, const string& sMachineName, MachMgr*
m_pMchMgr = pMchMgr ;
m_pGeomDB = m_pMchMgr->GetGeomDB() ;
// verifico direttorio dati macchina
m_sMachineDir = sMachinesDir + "\\" + sMachineName ;
m_sMachineDir = sMachineDir ;
if ( ! ExistsDirectory( m_sMachineDir))
return false ;
// creo il gruppo per la macchina
@@ -133,7 +144,9 @@ Machine::Init( const string& sMachinesDir, const string& sMachineName, MachMgr*
// imposto stato di visualizzazione
m_nMachineLook = ( bOk ? MCH_LOOK_ALL : MCH_LOOK_NONE) ;
// metto tutti gli assi in posizione home
bOk = bOk && ResetAllAxesPos() ;
bOk = bOk && ResetAllAxesPos( true, true) ;
// reset catena cinematica corrente
m_nCalcChainType = KIN_CHAIN_NONE ;
return bOk ;
}
@@ -202,7 +215,7 @@ Machine::AdjustAuxGeometry( const STRVECTOR& vsAux, int nLay)
bool
Machine::LoadMachineTable( const string& sName, const string& sParent, int nType,
const Point3d& ptRef1, double dCoeffX, double dCoeffY, double dCoeffZ,
const string& sGeo, const STRVECTOR& vsAux)
const STRVECTOR& vsColl, const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della tavola
string sPart, sLay ;
@@ -241,7 +254,7 @@ Machine::LoadMachineTable( const string& sName, const string& sParent, int nType
Table* pTab = new(nothrow) Table ;
if ( pTab == nullptr)
return false ;
pTab->Set( sName, nType, ptRef1, b3Area1) ;
pTab->Set( sName, nType, ptRef1, b3Area1, vsColl) ;
m_pGeomDB->SetUserObj( nLay, pTab) ;
// lo inserisco nel dizionario dei gruppi della macchina
return m_mapGroups.emplace( sName, nLay).second ;
@@ -280,7 +293,7 @@ Machine::AdjustTable( int nLay, const Point3d& ptRef1)
//----------------------------------------------------------------------------
bool
Machine::LoadMachineAxis( const string& sName, const string& sParent, const string& sToken, bool bInvert,
int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke,
double dOffset, int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke,
double dHome, bool bAdjustAux, const string& sGeo, const STRVECTOR& vsAux)
{
// verifico sia di tipo ammesso
@@ -321,7 +334,7 @@ Machine::LoadMachineAxis( const string& sName, const string& sParent, const stri
Axis* pAxis = new(nothrow) Axis ;
if ( pAxis == nullptr)
return false ;
pAxis->Set( sName, sToken, bInvert, nType, ptPos, vtDir, Stroke, dHome) ;
pAxis->Set( sName, sToken, bInvert, dOffset, nType, ptPos, vtDir, Stroke, dHome) ;
m_pGeomDB->SetUserObj( nLay, pAxis) ;
// verifico il vettore rappresentativo dell'asse
if ( ! AdjustAxis( nLay, sPart, sName, nType, ptPos, vtDir, bAdjustAux))
@@ -434,8 +447,16 @@ Machine::ModifyMachineAxisPosition( const string& sName, const Point3d& ptPos)
Axis* pAx = GetAxis( nAxGrp) ;
if ( pAx == nullptr)
return false ;
// se valore dell'asse non nullo, lo annullo
double dCurrVal = pAx->GetCurrVal() ;
if ( abs( dCurrVal) > EPS_ZERO)
SetAxisPos( sName, 0, false) ;
// eseguo la modifica
return pAx->Modify( ptPos, m_dAxisMaxAdjust) ;
bool bOk = pAx->Modify( ptPos, m_dAxisMaxAdjust) ;
// ripristino l'asse al valore corrente
if ( abs( dCurrVal) > EPS_ZERO)
SetAxisPos( sName, dCurrVal, false) ;
return bOk ;
}
//----------------------------------------------------------------------------
@@ -451,8 +472,16 @@ Machine::ModifyMachineAxisDirection( const string& sName, const Vector3d& vtDir)
Axis* pAx = GetAxis( nAxGrp) ;
if ( pAx == nullptr)
return false ;
// se valore dell'asse non nullo, lo annullo
double dCurrVal = pAx->GetCurrVal() ;
if ( abs( dCurrVal) > EPS_ZERO)
SetAxisPos( sName, 0, false) ;
// eseguo la modifica
return pAx->Modify( vtDir, m_dAxisMaxRotAdj) ;
bool bOk = pAx->Modify( vtDir, m_dAxisMaxRotAdj) ;
// ripristino l'asse al valore corrente
if ( abs( dCurrVal) > EPS_ZERO)
SetAxisPos( sName, dCurrVal, false) ;
return bOk ;
}
//----------------------------------------------------------------------------
@@ -493,7 +522,7 @@ Machine::ModifyMachineAxisHome( const string& sName, double dHome)
bool
Machine::LoadMachineStdHead( const string& sName, const string& sParent, const string& sHSet,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della testa
@@ -521,7 +550,7 @@ Machine::LoadMachineStdHead( const string& sName, const string& sParent, const s
Head* pHead = new(nothrow) Head ;
if ( pHead == nullptr)
return false ;
pHead->Set( sName, MCH_HT_STD, 1, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh, vsOthColl) ;
pHead->Set( sName, MCH_HT_STD, 1, sHSet, 0, vtADir, dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl) ;
m_pGeomDB->SetUserObj( nLay, pHead) ;
// aggiorno la testa capostipite
if ( ! AddHeadToSet( sHSet, sName))
@@ -541,8 +570,8 @@ Machine::LoadMachineStdHead( const string& sName, const string& sParent, const s
//----------------------------------------------------------------------------
bool
Machine::LoadMachineMultiHead( const string& sName, const string& sParent, const string& sHSet,
const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
int nSelectType, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della testa
@@ -570,7 +599,8 @@ Machine::LoadMachineMultiHead( const string& sName, const string& sParent, const
Head* pHead = new(nothrow) Head ;
if ( pHead == nullptr)
return false ;
pHead->Set( sName, MCH_HT_MULTI, int( vMuExit.size()), sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh, vsOthColl) ;
pHead->Set( sName, MCH_HT_MULTI, int( vMuExit.size()), sHSet, nSelectType,
vtADir, dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl) ;
m_pGeomDB->SetUserObj( nLay, pHead) ;
// aggiorno la testa capostipite
if ( ! AddHeadToSet( sHSet, sName))
@@ -589,7 +619,7 @@ Machine::LoadMachineMultiHead( const string& sName, const string& sParent, const
bool
Machine::LoadMachineSpecialHead( const string& sName, const string& sParent, const string& sHSet,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della testa
@@ -617,7 +647,7 @@ Machine::LoadMachineSpecialHead( const string& sName, const string& sParent, con
Head* pHead = new(nothrow) Head ;
if ( pHead == nullptr)
return false ;
pHead->Set( sName, MCH_HT_SPECIAL, 1, sHSet, vtADir, dRot1W, Rot2Stroke, nSolCh, vsOthColl) ;
pHead->Set( sName, MCH_HT_SPECIAL, 1, sHSet, 0, vtADir, dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl) ;
m_pGeomDB->SetUserObj( nLay, pHead) ;
// aggiorno la testa capostipite
if ( ! AddHeadToSet( sHSet, sName))
@@ -636,9 +666,9 @@ Machine::LoadMachineSpecialHead( const string& sName, const string& sParent, con
//----------------------------------------------------------------------------
bool
Machine::LoadMachineTcPos( const string& sName, const string& sParent,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
const string& sGeo, const STRVECTOR& vsAux)
Machine::LoadMachineStdTcPos( const string& sName, const string& sParent,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della posizione nel cambio utensile
string sPart, sLay ;
@@ -678,6 +708,48 @@ Machine::LoadMachineTcPos( const string& sName, const string& sParent,
return m_mapGroups.emplace( sName, nLay).second ;
}
//----------------------------------------------------------------------------
bool
Machine::LoadMachineMultiTcPos( const string& sName, const string& sParent,
const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
const string& sGeo, const STRVECTOR& vsAux)
{
// recupero pezzo e layer della geometria originale della posizione nel cambio utensile
string sPart, sLay ;
Split( sGeo, "/", true, sPart, sLay) ;
// cerco il gruppo nella geometria originale
int nPart = m_pGeomDB->GetFirstNameInGroup( m_nTempGroupId, sPart) ;
int nLay = m_pGeomDB->GetFirstNameInGroup( nPart, sLay) ;
if ( nLay == GDB_ID_NULL)
return false ;
// cerco il gruppo padre per spostarvelo
int nParentId = GetGroup( sParent) ;
if ( nParentId == GDB_ID_NULL ||
! m_pGeomDB->RelocateGlob( nLay, nParentId, GDB_LAST_SON))
return false ;
// sistemo lo stato di visualizzazione
m_pGeomDB->SetStatus( nLay, GDB_ST_ON) ;
// gli assegno il nome
m_pGeomDB->SetName( nLay, sName) ;
// sistemo la geometria ausiliaria
if ( ! AdjustAuxGeometry( vsAux, nLay))
return false ;
// installo e inizializzo il gestore della posizione nel cambio utensile
TcPos* pTcPos = new(nothrow) TcPos ;
if ( pTcPos == nullptr)
return false ;
pTcPos->Set( sName, vtADir) ;
m_pGeomDB->SetUserObj( nLay, pTcPos) ;
// sistemo il riferimento dell'uscita rispetto alla direzione ausiliaria
if ( ! AdjustExitFrames( nLay, vMuExit, vtADir))
return false ;
// trasformazione del riferimento di uscita in gruppo di uscita
if ( ! CreateExitGroups( nLay, vMuExit))
return false ;
// lo inserisco nel dizionario dei gruppi della macchina
return m_mapGroups.emplace( sName, nLay).second ;
}
//----------------------------------------------------------------------------
int
Machine::GetGroup( const string& sGroup) const
@@ -801,6 +873,22 @@ Machine::EnableHeadInSet( const string& sHead)
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::ModifyMachineHeadAuxDirection( const string& sHead, const Vector3d& vtADir)
{
// controllo GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero testa
int nHeadId = GetGroup( sHead) ;
Head* pHead = GetHead( nHeadId) ;
if ( pHead == nullptr)
return false ;
// eseguo la modifica
return pHead->ModifyHeadAuxDirection( vtADir) ;
}
//----------------------------------------------------------------------------
bool
Machine::AdjustExitFrames( int nLay, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir)
@@ -895,7 +983,7 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
return false ;
}
else {
Vector3d vtRotAx = vtTDir ^ vtDirN ; vtRotAx.Normalize() ;
Vector3d vtRotAx = vtTDir ^ vtDirN ; vtRotAx.Normalize( EPS_ZERO) ;
string sOut = " Exit " + sName + " rotation = (" + ToString( dAngRot) + "/" + ToString( vtRotAx) + ")" ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str()) ;
vtRotAx.ToLoc( frHead) ;
@@ -917,8 +1005,8 @@ Machine::CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit)
m_pGeomDB->SetName( nGT, sName) ;
// copio le info
m_pGeomDB->CopyAllInfoFrom( nGT, nT) ;
// assegno info per eventuale movimento
m_pGeomDB->SetInfo( nGT, "Val", 0) ;
// assegno info per eventuale movimento (sempre in Z globale)
m_pGeomDB->SetInfo( nGT, MCH_EXIT_VAL, 0) ;
// installo e inizializzo il gestore dell'uscita
Exit* pExit = new(nothrow) Exit ;
if ( pExit == nullptr)
@@ -953,7 +1041,11 @@ Machine::ModifyMachineExitPosition( const string& sHead, int nExit, const Point3
if ( pExit == nullptr)
return false ;
// eseguo la modifica
return pExit->Modify( ptPos, m_dExitMaxAdjust) ;
if ( ! pExit->Modify( ptPos, m_dExitMaxAdjust))
return false ;
// eventuale aggiornamento variabile lua EMC.EXITPOS con la nuova posizione
LuaSetGlobVar( "EMC.EXITPOS", ptPos) ;
return true ;
}
//----------------------------------------------------------------------------
@@ -977,6 +1069,8 @@ Machine::SetLook( int nFlag)
nTabId = GetFirstTable() ;
if ( nTabId == GDB_ID_NULL)
return false ;
// il gruppo tavola corrente deve essere sempre visibile
m_pGeomDB->SetStatus( nTabId, GDB_ST_ON) ;
// nascondo o visualizzo i fratelli e tutti i fratelli degli ascendenti della tavola
bool bTabOnly = ( nFlag != MCH_LOOK_ALL) ;
int nTabCurrId = nTabId ;
@@ -1081,6 +1175,13 @@ Machine::IsLinkedRawPart( int nRawId) const
return ( find( m_vLinkedRawParts.begin(), m_vLinkedRawParts.end(), nRawId) != m_vLinkedRawParts.end()) ;
}
//----------------------------------------------------------------------------
const INTVECTOR&
Machine:: GetAllLinkedRawParts( void) const
{
return m_vLinkedRawParts ;
}
//----------------------------------------------------------------------------
bool
Machine::UnlinkRawPartFromGroup( int nRawPartId)
+92 -36
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2023
//----------------------------------------------------------------------------
// File : Machine.h Data : 06.05.15 Versione : 1.6e3
// File : Machine.h Data : 16.01.23 Versione : 2.5a2
// Contenuto : Dichiarazione della classe Machine.
//
//
@@ -34,7 +34,7 @@ class Machine
public :
Machine( void) ;
~Machine( void) ;
bool Init( const std::string& sMachinesDir, const std::string& sMachineName, MachMgr* pMchMgr) ;
bool Init( const std::string& sMachineName, const std::string& sMachineDir, MachMgr* pMchMgr) ;
const std::string& GetMachineName( void) const
{ return m_sName ; }
const std::string& GetMachineDir( void) const
@@ -50,21 +50,46 @@ class Machine
int GetAxisId( const std::string& sAxis) const
{ int nId = GetGroup( sAxis) ;
return ( IsAxisGroup( nId) ? nId : GDB_ID_NULL) ; }
bool GetAxisName( int nAxId, std::string& sAxis) const ;
int GetHeadId( const std::string& sHead) const
{ int nId = GetGroup( sHead) ;
return ( IsHeadGroup( nId) ? nId : GDB_ID_NULL) ; }
int GetExitId( const std::string& sHead, int nExit) const
{ int nHeadId = GetHeadId( sHead) ;
int nId = ( m_pGeomDB != nullptr ? m_pGeomDB->GetFirstNameInGroup( nHeadId, MCH_EXIT + ToString( nExit)) : GDB_ID_NULL) ;
return ( IsExitGroup( nId) ? nId : GDB_ID_NULL) ; }
int GetTcPosId( const std::string& sTcPos) const
{ int nId = GetGroup( sTcPos) ;
return ( IsTcPosGroup( nId) ? nId : GDB_ID_NULL) ; }
bool IsBaseGroup( int nGroup) const ;
bool IsAxisGroup( int nGroup) const
{ return ( GetAxis( nGroup) != nullptr) ; }
bool IsLinearAxisGroup( int nGroup) const ;
bool IsRotaryAxisGroup( int nGroup) const ;
bool IsTableGroup( int nGroup) const
{ return ( GetTable( nGroup) != nullptr) ; }
bool IsHeadGroup( int nGroup) const
{ return ( GetHead( nGroup) != nullptr) ; }
bool IsTcPosGroup( int nGroup) const
{ return ( GetTcPos( nGroup) != nullptr) ; }
bool IsExitGroup( int nGroup) const
{ return ( GetExit( nGroup) != nullptr) ; }
bool GetAllAxesIds( INTVECTOR& vIds) const ;
bool GetAllTablesNames( STRVECTOR& vNames) const ;
bool GetAllAxesNames( STRVECTOR& vNames) const ;
bool GetAllHeadsNames( STRVECTOR& vNames) const ;
bool GetAllTcPosNames( STRVECTOR& vNames) const ;
int GetFirstTable( void) const ;
int GetHeadExitCount( const std::string& sHead) const ;
int GetHeadExitPosDirAux( const std::string& sHead, int nExit, Point3d& ptPos, Vector3d& vtDir, Vector3d& vtAux) const ;
int GetHeadSolCh( const std::string& sHead) const ;
int GetHeadSelectType(const std::string& sHead) const ;
double GetAngDeltaMinForHome( void) const
{ return m_dAngDeltaMinForHome ; }
bool GetMultiProcess( int nOpt = 1) const
{ return ( m_nMultiProcess >= nOpt) ; }
bool GetNewLinkMgr( int nOpt = 1) const
{ return ( m_nNewLinkMgr >= nOpt) ; }
bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ;
bool GetLoadedTool( const std::string& sHead, int nExit, std::string& sTool) const ;
bool UnloadTool( const std::string& sHead, int nExit) ;
@@ -75,14 +100,18 @@ class Machine
bool ResetHeadSet( const std::string& sHead) ;
bool GetAxisToken( const std::string& sAxis, std::string& sToken) const ;
bool GetAxisInvert( const std::string& sAxis, bool& bInvert) const ;
bool GetAxisOffset( const std::string& sAxis, double& dOffset) const ;
bool GetAxisType( const std::string& sAxis, bool& bLinear) const ;
bool SetAxisPos( const std::string& sAxis, double dVal, double* pdNewVal = nullptr) ;
bool GetAxisDir( const std::string& sAxis, Vector3d& vtDir) const ;
bool SetAxisPos( const std::string& sAxis, double dVal, bool bInStroke = true, double* pdNewVal = nullptr) ;
bool GetAxisPos( const std::string& sAxis, double& dVal) const ;
bool GetAxisMin( const std::string& sAxis, double& dMin) const ;
bool GetAxisMax( const std::string& sAxis, double& dMax) const ;
bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) const ;
bool IsDispositionAxis( int nAxisId, int nTableId = GDB_ID_NULL) const ;
bool IsDispositionAxis( const std::string& sAxis, const std::string& sTable = "") const ;
bool ResetAxisPos( const std::string& sAxis) ;
bool ResetAllAxesPos( void) ;
bool ResetAllAxesPos( bool bStdAxes, bool bDispAxes) ;
bool SetCurrTable( const std::string& sTable) ;
bool ResetCurrTable( void) ;
int GetCurrTable( void) const ;
@@ -90,7 +119,8 @@ class Machine
bool GetCurrTableRef1( Point3d& ptRef1) const ;
bool GetCurrTableArea1( BBox3d& b3Area1) const ;
bool GetCurrTableDeltaRef1( Vector3d& vtDelta1) const ;
bool GetCurrTableIsTilting( bool& bTilting) const ;
bool GetCurrTableIsTilting( bool& bTilting, Vector3d& vtTiltingAx) const ;
bool GetCurrTableCollGroups( INTVECTOR& vIds) const ;
bool SetCurrTool( const std::string& sTool, const std::string& sHead, int nExit) ;
bool ResetCurrTool( void) ;
int GetCurrTool( void) const ;
@@ -100,7 +130,11 @@ class Machine
int GetCurrExit( void) const ;
bool GetCurrExit( int& nExit) const ;
bool GetCurrHeadCollGroups( INTVECTOR& vIds) const ;
double GetCurrRot1W( void) const ;
bool IsCurrToolFloating( void) const ;
double GetCurrRot1W( void) const
{ return m_dCalcRot1W ; }
bool GetCurrMaxDeltaR2OnFirst( void) const
{ return m_bCalcMaxDeltaR2On1 ; }
std::string GetKinematicAxis( int nInd) const ;
bool BlockKinematicRotAxis( const std::string& sName, double dVal) ;
bool BlockKinematicRotAxis( int nId, double dVal) ;
@@ -112,25 +146,32 @@ class Machine
int GetCurrLinAxes( void) const ;
int GetCurrRotAxes( void) const ;
bool GetCurrAxisName( int nInd, std::string& sAxName) const ;
bool GetAllCurrAxesName( STRVECTOR& vAxName) const ;
bool GetAllCurrAxesNames( STRVECTOR& vAxName) const ;
bool GetCurrAxisToken( int nInd, std::string& sAxToken) const ;
bool GetAllCurrAxesToken( STRVECTOR& vAxToken) const ;
bool GetAllCurrAxesTokens( STRVECTOR& vAxToken) const ;
bool GetCurrAxisType( int nInd, bool& bLinear, bool& bHead) const ;
bool GetCurrAxisMin( int nInd, double& dMin) const ;
bool GetCurrAxisMax( int nInd, double& dMax) const ;
bool GetCurrAxisOffset( int nInd, double& dOffset) const ;
bool GetCurrAxisInvert( int nInd, bool& bInvert) const ;
bool GetCurrAxisHomePos( int nInd, double& dHome) const ;
bool GetAllCurrAxesHomePos( DBLVECTOR& vAxHomeVal) const ;
const Frame3d& GetCurrLinAxesFrame( void) const
{ return m_frLinAx ; }
int GetCurrKinematicChainType( void) const
{ return m_nCalcChainType ; }
bool GetAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) const ;
bool GetAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
int& nStat, DBLVECTOR& vAng1, DBLVECTOR& vAng2) const ;
bool GetPositions( const Point3d& ptP, const DBLVECTOR& vAng,
int& nStat, double& dX, double& dY, double& dZ) const ;
bool GetHeadOffsetDelta( const DBLVECTOR& vAng,
double& dRecX, double& dRecY, double& dRecZ) const ;
bool GetRobotAngles( const Point3d& ptP, const Vector3d& vtDirT, const Vector3d& vtDirA,
DBLVECTOR& vAng1, DBLVECTOR& vAng2) const ;
bool GetNoseFromPositions( double dX, double dY, double dZ, const DBLVECTOR& vAng,
Point3d& ptNose) const ;
bool GetTipFromPositions( double dX, double dY, double dZ, const DBLVECTOR& vAng,
bool bBottom, bool bOverall, Point3d& ptTip) const ;
bool bOverall, bool bBottom, bool bBack, Point3d& ptTip) const ;
bool GetToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
bool GetAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
bool GetPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const ;
@@ -141,7 +182,7 @@ class Machine
bool VerifyAngleOutstroke( int nInd, double dAng) const ;
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, bool bClear, int& nStat) const ;
bool ExistProtectedAreas( void) const ;
bool VerifyProtectedAreas( double dX, double dY, double dZ, const DBLVECTOR& vAng, int& nStat) ;
bool VerifyProtectedAreas( double dX, double dY, double dZ, const DBLVECTOR& vAng, int nLinkType, int& nStat) ;
bool VerifyOutstroke( const std::string& sAxName, double dVal) const ;
std::string GetOutstrokeInfo( bool bMM = true) const ;
void ResetOutstrokeInfo( void) const
@@ -151,6 +192,7 @@ class Machine
{ return m_nMachineLook ; }
bool LinkRawPartToGroup( int nRawPartId, const std::string& sGroupName) ;
bool IsLinkedRawPart( int nRawId) const ;
const INTVECTOR& GetAllLinkedRawParts( void) const ;
bool UnlinkRawPartFromGroup( int nRawPartId) ;
bool UnlinkAllRawPartsFromGroups( void) ;
bool LinkFixtureToGroup( int nFxtId, const std::string& sGroupName) ;
@@ -181,10 +223,10 @@ class Machine
bool AdjustAuxGeometry( const STRVECTOR& vsAux, int nLay) ;
bool LoadMachineTable( const std::string& sName, const std::string& sParent, int nType,
const Point3d& ptRef1, double dCoeffX, double dCoeffY, double dCoeffZ,
const std::string& sGeo, const STRVECTOR& vsAux) ;
const STRVECTOR& vsColl, const std::string& sGeo, const STRVECTOR& vsAux) ;
bool AdjustTable( int nLay, const Point3d& ptRef1) ;
bool LoadMachineAxis( const std::string& sName, const std::string& sParent, const std::string& sToken,
bool bInvert, int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke,
bool LoadMachineAxis( const std::string& sName, const std::string& sParent, const std::string& sToken, bool bInvert,
double dOffset, int nType, const Point3d& ptPos, const Vector3d& vtDir, const STROKE& Stroke,
double dHome, bool bAdjustAux, const std::string& sGeo, const STRVECTOR& vsAux) ;
bool AdjustAxis( int nLay, const std::string& sPart, const std::string& sName,
int nType, const Point3d& ptPos, const Vector3d& vtDir, bool bAdjustAux) ;
@@ -194,45 +236,37 @@ class Machine
bool ModifyMachineAxisHome( const std::string& sName, double dHome) ;
bool LoadMachineStdHead( const std::string& sName, const std::string& sParent, const std::string& sHSet,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const std::string& sGeo, const STRVECTOR& vsAux) ;
bool LoadMachineMultiHead( const std::string& sName, const std::string& sParent, const std::string& sHSet,
const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
int nSelectType, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const std::string& sGeo, const STRVECTOR& vsAux) ;
bool LoadMachineSpecialHead( const std::string& sName, const std::string& sParent, const std::string& sHSet,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
double dRot1W, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
double dRot1W, bool bMaxDeltaR2On1, const STROKE& Rot2Stroke, int nSolCh, const STRVECTOR& vsOthColl,
const std::string& sGeo, const STRVECTOR& vsAux) ;
bool LoadMachineTcPos( const std::string& sName, const std::string& sParent,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
const std::string& sGeo, const STRVECTOR& vsAux) ;
bool LoadMachineStdTcPos( const std::string& sName, const std::string& sParent,
const Point3d& ptPos, const Vector3d& vtTDir, const Vector3d& vtADir,
const std::string& sGeo, const STRVECTOR& vsAux) ;
bool LoadMachineMultiTcPos( const std::string& sName, const std::string& sParent,
const MUEXITVECTOR& vMuExit, const Vector3d& vtADir,
const std::string& sGeo, const STRVECTOR& vsAux) ;
int GetGroup( const std::string& sGroup) const ;
bool IsBaseGroup( int nGroup) const ;
Axis* GetAxis( int nGroup) const ;
bool IsAxisGroup( int nGroup) const
{ return ( GetAxis( nGroup) != nullptr) ; }
bool IsLinearAxisGroup( int nGroup) const ;
bool IsRotaryAxisGroup( int nGroup) const ;
Table* GetTable( int nGroup) const ;
bool IsTableGroup( int nGroup) const
{ return ( GetTable( nGroup) != nullptr) ; }
Head* GetHead( int nGroup) const ;
bool IsHeadGroup( int nGroup) const
{ return ( GetHead( nGroup) != nullptr) ; }
TcPos* GetTcPos( int nGroup) const ;
bool IsTcPosGroup( int nGroup) const
{ return ( GetTcPos( nGroup) != nullptr) ; }
Exit* GetExit( int nGroup) const ;
bool IsExitGroup( int nGroup) const
{ return ( GetExit( nGroup) != nullptr) ; }
bool AddHeadToSet( const std::string& sHSet, const std::string& sName) ;
const STRVECTOR& GetHSet( const std::string& sHead) const ;
bool EnableHeadInSet( const std::string& sHead) ;
bool LoadTool( Exit* pExit, const std::string& sTool) ;
bool ModifyMachineHeadAuxDirection( const std::string& sHead, const Vector3d& vtADir) ;
bool AdjustExitFrames( int nLay, const MUEXITVECTOR& vMuExit, const Vector3d& vtADir) ;
bool CreateExitGroups( int nLay, const MUEXITVECTOR& vMuExit) ;
bool ModifyMachineExitPosition( const std::string& sHead, int nExit, const Point3d& ptPos) ;
bool ClearKinematicChain( void) ;
bool CalculateKinematicChain( void) ;
bool AddKinematicAxis( bool bOnHead, int nId) ;
bool GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
@@ -268,6 +302,8 @@ class Machine
double m_dExitMaxAdjust ; // massimo aggiustamento uscita da geometria a descrizione cinematica
double m_dExitMaxRotAdj ; // massima rotazione di aggiustamento uscita da geometria a descrizione cinematica
double m_dAngDeltaMinForHome ; // minima differenza angolare da valore precedente per scegliere di stare vicino a home
int m_nMultiProcess ; // codice di macchina multi-processo (con stima speciale e simulazione ad hoc)
int m_nNewLinkMgr ; // codice del nuovo gestore link tra lavorazioni (0=vecchio, 1=nuovo)
INTVECTOR m_vLinkedRawParts ; // elenco dei grezzi agganciati a gruppi della macchina
INTVECTOR m_vLinkedFixtures ; // elenco dei bloccaggi agganciati a gruppi della macchina
INTVECTOR m_vLinkedParts ; // elenco dei pezzi agganciati a gruppi della macchina
@@ -277,6 +313,7 @@ class Machine
int m_nCalcExitId ; // uscita corrente per calcoli
int m_nCalcToolId ; // utensile corrente per calcoli
double m_dCalcRot1W ; // peso del primo asse rotante per i confronti
bool m_bCalcMaxDeltaR2On1 ; // flag utilizzo controllo massimo delta secondo asse rotante su inizio lavorazione
int m_nCalcSolCh ; // criterio di scelta della soluzione
bool m_bSolChExact ; // flag per scelta soluzione da soddisfare esattamente
Point3d m_ptCalcPos ; // posizione utensile a riposo per calcoli
@@ -286,8 +323,18 @@ class Machine
double m_dCalcTRad ; // raggio utensile corrente per calcoli
double m_dCalcTOvLen ; // lunghezza di ingombro utensile corrente per calcoli
double m_dCalcTOvRad ; // raggio di ingombro utensile corrente per calcoli
int m_nTabLinAxes ; // numero assi lineari attivi di tavola per calcoli
int m_nTabRotAxes ; // numero assi rotanti attivi di tavola per calcoli
int m_nHeadLinAxes ; // numero assi lineari attivi di testa per calcoli
int m_nHeadRotAxes ; // numero assi rotanti attivi di testa per calcoli
int m_nHeadSpecRotAxis ; // indice eventuale asse rotante speciale di testa prima dei lineari di testa (-1 non esiste)
KINAXISVECTOR m_vCalcLinAx ; // vettore assi lineari attivi per calcoli
KINAXISVECTOR m_vCalcRotAx ; // vettore assi rotanti attivi per calcoli
Frame3d m_frLinAx ; // sistema di riferimento definito dagli assi lineari
Frame3d m_frRobot ; // sistema di riferimento canonico del robot
int m_nCalcChainType ; // tipologia testa attiva (nulla, centro di lavoro o robot)
Point3d m_ptWristCen ; // centro del polso sferico nel riferimento testa/uscita di calcolo
Vector3d m_vtWristRef ; // direzione del polso sferico nel riferimento testa/uscita di calcolo
mutable OutStroke m_OutstrokeInfo ; // informazioni su ultima extra corsa
// stato di visualizzazione
int m_nMachineLook ; // stato di visualizzazione della macchina
@@ -306,10 +353,13 @@ class Machine
static int LuaEmtMultiHead( lua_State* L) ;
static int LuaEmtSpecialHead( lua_State* L) ;
static int LuaEmtTcPos( lua_State* L) ;
static int LuaEmtStdTcPos( lua_State* L) ;
static int LuaEmtMultiTcPos( lua_State* L) ;
static int LuaEmtModifyAxisPosition( lua_State* L) ;
static int LuaEmtModifyAxisDirection( lua_State* L) ;
static int LuaEmtModifyAxisStroke( lua_State* L) ;
static int LuaEmtModifyAxisHome( lua_State* L) ;
static int LuaEmtModifyHeadAuxDirection( lua_State* L) ;
static int LuaEmtModifyExitPosition( lua_State* L) ;
static int LuaEmtAddRapidStart( lua_State* L) ;
static int LuaEmtAddRapidMove( lua_State* L) ;
@@ -319,6 +369,7 @@ class Machine
static int LuaEmtGetAxesPos( lua_State* L) ;
static int LuaEmtGetBackAuxDir( lua_State* L) ;
static int LuaEmtLinkRawPartToGroup( lua_State* L) ;
static int LuaEmtGetAllLinkedRawParts( lua_State* L) ;
static int LuaEmtUnlinkRawPartFromGroup( lua_State* L) ;
static int LuaEmtUnlinkAllRawPartsFromGroups( lua_State* L) ;
static int LuaEmtLinkFixtureToGroup( lua_State* L) ;
@@ -335,6 +386,11 @@ class Machine
static int LuaEmtAddCollisionObjEx( lua_State* L) ;
static int LuaEmtExecCollisionCheck( lua_State* L) ;
static int LuaEmtOnCollision( lua_State* L) ;
static int LuaEmtSetToolForVmill( lua_State* L) ;
static int LuaEmtAddToolForVmill( lua_State* L) ;
static int LuaEmtEnableToolsForVmill( lua_State* L) ;
static int LuaEmtMoveAxes( lua_State* L) ;
static int LuaEmtSaveCmd( lua_State* L) ;
} ;
//----------------------------------------------------------------------------
+140 -16
View File
@@ -19,9 +19,54 @@
#include "/EgtDev/Include/EGkGeoVector3d.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EgtNumUtils.h"
using namespace std ;
//----------------------------------------------------------------------------
bool
Machine::GetAllAxesIds( INTVECTOR& vIds) const
{
// reset lista identificativi
vIds.clear() ;
// ricerca degli assi
for ( const auto& snGro : m_mapGroups) {
if ( IsAxisGroup( snGro.second))
vIds.push_back( snGro.second) ;
}
// se richiesto, ordino alfabeticamente
sort( vIds.begin(), vIds.end()) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAllAxesNames( STRVECTOR& vNames) const
{
// reset lista nomi
vNames.clear() ;
// ricerca degli assi
for ( const auto& snGro : m_mapGroups) {
if ( IsAxisGroup( snGro.second))
vNames.push_back( snGro.first) ;
}
// se richiesto, ordino alfabeticamente
sort( vNames.begin(), vNames.end()) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAxisName( int nAxId, string& sName) const
{
// recupero il relativo gestore
const Axis* pAx = GetAxis( nAxId) ;
if ( pAx == nullptr)
return false ;
// recupero il token dell'asse
sName = pAx->GetName() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAxisToken( const string& sAxis, string& sToken) const
@@ -30,7 +75,7 @@ Machine::GetAxisToken( const string& sAxis, string& sToken) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il token dell'asse
@@ -46,7 +91,7 @@ Machine::GetAxisInvert( const string& sAxis, bool& bInvert) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il flag di inversione dell'asse in visualizzazione
@@ -54,6 +99,22 @@ Machine::GetAxisInvert( const string& sAxis, bool& bInvert) const
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAxisOffset( const string& sAxis, double& dOffset) const
{
// controllo GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il valore di offset dell'asse in visualizzazione
dOffset = pAx->GetOffset() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::GetAxisType( const string& sAxis, bool& bLinear) const
@@ -62,7 +123,7 @@ Machine::GetAxisType( const string& sAxis, bool& bLinear) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il tipo dell'asse
@@ -72,7 +133,23 @@ Machine::GetAxisType( const string& sAxis, bool& bLinear) const
//----------------------------------------------------------------------------
bool
Machine::SetAxisPos( const string& sAxis, double dVal, double* pdNewVal)
Machine::GetAxisDir( const string& sAxis, Vector3d& vtDir) const
{
// controllo GeomDB
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero la direzione dell'asse
vtDir = pAx->GetDir() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::SetAxisPos( const string& sAxis, double dVal, bool bInStroke, double* pdNewVal)
{
// controllo GeomDB
if ( m_pGeomDB == nullptr)
@@ -89,6 +166,15 @@ Machine::SetAxisPos( const string& sAxis, double dVal, double* pdNewVal)
double dCurrVal = pAx->GetCurrVal() ;
// limiti della corsa
STROKE Stroke = pAx->GetStroke() ;
// se rotante e corrente, verifico se ci sono limitazioni aggiuntive (dalla testa)
if ( ! bLinear) {
for ( const auto& CalcRotAx : m_vCalcRotAx) {
if ( CalcRotAx.nGrpId == nAxGrp) {
Stroke.Min = max( Stroke.Min, CalcRotAx.stroke.Min) ;
Stroke.Max = min( Stroke.Max, CalcRotAx.stroke.Max) ;
}
}
}
// recupero il vettore dell'asse
int nV = m_pGeomDB->GetFirstNameInGroup( nAxGrp, sAxis) ;
const IGeoVector3d* pGV = GetGeoVector3d( m_pGeomDB->GetGeoObj( nV)) ;
@@ -97,11 +183,9 @@ Machine::SetAxisPos( const string& sAxis, double dVal, double* pdNewVal)
Point3d ptPos = pGV->GetBase() ;
Vector3d vtDir = pGV->GetVector() ;
vtDir.Normalize() ;
// limito il movimento alla corsa dell'asse
if ( dVal > Stroke.Max)
dVal = Stroke.Max ;
else if ( dVal < Stroke.Min)
dVal = Stroke.Min ;
// se richiesto, limito il movimento alla corsa dell'asse
if ( bInStroke)
dVal = Clamp( dVal, Stroke.Min, Stroke.Max) ;
// eseguo il movimento
if ( bLinear)
m_pGeomDB->TranslateGroup( nAxGrp, vtDir * ( dVal - dCurrVal)) ;
@@ -122,7 +206,7 @@ Machine::GetAxisPos( const string& sAxis, double& dVal) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il relativo gestore
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero la posizione corrente
@@ -138,7 +222,7 @@ Machine::GetAxisMin( const string& sAxis, double& dMin) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il gestore dell'asse
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il minimo
@@ -154,7 +238,7 @@ Machine::GetAxisMax( const string& sAxis, double& dMax) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il gestore dell'asse
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero il massimo
@@ -170,7 +254,7 @@ Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal) const
if ( m_pGeomDB == nullptr)
return false ;
// recupero il gestore dell'asse
Axis* pAx = GetAxis( GetGroup( sAxis)) ;
const Axis* pAx = GetAxis( GetGroup( sAxis)) ;
if ( pAx == nullptr)
return false ;
// recupero la posizione home
@@ -178,6 +262,42 @@ Machine::GetAxisHomePos( const string& sAxis, double& dHomeVal) const
return true ;
}
//----------------------------------------------------------------------------
bool
Machine::IsDispositionAxis( int nAxisId, int nTableId) const
{
// se direttamente dipendente dalla tavola
int nParentId = m_pGeomDB->GetParentId( nAxisId) ;
if ( ( nTableId != GDB_ID_NULL && nParentId == nTableId) || IsTableGroup( nParentId))
return true ;
// altrimenti deve dipendere da asse dipendente dalla tavola
if ( ! IsAxisGroup( nParentId))
return false ;
int nGrParId = m_pGeomDB->GetParentId( nParentId) ;
return ( ( nTableId != GDB_ID_NULL && nGrParId == nTableId) || IsTableGroup( nGrParId)) ;
}
//----------------------------------------------------------------------------
bool
Machine::IsDispositionAxis( const string& sAxis, const string& sTable) const
{
if ( m_pGeomDB == nullptr)
return false ;
// recupero Id asse
int nAxId = GetAxisId( sAxis) ;
if ( nAxId == GDB_ID_NULL)
return false ;
// recupero eventuale Id tavola
int nTabId = GDB_ID_NULL ;
if ( ! sTable.empty()) {
nTabId = GetTableId( sTable) ;
if ( nTabId == GDB_ID_NULL)
return false ;
}
// eseguo
return IsDispositionAxis( nAxId, nTabId) ;
}
//----------------------------------------------------------------------------
bool
Machine::ResetAxisPos( const string& sAxis)
@@ -195,13 +315,17 @@ Machine::ResetAxisPos( const string& sAxis)
//----------------------------------------------------------------------------
bool
Machine::ResetAllAxesPos( void)
Machine::ResetAllAxesPos( bool bStdAxes, bool bDispAxes)
{
// ciclo sui gruppi della macchina
for ( auto Iter = m_mapGroups.cbegin() ; Iter != m_mapGroups.cend() ; ++ Iter) {
if ( IsAxisGroup( Iter->second)) {
if ( ! ResetAxisPos( Iter->first))
return false ;
if ( ( bStdAxes && bDispAxes) ||
( bStdAxes && ! IsDispositionAxis( Iter->first)) ||
( bDispAxes && IsDispositionAxis( Iter->first))) {
if ( ! ResetAxisPos( Iter->first))
return false ;
}
}
}
return true ;
+598 -121
View File
File diff suppressed because it is too large Load Diff
+17 -1
View File
@@ -98,6 +98,18 @@ Machine::GetHeadSolCh( const string& sHead) const
return pHead->GetSolCh() ;
}
//----------------------------------------------------------------------------
int
Machine::GetHeadSelectType( const string& sHead) const
{
// recupero testa
Head* pHead = GetHead( GetGroup( sHead)) ;
if ( pHead == nullptr)
return MCH_SCC_NONE ;
// recupero tipo di selezione delle uscite della testa
return pHead->GetSelectType() ;
}
//----------------------------------------------------------------------------
bool
Machine::LoadTool( const string& sHead, int nExit, const string& sTool)
@@ -170,13 +182,17 @@ Machine::LoadTool( Exit* pExit, const string& sTool)
if ( nSolidId == GDB_ID_NULL)
return false ;
// sposto eventuali info relative al porta utensile (ToolHolder) nel gruppo SOLID
double dVal ;
double dVal ; string sVal ;
if ( m_pGeomDB->GetInfo( nTGrpId, TTH_BASE, dVal))
m_pGeomDB->SetInfo( nSolidId, TTH_BASE, dVal) ;
if ( m_pGeomDB->GetInfo( nTGrpId, TTH_LEN, dVal))
m_pGeomDB->SetInfo( nSolidId, TTH_LEN, dVal) ;
if ( m_pGeomDB->GetInfo( nTGrpId, TTH_DIAM, dVal))
m_pGeomDB->SetInfo( nSolidId, TTH_DIAM, dVal) ;
if ( m_pGeomDB->GetInfo( nTGrpId, TTH_STEM_DIAM, dVal))
m_pGeomDB->SetInfo( nSolidId, TTH_STEM_DIAM, dVal) ;
if ( m_pGeomDB->GetInfo( nTGrpId, TTH_TYPE, sVal))
m_pGeomDB->SetInfo( nSolidId, TTH_TYPE, sVal) ;
// sposto il gruppo SOLID nell'uscita ed elimino la sua vecchia base
m_pGeomDB->RelocateGlob( nSolidId, nExGrp, GDB_FIRST_SON) ;
m_pGeomDB->Erase( nTGrpId) ;
+367 -24
View File
@@ -1,13 +1,15 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2020
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachineLua.cpp Data : 26.04.20 Versione : 2.2d4
// File : MachineLua.cpp Data : 01.09.24 Versione : 2.6i1
// Contenuto : Implementazione gestione macchina : funzioni Lua.
//
//
//
// Modifiche : 06.05.15 DS Creazione modulo.
// 26.04.20 DS Aggiunta gestione TcPos.
// 05.08.24 DS Aggiunta gestione SpecialEstimate.
// 01.09.24 DS SpecialEstimate è diventato MultiProcess.
//
//----------------------------------------------------------------------------
@@ -34,6 +36,8 @@ static const string FLD_AXISMAXROTADJ = "AxisMaxRotAdj" ;
static const string FLD_EXITMAXADJUST = "ExitMaxAdjust" ;
static const string FLD_EXITMAXROTADJ = "ExitMaxRotAdj" ;
static const string FLD_ANGDELTAMINFORHOME = "AngDeltaMinForHome" ;
static const string FLD_MULTIPROCESS = "MultiProcess" ;
static const string FLD_NEWLINKMGR = "NewLinkMgr" ;
static const string FLD_NAME = "Name" ;
static const string FLD_PARENT = "Parent" ;
static const string FLD_GEO = "Geo" ;
@@ -41,20 +45,25 @@ static const string FLD_AUX = "Aux" ;
static const string FLD_TOKEN = "Token" ;
static const string FLD_TYPE = "Type" ;
static const string FLD_INVERT = "Invert" ;
static const string FLD_AXIS_OFFSET = "Offset" ;
static const string FLD_REF1 = "Ref1" ;
static const string FLD_SCALE = "Scale" ;
static const string FLD_EXIT_NBR = "ExitNbr" ;
static const string FLD_POS = "Pos" ;
static const string FLD_DIR = "Dir" ;
static const string FLD_STROKE = "Stroke" ;
static const string FLD_HOME = "Home" ;
static const string FLD_ADJUSTAUX = "AdjustAux" ;
static const string FLD_HSET = "HSet" ;
static const string FLD_SEL_TYPE = "SelType" ;
static const string FLD_TDIR = "TDir" ;
static const string FLD_ADIR = "ADir" ;
static const string FLD_ROT1W = "Rot1W" ;
static const string FLD_MAXDELTAR2ON1 = "MaxDeltaR2OnFirst" ;
static const string FLD_ROT2STROKE = "Rot2Stroke" ;
static const string FLD_SOLCH = "SolCh" ;
static const string FLD_OTHCOLL = "OthColl" ;
static const string FLD_COLL = "Coll" ;
//----------------------------------------------------------------------------
Machine* Machine::m_pMchLua = nullptr ;
@@ -93,8 +102,10 @@ Machine::LuaInit( const string& sMachineName)
m_LuaMgr.RegisterFunction( "EmtModifyAxisDirection", Machine::LuaEmtModifyAxisDirection) ;
m_LuaMgr.RegisterFunction( "EmtModifyAxisStroke", Machine::LuaEmtModifyAxisStroke) ;
m_LuaMgr.RegisterFunction( "EmtModifyAxisHome", Machine::LuaEmtModifyAxisHome) ;
m_LuaMgr.RegisterFunction( "EmtModifyHeadAuxDirection", Machine::LuaEmtModifyHeadAuxDirection) ;
m_LuaMgr.RegisterFunction( "EmtModifyExitPosition", Machine::LuaEmtModifyExitPosition) ;
m_LuaMgr.RegisterFunction( "EmtLinkRawPartToGroup", Machine::LuaEmtLinkRawPartToGroup) ;
m_LuaMgr.RegisterFunction( "EmtGetAllLinkedRawParts", Machine::LuaEmtGetAllLinkedRawParts) ;
m_LuaMgr.RegisterFunction( "EmtUnlinkRawPartFromGroup", Machine::LuaEmtUnlinkRawPartFromGroup) ;
m_LuaMgr.RegisterFunction( "EmtUnlinkAllRawPartsFromGroups", Machine::LuaEmtUnlinkAllRawPartsFromGroups) ;
m_LuaMgr.RegisterFunction( "EmtLinkFixtureToGroup", Machine::LuaEmtLinkFixtureToGroup) ;
@@ -128,6 +139,16 @@ Machine::LuaInit( const string& sMachineName)
m_LuaMgr.RegisterFunction( "EmtExecCollisionCheck", Machine::LuaEmtExecCollisionCheck) ;
// registro la funzione di gestione della collisione in simulazione
m_LuaMgr.RegisterFunction( "EmtOnCollision", Machine::LuaEmtOnCollision) ;
// registro la funzione di impostazione del primo utensile per virtual milling in simulazione
m_LuaMgr.RegisterFunction( "EmtSetToolForVmill", Machine::LuaEmtSetToolForVmill) ;
// registro la funzione di impostazione di utensile aggiuntivo per virtual milling in simulazione
m_LuaMgr.RegisterFunction( "EmtAddToolForVmill", Machine::LuaEmtAddToolForVmill) ;
// registro la funzione per abilitare/disabilitare l'esecuzione del virtual milling
m_LuaMgr.RegisterFunction( "EmtEnableToolsForVmill", Machine::LuaEmtEnableToolsForVmill) ;
// registro la funzione di movimento assi in simulazione
m_LuaMgr.RegisterFunction( "EmtMoveAxes", Machine::LuaEmtMoveAxes) ;
// registro la funzione di salvataggio comandi in simulazione MP
m_LuaMgr.RegisterFunction( "EmtSaveCmd", Machine::LuaEmtSaveCmd) ;
return true ;
}
@@ -327,6 +348,13 @@ Machine::LuaEmtGeneral( lua_State* L)
// lettura eventuale campo 'AngDeltaForHome' dalla tabella (default INFINITO)
double dAngDeltaMinForHome = INFINITO ;
LuaGetTabFieldParam( L, 1, FLD_ANGDELTAMINFORHOME, dAngDeltaMinForHome) ;
// lettura eventuale campo 'MultiProcess' dalla tabella (0=no, 1=si, 2=si con simulazione MP)
int nMultiProcess = 0 ;
LuaGetTabFieldParam( L, 1, FLD_MULTIPROCESS, nMultiProcess) ;
// lettura eventuale campo 'NewLinkMgr' dalla tabella (0=old, 1 =new)
int nNewLinkMgr = 0 ;
LuaGetTabFieldParam( L, 1, FLD_NEWLINKMGR, nNewLinkMgr) ;
// pulizia stack
LuaClearStack( L) ;
// info
@@ -376,6 +404,11 @@ Machine::LuaEmtGeneral( lua_State* L)
// imposto minima differenza angolare da posizione precedente per stare vivino a posizione home
m_pMchLua->m_dAngDeltaMinForHome = dAngDeltaMinForHome ;
// imposto codice per macchina multiprocesso
m_pMchLua->m_nMultiProcess = nMultiProcess ;
// imposto codice per gestione link tra lavorazioni
m_pMchLua->m_nNewLinkMgr = nNewLinkMgr ;
return 0 ;
}
@@ -440,6 +473,9 @@ Machine::LuaEmtTable( lua_State* L)
// lettura eventuale campo 'Scale' dalla tabella
double vScale[3] = {1.0, 1.0, 1.0} ;
LuaGetTabFieldParam( L, 1, FLD_SCALE, vScale) ;
// lettura eventuale campo 'Coll' dalla tabella
STRVECTOR vsColl ;
LuaGetTabFieldParam( L, 1, FLD_COLL, vsColl) ;
// lettura campo 'Geo' dalla tabella
string sGeo ;
LuaCheckTabFieldParam( L, 1, FLD_GEO, sGeo)
@@ -457,7 +493,7 @@ Machine::LuaEmtTable( lua_State* L)
return luaL_error( L, " Unknown Machine") ;
// carico i dati della tavola
if ( ! m_pMchLua->LoadMachineTable( sName, sParent, nType, Ref1, vScale[0], vScale[1], vScale[2], sGeo, vsAux))
if ( ! m_pMchLua->LoadMachineTable( sName, sParent, nType, Ref1, vScale[0], vScale[1], vScale[2], vsColl, sGeo, vsAux))
return luaL_error( L, " Load Machine Table failed") ;
// restituisco l'indice della tavola
@@ -488,6 +524,9 @@ Machine::LuaEmtAxis( lua_State* L)
// lettura eventuale campo 'Invert' dalla tabella (default false)
bool bInvert = false ;
LuaGetTabFieldParam( L, 1, FLD_INVERT, bInvert) ;
// lettura eventuale campo 'Offset' dalla tabella (default 0)
double dOffset = 0 ;
LuaGetTabFieldParam( L, 1, FLD_AXIS_OFFSET, dOffset) ;
// lettura campo 'Type' dalla tabella
int nType ;
LuaCheckTabFieldParam( L, 1, FLD_TYPE, nType)
@@ -523,8 +562,8 @@ Machine::LuaEmtAxis( lua_State* L)
return luaL_error( L, " Unknown Machine") ;
// carico i dati dell'asse
if ( ! m_pMchLua->LoadMachineAxis( sName, sParent, sToken, bInvert, nType, ptPos, vtDir,
Stroke, dHome, bAdjustAux, sGeo, vsAux))
if ( ! m_pMchLua->LoadMachineAxis( sName, sParent, sToken, bInvert, dOffset,
nType, ptPos, vtDir, Stroke, dHome, bAdjustAux, sGeo, vsAux))
return luaL_error( L, " Load Machine Axis failed") ;
// restituisco l'indice dell'asse
@@ -588,8 +627,11 @@ Machine::LuaEmtStdHead( lua_State* L)
// lettura eventuale campo 'Rot1W' dalla tabella (default 1)
double dRot1W = 1 ;
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
// lettura eventuale campo 'MaxDeltaR2OnFirst' dalla tabella (default true)
bool bMaxDeltaR2On1 = true ;
LuaGetTabFieldParam( L, 1, FLD_MAXDELTAR2ON1, bMaxDeltaR2On1) ;
// lettura eventuale campo 'Rot2Stroke' dalla tabella
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
// lettura eventuale campo 'SolCh' dalla tabella
int nSolCh = MCH_SCC_NONE ;
@@ -615,7 +657,7 @@ Machine::LuaEmtStdHead( lua_State* L)
// carico i dati della testa standard
if ( ! m_pMchLua->LoadMachineStdHead( sName, sParent, sHSet, ptPos, vtTDir, vtADir,
dRot1W, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
return luaL_error( L, " Load Machine Standard Head failed") ;
// restituisco l'indice della testa
@@ -643,9 +685,12 @@ Machine::LuaEmtMultiHead( lua_State* L)
// lettura campo 'HSet' dalla tabella
string sHSet ;
LuaCheckTabFieldParam( L, 1, FLD_HSET, sHSet)
// lettura eventuale campo tipo di selezione ammessa per le uscite
int nSelectType = MCH_SLT_FIXEDEXITS ;
LuaGetTabFieldParam( L, 1, FLD_SEL_TYPE, nSelectType) ;
// lettura campo 'ExitNbr' dalla tabella
int nExitNbr ;
LuaCheckTabFieldParam( L, 1, "ExitNbr", nExitNbr)
LuaCheckTabFieldParam( L, 1, FLD_EXIT_NBR, nExitNbr)
// lettura campi 'PosN' e 'TDirN' per ogni uscita dalla tabella
MUEXITVECTOR vMuExit ;
vMuExit.reserve( nExitNbr) ;
@@ -660,14 +705,17 @@ Machine::LuaEmtMultiHead( lua_State* L)
// inserimento nell'array
vMuExit.emplace_back( ptPos, vtTDir) ;
}
// lettura campo 'ADir' dalla tabella
// lettura eventuale campo 'ADir' dalla tabella
Vector3d vtADir ;
LuaGetTabFieldParam( L, 1, FLD_ADIR, vtADir) ;
// lettura eventuale campo 'Rot1W' dalla tabella (default 1)
double dRot1W = 1 ;
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
// lettura eventuale campo 'MaxDeltaR2OnFirst' dalla tabella (default true)
bool bMaxDeltaR2On1 = true ;
LuaGetTabFieldParam( L, 1, FLD_MAXDELTAR2ON1, bMaxDeltaR2On1) ;
// lettura eventuale campo 'Rot2Stroke' dalla tabella
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
// lettura eventuale campo 'SolCh' dalla tabella
int nSolCh = MCH_SCC_NONE ;
@@ -692,9 +740,9 @@ Machine::LuaEmtMultiHead( lua_State* L)
return luaL_error( L, " Unknown Machine") ;
// carico i dati della testa multipla
if ( ! m_pMchLua->LoadMachineMultiHead( sName, sParent, sHSet, vMuExit, vtADir,
dRot1W, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
return luaL_error( L, " Load Machine Standard Head failed") ;
if ( ! m_pMchLua->LoadMachineMultiHead( sName, sParent, sHSet, nSelectType, vMuExit, vtADir,
dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
return luaL_error( L, " Load Machine Multi Head failed") ;
// restituisco l'indice della testa
int nHeadId = m_pMchLua->GetHeadId( sName) ;
@@ -733,8 +781,11 @@ Machine::LuaEmtSpecialHead( lua_State* L)
// lettura eventuale campo 'Rot1W' dalla tabella (default 1)
double dRot1W = 1 ;
LuaGetTabFieldParam( L, 1, FLD_ROT1W, dRot1W) ;
// lettura eventuale campo 'MaxDeltaR2OnFirst' dalla tabella (default true)
bool bMaxDeltaR2On1 = true ;
LuaGetTabFieldParam( L, 1, FLD_MAXDELTAR2ON1, bMaxDeltaR2On1) ;
// lettura eventuale campo 'Rot2Stroke' dalla tabella
STROKE Rot2Stroke{ -INFINITO, INFINITO} ;
STROKE Rot2Stroke{{ -INFINITO, INFINITO}} ;
LuaGetTabFieldParam( L, 1, FLD_ROT2STROKE, Rot2Stroke.v) ;
// lettura eventuale campo 'SolCh' dalla tabella
int nSolCh = MCH_SCC_NONE ;
@@ -760,7 +811,7 @@ Machine::LuaEmtSpecialHead( lua_State* L)
// carico i dati della testa standard
if ( ! m_pMchLua->LoadMachineSpecialHead( sName, sParent, sHSet, ptPos, vtTDir, vtADir,
dRot1W, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
dRot1W, bMaxDeltaR2On1, Rot2Stroke, nSolCh, vsOthColl, sGeo, vsAux))
return luaL_error( L, " Load Machine Special Head failed") ;
// restituisco l'indice della testa
@@ -775,6 +826,26 @@ Machine::LuaEmtSpecialHead( lua_State* L)
//----------------------------------------------------------------------------
int
Machine::LuaEmtTcPos( lua_State* L)
{
// Il parametro 1 deve essere una tabella
if ( ! lua_istable( L, 1))
return luaL_error( L, " Invalid Parameter, required a table") ;
// lettura campo opzionale 'ExitNbr' dalla tabella
int nExitNbr = 1 ;
LuaGetTabFieldParam( L, 1, FLD_EXIT_NBR, nExitNbr) ;
// Procedo alla lettura a seconda del tnumero di uscite
if ( nExitNbr == 1)
return LuaEmtStdTcPos( L) ;
else if ( nExitNbr > 1)
return LuaEmtMultiTcPos( L) ;
else
return luaL_error( L, " Tc Position type unknown") ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtStdTcPos( lua_State* L)
{
// Il parametro 1 deve essere una tabella
if ( ! lua_istable( L, 1))
@@ -811,8 +882,70 @@ Machine::LuaEmtTcPos( lua_State* L)
return luaL_error( L, " Unknown Machine") ;
// carico i dati della posizione cambio utensile
if ( ! m_pMchLua->LoadMachineTcPos( sName, sParent, ptPos, vtTDir, vtADir, sGeo, vsAux))
return luaL_error( L, " Load Machine Tc Position failed") ;
if ( ! m_pMchLua->LoadMachineStdTcPos( sName, sParent, ptPos, vtTDir, vtADir, sGeo, vsAux))
return luaL_error( L, " Load Machine Standard Tc Position failed") ;
// restituisco l'indice della posizione cambio utensile
int nTcPosId = m_pMchLua->GetTcPosId( sName) ;
if ( nTcPosId != GDB_ID_NULL)
LuaSetParam( L, nTcPosId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtMultiTcPos( lua_State* L)
{
// Il parametro 1 deve essere una tabella
if ( ! lua_istable( L, 1))
return luaL_error( L, " Invalid Parameter, required a table") ;
// lettura campo 'Name' dalla tabella
string sName ;
LuaCheckTabFieldParam( L, 1, FLD_NAME, sName)
// lettura campo 'Parent' dalla tabella
string sParent ;
LuaCheckTabFieldParam( L, 1, FLD_PARENT, sParent)
// lettura campo 'ExitNbr' dalla tabella
int nExitNbr ;
LuaCheckTabFieldParam( L, 1, FLD_EXIT_NBR, nExitNbr)
// lettura campi 'PosN' e 'TDirN' per ogni uscita dalla tabella
MUEXITVECTOR vMuExit ;
vMuExit.reserve( nExitNbr) ;
for ( int i = 0 ; i < nExitNbr ; ++ i) {
// lettura
string sPos = FLD_POS + ToString( i + 1) ;
Point3d ptPos ;
LuaCheckTabFieldParam( L, 1, sPos.c_str(), ptPos)
string sTDir = FLD_TDIR + ToString( i + 1) ;
Vector3d vtTDir ;
LuaCheckTabFieldParam( L, 1, sTDir.c_str(), vtTDir)
// inserimento nell'array
vMuExit.emplace_back( ptPos, vtTDir) ;
}
// lettura eventuale campo 'ADir' dalla tabella
Vector3d vtADir ;
LuaGetTabFieldParam( L, 1, FLD_ADIR, vtADir) ;
// lettura campo 'Geo' dalla tabella
string sGeo ;
LuaCheckTabFieldParam( L, 1, FLD_GEO, sGeo)
// lettura eventuale campo 'Aux' dalla tabella
STRVECTOR vsAux ;
LuaGetTabFieldParam( L, 1, FLD_AUX, vsAux) ;
LuaClearStack( L) ;
// info
string sOut = "LuaEmtTcPos : " + sName ;
LOG_DBG_INFO( GetEMkLogger(), sOut.c_str())
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// carico i dati della posizione cambio utensile
if ( ! m_pMchLua->LoadMachineMultiTcPos( sName, sParent, vMuExit, vtADir, sGeo, vsAux))
return luaL_error( L, " Load Machine Multi Tc Position failed") ;
// restituisco l'indice della posizione cambio utensile
int nTcPosId = m_pMchLua->GetTcPosId( sName) ;
@@ -903,6 +1036,26 @@ Machine::LuaEmtModifyAxisHome( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtModifyHeadAuxDirection( lua_State* L)
{
// 2 parametri : sHead, vtADir
string sHead ;
LuaCheckParam( L, 1, sHead)
Vector3d vtADir ;
LuaCheckParam( L, 2, vtADir)
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// modifico la direzione ausiliaria della testa
bool bOk = m_pMchLua->ModifyMachineHeadAuxDirection( sHead, vtADir) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtModifyExitPosition( lua_State* L)
@@ -963,6 +1116,22 @@ Machine::LuaEmtUnlinkRawPartFromGroup( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtGetAllLinkedRawParts( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// recupero l'elenco dei grezzi agganciati ad un gruppo macchina
const INTVECTOR& vLinkedRawParts = m_pMchLua->GetAllLinkedRawParts() ;
// assegno risultato
LuaSetParam( L, vLinkedRawParts) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtUnlinkAllRawPartsFromGroups( lua_State* L)
@@ -1150,7 +1319,7 @@ Machine::LuaEmtSetLastError( lua_State* L)
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// assegno i dati
// imposto informazioni di errore
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SetLastError( nErrId, sErrDesc)) ;
string sOut = "(" + ToString( nErrId) + ") " + sErrDesc ;
// se uscita dolce
@@ -1175,7 +1344,7 @@ Machine::LuaEmtSetWarning( lua_State* L)
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// assegno i dati
// imposto informazioni di warning
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SetWarning( nWarnId, sWarnDesc)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
@@ -1204,7 +1373,7 @@ Machine::LuaEmtAddCollisionObj( lua_State* L)
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// assegno i dati
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimAddCollisionObj( nInd, nFrameId, nType, Vector3d(), dPar1, dPar2, dPar3)) ;
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimAddCollisionObj( nInd, false, nFrameId, nType, Vector3d(), dPar1, dPar2, dPar3)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
@@ -1214,7 +1383,7 @@ Machine::LuaEmtAddCollisionObj( lua_State* L)
int
Machine::LuaEmtAddCollisionObjEx( lua_State* L)
{
// 7 parametri : nInd, nFrameId, nType, vtMove, dPar1, dPar2, dPar3
// 7 o 8 parametri : nInd, nFrameId, nType, vtMove, dPar1, dPar2, dPar3 [,bToolOn]
int nInd ;
LuaCheckParam( L, 1, nInd)
int nFrameId ;
@@ -1229,12 +1398,14 @@ Machine::LuaEmtAddCollisionObjEx( lua_State* L)
LuaCheckParam( L, 6, dPar2)
double dPar3 ;
LuaCheckParam( L, 7, dPar3)
bool bToolOn = false ;
LuaGetParam( L, 8, bToolOn) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// assegno i dati
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimAddCollisionObj( nInd, nFrameId, nType, vtMove, dPar1, dPar2, dPar3)) ;
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimAddCollisionObj( nInd, bToolOn, nFrameId, nType, vtMove, dPar1, dPar2, dPar3)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
@@ -1244,7 +1415,7 @@ Machine::LuaEmtAddCollisionObjEx( lua_State* L)
int
Machine::LuaEmtExecCollisionCheck( lua_State* L)
{
// 1 parametro opzionale
// 1 parametro opzionale : [nMoveType = 0]
int nMoveType = 0 ;
LuaGetParam( L, 1, nMoveType) ;
LuaClearStack( L) ;
@@ -1274,7 +1445,7 @@ Machine::LuaEmtOnCollision( lua_State* L)
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// eseguo la verifica di collisione (nessuna collisione -> true)
// eseguo gestione della collisione in simulazione
int nErr = 0 ;
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimOnCollision( nCdInd, nObjInd, nErr)) ;
// assegno risultato
@@ -1282,3 +1453,175 @@ Machine::LuaEmtOnCollision( lua_State* L)
LuaSetParam( L, nErr) ;
return 2 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtSetToolForVmill( lua_State* L)
{
// 4 o 7 parametri : sTool, sHead, nExit, vVmill [, nFlag , dPar1, dPar2]
string sTool ;
LuaGetParam( L, 1, sTool) ;
string sHead ;
LuaGetParam( L, 2, sHead) ;
int nExit = 0 ;
LuaGetParam( L, 3, nExit) ;
INTVECTOR vVmill ;
LuaGetParam( L, 4, vVmill) ;
int nFlag = 0 ;
LuaGetParam( L, 5, nFlag) ;
double dPar1 = 0 ;
LuaGetParam( L, 6, dPar1) ;
double dPar2 = 0 ;
LuaGetParam( L, 7, dPar2) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// imposto dati primo utensile per virtual milling in simulazione
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr &&
m_pMchLua->m_pMchMgr->SimSetToolForVmill( sTool, sHead, nExit, nFlag, dPar1, dPar2, vVmill, true)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtAddToolForVmill( lua_State* L)
{
// 4 o 7 parametri : sTool, sHead, nExit, vVmill [, nFlag, dPar1, dPar2]
string sTool ;
LuaGetParam( L, 1, sTool) ;
string sHead ;
LuaGetParam( L, 2, sHead) ;
int nExit = 0 ;
LuaGetParam( L, 3, nExit) ;
INTVECTOR vVmill ;
LuaGetParam( L, 4, vVmill) ;
int nFlag = 0 ;
LuaGetParam( L, 5, nFlag) ;
double dPar1 = 0 ;
LuaGetParam( L, 6, dPar1) ;
double dPar2 = 0 ;
LuaGetParam( L, 7, dPar2) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// imposto dati utensile aggiuntivo per virtual milling in simulazione
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr &&
m_pMchLua->m_pMchMgr->SimSetToolForVmill( sTool, sHead, nExit, nFlag, dPar1, dPar2, vVmill, false)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtEnableToolsForVmill( lua_State* L)
{
// 1 parametro : bEnable
bool bEnable = false ;
LuaGetParam( L, 1, bEnable) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// imposto abilitazione utensili per virtual milling in simulazione
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimEnableToolsForVmill( bEnable)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtMoveAxes( lua_State* L)
{
// 4, ..., 31 parametri : nMoveType, sAx1, dPos1, dStep1 [, sAx2, dPos2, dStep2] ... [, sAx10, dPos10, dStep10]
int nMoveType = 0 ;
LuaGetParam( L, 1, nMoveType) ;
SAMVECTOR vAxNaEpSt ;
for ( int i = 0 ; i < 10 ; ++ i) {
int nInd = 2 + 3 * i ;
string sAxN ;
double dEndN ;
double dStepN ;
if ( LuaGetParam( L, nInd, sAxN) && LuaGetParam( L, nInd + 1, dEndN) && LuaGetParam( L, nInd + 2, dStepN))
vAxNaEpSt.emplace_back( sAxN, dEndN, dStepN) ;
else
break ;
}
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// eseguo movimento in simulazione
int nRes = 0 ;
if ( m_pMchLua->m_pMchMgr != nullptr)
nRes = m_pMchLua->m_pMchMgr->SimMoveAxes( nMoveType, vAxNaEpSt) ;
// assegno risultato
if ( nRes == SIM_AXMV_RES_STOP)
return luaL_error( L, "STOP") ;
else {
LuaSetParam( L, ( nRes == SIM_AXMV_RES_OK)) ;
LuaSetParam( L, m_pMchLua->GetMultiProcess()) ;
}
return 2 ;
}
//----------------------------------------------------------------------------
int
Machine::LuaEmtSaveCmd( lua_State* L)
{
// parametri : nType,
int nType = 0 ;
LuaGetParam( L, 1, nType) ;
int nPar = 0 ;
LuaGetParam( L, 2, nPar) ;
string sPar ;
LuaGetParam( L, 3, sPar) ;
string sPar2 ;
if ( nType == 4) {
switch ( lua_type( L, 4)) {
case LUA_TNIL :
nPar = 0 ;
break ;
case LUA_TBOOLEAN :
{ nPar = 1 ;
bool bVal ;
LuaGetParam( L, 4, bVal) ;
sPar2 = ( bVal ? "1" : "0") ;
} break ;
case LUA_TNUMBER :
if ( lua_isinteger( L, 4)) {
nPar = 2 ;
int nVal ;
LuaGetParam( L, 4, nVal) ;
sPar2 = ToString( nVal) ;
}
else {
nPar = 3 ;
double dVal ;
LuaGetParam( L, 4, dVal) ;
sPar2 = ToString( dVal, 9) ;
}
break ;
case LUA_TSTRING :
{ nPar = 4 ;
LuaGetParam( L, 4, sPar2) ;
} break ;
default :
return luaL_error( L, " Unknown Type") ;
}
}
LuaClearStack( L) ;
// verifico ci sia una macchina attiva
if ( m_pMchLua == nullptr)
return luaL_error( L, " Unknown Machine") ;
// salvo il comando
bool bOk = ( m_pMchLua->m_pMchMgr != nullptr && m_pMchLua->m_pMchMgr->SimSaveCmd( nType, nPar, sPar, sPar2)) ;
// assegno risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
+17 -4
View File
@@ -15,6 +15,7 @@
#include "stdafx.h"
#include "MachMgr.h"
#include "DllMain.h"
#include "CamData.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkGeoPoint3d.h"
#include "/EgtDev/Include/EGkCurveLine.h"
@@ -31,7 +32,7 @@ using namespace std ;
int
Machine::LuaEmtAddRapidStart( lua_State* L)
{
// 6 parametri : nPathId, ptP, vtTool, vtCorr, vtAux, nFlag
// 6 o 7 parametri : nPathId, ptP, vtTool, vtCorr, vtAux, nFlag [, bToolShow]
int nPathId ;
LuaCheckParam( L, 1, nPathId)
Point3d ptP ;
@@ -44,6 +45,8 @@ Machine::LuaEmtAddRapidStart( lua_State* L)
LuaCheckParam( L, 5, vtAux)
int nFlag ;
LuaCheckParam( L, 6, nFlag)
bool bToolShow = false ;
LuaGetParam( L, 7, bToolShow) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva valida
if ( m_pMchLua == nullptr ||
@@ -69,6 +72,7 @@ Machine::LuaEmtAddRapidStart( lua_State* L)
pCam->SetEndPoint( ptP) ;
pCam->SetFeed( 0) ;
pCam->SetFlag( nFlag) ;
pCam->SetToolShow( bToolShow) ;
// associo questo oggetto a quello geometrico
m_pMchLua->m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
}
@@ -84,7 +88,7 @@ Machine::LuaEmtAddRapidStart( lua_State* L)
int
Machine::LuaEmtAddRapidMove( lua_State* L)
{
// 7 parametri : nPathId, ptIni, ptFin, vtTool, vtCorr, vtAux, nFlag
// 7 o 8 parametri : nPathId, ptIni, ptFin, vtTool, vtCorr, vtAux, nFlag [, bToolShow]
int nPathId ;
LuaCheckParam( L, 1, nPathId)
Point3d ptIni ;
@@ -99,6 +103,8 @@ Machine::LuaEmtAddRapidMove( lua_State* L)
LuaCheckParam( L, 6, vtAux)
int nFlag ;
LuaCheckParam( L, 7, nFlag)
bool bToolShow = false ;
LuaGetParam( L, 8, bToolShow) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva valida
if ( m_pMchLua == nullptr ||
@@ -124,6 +130,7 @@ Machine::LuaEmtAddRapidMove( lua_State* L)
pCam->SetEndPoint( ptFin) ;
pCam->SetFeed( 0) ;
pCam->SetFlag( nFlag) ;
pCam->SetToolShow( bToolShow) ;
// associo questo oggetto a quello geometrico
m_pMchLua->m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
}
@@ -139,7 +146,7 @@ Machine::LuaEmtAddRapidMove( lua_State* L)
int
Machine::LuaEmtAddLinearMove( lua_State* L)
{
// 8 parametri : nPathId, ptIni, ptFin, vtTool, vtCorr, vtAux, dFeed, nFlag
// 8 o 9 parametri : nPathId, ptIni, ptFin, vtTool, vtCorr, vtAux, dFeed, nFlag [, bToolShow]
int nPathId ;
LuaCheckParam( L, 1, nPathId)
Point3d ptIni ;
@@ -156,6 +163,8 @@ Machine::LuaEmtAddLinearMove( lua_State* L)
LuaCheckParam( L, 7, dFeed)
int nFlag ;
LuaCheckParam( L, 8, nFlag)
bool bToolShow = false ;
LuaGetParam( L, 9, bToolShow) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva valida
if ( m_pMchLua == nullptr ||
@@ -181,6 +190,7 @@ Machine::LuaEmtAddLinearMove( lua_State* L)
pCam->SetEndPoint( ptFin) ;
pCam->SetFeed( dFeed) ;
pCam->SetFlag( nFlag) ;
pCam->SetToolShow( bToolShow) ;
// associo questo oggetto a quello geometrico
m_pMchLua->m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
}
@@ -196,7 +206,7 @@ Machine::LuaEmtAddLinearMove( lua_State* L)
int
Machine::LuaEmtAddArcMove( lua_State* L)
{
// 11 parametri : nPathId, ptIni, ptFin, ptCen, dAngCen, vtN, vtTool, vtCorr, vtAux, dFeed, nFlag
// 11 o 12 parametri : nPathId, ptIni, ptFin, ptCen, dAngCen, vtN, vtTool, vtCorr, vtAux, dFeed, nFlag [, bToolShow]
int nPathId ;
LuaCheckParam( L, 1, nPathId)
Point3d ptIni ;
@@ -219,6 +229,8 @@ Machine::LuaEmtAddArcMove( lua_State* L)
LuaCheckParam( L, 10, dFeed)
int nFlag ;
LuaCheckParam( L, 11, nFlag)
bool bToolShow = false ;
LuaGetParam( L, 12, bToolShow) ;
LuaClearStack( L) ;
// verifico ci sia una macchina attiva valida
if ( m_pMchLua == nullptr ||
@@ -252,6 +264,7 @@ Machine::LuaEmtAddArcMove( lua_State* L)
pCam->SetNormDir( vtN) ;
pCam->SetFeed( dFeed) ;
pCam->SetFlag( nFlag) ;
pCam->SetToolShow( bToolShow) ;
// associo questo oggetto a quello geometrico
m_pMchLua->m_pGeomDB->SetUserObj( nId, Release( pCam)) ;
}
+31 -8
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachineStruConst.h Data : 25.05.15 Versione : 1.6e7
// File : MachineStruConst.h Data : 15.01.24 Versione : 2.5l6
// Contenuto : Strutture e costanti di macchina.
//
//
@@ -44,6 +44,7 @@ struct KinAxis {
int nGrpId ;
bool bLinear ;
bool bHead ;
int nInd ;
Point3d ptPos ;
Vector3d vtDir ;
STROKE stroke ;
@@ -51,7 +52,7 @@ struct KinAxis {
bool bFixed ;
double dFixVal ;
KinAxis( void)
: nGrpId( GDB_ID_NULL), bLinear( true), bHead( true), ptPos(), vtDir(), dHomeVal( 0), bFixed( false), dFixVal( 0)
: nGrpId( GDB_ID_NULL), bLinear( true), bHead( true), nInd( 0), ptPos(), vtDir(), dHomeVal( 0), bFixed( false), dFixVal( 0)
{ stroke.Min = 0 ; stroke.Max = 0 ; }
} ;
typedef std::vector<KinAxis> KINAXISVECTOR ;
@@ -87,6 +88,18 @@ enum MchHeadType { MCH_HT_NONE = 0,
MCH_HT_MULTI = 2,
MCH_HT_SPECIAL = 3} ;
//----------------------------------------------------------------------------
// Tipo di selezione ammessa per le uscite
enum MchSelType { MCH_SLT_FIXEDEXITS = 0,
MCH_SLT_ONEEXIT = 1,
MCH_SLT_MULTIEXITS = 2} ;
//----------------------------------------------------------------------------
// Tipo della catena cinematica
enum KinChainType { KIN_CHAIN_NONE = 0,
KIN_CHAIN_CENTER = 1,
KIN_CHAIN_ROBOT = 2} ;
//----------------------------------------------------------------------------
// Identificativo iniziale riferimenti di tavola
const std::string MCH_TREF = "R" ;
@@ -112,17 +125,20 @@ const std::string MCH_ZHOMEDOWN = "ZHOMEDOWN" ;
const std::string MCH_ABOVE = "ABOVE" ;
// Info di testa per una variazione alla Z di sicurezza globale
const std::string MCH_ZSAFEDELTA = "ZSAFEDELTA" ;
// Info di tavola per dichiarare che va considerata come basculante
const std::string MCH_TILTINGLIKE = "TiltingLike" ;
//----------------------------------------------------------------------------
// Dati aggregato rotante da sotto
struct AggrBottom {
int nType ;
double dDMax ;
double dEncH ;
double dEncV ;
int nType ;
double dDMax ;
double dEncH ;
double dEncV ;
Vector3d vtMDir ;
AggrBottom( void) : nType( 0), dDMax( 0), dEncH( 0), dEncV( 0) {}
void Clear( void)
{ nType = 0 ; dDMax= 0 ; dEncH = 0 ; dEncV = 0 ; }
{ nType = 0 ; dDMax= 0 ; dEncH = 0 ; dEncV = 0 ; vtMDir = V_NULL ; }
} ;
//----------------------------------------------------------------------------
@@ -134,3 +150,10 @@ const std::string MCH_AGB_DMAX = "AGB_DMAX" ;
const std::string MCH_AGB_ENCH = "AGB_ENCH" ;
// Info in rinvio rotante da sotto con ingombro verticale
const std::string MCH_AGB_ENCV = "AGB_ENCV" ;
// Info in rinvio rotante da sotto per definire la direzione di approccio preferenziale (consentito delta max di 95deg)
const std::string MCH_AGB_MDIR = "AGB_MDIR" ;
const double MCH_AGB_DELTAMAX_MDIR = cos( 95 * DEGTORAD) ;
//----------------------------------------------------------------------------
// Info di uscita per indicare quanto mossa lungo la sua Z locale
const std::string MCH_EXIT_VAL = "Val" ;
+194 -68
View File
@@ -148,6 +148,15 @@ Machining::PrepareToolPreview( void) const
int nId = m_pGeomDB->CopyGlob( nHeadId, GDB_ID_NULL, nStId) ;
m_pGeomDB->SetMode( nId, GDB_MD_STD) ;
m_pGeomDB->SetStatus( nId, GDB_ST_OFF) ;
// elimino eventuali gruppi opportunamente indicati
int nSubId = m_pGeomDB->GetFirstGroupInGroup( nId) ;
while ( nSubId != GDB_ID_NULL) {
int nNextSubId = m_pGeomDB->GetNextGroup( nSubId) ;
bool bShow = true ;
if ( m_pGeomDB->GetInfo( nSubId, KEY_PREVIEWSHOW, bShow) && ! bShow)
m_pGeomDB->Erase( nSubId) ;
nSubId = nNextSubId ;
}
return ( nId != GDB_ID_NULL) ;
}
@@ -167,68 +176,125 @@ Machining::RemoveToolPreview( void) const
//----------------------------------------------------------------------------
int
GetToolPreviewNext( IGeomDB* pGeomDB, int nEntId, int nParentId)
Machining::GetToolPreviewStepCount( void) const
{
// verifico validità gestori DB geometrico e CAM
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
return 0 ;
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
if ( nClId == GDB_ID_NULL)
return 0 ;
// determino il numero di entità di tutti i sottogruppi, escludendo CLIMB e RISE
int nCount = 0 ;
int nPxId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
while ( nPxId != GDB_ID_NULL) {
// aggiungo tutte le entità del truppo
nCount += m_pGeomDB->GetGroupObjs( nPxId) ;
// tolgo le entità CLIMB
int nClimbId = m_pGeomDB->GetFirstNameInGroup( nPxId, MCH_CL_CLIMB) ;
while ( nClimbId != GDB_ID_NULL) {
-- nCount ;
nClimbId = m_pGeomDB->GetNextName( nClimbId, MCH_CL_CLIMB) ;
}
// tolgo le entità RISE
int nRiseId = m_pGeomDB->GetFirstNameInGroup( nPxId, MCH_CL_RISE) ;
while ( nRiseId != GDB_ID_NULL) {
-- nCount ;
nRiseId = m_pGeomDB->GetNextName( nRiseId, MCH_CL_RISE) ;
}
// passo al successivo sottogruppo
nPxId = m_pGeomDB->GetNextGroup( nPxId) ;
}
return nCount ;
}
//----------------------------------------------------------------------------
int
Machining::GetToolPreviewNext( int nEntId, int nParentId, int nStId) const
{
// recupero la successiva
int nNewId = (( nEntId != GDB_ID_NULL) ? pGeomDB->GetNext( nEntId) : pGeomDB->GetFirstInGroup( nParentId)) ;
int nNewId = (( nEntId != GDB_ID_NULL) ? m_pGeomDB->GetNext( nEntId) : m_pGeomDB->GetFirstInGroup( nParentId)) ;
int nNewParentId = nParentId ;
// ciclo nei gruppi successivi
do {
// ciclo nel gruppo
while ( nNewId != GDB_ID_NULL) {
string sName ; pGeomDB->GetName( nNewId, sName) ;
string sName ; m_pGeomDB->GetName( nNewId, sName) ;
if ( sName != MCH_CL_CLIMB && sName != MCH_CL_RISE)
break ;
nNewId = pGeomDB->GetNext( nNewId) ;
nNewId = m_pGeomDB->GetNext( nNewId) ;
}
// se trovata, esco
if ( nNewId != GDB_ID_NULL)
if ( nNewId != GDB_ID_NULL) {
// se prima entità, eventuale attivazione uscite di gruppo a forare
if ( nEntId == GDB_ID_NULL && m_pGeomDB->ExistsInfo( nNewParentId, KEY_DRACEX)) {
INTVECTOR vActExit ;
if ( m_pGeomDB->GetInfo( nNewParentId, KEY_DRACEX, vActExit))
ActivateDrillingUnit( nStId, vActExit) ;
}
return nNewId ;
}
// passo al gruppo successivo
nNewParentId = m_pGeomDB->GetNextGroup( nNewParentId) ;
// eventuale attivazione uscite di gruppo a forare
if ( m_pGeomDB->ExistsInfo( nNewParentId, KEY_DRACEX)) {
INTVECTOR vActExit ;
if ( m_pGeomDB->GetInfo( nNewParentId, KEY_DRACEX, vActExit))
ActivateDrillingUnit( nStId, vActExit) ;
}
// recupero la prima entità del successivo gruppo
nNewParentId = pGeomDB->GetNextGroup( nNewParentId) ;
nNewId = pGeomDB->GetFirstInGroup( nNewParentId) ;
nNewId = m_pGeomDB->GetFirstInGroup( nNewParentId) ;
} while ( nNewId != GDB_ID_NULL) ;
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
int
GetToolPreviewPrev( IGeomDB* pGeomDB, int nEntId, int nParentId)
Machining::GetToolPreviewPrev( int nEntId, int nParentId, int nStId) const
{
// recupero la precedente
int nNewId = (( nEntId != GDB_ID_NULL) ? pGeomDB->GetPrev( nEntId) : pGeomDB->GetLastInGroup( nParentId)) ;
int nNewId = (( nEntId != GDB_ID_NULL) ? m_pGeomDB->GetPrev( nEntId) : m_pGeomDB->GetLastInGroup( nParentId)) ;
int nNewParentId = nParentId ;
// ciclo nei gruppi precedenti
do {
// ciclo nel gruppo
while ( nNewId != GDB_ID_NULL) {
string sName ; pGeomDB->GetName( nNewId, sName) ;
string sName ; m_pGeomDB->GetName( nNewId, sName) ;
if ( sName != MCH_CL_CLIMB && sName != MCH_CL_RISE)
break ;
nNewId = pGeomDB->GetPrev( nNewId) ;
nNewId = m_pGeomDB->GetPrev( nNewId) ;
}
// se trovata, esco
if ( nNewId != GDB_ID_NULL)
return nNewId ;
// passo al gruppo precedente
nNewParentId = m_pGeomDB->GetPrevGroup( nNewParentId) ;
// eventuale attivazione uscite di gruppo a forare
if ( m_pGeomDB->ExistsInfo( nNewParentId, KEY_DRACEX)) {
INTVECTOR vActExit ;
if ( m_pGeomDB->GetInfo( nNewParentId, KEY_DRACEX, vActExit))
ActivateDrillingUnit( nStId, vActExit) ;
}
// recupero l'ultima entità del precedente gruppo
nNewParentId = pGeomDB->GetPrevGroup( nNewParentId) ;
nNewId = pGeomDB->GetLastInGroup( nNewParentId) ;
nNewId = m_pGeomDB->GetLastInGroup( nNewParentId) ;
} while ( nNewId != GDB_ID_NULL) ;
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
int
Machining::ToolPreview( int nEntId, int nFlag) const
Machining::ToolPreview( int nEntId, int nStep) const
{
// verifico validità gestori DB geometrico e CAM
if ( m_pGeomDB == nullptr || m_pMchMgr == nullptr)
return GDB_ID_NULL ;
// recupero la testa nel gruppo per anteprima utensile
int nId = m_pGeomDB->GetFirstGroupInGroup( m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_ST)) ;
if ( nId == GDB_ID_NULL)
int nStId = m_pGeomDB->GetFirstGroupInGroup( m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_ST)) ;
if ( nStId == GDB_ID_NULL)
return GDB_ID_NULL ;
m_pGeomDB->SetStatus( nId, GDB_ST_OFF) ;
m_pGeomDB->SetStatus( nStId, GDB_ST_OFF) ;
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
if ( nClId == GDB_ID_NULL)
@@ -239,11 +305,11 @@ Machining::ToolPreview( int nEntId, int nFlag) const
// recupero il gruppo di appartenenza
nParentId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
// se richiesta successiva
if ( nFlag == MCH_TPM_AFTER)
nEntId = GetToolPreviewNext( m_pGeomDB, nEntId, nParentId) ;
if ( nStep > 0)
nEntId = GetToolPreviewNext( nEntId, nParentId, nStId) ;
// se richiesta precedente
else if ( nFlag == MCH_TPM_BEFORE)
nEntId = GetToolPreviewPrev( m_pGeomDB, nEntId, nParentId) ;
else if ( nStep < 0)
nEntId = GetToolPreviewPrev( nEntId, nParentId, nStId) ;
// altrimenti richiesta corrente
else
nEntId = GDB_ID_NULL ;
@@ -251,21 +317,39 @@ Machining::ToolPreview( int nEntId, int nFlag) const
// altrimenti
else {
// verifico che l'entità stia in un sottogruppo di CL
nParentId = m_pGeomDB->GetParentId( nEntId) ;
nParentId = m_pGeomDB->GetParentId( nEntId) ;
if ( m_pGeomDB->GetParentId( nParentId) == nClId) {
// se richiesta successiva
if ( nFlag == MCH_TPM_AFTER)
nEntId = GetToolPreviewNext( m_pGeomDB, nEntId, nParentId) ;
if ( nStep > 0) {
while ( nStep > 0) {
int nOldId = nEntId ;
nEntId = GetToolPreviewNext( nEntId, nParentId, nStId) ;
-- nStep ;
if ( nEntId == GDB_ID_NULL) {
nEntId = nOldId ;
break ;
}
}
}
// se richiesta precedente
else if ( nFlag == MCH_TPM_BEFORE)
nEntId = GetToolPreviewPrev( m_pGeomDB, nEntId, nParentId) ;
else if ( nStep < 0) {
while ( nStep < 0) {
int nOldId = nEntId ;
nEntId = GetToolPreviewPrev( nEntId, nParentId, nStId) ;
++ nStep ;
if ( nEntId == GDB_ID_NULL) {
nEntId = nOldId ;
break ;
}
}
}
}
else
nEntId = GDB_ID_NULL ;
}
// se esiste il gruppo genitore, visualizzo testa preview
if ( nParentId != GDB_ID_NULL)
m_pGeomDB->SetStatus( nId, GDB_ST_ON) ;
m_pGeomDB->SetStatus( nStId, GDB_ST_ON) ;
// recupero i dati di questa entità
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
@@ -275,34 +359,76 @@ Machining::ToolPreview( int nEntId, int nFlag) const
Vector3d vtTool = pCamData->GetToolDir() ;
Vector3d vtBAux = pCamData->GetBackAuxDir() ;
// dati correnti testa/uscita
int nExitId = m_pGeomDB->GetFirstNameInGroup( nId, MCH_EXIT + ToString( GetExitNbr())) ;
int nExitId = m_pGeomDB->GetFirstNameInGroup( nStId, MCH_EXIT + ToString( GetExitNbr())) ;
Frame3d frExit ;
m_pGeomDB->GetGroupGlobFrame( nExitId, frExit) ;
// correggo eventuale movimento di disattivazione sempre in Z globale
double dVal ;
if ( m_pGeomDB->GetInfo( nExitId, MCH_EXIT_VAL, dVal))
frExit.Translate( -dVal * Z_AX) ;
Point3d ptOrig = frExit.Orig() ;
Vector3d vtDir = frExit.VersZ() ;
Vector3d vtAux ;
int nAvId = m_pGeomDB->GetFirstNameInGroup( nId, MCH_AUX_VECT) ;
int nAvId = m_pGeomDB->GetFirstNameInGroup( nStId, MCH_AUX_VECT) ;
ExeStartVector( nAvId, GDB_ID_ROOT, vtAux) ;
// rototraslo opportunamente
Frame3d frHead ;
m_pGeomDB->GetGroupGlobFrame( nId, frHead) ;
m_pGeomDB->GetGroupGlobFrame( nStId, frHead) ;
Frame3d frRef ;
if ( vtAux.IsSmall())
if ( vtAux.IsSmall() || AreSameOrOppositeVectorApprox( vtAux, vtDir))
frRef.Set( ptOrig, vtDir) ;
else
frRef.Set( ptOrig, vtDir, vtAux) ;
Frame3d frShow ;
if ( vtBAux.IsSmall())
if ( vtBAux.IsSmall() || AreSameOrOppositeVectorApprox( vtBAux, vtTool))
frShow.Set( ptEnd + vtTool * GetToolData().m_dLen, vtTool) ;
else
frShow.Set( ptEnd + vtTool * GetToolData().m_dLen, vtTool, vtBAux) ;
frHead.ToLoc( frRef) ;
frHead.ToGlob( frShow) ;
*(m_pGeomDB->GetGroupFrame( nId)) = frHead ;
*(m_pGeomDB->GetGroupFrame( nStId)) = frHead ;
return nEntId ;
}
//----------------------------------------------------------------------------
bool
Machining::ActivateDrillingUnit( int nHeadId, const INTVECTOR& vActExit) const
{
// recupero la macchina corrente
Machine* pMch = m_pMchMgr->GetCurrMachine() ;
if ( pMch == nullptr)
return false ;
// costanti
static const string EMC_VAR = "EMC" ; // tabella variabili locali per calcolo
static const string EVAR_VER = ".VER" ; // IN (string) versione della Dll
static const string EVAR_HEADID = ".HEADID" ; // IN (int) identificativo testa
static const string EVAR_DRACEX = ".DRACEX" ; // IN (ints) vettore indici uscite attive
static const string EVAR_ERROR = ".ERR" ; // OUT (int) codice di errore ( 0 = ok, > 0 errore)
static const string ON_ACTIVATE_DRILLING_UNIT = "OnActivateDrillingUnit" ;
// se non esiste la funzione, esco
if ( ! pMch->LuaExistsFunction( ON_ACTIVATE_DRILLING_UNIT))
return true ;
// eseguo l'azione
bool bOk = true ;
int nErr = 99 ;
// imposto valori parametri
bOk = bOk && pMch->LuaCreateGlobTable( EMC_VAR) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_VER, GetEMkVer()) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_HEADID, nHeadId) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_DRACEX, vActExit) ;
// eseguo
bOk = bOk && pMch->LuaCallFunction( ON_ACTIVATE_DRILLING_UNIT) ;
// recupero valori parametri obbligatori
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_ERROR, nErr) ;
// reset
bOk = pMch->LuaResetGlobVar( EMC_VAR) && bOk ;
// segnalo errori
return ( bOk && nErr == 0) ;
}
//----------------------------------------------------------------------------
bool
Machining::PostApply( string& sErr)
@@ -319,39 +445,39 @@ Machining::PostApply( string& sErr)
static const string EVAR_MSG = ".MSG" ; // OUT (string) stringa di errore ( opzionale)
static const string ON_POST_APPLY = "OnPostApplyMachining" ;
// eseguo l'azione
if ( pMch->LuaExistsFunction( ON_POST_APPLY)) {
bool bOk = true ;
int nErr = 99 ;
// imposto valori parametri
bOk = bOk && pMch->LuaCreateGlobTable( EMC_VAR) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_PHASE, m_nPhase) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_MCHID, m_nOwnerId) ;
// eseguo
bOk = bOk && pMch->LuaCallFunction( ON_POST_APPLY, false) ;
// recupero valori parametri obbligatori
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_ERROR, nErr) ;
// recupero valori parametri opzionali
string sMsg ;
bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_MSG, sMsg) ;
// reset
bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ;
// segnalo errori
if ( ! bOk || nErr > 0) {
bOk = false ;
sErr = sMsg ;
if ( IsEmptyOrSpaces( sErr))
sErr = " Error in " + ON_POST_APPLY + " (" + ToString( nErr) + ")" ;
}
// recupero eventuale warning
else if ( nErr < 0) {
string sOut = sMsg ;
if ( IsEmptyOrSpaces( sOut))
sOut = " Warning in " + ON_POST_APPLY + " (" + ToString( abs( nErr)) + ")" ;
m_pMchMgr->SetWarning( abs( nErr), sOut) ;
}
return bOk ;
}
else
// se non esiste la funzione, esco
if ( ! pMch->LuaExistsFunction( ON_POST_APPLY))
return true ;
}
// eseguo l'azione
bool bOk = true ;
int nErr = 99 ;
// imposto valori parametri
bOk = bOk && pMch->LuaCreateGlobTable( EMC_VAR) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_PHASE, m_nPhase) ;
bOk = bOk && pMch->LuaSetGlobVar( EMC_VAR + EVAR_MCHID, m_nOwnerId) ;
// eseguo
bOk = bOk && pMch->LuaCallFunction( ON_POST_APPLY, false) ;
// recupero valori parametri obbligatori
bOk = bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_ERROR, nErr) ;
// recupero valori parametri opzionali
string sMsg ;
bOk && pMch->LuaGetGlobVar( EMC_VAR + EVAR_MSG, sMsg) ;
// reset
bOk = bOk && pMch->LuaResetGlobVar( EMC_VAR) ;
// segnalo errori
if ( ! bOk || nErr > 0) {
bOk = false ;
sErr = sMsg ;
if ( IsEmptyOrSpaces( sErr))
sErr = " Error in " + ON_POST_APPLY + " (" + ToString( nErr) + ")" ;
}
// recupero eventuale warning
else if ( nErr < 0) {
string sOut = sMsg ;
if ( IsEmptyOrSpaces( sOut))
sOut = " Warning in " + ON_POST_APPLY + " (" + ToString( abs( nErr)) + ")" ;
m_pMchMgr->SetWarning( abs( nErr), sOut) ;
}
return bOk ;
}
+9 -1
View File
@@ -43,17 +43,25 @@ class Machining : public Operation
virtual bool UpdateToolData( bool* pbChanged = nullptr) = 0 ;
virtual const ToolData& GetToolData( void) const = 0 ;
virtual bool GetGeometry( SELVECTOR& vIds) const = 0 ;
virtual bool GetSkippedGeometry( SELVECTOR& vIds) const
{ vIds.clear() ; return false ; }
public :
bool GetStartPoint( Point3d& ptStart) const ;
bool GetEndPoint( Point3d& ptEnd) const ;
bool PrepareToolPreview( void) const ;
int ToolPreview( int nEntId, int nFlag) const ;
bool RemoveToolPreview( void) const ;
int GetToolPreviewStepCount( void) const ;
int ToolPreview( int nEntId, int nStep) const ;
bool ActivateDrillingUnit( int nHeadId, const INTVECTOR& vActExit) const ;
protected :
Machining( void) ;
bool PostApply( std::string& sErr) ;
private :
int GetToolPreviewNext( int nEntId, int nParentId, int nStId) const ;
int GetToolPreviewPrev( int nEntId, int nParentId, int nStId) const ;
} ;
//----------------------------------------------------------------------------
+10 -1
View File
@@ -103,7 +103,11 @@ GetMachiningTitle( int nMchType)
"SawRoughing",
"SawFinishing",
"GenMachining",
"Chiseling"} ;
"Chiseling",
"SurfRoughing",
"SurfFinishing",
"Waterjetting",
"5AxisMilling"} ;
switch ( nMchType) {
case MT_DRILLING : return MchTitle[1] ;
case MT_SAWING : return MchTitle[2] ;
@@ -114,6 +118,11 @@ GetMachiningTitle( int nMchType)
case MT_SAWFINISHING : return MchTitle[7] ;
case MT_GENMACHINING : return MchTitle[8] ;
case MT_CHISELING : return MchTitle[9] ;
case MT_SURFROUGHING : return MchTitle[10] ;
case MT_SURFFINISHING : return MchTitle[11] ;
case MT_WATERJETTING : return MchTitle[12] ;
case MT_FIVEAXISMILLING : return MchTitle[13] ;
}
return MchTitle[0] ;
}
+338 -20
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2020
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachiningsMgr.cpp Data : 09.11.20 Versione : 2.2k2
// File : MachiningsMgr.cpp Data : 29.03.24 Versione : 2.6d1
// Contenuto : Implementazione gestore database lavorazioni.
//
//
@@ -15,6 +15,8 @@
// 03.06.20 DS Agg. per nuovi parametri Tab in fresatura (MF_CURR_VER = 1009).
// 22.06.20 DS Agg. per nuovi parametri attacco tagli di lama (MF_CURR_VER = 1010).
// 09.11.20 DS Agg. per nuovi parametri tagli di lama (MF_CURR_VER = 1011).
// 04.02.22 DS Agg. per nuovi parametri svuotature con epicicli (MF_CURR_VER = 1012).
// 29.03.24 DS Agg. parametro APPROX_LINTOL (MF_CURR_VER = 1013).
//
//----------------------------------------------------------------------------
@@ -31,7 +33,6 @@
#include "/EgtDev/Include/EGnFileUtils.h"
#include "/EgtDev/Include/EGnScanner.h"
#include "/EgtDev/Include/EGnWriter.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include <cassert>
#include <bitset>
@@ -42,7 +43,7 @@ const string MF_HEADER = "[HEADER]" ;
const string MF_VERSION = "VERSION" ;
const string MF_TOTAL = "TOTAL" ;
const string MF_SIZE = "SIZE" ;
const int MF_CURR_VER = 1011 ;
const int MF_CURR_VER = 1013 ;
const string MF_GENERAL = "[GENERAL]" ;
const string MF_3AXCOMP = "3AXCOMP" ;
const bool MF_CURR_3AXCOMP = false ;
@@ -64,6 +65,8 @@ const string MF_INTSAWARCMAXSIDEANG = "INTSAWARCMAXSIDEANG" ;
const double MF_CURR_INTSAWARCMAXSIDEANG = 45 ;
const string MF_SPLITARCS = "SPLITARCS" ;
const int MF_CURR_SPLITARCS = SPLAR_NEVER ;
const string MF_APPROX_LINTOL = "APPROX_LINTOL" ;
const double MF_CURR_APPROX_LINTOL = 0.05 ;
const string MF_MAXDEPTHSAFE = "MAXDEPTHSAFE" ;
const double MF_CURR_MAXDEPTHSAFE = 2.0 ;
@@ -85,6 +88,7 @@ MachiningsMgr::MachiningsMgr( void)
m_dExtSawArcMinRad = MF_CURR_EXTSAWARCMINRAD ;
m_dIntSawArcMaxSideAng = MF_CURR_INTSAWARCMAXSIDEANG ;
m_nSplitArcs = MF_CURR_SPLITARCS ;
m_dApproxLinTol = MF_CURR_APPROX_LINTOL ;
m_dMaxDepthSafe = MF_CURR_MAXDEPTHSAFE ;
}
@@ -189,11 +193,25 @@ MachiningsMgr::Reload( void)
// Ciclo di lettura delle lavorazioni
do {
if ( ! LoadOneMachining( TheScanner, bEnd)) {
PtrOwner<MachiningData> pMch ;
if ( LoadOneMachining( TheScanner, pMch, bEnd)) {
// salvo i dati della lavorazione
if ( ! IsNull( pMch)) {
if ( ! m_umData.emplace( pMch->m_Uuid, Get( pMch)).second ||
! m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second) {
bOk = false ;
string sOut = "ReloadMachinings : Error adding machining " + pMch->m_sName ;
LOG_ERROR( GetEMkLogger(), sOut.c_str())
}
Release( pMch) ;
}
}
else {
bOk = false ;
string sOut = "ReloadMachinings : Error on line " + ToString( TheScanner.GetCurrLineNbr()) ;
LOG_ERROR( GetEMkLogger(), sOut.c_str())
}
} while ( bOk && ! bEnd) ;
// Termino lo scanner
@@ -207,7 +225,7 @@ MachiningsMgr::Reload( void)
//----------------------------------------------------------------------------
bool
MachiningsMgr::LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd)
MachiningsMgr::LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) const
{
// leggo la prossima linea
string sLine ;
@@ -298,6 +316,8 @@ MachiningsMgr::LoadGeneral( Scanner& TheScanner, bool& bEnd)
bOk = FromString( sVal, m_dIntSawArcMaxSideAng) ;
else if ( ToUpper( sKey) == MF_SPLITARCS)
bOk = FromString( sVal, m_nSplitArcs) ;
else if ( ToUpper( sKey) == MF_APPROX_LINTOL)
bOk = FromString( sVal, m_dApproxLinTol) ;
else if ( ToUpper( sKey) == MF_MAXDEPTHSAFE)
bOk = FromString( sVal, m_dMaxDepthSafe) ;
else
@@ -311,11 +331,12 @@ MachiningsMgr::LoadGeneral( Scanner& TheScanner, bool& bEnd)
//----------------------------------------------------------------------------
bool
MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
MachiningsMgr::LoadOneMachining( Scanner& TheScanner, PtrOwner<MachiningData>& pMch, bool& bEnd) const
{
// leggo la prossima linea
string sLine ;
if ( ! TheScanner.GetLine( sLine)) {
pMch.Reset() ;
// fine file
bEnd = true ;
return true ;
@@ -324,12 +345,12 @@ MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
if ( sLine.front() != '[' || sLine.back() != ']')
return false ;
Trim( sLine, "[]") ;
// separo tipo da contatore
// separo tipo da contatore
string sType, sCount ;
SplitFirst( sLine, "_", sType, sCount) ;
ToUpper( sType) ;
// alloco la lavorazione del tipo corrispondente
PtrOwner<MachiningData> pMch( MCHDATA_CREATE( MCHDATA_NAMETOTYPE( sType))) ;
pMch.Set( MCHDATA_CREATE( MCHDATA_NAMETOTYPE( sType))) ;
if ( IsNull( pMch))
return false ;
bool bOk = true ;
@@ -366,10 +387,6 @@ MachiningsMgr::LoadOneMachining( Scanner& TheScanner, bool& bEnd)
}
// verifico di aver letto tutti i campi
bOk = bOk && ( Flag.count() == nSize) ;
// salvo i dati della lavorazione
bOk = bOk && m_umData.emplace( pMch->m_Uuid, Get( pMch)).second ;
bOk = bOk && m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second ;
Release( pMch) ;
return bOk ;
}
@@ -438,7 +455,7 @@ MachiningsMgr::Save( bool bCompressed) const
//----------------------------------------------------------------------------
bool
MachiningsMgr::SaveHeader( Writer& TheWriter) const
MachiningsMgr::SaveHeader( Writer& TheWriter, int nTotal) const
{
// scrivo l'intestazione
bool bOk = true ;
@@ -447,7 +464,10 @@ MachiningsMgr::SaveHeader( Writer& TheWriter) const
bOk = bOk && TheWriter.OutText( sOut) ;
sOut = MF_VERSION + "=" + ToString( m_nDbVer) ;
bOk = bOk && TheWriter.OutText( sOut) ;
sOut = MF_TOTAL + "=" + ToString( int( m_umData.size())) ;
if ( nTotal == -1)
sOut = MF_TOTAL + "=" + ToString( int( m_umData.size())) ;
else
sOut = MF_TOTAL + "=" + ToString( nTotal) ;
bOk = bOk && TheWriter.OutText( sOut) ;
return bOk ;
}
@@ -485,6 +505,10 @@ MachiningsMgr::SaveGeneral( Writer& TheWriter) const
sOut = MF_MAXDEPTHSAFE + "=" + ToString( m_dMaxDepthSafe) ;
bOk = bOk && TheWriter.OutText( sOut) ;
}
if ( m_nDbVer >= 1013) {
sOut = MF_APPROX_LINTOL + "=" + ToString( m_dApproxLinTol) ;
bOk = bOk && TheWriter.OutText( sOut) ;
}
return bOk ;
}
@@ -498,14 +522,20 @@ MachiningsMgr::SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& The
if ( iIter == m_umData.end())
return false ;
const MachiningData* pmData = iIter->second ;
// preparo la lista dei dati (quelli vuoti sono opzionali con default)
STRVECTOR vsOut ;
for ( int i = 0 ; i < pmData->GetSize() ; ++ i) {
string sOut = pmData->ToString( i) ;
if ( ! sOut.empty())
vsOut.emplace_back( sOut) ;
}
// scrivo i dati della lavorazione
string sOut = "[" + pmData->GetTitle() + "_" + ToString( ++ nCounter, 3) + "]" ;
bool bOk = TheWriter.OutText( sOut) ;
sOut = MF_SIZE + "=" + ToString( pmData->GetSize()) ;
sOut = MF_SIZE + "=" + ToString( int( vsOut.size())) ;
bOk = bOk && TheWriter.OutText( sOut) ;
for ( int i = 0 ; i < pmData->GetSize() ; ++ i) {
string sOut = pmData->ToString( i) ;
bOk = bOk && ! sOut.empty() && TheWriter.OutText( sOut) ;
for ( const auto& sOut : vsOut) {
bOk = bOk && TheWriter.OutText( sOut) ;
}
return bOk ;
}
@@ -514,7 +544,7 @@ MachiningsMgr::SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& The
bool
MachiningsMgr::GetMachiningNewName( string& sName) const
{
// il parametro nome deve essere valido
// il parametro nome deve essere valido
if ( &sName == nullptr)
return false ;
// se nome vuoto, assegno radice standard
@@ -1155,6 +1185,20 @@ MachiningsMgr::SetSplitArcs( int nFlag)
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::SetApproxLinTol( double dLinTol)
{
// verifico non sia inferiore al minimo
dLinTol = max( dLinTol, EPS_SMALL) ;
// se cambiato, salvo e setto modifica
if ( abs( dLinTol - m_dApproxLinTol) > EPS_SMALL) {
m_dApproxLinTol = dLinTol ;
m_bModified = true ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::SetMaxDepthSafe( double dSafe)
@@ -1168,3 +1212,277 @@ MachiningsMgr::SetMaxDepthSafe( double dSafe)
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::Export( const STRVECTOR& vsMachiningsNames, const string& sOutFile, bool bCompressed) const
{
LOG_INFO( GetEMkLogger(), ( "Export Machinings " + sOutFile).c_str()) ;
// conto le lavorazioni da esportare
int nMachinings = 0 ;
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
if ( m_suData.find( vsMachiningsNames[i]) != m_suData.end())
nMachinings ++ ;
}
// inizializzo il writer
Writer TheWriter ;
if ( ! TheWriter.Init( sOutFile, bCompressed)) {
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Init") ;
return false ;
}
// scrivo linea di inizio file
string sOut = "; --- " + sOutFile + " " + CurrDateTime() + " ---" ;
if ( ! TheWriter.OutText( sOut)) {
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Start") ;
return false ;
}
// scrivo l'intestazione
if ( ! SaveHeader( TheWriter, nMachinings)) {
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on Header") ;
return false ;
}
// scrivo i dati generali
if ( m_nDbVer >= 1002 && ! SaveGeneral( TheWriter)) {
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on General") ;
return false ;
}
// ciclo su tutti i nomi delle lavorazioni da esportare
int nCounter = 0 ;
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
auto it = m_suData.find( vsMachiningsNames[i]) ;
// se la lavorazione non esiste passo alla sucessiva
if ( it == m_suData.end()) {
string sOut = " Warning Exporting Machinings : " + vsMachiningsNames[i] + " not found. Machining is ignored." ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
continue ;
}
// esporto la singola lavorazione
if ( ! SaveOneMachining( it->second, nCounter, TheWriter)) {
string sOut = " Error Exporting Machining " + it->first ;
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
return false ;
}
}
// scrivo linea di fine file
if ( ! TheWriter.OutText( "; --- End ---")) {
LOG_ERROR( GetEMkLogger(), " Error Exporting Machinings on End") ;
return false ;
}
// chiudo la scrittura
TheWriter.Close() ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::ToBeImported( const string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const
{
// inizializzo lo scanner
Scanner TheScanner ;
if ( ! TheScanner.Init( sFile, ";")) {
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : Error on Init") ;
return false ;
}
// leggo l'intestazione
int nVersion = 0 ;
int nTotal = 0 ;
bool bEnd = false ;
if ( ! LoadHeader( TheScanner, nVersion, nTotal, bEnd)) {
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : Error on Header") ;
return false ;
}
string sLine ;
if ( ! TheScanner.GetLine( sLine))
return true ; // il file è finito, esco
// parte generale
if ( sLine == MF_GENERAL) {
// scorro le linee fino ad arrivare alla sezione successiva
while ( TheScanner.GetLine( sLine)) {
if ( sLine.front() == '[' && sLine.back() == ']')
break ;
}
// se non c'è una sezione successiva esco
if ( sLine.empty())
return true ;
}
else if ( nVersion >= 1002) {
LOG_ERROR( GetEMkLogger(), "Machinings ToBeImported : General section missing") ;
return false ;
}
bool bMachiningName = false ;
bool bAdd = true ;
string sName ;
int nType = 0 ;
TheScanner.UngetLine( sLine) ;
while ( TheScanner.GetLine( sLine)) {
if ( sLine.front() == '[' && sLine.back() == ']') { // se è intestazione
// aggiungo lavorazione precedente se ok
if ( bAdd && bMachiningName && nType != 0) {
vsMachiningsNames.push_back( sName) ;
vMachiningsTypes.push_back( nType) ;
}
bMachiningName = false ;
bAdd = true ;
// salvo il tipo di lavorazione
Trim( sLine, "[]") ;
string sType, sCount ;
SplitFirst( sLine, "_", sType, sCount) ;
ToUpper( sType) ;
nType = MCHDATA_NAMETOTYPE( sType) ;
}
else {
string sKey, sVal ;
SplitFirst( sLine, "=", sKey, sVal) ;
if ( ToUpper( sKey) == "NAME") {
if ( ! bMachiningName) {
bMachiningName = true ;
sName = sVal ;
}
else // se lavorazione ha più nomi è errore, non deve essere importata
bAdd = false ;
}
}
}
// aggiungo ultima lavorazione se ok
if ( bAdd && bMachiningName && nType != 0) {
vsMachiningsNames.push_back( sName) ;
vMachiningsTypes.push_back( nType) ;
}
if ( vsMachiningsNames.size() != vMachiningsTypes.size())
return false ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::Import( const string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported)
{
LOG_INFO( GetEMkLogger(), ( "Import Machinings : " + sFile).c_str()) ;
for ( size_t i = 0 ; i < vsMachiningsNames.size() ; i ++) {
// se esiste già nel DB una lavorazione con lo stesso nome la rimuovo
if ( m_suData.find( vsMachiningsNames[i]) != m_suData.end()) {
bool bOk = RemoveMachining( vsMachiningsNames[i]) ;
if ( ! bOk) {
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : removing " + vsMachiningsNames[i] + " failed" ).c_str()) ;
return false ;
}
}
// verfico che il nome non sia ripetuto nella lista dei vsMachiningsNames
if ( i != vsMachiningsNames.size() - 1 &&
find( vsMachiningsNames.begin() + i + 1, vsMachiningsNames.end(), vsMachiningsNames[i]) != vsMachiningsNames.end()) {
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : name \"" + vsMachiningsNames[i] + "\" is already used").c_str()) ;
return false ;
}
}
// inizializzo lo scanner
Scanner TheScanner ;
if ( ! TheScanner.Init( sFile, ";")) {
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on Init") ;
return false ;
}
// leggo l'intestazione
int nVersion = 0 ;
int nTotal = 0 ;
bool bEnd ;
if ( ! LoadHeader( TheScanner, nVersion, nTotal, bEnd)) {
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on Header") ;
return false ;
}
// leggo i dati generali (da versione 1002) e li ignoro
if ( nVersion >= 1002 && ! SkipGeneral( TheScanner, bEnd)) {
LOG_ERROR( GetEMkLogger(), " Error Importing Machinings on General") ;
return false ;
}
// ciclo di lettura delle lavorazioni
while ( ! bEnd) {
PtrOwner<MachiningData> pMch ;
if ( ! LoadOneMachining( TheScanner, pMch, bEnd)) {
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : reading at line" + ToString( TheScanner.GetCurrLineNbr())).c_str()) ;
continue ;
}
// se non c'è lavorazione (si è alla fine), si prosegue
if ( IsNull( pMch))
continue ;
// se la lavorazione non deve essere importata proseguo con la successiva
auto it = find( vsMachiningsToImport.begin(), vsMachiningsToImport.end(), pMch->m_sName) ;
if ( it == vsMachiningsToImport.end())
continue ;
// assegno il nuovo nome
pMch->m_sName = vsMachiningsNames[ it - vsMachiningsToImport.begin()] ;
// se il suo UUID esiste già nel DB lo modifico
if ( m_umData.find( pMch->m_Uuid) != m_umData.end()) {
LOG_ERROR( GetEMkLogger(), ( " Warning Importing Machinings: " + pMch->m_sName + " UUID changed").c_str()) ;
CreateEgtUUID( pMch->m_Uuid) ;
}
// aggiungo la lavorazione
if ( ! m_umData.emplace( pMch->m_Uuid, pMch).second ||
! m_suData.emplace( pMch->m_sName, pMch->m_Uuid).second) {
LOG_ERROR( GetEMkLogger(), ( " Error Importing Machinings : failed adding " + pMch->m_sName).c_str()) ;
continue ;
}
vsImported.push_back( pMch->m_sName) ;
Release( pMch) ;
}
if ( ! vsImported.empty())
m_bModified = true ;
return true ;
}
//----------------------------------------------------------------------------
bool
MachiningsMgr::SkipGeneral( Scanner& TheScanner, bool& bEnd) const
{
// leggo la prossima linea
string sLine ;
if ( ! TheScanner.GetLine( sLine)) {
// fine file
bEnd = true ;
return true ;
}
// deve essere dati generali
if ( sLine != MF_GENERAL)
return false ;
bool bOk = true ;
// leggo le linee successive
bEnd = true ;
while ( bOk && TheScanner.GetLine( sLine)) {
// se sezione successiva
if ( sLine.front() == '[' && sLine.back() == ']') {
TheScanner.UngetLine( sLine) ;
bEnd = false ;
break ;
}
}
return bOk ;
}
+14 -5
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : MachiningsMgr.h Data : 02.06.15 Versione : 1.6f1
// File : MachiningsMgr.h Data : 29.03.24 Versione : 2.6d1
// Contenuto : Dichiarazione della classe MachiningsMgr.
//
//
@@ -14,6 +14,7 @@
#pragma once
#include "MachiningData.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include <unordered_map>
#include <map>
@@ -78,16 +79,23 @@ class MachiningsMgr
bool SetSplitArcs( int nFlag) ;
int GetSplitArcs( void) const
{ return m_nSplitArcs ; }
bool SetApproxLinTol( double dLinTol) ;
double GetApproxLinTol( void) const
{ return m_dApproxLinTol ; }
bool SetMaxDepthSafe( double dSafe) ;
double GetMaxDepthSafe( void) const
{ return m_dMaxDepthSafe ; }
bool Export( const STRVECTOR& vsMachiningsNames, const std::string& sOutFile, bool bCompressed = true) const ;
bool ToBeImported( const std::string& sFile, STRVECTOR& vsMachiningsNames, INTVECTOR& vMachiningsTypes) const ;
bool Import( const std::string& sFile, const STRVECTOR& vsMachiningsToImport, const STRVECTOR& vsMachiningsNames, STRVECTOR& vsImported) ;
private :
bool Clear( bool bReset) ;
bool LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) ;
bool LoadHeader( Scanner& TheScanner, int& nVersion, int& nTotal, bool& bEnd) const ;
bool LoadGeneral( Scanner& TheScanner, bool& bEnd) ;
bool LoadOneMachining( Scanner& TheScanner, bool& bEnd) ;
bool SaveHeader( Writer& TheWriter) const ;
bool SkipGeneral( Scanner& TheScanner, bool& bEnd) const ;
bool LoadOneMachining( Scanner& TheScanner, PtrOwner<MachiningData>& pMch, bool& bEnd) const ;
bool SaveHeader( Writer& TheWriter, int nTotal = -1) const ;
bool SaveGeneral( Writer& TheWriter) const ;
bool SaveOneMachining( const EgtUUID& Uuid, int& nCounter, Writer& TheWriter) const ;
bool VerifyCurrMachining( int nType, std::string& sName) const ;
@@ -126,5 +134,6 @@ class MachiningsMgr
double m_dExtSawArcMinRad ;
double m_dIntSawArcMaxSideAng ;
int m_nSplitArcs ;
double m_dApproxLinTol ;
double m_dMaxDepthSafe ;
} ;
+2275 -854
View File
File diff suppressed because it is too large Load Diff
+48 -19
View File
@@ -85,30 +85,37 @@ class Milling : public Machining
bool AdjustPathDrawForSaw( int nClPathId) ;
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) const ;
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo) ;
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo, double dRbDist, double dDepth) ;
bool AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev,
double dOkStep, bool bStepUp, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev,
double dOkStep, bool bStepUp, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
bool AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
bool AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bOutStart, bool bAboveStart) ;
bool AddSawBladeSideApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dStElev, double dAppr) ;
bool AddDirectApproach( const Point3d& ptP) ;
double dElev, double dAppr, bool bOutStart, bool bAboveStart, bool bFirst, bool bSplitArcs) ;
bool AddSawBladeSideApproach( const Point3d& ptP, const Vector3d& vtAppr, const Vector3d& vtTool,
double dSafeZ, double dSawStElev, double dStElev, double dAppr,
bool bFirst, bool bSplitArcs, bool bAddInsert = false) ;
bool AddDirectApproach( const Point3d& ptP, bool bSplitArcs) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bAboveEnd) ;
bool AddSawBladeSideRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dEndElev, double dAppr) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const ;
double dElev, double dAppr, bool bAboveEnd, bool bSplitArcs) ;
bool AddSawBladeSideRetract( const Point3d& ptP, const Vector3d& vtRetr, const Vector3d& vtTool,
double dSafeZ, double dSawEndElev, double dEndElev, double dAppr, bool bAddExtract = false) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool,
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1, Vector3d& vtDir1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
const Vector3d& vtN, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, double dEndElev,
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1) ;
const Vector3d& vtTool, double dStElev, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs) ;
bool CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool,
double dEndElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool, double dEndElev,
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1, Vector3d& vtDir1) ;
bool AdjustOscillParams( const ICurve* pCrv, bool& bPathOscEnable, double& dRampLen, double& dFlatLen) ;
bool AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double dRampLen, double dFlatLen) ;
bool AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRampLen, double dFlatLen) ;
@@ -117,11 +124,14 @@ class Milling : public Machining
bool AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBLVECTOR& vdTabs, const TabData& tdTabs) ;
bool AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVECTOR& vdTabs, const TabData& tdTabs) ;
double GetRadiusForStartEndElevation( bool bExtra = true) const ;
bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, double dElev, double dSafeZ) const ;
bool GetSimplePointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vector3d& vtRetr) const ;
bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vector3d& vtRetr, double dSafeZ) const ;
bool GetPointAboveRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU) ;
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU) ;
bool CalcOffset( ICurveComposite* pCompo, double dSignOffs) ;
bool GetPointBelowRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false, bool bSawSpecial = false) ;
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false, bool bSawSpecial = false) const ;
bool CalcOffset( ICurveComposite* pCompo, double dSignOffs) const ;
bool TrimExtendCurveToClosedStm( ICurveComposite* pCompo, int nCstmId, bool bInvert) ;
private :
double GetSpeed() const
@@ -143,24 +153,43 @@ class Milling : public Machining
bool IsLeadInHelixOrZigzag() const
{ int nType = GetLeadInType() ;
return ( nType == MILL_LI_ZIGZAG || nType == MILL_LI_HELIX) ; }
bool IsLeadInHelixOrZigzagOrGlide() const
{ int nType = GetLeadInType() ;
return ( nType == MILL_LI_ZIGZAG || nType == MILL_LI_HELIX || nType == MILL_LI_GLIDE) ; }
bool LeadInRawIsOk( void) const
{ if ( ( m_TParams.m_nType & TF_SAWBLADE) != 0)
return false ;
if ( m_TParams.m_nType != TT_MILL_NOTIP)
return true ;
return ( IsLeadInHelixOrZigzag() &&
m_Params.m_dLiTang >= 0.9 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
double GetLeadInOutToler( void) const
{ return ( m_bTHoldFloating ? LIO_ELEV_FLOAT : LIO_ELEV_TOL) ; }
friend class LeadIOStatus ;
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
MillingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
double m_dTHoldBase ; // posizione base del porta-utensile
double m_dTHoldLen ; // lunghezza del porta-utensile
double m_dTHoldDiam ; // diametro del porta-utensile
bool m_bTHoldFloating ; // flag di portautensili flottante
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nMills ; // numero di percorsi di lavoro generati
bool m_bStepOn ; // flag per indicare che effettivamente si lavora a step
double m_dAddedOverlap ; // overlap effettivamente aggiunto a percorso chiuso
int m_nHeadSolCh ; // criterio scelta soluzione impostato nella testa
bool m_bTiltingTab ; // flag utilizzo tavola basculante
Vector3d m_vtTiltingAx ; // versore direzione eventuale asse basculante
bool m_bAboveHead ; // flag utilizzo testa da sopra
bool m_bAggrBottom ; // flag utilizzo di aggregato da sotto
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
double m_dCurrOscillLen ; // lunghezza corrente lungo il percorso per l'oscillazione
double m_dCurrTabsLen ; // lunghezza corrente lungo il percorso per tabs
bool m_bStartOutRaw ; // flag forzatura inizio fuori dal grezzo
bool m_bEndOutRaw ; // flag forzatura fine fuori dal grezzo
Vector3d m_vtStartDir ; // direzione iniziale del percorso in elaborazione
Vector3d m_vtEndDir ; // direzione finale del percorso in elaborazione
} ;
+3 -2
View File
@@ -574,7 +574,8 @@ MillingData::VerifyLeadInType( int nVal) const
{
return ( nVal == MILL_LI_NONE || nVal == MILL_LI_LINEAR ||
nVal == MILL_LI_TANGENT || nVal == MILL_LI_GLIDE ||
nVal == MILL_LI_ZIGZAG || nVal == MILL_LI_HELIX) ;
nVal == MILL_LI_ZIGZAG || nVal == MILL_LI_HELIX ||
nVal == MILL_LI_TG_PERP) ;
}
//----------------------------------------------------------------------------
@@ -583,7 +584,7 @@ MillingData::VerifyLeadOutType( int nVal) const
{
return ( nVal == MILL_LO_NONE || nVal == MILL_LO_LINEAR ||
nVal == MILL_LO_TANGENT || nVal == MILL_LO_GLIDE ||
nVal == MILL_LO_AS_LI) ;
nVal == MILL_LO_AS_LI || nVal == MILL_LO_PERP_TG) ;
}
//----------------------------------------------------------------------------
+6 -2
View File
@@ -110,6 +110,10 @@ struct MillingData : public MachiningData
//----------------------------------------------------------------------------
inline const MillingData* GetMillingData( const MachiningData* pMdata)
{ return (dynamic_cast<const MillingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_MILLING)
return nullptr ;
return ( static_cast<const MillingData*>( pMdata)) ; }
inline MillingData* GetMillingData( MachiningData* pMdata)
{ return (dynamic_cast<MillingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_MILLING)
return nullptr ;
return ( static_cast<MillingData*>( pMdata)) ; }
+226 -124
View File
@@ -523,9 +523,17 @@ Mortising::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nMortises = nCurrMortises ;
LOG_DBG_INFO( GetEMkLogger(), "Mortising apply skipped : status already ok") ;
string sLog = string( "Mortising apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -609,6 +617,8 @@ Mortising::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "Mortising apply done") ;
return true ;
}
@@ -626,21 +636,17 @@ Mortising::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
if ( ! m_Params.m_sInitAngs.empty())
sHint = m_Params.m_sInitAngs ;
if ( ! CalculateAxesValues( sHint, true)) {
if ( ! CalculateAxesValues( sHint, true, true)) {
string sInfo = m_pMchMgr->GetOutstrokeInfo() ;
if ( sInfo.empty())
m_pMchMgr->SetLastError( 2507, "Error in Mortising : axes values not calculable") ;
@@ -811,15 +817,39 @@ Mortising::UpdateToolData( bool* pbChanged)
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
if ( pTMgr == nullptr)
return false ;
// recupero l'utensile nel DB utensili
// recupero l'utensile nel DB utensili (se fallisce con UUID provo con il nome)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
if ( pTdata == nullptr) {
pTdata = pTMgr->GetTool( m_Params.m_sToolName) ;
if ( pTdata == nullptr)
return false ;
m_Params.m_ToolUuid = m_TParams.m_Uuid ;
}
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in Mortising : tool name changed (" +
@@ -992,7 +1022,7 @@ Mortising::GetCurve( SelData Id)
else
nToolDir = TOOL_PAR_SLANT ;
int nFaceUse = ( m_Params.m_nFaceUse & 31) ;
AdjustCurveFromSurf( pCrvCompo, nToolDir, nFaceUse, m_TParams.m_dThick) ;
AdjustCurveFromSurf( pCrvCompo, nToolDir, nFaceUse, V_NULL, m_TParams.m_dThick, 2) ;
// la restituisco
return Release( pCrvCompo) ;
}
@@ -1186,7 +1216,7 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId)
{
// inclinazione della direzione utensile rispetto al movimento
Vector3d vtTg ; pCompo->GetMidDir( vtTg) ;
double dSinAng = max( ( vtTg ^ vtExtr).Len(), sin( 45 * DEGTORAD)) ;
double dSinAng = max( ( vtTg ^ vtExtr).Len(), sin( 30 * DEGTORAD)) ;
double dStartAddLen = m_Params.m_dStartAddLen / dSinAng ;
double dEndAddLen = m_Params.m_dEndAddLen / dSinAng ;
// verifico che il percorso sia abbastanza lungo
@@ -1295,11 +1325,21 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId)
return false ;
// eventuale imposizione massima elevazione da note utente
double dMaxElev ;
if ( FromString( ExtractInfo( m_Params.m_sUserNotes, "MaxElev="), dMaxElev) && dElev > dMaxElev)
if ( GetValInNotes( m_Params.m_sUserNotes, "MaxElev", dMaxElev) && dElev > dMaxElev)
dElev = dMaxElev ;
// ingombro aggiuntivo da larghezza sega a catena quando inclinata rispetto al movimento
Vector3d vtTg ; pCompo->GetMidDir( vtTg) ;
double dSinAng = max( ( vtTg ^ vtExtr).Len(), sin( 30 * DEGTORAD)) ;
double dCosAng = min( abs( vtTg * vtExtr), cos( 30 * DEGTORAD)) ;
double dAddEnc = m_TParams.m_dDiam / 2 * dCosAng / dSinAng ;
// affondamento speciale da note utente (!!! da trasformare in parametro come gli altri !!!)
int nPlunge = 0 ;
GetValInNotes( m_Params.m_sUserNotes, "Plunge", nPlunge) ;
// verifico che lo step dell'utensile sia sensato
double dOkStep = m_Params.m_dStep ;
double dOkStep = ( nPlunge == MORTISE_PLUNGE_STEP ? m_Params.m_dStep : 0) ;
const double MIN_ZSTEP = 1.0 ;
if ( dOkStep >= EPS_SMALL && dOkStep < MIN_ZSTEP) {
dOkStep = MIN_ZSTEP ;
@@ -1318,38 +1358,23 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId)
}
// se lo step supera la capacità dell'utensile
if ( m_Params.m_dStep > m_TParams.m_dMaxMat + EPS_SMALL) {
if ( dOkStep > m_TParams.m_dMaxMat + EPS_SMALL) {
dOkStep = m_TParams.m_dMaxMat ;
string sInfo = "Warning in Mortising : machining step (" + ToString( m_Params.m_dStep, 1) +
") bigger than MaxMaterial (" + ToString( m_TParams.m_dMaxMat, 1) + ")" ;
m_pMchMgr->SetWarning( 2557, sInfo) ;
}
// se lavorazione singola
if ( dOkStep < EPS_SMALL || dOkStep > dElev) {
// se l'elevazione supera la capacità dell'utensile
if ( dElev > m_TParams.m_dMaxMat + EPS_SMALL) {
// segnalo, riduco e continuo
string sInfo = "Warning in Mortising : machining depth (" + ToString(dElev, 1) +
") bigger than MaxMaterial (" + ToString(m_TParams.m_dMaxMat, 1) + ")" ;
m_pMchMgr->SetWarning(2558, sInfo) ;
dDepth -= dElev - m_TParams.m_dMaxMat ;
dElev = m_TParams.m_dMaxMat ;
}
}
// altrimenti lavorazione a step
else {
// massimo affondamento dell'utensile
double dMaxDepth = m_TParams.m_dMaxMat ;
// se l'elevazione supera il massimo affondamento dell'utensile
if ( dElev > dMaxDepth + EPS_SMALL) {
// segnalo, riduco e continuo
string sInfo = "Warning in Mortising : machining depth (" + ToString( dElev, 1) +
") bigger than MaxDepth (" + ToString( dMaxDepth, 1) + ")" ;
m_pMchMgr->SetWarning( 2558, sInfo) ;
dDepth -= dElev - dMaxDepth ;
dElev = dMaxDepth ;
}
}
// massimo affondamento dell'utensile
double dMaxDepth = m_TParams.m_dMaxMat - dAddEnc ;
// se l'elevazione supera il massimo affondamento dell'utensile
if ( dElev > dMaxDepth + EPS_SMALL) {
// segnalo, riduco e continuo
string sInfo = "Warning in Mortising : machining depth (" + ToString( dElev, 1) +
") bigger than MaxDepth (" + ToString( dMaxDepth, 1) + ")" ;
m_pMchMgr->SetWarning( 2558, sInfo) ;
dDepth -= dElev - dMaxDepth ;
dElev = dMaxDepth ;
}
// se richiesta anteprima
if ( nPvId != GDB_ID_NULL) {
@@ -1386,8 +1411,8 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId)
SetToolDir( vtTool) ;
SetAuxDir( vtAux) ;
// Calcolo la mortasatura
if ( ! GenerateMortisingCl( pCompo, vtTool, dDepth, dElev, dOkStep))
// Calcolo la mortasatura
if ( ! GenerateMortisingCl( pCompo, vtTool, dDepth, dElev, dOkStep, nPlunge))
return false ;
}
@@ -1473,103 +1498,186 @@ Mortising::GenerateMortisingPv( int nPathId, const ICurveComposite* pCompo)
//----------------------------------------------------------------------------
bool
Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev, double dOkStep)
Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& vtTool,
double dDepth, double dElev, double dOkStep, int nPlunge)
{
// estremi della curva composita
// inizio e fine
Point3d ptStart ; pCompo->GetStartPoint( ptStart) ;
Point3d ptEnd ; pCompo->GetEndPoint( ptEnd) ;
// verifico se affondamento ripetuto è veramente tale
if ( ( nPlunge == MORTISE_PLUNGE_START_END || nPlunge == MORTISE_PLUNGE_START_TO_END) && Dist( ptStart, ptEnd) < 10 * EPS_SMALL)
nPlunge = MORTISE_PLUNGE_START ;
// se affondamento inizio e fine
if ( nPlunge == MORTISE_PLUNGE_START_END) {
// affondamento iniziale
if ( ! GenerateOnePlungeCl( ptStart, ptEnd, vtTool, dDepth, dElev, dOkStep, MORTISE_PLUNGE_START, true))
return false ;
// affondamento finale
if ( ! GenerateOnePlungeCl( ptStart, ptEnd, vtTool, dDepth, dElev, dOkStep, MORTISE_PLUNGE_END, false))
return false ;
}
// se alrimenti affondamenti ripetuti da inizio a fine con ritorno basso
else if ( nPlunge == MORTISE_PLUNGE_START_TO_END) {
// distanza e vettore spostamento laterale
Vector3d vtDir = ptEnd - ptStart ;
double dLen = vtDir.Len() ;
vtDir.Normalize() ;
// affondamenti iniziale e intermedi
int kMax = ( int) floor( dLen / m_TParams.m_dDiam) ;
for ( int k = 0 ; k <= kMax ; ++ k) {
Point3d ptNewStart = ptStart + vtDir * k * m_TParams.m_dDiam ;
// se non è finale
if ( k != kMax || ! AreSamePointEpsilon( ptNewStart, ptEnd, 10 * EPS_SMALL)) {
if ( ! GenerateOnePlungeCl( ptNewStart, ptEnd, vtTool, dDepth, dElev, dOkStep, MORTISE_PLUNGE_START, k == 0))
return false ;
}
}
// affondamento finale
if ( ! GenerateOnePlungeCl( ptEnd, ptStart, vtTool, dDepth, dElev, dOkStep, MORTISE_PLUNGE_STEP, false))
return false ;
}
// altrimenti affondamento singolo
else {
if ( ! GenerateOnePlungeCl( ptStart, ptEnd, vtTool, dDepth, dElev, dOkStep, nPlunge, true))
return false ;
}
// reset dati di movimento
ResetMoveData() ;
// incremento numero di mortasature
++ m_nMortises ;
return true ;
}
//----------------------------------------------------------------------------
bool
Mortising::GenerateOnePlungeCl( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtTool, double dDepth, double dElev,
double dOkStep, int nPlunge, bool bFirst)
{
// compensazione elevazione/affondamento
double dDelta = dElev - dDepth ;
// determino se l'inizio dell'attacco è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() + m_pMchMgr->GetDeltaSafeZ( m_TParams.m_sHead) ;
double dSafeZ = GetSafeZ() + GetDeltaSafeZ( vtTool) ;
double dStartElev = 0 ;
Point3d ptLi = ptStart + vtTool * dDelta ;
bool bUnderStart = GetPointUnderRaw( ptLi, vtTool, 0,
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dStartElev) ;
Point3d ptLi = ( nPlunge != MORTISE_PLUNGE_END ? ptStart : ptEnd) + vtTool * dDelta ;
bool bUnderStart = GetAhPointUnderRaw( ptLi, vtTool, 0,
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtTool, dStartElev) ;
// altrimenti ridetermino elevazione su inizio percorso di lavoro
if ( ! bUnderStart)
GetElevation( m_nPhase, ptLi, vtTool, GetRadiusForStartEndElevation(), vtTool, dStartElev) ;
// 1 -> punto approccio
SetFlag( 1) ;
Point3d ptP1 = ptStart + vtTool * ( dDelta + dStartElev + dSafeZ) ;
if ( AddRapidStart( ptP1) == GDB_ID_NULL)
int nFirstFlag = ( bFirst ? 1 : 0) ;
SetFlag( nFirstFlag) ;
Point3d ptP1 = ( nPlunge != MORTISE_PLUNGE_END ? ptStart : ptEnd) + vtTool * ( dDelta + dStartElev + dSafeZ) ;
int nStart = AddRapidStartOrMove( ptP1, bFirst) ;
if ( nStart == GDB_ID_NULL)
return false ;
SetFlag( 0) ;
// 2 -> punto fuori (se diverso dal precedente)
if ( m_Params.m_dStartPos < dSafeZ) {
Point3d ptP2 = ptStart + vtTool * ( dDelta + m_Params.m_dStartPos) ;
if ( m_Params.m_dStartPos < dSafeZ - 10 * EPS_SMALL) {
Point3d ptP2 = ( nPlunge != MORTISE_PLUNGE_END ? ptStart : ptEnd) + vtTool * ( dDelta + m_Params.m_dStartPos) ;
if ( AddRapidMove( ptP2) == GDB_ID_NULL)
return false ;
}
// determino numero e affondamento degli step
if ( dOkStep < EPS_SMALL)
dOkStep = dElev ;
int nStep = max( 1, static_cast<int>( ceil( dElev / dOkStep))) ;
double dStep = dElev / nStep ;
const double RETURN_DIST = 10 ;
// eseguo ciclo a seconda del tipo di step
// eseguo ciclo a seconda del tipo di affondamento
Point3d ptLast ;
switch ( m_Params.m_nStepType) {
default : // ZIGZAG
for ( int i = 1 ; i <= nStep ; ++ i) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = (( i % 2 == 1) ? ptStart : ptEnd) + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
// 4 -> punto termine
SetFeed( GetFeed()) ;
SetFlag( 0) ;
ptLast = (( i % 2 == 1) ? ptEnd : ptStart) ;
Point3d ptP4 = ptLast + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
return false ;
}
break ;
case MORTISE_ST_ONEWAY :
for ( int i = 1 ; i <= nStep ; ++ i) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = ptStart + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
// 4 -> punto termine
SetFeed( GetFeed()) ;
SetFlag( 0) ;
ptLast = ptEnd ;
Point3d ptP4 = ptLast + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
return false ;
// 5 -> ritorno sull'inizio, se non ultimo punto
if ( i < nStep) {
// retrocedo
if ( nPlunge == MORTISE_PLUNGE_START) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = ptStart + ( dDelta - dElev) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
ptLast = ptStart ;
}
else if ( nPlunge == MORTISE_PLUNGE_END) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = ptEnd + ( dDelta - dElev) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
ptLast = ptEnd ;
}
else {
// determino numero e affondamento degli step
if ( dOkStep < EPS_SMALL)
dOkStep = dElev ;
int nStep = max( 1, static_cast<int>( ceil( ( dElev - 10 * EPS_SMALL) / dOkStep))) ;
double dStep = dElev / nStep ;
const double RETURN_DIST = 10 ;
// a seconda del tipo
switch ( m_Params.m_nStepType) {
default : // ZIGZAG
for ( int i = 1 ; i <= nStep ; ++ i) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = (( i % 2 == 1) ? ptStart : ptEnd) + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
// 4 -> punto termine
SetFeed( GetFeed()) ;
SetFlag( 0) ;
Point3d ptP5a = ptP4 + RETURN_DIST * vtTool ;
if ( AddLinearMove( ptP5a) == GDB_ID_NULL)
return false ;
// ritorno sopra inizio
SetFeed( GetFeed()) ;
SetFlag( 0) ;
Point3d ptP5b = ptP3 + RETURN_DIST * vtTool ;
if ( AddLinearMove( ptP5b) == GDB_ID_NULL)
return false ;
ptLast = (( i % 2 == 1) ? ptEnd : ptStart) ;
Point3d ptP4 = ptLast + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
return false ;
}
break ;
case MORTISE_ST_ONEWAY :
for ( int i = 1 ; i <= nStep ; ++ i) {
// 3 -> punto in affondamento
SetFeed( GetStartFeed()) ;
SetFlag( 0) ;
Point3d ptP3 = ptStart + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
// 4 -> punto termine
SetFeed( GetFeed()) ;
SetFlag( 0) ;
ptLast = ptEnd ;
Point3d ptP4 = ptLast + ( dDelta - i * dStep) * vtTool ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
return false ;
// 5 -> ritorno sull'inizio, se non ultimo punto
if ( i < nStep) {
// retrocedo
SetFeed( GetFeed()) ;
SetFlag( 0) ;
Point3d ptP5a = ptP4 + RETURN_DIST * vtTool ;
if ( AddLinearMove( ptP5a) == GDB_ID_NULL)
return false ;
// ritorno sopra inizio
SetFeed( GetFeed()) ;
SetFlag( 0) ;
Point3d ptP5b = ptP3 + RETURN_DIST * vtTool ;
if ( AddLinearMove( ptP5b) == GDB_ID_NULL)
return false ;
}
}
break ;
}
break ;
}
// determino se la fine dell'uscita è esattamente sotto il grezzo, nel qual caso ricalcolo l'elevazione
double dEndElev = 0 ;
Point3d ptLo = ptLast + vtTool * dDelta ;
bool bUnderEnd = GetPointUnderRaw( ptLo, vtTool, 0,
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, dEndElev) ;
bool bUnderEnd = GetAhPointUnderRaw( ptLo, vtTool, 0,
GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtTool, dEndElev) ;
// altrimenti ridetermino elevazione su fine percorso di lavoro
if ( ! bUnderEnd)
GetElevation( m_nPhase, ptLo, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev) ;
// 6 -> ritorno all'approccio
SetFeed( GetEndFeed()) ;
SetFlag( 104) ; // risalita sopra la fine
@@ -1577,12 +1685,6 @@ Mortising::GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& v
if ( AddLinearMove( ptP6) == GDB_ID_NULL)
return false ;
// reset dati di movimento
ResetMoveData() ;
// incremento numero di mortasature
++ m_nMortises ;
return true ;
}
+3 -1
View File
@@ -74,7 +74,9 @@ class Mortising : public Machining
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double dThick, double& dElev) const ;
bool GenerateMortisingPv( int nPathId, const ICurveComposite* pCompo) ;
bool GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev, double dOkStep) ;
bool GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev, double dOkStep, int nPlunge) ;
bool GenerateOnePlungeCl( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtTool, double dDepth, double dElev, double dOkStep,
int nPlunge, bool bFirst) ;
double GetRadiusForStartEndElevation( void) const ;
private :
+6 -2
View File
@@ -77,6 +77,10 @@ struct MortisingData : public MachiningData
//----------------------------------------------------------------------------
inline const MortisingData* GetMortisingData( const MachiningData* pMdata)
{ return (dynamic_cast<const MortisingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_MORTISING)
return nullptr ;
return ( static_cast<const MortisingData*>( pMdata)) ; }
inline MortisingData* GetMortisingData( MachiningData* pMdata)
{ return (dynamic_cast<MortisingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_MORTISING)
return nullptr ;
return ( static_cast<MortisingData*>( pMdata)) ; }
+2779 -769
View File
File diff suppressed because it is too large Load Diff
+170 -21
View File
@@ -14,14 +14,15 @@
#pragma once
#include "MachMgr.h"
#include "MachConst.h"
#include "MachineStruConst.h"
#include "CamData.h"
#include "/EgtDev/Include/EGkPoint3d.h"
#include "/EgtDev/Include/EGkUserObj.h"
#include "/EgtDev/Include/EGkSelection.h"
#include "/EgtDev/Include/EgtNumCollection.h"
class MachMgr ;
class CamData ;
class ICurve ;
class ICurveComposite ;
@@ -43,6 +44,7 @@ class Operation : public IUserObj
virtual int GetPhase( void) const
{ return m_nPhase ; }
virtual bool RemoveHome( void) ;
std::string GetName( void) const ;
public :
virtual int GetType( void) const = 0 ;
@@ -60,67 +62,195 @@ class Operation : public IUserObj
{ return true ; }
virtual bool AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCen) const
{ return true ; }
virtual bool NeedSplit( bool bSplit = true, bool bFeed = true) const
{ return ( bSplit && ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrIsRobot())) ; }
virtual double GetMaxSplitLen( bool bSplit = true, bool bFeed = true) const
{ return ( bSplit && ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrIsRobot()) ? ( bFeed ? 5 : 50) : 0) ; }
virtual double GetSafeZ( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 100 ; // MF_CURR_SAFEZ in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ; }
virtual double GetSafeAggrBottZ( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 10 ; // MF_CURR_SAFEAGGRBOTTZ in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetSafeAggrBottZ() ; }
virtual double GetExtraLOnCutRegion( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 0 ; // MF_CURR_EXTRALCR in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetExtraLOnCutRegion() ; }
virtual double GetExtraROnDrillRegion( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 0 ; // MF_CURR_EXTRARDR in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetExtraROnDrillRegion() ; }
virtual double GetHoleDiamToler( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 10 * EPS_SMALL ; // MF_CURR_HOLEDTOL in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetHoleDiamToler() ; }
virtual double GetExtSawArcMinRad( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 200 ; // MF_CURR_EXTSAWARCMINRAD in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetExtSawArcMinRad() ; }
virtual double GetIntSawArcMaxSideAng( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 45 ; // MF_CURR_INTSAWARCMAXSIDEANG in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetIntSawArcMaxSideAng() ; }
virtual bool GetSplitArcs( const Vector3d& vtTool) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrIsRobot() ||
m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return true ;
int nSplitArcs = m_pMchMgr->GetCurrMachiningsMgr()->GetSplitArcs() ;
return ( nSplitArcs == SPLAR_ALWAYS ||
( nSplitArcs == SPLAR_NO_XY_PLANE && ! vtTool.IsZplus()) ||
( nSplitArcs == SPLAR_GEN_PLANE && vtTool.IsGeneric())) ; }
virtual double GetApproxLinTol( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 50 * EPS_SMALL ; // MF_APPROX_LINTOL in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetApproxLinTol() ; }
virtual double GetMaxDepthSafe( void) const
{ if ( m_pMchMgr == nullptr || m_pMchMgr->GetCurrMachiningsMgr() == nullptr)
return 2 ; // MF_CURR_MAXDEPTHSAFE in MachiningsMgr
return m_pMchMgr->GetCurrMachiningsMgr()->GetMaxDepthSafe() ; }
protected :
Operation( void) ;
protected :
struct Position {
int nSide ;
DBLVECTOR vAxis ;
int nFlag ;
int nFlag2 ;
int nMask ;
std::string sInfo ;
Position() : nSide( 0), nFlag( 0), nFlag2( 0), nMask( -1) {}
} ;
typedef std::vector<Position> POSVECTOR ;
protected :
bool UpdateFollowingOperationsStatus( int nModif) ;
bool GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double& dElev, Vector3d& vtNorm) const ;
bool GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double& dElev, INTVECTOR& vRawStmId) const ;
bool GetElevation( int nPhase, const Point3d& ptP,
const Vector3d& vtDir, double& dElev, Vector3d& vtNorm, INTVECTOR& vRawStmId) const ;
bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2,
const Vector3d& vtDir, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3,
const Vector3d& vtDir, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtTool, double dRad,
const Vector3d& vtDir, double& dElev) const ;
bool GetPointUnderRaw( const Point3d& ptP, const Vector3d& vtTool, double dToolRad, double dToolRadForElev,
double dToolLen, bool bIsSaw, double dSafeZ, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtTool, double dRad, double dLen,
const Vector3d& vtDir, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtTool, double dRad, double dLen, double dSafeDist,
const Vector3d& vtDir, double& dElev) const ;
bool GetElevation( int nPhase, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtTool, double dRad, double dLen,
const Vector3d& vtDir, double& dElev) const ;
bool GetAhPointUnderRaw( const Point3d& ptP, const Vector3d& vtTool, double dToolRad, double dToolRadForElev,
double dToolLen, bool bIsSaw, double dSafeZ, const Vector3d& vtDir, double& dElev) const ;
bool GetUhPointAboveRaw( const Point3d& ptP, const Vector3d& vtTool, double dToolRad, double dToolRadForElev,
double dToolLen, bool bIsSaw, double dSafeZ, const Vector3d& vtDir, double& dElev) const ;
bool GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist) const ;
bool GetMinDistanceFromRawSide( int nPhase, const Point3d& ptP, double dExpand, double& dDist, Vector3d& vtDir) const ;
bool GetAggrBottDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double dEncSafeH, double& dDist) const ;
bool GetMinDistanceFromRawSide( int nPhase, const Point3d& ptP, double dExpand,
double& dDist, Vector3d& vtDir) const ;
bool GetMinDistanceFromRawSide( int nPhase, const Point3d& ptP, double dExpand,
const Vector3d& vtMainDir, double dCosMaxDelta,
double& dDist, Vector3d& vtDir) const ;
bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist) const
{ double dDummy ;
return GetDistanceFromRawBottom( nPhase, nPathId, dToler, dRbDist, dDummy) ; }
bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist, double& dAllRbDist) const ;
bool GetRawGlobBox( int nPhase, int nPathId, double dToler, BBox3d& b3Raw) const ;
bool GetRawGlobBox( int nPhase, const BBox3d& b3Test, double dToler, BBox3d& b3Raw) const ;
bool GetCurrRawsGlobBox( BBox3d& b3Raw) const ;
bool AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nFaceUse, double dToolThick) ;
bool AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nFaceUse, const Vector3d& vtFaceUse,
double dToolThick, int nGrade = 3) ;
bool ApproxWithArcsIfUseful( ICurveComposite* pCompo, bool bCareTempProp = false) const ;
bool ApproxWithLines( ICurveComposite* pCompo) const ;
bool ApproxWithLines( ICurveComposite* pCompo, bool bFeed = true) const ;
bool VerifyArcs( ICurveComposite* pCompo, double dMaxAngCen = MAX_ANG_CEN) const ;
bool CalcAndSetBBox( int nClId) ;
bool CalcAndSetAxesBBox( void) ;
bool GetInitialAxesValues( DBLVECTOR& vAxVal) const ;
bool GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) const ;
bool CalcMirrorByDouble( int nClId, const std::string& sUserNotes) ;
bool GetInitialAxesValues( bool bSkipClimb, DBLVECTOR& vAxVal) const ;
bool GetClPathInitialAxesValues( int nClPathId, bool bSkipClimb, DBLVECTOR& vAxVal) const ;
bool GetFinalAxesValues( bool bSkipRise, DBLVECTOR& vAxVal) const ;
bool GetClPathFinalAxesValues( int nClPathId, bool bSkipRise, DBLVECTOR& vAxVal) const ;
bool GetInitialToolDir( bool bSkipClimb, Vector3d& vtTool) const ;
bool GetClPathInitialToolDir( int nClPathId, bool bSkipClimb, Vector3d& vtTool) const ;
bool GetFinalToolDir( bool bSkipRise, Vector3d& vtTool) const ;
bool GetClPathFinalToolDir( int nClPathId, bool bSkipRise, Vector3d& vtTool) const ;
const CamData* GetInitialCamData( bool bSkipClimb) const ;
const CamData* GetClPathInitialCamData( int nClPathId, bool bSkipClimb) const ;
const CamData* GetFinalCamData( bool bSkipRise) const ;
const CamData* GetClPathFinalCamData( int nClPathId, bool bSkipRise) const ;
std::string ExtractInfo( const std::string& sNotes, const std::string& sKey) const ;
std::string ExtractHint( const std::string& sNotes) const ;
bool CalculateAxesValues( const std::string& sHint, bool bSolChExact = false) ;
bool SetBlockedRotAxis( const std::string& sBlockedAxis) const ;
bool CalculateAxesValues( const std::string& sHint, bool bRotContOnNext = true, bool bSolChExact = false) ;
bool CalculateClPathCenterAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome,
const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec) ;
bool CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
double dAngDeltaMinForHome, const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC) ;
bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome,
const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec, int& nOutStrC) ;
bool CalculateRotAxesValues( bool bFirst, const Vector3d& vtTool, const Vector3d& vtAux,
double dRot1W, bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome,
const DBLVECTOR& vAxRotHome, const DBLVECTOR& vAxRotPrec, DBLVECTOR& vAxRot) ;
bool VerifyLineMidPoint( const Point3d& ptPrec, const Vector3d& vtDirPrec, const Vector3d& vtAuxPrec, const Vector3d& vtCorrPrec, const DBLVECTOR& vAxPrec,
const Point3d& ptP, const Vector3d& vtDir, const Vector3d& vtAux, const Vector3d& vtCorr, const DBLVECTOR& vAxVal,
int nCnt, int nEntId, double dRot1W, int nMoveType, bool& bAdded, bool& bAxError) ;
bool CalculateClPathRobotAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
bool bMaxDeltaR2OnFirst, bool bRotContOnNext, double dAngDeltaMinForHome,
const DBLVECTOR& vAxRotHome, DBLVECTOR& vAxRotPrec) ;
bool AdjustStartEndMovements( bool bVerifyPreviousLink = true) ;
bool AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation* pPrevOp, const DBLVECTOR& vAxPrev, bool bMaxZ) ;
bool ManageProtectedAreas( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, Operation* pPrevOp, Operation* pNextOp, bool& bClimbDone) ;
bool AdjustOneStartEndMovement( int nClPathId, int nPrevClPathId, Operation* pPrevOp, const DBLVECTOR& vAxPrev, bool bMaxZ) ;
bool ToolChangeNeeded( const Operation& Op1, const Operation& Op2) const ;
bool RemoveClimb( int nClPathId) ;
bool AddRise( DBLVECTOR& vAxVal, double dDelta = - 1, int nClPathId = GDB_ID_NULL, bool bZHomeDown = false) ;
bool AddSpecialRise( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL, int nFlag = 0) ;
bool AddSpecialClimb( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL,
int nFlag = 0, int nFlag2 = 0, int nMask = -1, const std::string& sInfo = "") ;
bool RemoveClimb( int nClPathId = GDB_ID_NULL) ;
bool AddRise( DBLVECTOR& vAxVal, double dDelta = NAN, int nClPathId = GDB_ID_NULL, int nToMinMaxZ = 0) ;
bool AddSpecialRise( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL,
int nFlag = 0, int nFlag2 = 0, int nMask = -1, const std::string& sInfo = "") ;
bool RemoveRise( int nClPathId = GDB_ID_NULL) ;
bool AddHome( void) ;
bool RemoveClimbRiseHome( void) ;
bool AddRobotClimb( int nEntId, double dDeltaZ = NAN) ;
bool CalcRobotAxesAbovePos( const Point3d& ptP, const Vector3d& vtT, const Vector3d& vtA, double dDeltaZ,
DBLVECTOR& vAx, double* pdNewDeltaZ = nullptr) const ;
bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const ;
bool GetExtraZ( double dSafeZ, double& dExtraZ, double& dMaxAngV) const ;
bool GetExtraZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
double dHomeZ, double& dExtraZ) const ;
bool SpecialGetMaxZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1,
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
double& dMaxZ) const ;
bool GetRotationAtZmax( void) const ;
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, const BBox3d& b3Raws) const ;
int GetUserNotesZmax( void) const ;
double GetDeltaSafeZ( const Vector3d& vtTool) const ;
bool GetZHomeDown( void) const ;
bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nFlag2, bool& bModif) ;
bool SpecialMoveRapid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, DBLVECTOR& vAxNew, bool& bModif) ;
int SpecialTestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool SpecialMoveZup( DBLVECTOR& vAx, Vector3d& vtTool, int& nFlag, int& nFlag2, bool& bModif) ;
bool SpecialMoveRapid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, int nOutstroke, int nLinkType,
POSVECTOR& vNewPos) ;
bool GetAggrBottomData( const std::string& sHead, AggrBottom& agbData) const ;
bool IsAggrBottom( const std::string& sHead) const ;
private :
bool GetAxisMidForTestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, int nAxisOrder, Machine* pMch,
DBLVECTOR& vAxMid) const ;
bool OneMoveTestCollisionAvoid( const STRVECTOR& vAxName, const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd,
Machine* pMch, const INTVECTOR& vRawId, const INTVECTOR& vFxtId) const ;
protected :
int m_nOwnerId ; // identificativo dell'oggetto geometrico possessore
@@ -136,6 +266,7 @@ class Operation : public IUserObj
bool SetCorrAuxDir( const Vector3d& vtDir) ;
bool SetFeed( double dFeed) ;
bool SetFlag( int nFlag) ;
bool SetFlagOnLastMove( int nFlag) ;
bool SetFlag2( int nFlag2) ;
bool SetIndex( int nIndex) ;
bool GetCurrPos( Point3d& ptCurr) const
@@ -150,12 +281,26 @@ class Operation : public IUserObj
int AddRapidStart( const Point3d& ptP, const std::string& sName) ;
int AddRapidMove( const Point3d& ptP) ;
int AddRapidMove( const Point3d& ptP, const std::string& sName) ;
int AddRapidMove( const Point3d& ptP, bool bSplit) ;
int AddRapidMove( const Point3d& ptP, bool bSplit, const std::string& sName) ;
int AddRapidStartOrMove( const Point3d& ptP, bool bFirst)
{ return ( bFirst ? AddRapidStart( ptP) : AddRapidMove( ptP)) ; }
int AddRapidStartOrMove( const Point3d& ptP, bool bFirst, const std::string& sName)
{ return ( bFirst ? AddRapidStart( ptP, sName) : AddRapidMove( ptP, sName)) ; }
int AddRapidStartOrMove( const Point3d& ptP, bool bFirst, bool bSplit)
{ return ( bFirst ? AddRapidStart( ptP) : AddRapidMove( ptP, bSplit)) ; }
int AddRapidStartOrMove( const Point3d& ptP, bool bFirst, bool bSplit, const std::string& sName)
{ return ( bFirst ? AddRapidStart( ptP, sName) : AddRapidMove( ptP, bSplit, sName)) ; }
int AddLinearMove( const Point3d& ptP) ;
int AddLinearMove( const Point3d& ptP, const std::string& sName) ;
int AddLinearMove( const Point3d& ptP, bool bSplit) ;
int AddLinearMove( const Point3d& ptP, bool bSplit, const std::string& sName) ;
int AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, const Vector3d& vtN) ;
int AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, const Vector3d& vtN, const std::string& sName) ;
int AddCurveMove( const ICurve* pCrv, bool bOnlySimple = false) ;
int AddCurveMove( const ICurve* pCrv, const std::string& sName, bool bOnlySimple = false) ;
int AddCurveMove( const ICurve* pCrv) ;
int AddCurveMove( const ICurve* pCrv, const std::string& sName) ;
int AddCurveMove( const ICurve* pCrv, bool bSplit) ;
int AddCurveMove( const ICurve* pCrv, bool bSplit, const std::string& sName) ;
bool ResetMoveData( void) ;
protected :
@@ -181,4 +326,8 @@ inline Operation* GetOperation( IUserObj* pUserObj)
// tipo posizione utensile
enum { TOOL_PARAL = 1, TOOL_ORTHO = 2, TOOL_ORTUP = 3, TOOL_PAR_SLANT= 4} ;
// tipo di utilizzo contorno faccia
enum { FACE_DOWN = 1, FACE_TOP = 2, FACE_FRONT = 3, FACE_BACK = 4, FACE_LEFT = 5, FACE_RIGHT = 6, FACE_CONT = 7} ;
enum { FACE_DOWN = 1, FACE_TOP = 2, FACE_FRONT = 3, FACE_BACK = 4, FACE_LEFT = 5, FACE_RIGHT = 6, FACE_CONT = 7, FACE_VERSOR = 8} ;
// risultato di SpecialTestCollisionAvoid
enum { SCAV_ERROR = -1, SCAV_COLLIDE = 0, SCAV_AVOID = 1, SCAV_TOTEST = 2} ;
// ordine di movimento assi nei link
enum { LKAO_INTERP = 0, LKAO_HEAD_BEFORE = -1, LKAO_HEAD_AFTER = +1, LKAO_HEAD_BOTH = 11} ;
+123 -6
View File
@@ -82,6 +82,18 @@ Operation::SetFlag( int nFlag)
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::SetFlagOnLastMove( int nFlag)
{
int nLastEntId = m_pGeomDB->GetLastInGroup( m_nPathId) ;
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nLastEntId)) ;
if ( pCamData == nullptr)
return false ;
pCamData->SetFlag( nFlag) ;
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::SetFlag2( int nFlag2)
@@ -200,6 +212,46 @@ Operation::AddRapidMove( const Point3d& ptP, const string& sName)
return nId ;
}
//----------------------------------------------------------------------------
int
Operation::AddRapidMove( const Point3d& ptP, bool bSplit)
{
// se non richiesta spezzatura con massima lunghezza, emissione normale
if ( ! NeedSplit( bSplit))
return AddRapidMove( ptP) ;
// altrimenti opportuna spezzatura
Point3d ptS ;
if ( ! GetCurrPos( ptS))
return GDB_ID_NULL ;
double dLen = Dist( ptS, ptP) ;
double dStep = GetMaxSplitLen( true, false) ;
int nStep = int( dLen / dStep + 0.999) ;
int nFirstId = GDB_ID_NULL ;
for ( int i = 1 ; i <= nStep ; ++ i) {
int nId = AddRapidMove( Media( ptS, ptP, i * 1.0 / nStep)) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
SetFlag( 0) ;
SetFlag2( 0) ;
}
return nFirstId ;
}
//----------------------------------------------------------------------------
int
Operation::AddRapidMove( const Point3d& ptP, bool bSplit, const string& sName)
{
int nFirstId = AddRapidMove( ptP, bSplit) ;
int nId = nFirstId ;
while ( nId != GDB_ID_NULL) {
m_pGeomDB->SetName( nId, sName) ;
nId = m_pGeomDB->GetNext( nId) ;
}
return nFirstId ;
}
//----------------------------------------------------------------------------
int
Operation::AddLinearMove( const Point3d& ptP)
@@ -258,6 +310,44 @@ Operation::AddLinearMove( const Point3d& ptP, const string& sName)
return nId ;
}
//----------------------------------------------------------------------------
int
Operation::AddLinearMove( const Point3d& ptP, bool bSplit)
{
// se non richiesta spezzatura con massima lunghezza, emissione normale
if ( ! NeedSplit( bSplit))
return AddLinearMove( ptP) ;
// altrimenti opportuna spezzatura
Point3d ptS ;
if ( ! GetCurrPos( ptS))
return GDB_ID_NULL ;
double dLen = Dist( ptS, ptP) ;
double dStep = GetMaxSplitLen( true, true) ;
int nStep = int( dLen / dStep + 0.999) ;
int nFirstId = GDB_ID_NULL ;
for ( int i = 1 ; i <= nStep ; ++ i) {
int nId = AddLinearMove( Media( ptS, ptP, i * 1.0 / nStep)) ;
if ( nId == GDB_ID_NULL)
return GDB_ID_NULL ;
if ( nFirstId == GDB_ID_NULL)
nFirstId = nId ;
}
return nFirstId ;
}
//----------------------------------------------------------------------------
int
Operation::AddLinearMove( const Point3d& ptP, bool bSplit, const string& sName)
{
int nFirstId = AddLinearMove( ptP, bSplit) ;
int nId = nFirstId ;
while ( nId != GDB_ID_NULL) {
m_pGeomDB->SetName( nId, sName) ;
nId = m_pGeomDB->GetNext( nId) ;
}
return nFirstId ;
}
//----------------------------------------------------------------------------
int
Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, const Vector3d& vtN)
@@ -334,7 +424,7 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen,
//----------------------------------------------------------------------------
int
Operation::AddCurveMove( const ICurve* pCrv, bool bOnlySimple)
Operation::AddCurveMove( const ICurve* pCrv)
{
// verifico che la curva esista
if ( pCrv == nullptr)
@@ -355,8 +445,8 @@ Operation::AddCurveMove( const ICurve* pCrv, bool bOnlySimple)
pArc->GetEndPoint( ptP3) ;
return AddArcMove( ptP3, ptCen, dAngCen, vtN) ;
}
// se ammesse curve composite
else if ( ! bOnlySimple) {
// se arco o curva composita
else if ( pCrv->GetType() == CRV_ARC || pCrv->GetType() == CRV_COMPO) {
// in ogni caso, converto in archi e rette
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
if ( ! pCompo->AddCurve( *pCrv))
@@ -395,16 +485,43 @@ Operation::AddCurveMove( const ICurve* pCrv, bool bOnlySimple)
}
return nFirstId ;
}
// altrimenti
// altre curve non ammesse
else
return GDB_ID_NULL ;
}
//----------------------------------------------------------------------------
int
Operation::AddCurveMove( const ICurve* pCrv, const string& sName, bool bOnlySimple)
Operation::AddCurveMove( const ICurve* pCrv, const string& sName)
{
int nFirstId = AddCurveMove( pCrv, bOnlySimple) ;
int nFirstId = AddCurveMove( pCrv) ;
int nId = nFirstId ;
while ( nId != GDB_ID_NULL) {
m_pGeomDB->SetName( nId, sName) ;
nId = m_pGeomDB->GetNext( nId) ;
}
return nFirstId ;
}
//----------------------------------------------------------------------------
int
Operation::AddCurveMove( const ICurve* pCrv, bool bSplit)
{
// se non richiesta spezzatura, emissione normale
if ( ! bSplit)
return AddCurveMove( pCrv) ;
// altrimenti opportuna spezzatura
PtrOwner<ICurveComposite> pCompo ;
if ( ! pCompo.Set( ConvertCurveToComposite( pCrv->Clone())) || ! ApproxWithLines( pCompo))
return false ;
return AddCurveMove( pCompo) ;
}
//----------------------------------------------------------------------------
int
Operation::AddCurveMove( const ICurve* pCrv, bool bSplit, const string& sName)
{
int nFirstId = AddCurveMove( pCrv, bSplit) ;
int nId = nFirstId ;
while ( nId != GDB_ID_NULL) {
m_pGeomDB->SetName( nId, sName) ;
+10 -4
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2019
// EgalTech 2017-2024
//----------------------------------------------------------------------------
// File : OperationConst.h Data : 08.07.19 Versione : 2.1g2
// File : OperationConst.h Data : 22.05.24 Versione : 2.6e5
// Contenuto : Costanti per le operazioni.
//
//
@@ -9,6 +9,7 @@
// Modifiche : 17.08.17 DS Creazione modulo.
// 25.05.19 DS Aggiunte SurfRoughing e SurfFinishing.
// 25.05.19 DS Aggiunta WaterJetting.
// 22.05.24 DS Aggiunta FiveAxisMilling.
//
//----------------------------------------------------------------------------
@@ -17,6 +18,7 @@
#include "/EgtDev/Include/EMkOperationConst.h"
#include <string>
#define POCKETING_NT 0
//----------------------------------------------------------------------------
static const std::string s_OpeClass[] = {"",
@@ -32,7 +34,8 @@ static const std::string s_OpeClass[] = {"",
"EMkChiseling",
"EMkSurfRoughing",
"EMkSurfFinishing",
"EMkWaterJetting"} ;
"EMkWaterJetting",
"EMkFiveAxisMilling"} ;
//----------------------------------------------------------------------------
// Dal tipo numerico restituisce la classe della operazione
@@ -53,6 +56,7 @@ GetOperationClass( int nOpeType)
case OPER_SURFROUGHING : return s_OpeClass[11] ;
case OPER_SURFFINISHING : return s_OpeClass[12] ;
case OPER_WATERJETTING : return s_OpeClass[13] ;
case OPER_FIVEAXISMILLING : return s_OpeClass[14] ;
}
return s_OpeClass[0] ;
}
@@ -88,6 +92,8 @@ GetOperationType( const std::string& sOpeClass)
return OPER_SURFFINISHING ;
else if ( sOpeClass == s_OpeClass[13])
return OPER_WATERJETTING ;
else if ( sOpeClass == s_OpeClass[14])
return OPER_FIVEAXISMILLING ;
else
return OPER_NULL ;
}
}
+305 -177
View File
@@ -20,143 +20,181 @@
static const int MAX_AXES = 7 ;
// Variabili
static const std::string GLOB_VAR = "EMT" ; // tavola variabili globali
static const std::string GVAR_VER = ".VER" ; // (string) versione della Dll
static const std::string GVAR_ERR = ".ERR" ; // (int) codice di errore (0=ok)
static const std::string GVAR_USETO1 = ".USETO1" ; // (bool) flag per utilizzo origine tavola
static const std::string GVAR_MODAL = ".MODAL" ; // (bool) flag per emissione modale dei valori
static const std::string GVAR_INCHES = ".INCHES" ; // (bool) flag unità di misura (true=inches, false=mm)
static const std::string GVAR_SPLITARCS = ".SPLITARCS" ; // (int) flag spezzatura archi (0=mai, 1=piani generici, 2=piani diversi da XY, 3=sempre)
static const std::string GVAR_NUM = ".NUM" ; // (bool) flag numerazione
static const std::string GVAR_NUMTOK = ".Nt" ; // (string) token per numerazione
static const std::string GVAR_LINENBR = ".LINENBR" ; // (int) numero progressivo di linea
static const std::string GVAR_LINEINC = ".LINEINC" ; // (int) incremento per numero di linea
static const std::string GVAR_F = ".F" ; // (num) valore della feed
static const std::string GVAR_FT = ".Ft" ; // (string) token per feed
static const std::string GVAR_S = ".S" ; // (num) valore della speed
static const std::string GVAR_ST = ".St" ; // (string) token per speed
static const std::string GVAR_MACHNAME = ".MACHNAME" ; // (string) nome macchina
static const std::string GVAR_FILE = ".FILE" ; // (string) path file di output
static const std::string GVAR_INFO = ".INFO" ; // (string) informazioni iniziali
static const std::string GVAR_SETUP = ".SETUP" ; // (bool) flag definizione setup
static const std::string GVAR_DISPID = ".DISPID" ; // (int) identificativo disposizione
static const std::string GVAR_DISPIND = ".DISPIND" ; // (int) indice disposizione
static const std::string GVAR_PHASE = ".PHASE" ; // (int) indice fase
static const std::string GVAR_EMPTY = ".EMPTY" ; // (bool) flag disposizione passiva
static const std::string GVAR_SBH = ".SBH" ; // (bool) flag disposizione con operazioni manuali
static const std::string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
static const std::string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
static const std::string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
static const std::string GVAR_FIXIND = ".FIXIND" ; // (int) indice bloccaggio
static const std::string GVAR_FIXNAME = ".FIXNAME" ; // (string) nome bloccaggio
static const std::string GVAR_FIXPOS = ".FIXPOS" ; // (Point3d) posizione bloccaggio
static const std::string GVAR_FIXANG = ".FIXANG" ; // (num) angolo di rotazione bloccaggio
static const std::string GVAR_FIXMOB = ".FIXMOB" ; // (num) movimento eventuale parte mobile del bloccaggio
static const std::string GVAR_RAWID = ".RAWID" ; // (int) identificativo grezzo
static const std::string GVAR_RAWIND = ".RAWIND" ; // (int) indice movimento del grezzo
static const std::string GVAR_RAWTYPE = ".RAWTYPE" ; // (int) tipo di movimento del grezzo
static const std::string GVAR_RAWPOS = ".RAWPOS" ; // (Point3d) posizione di movimento del grezzo
static const std::string GVAR_RAWFLAG = ".RAWFLAG" ; // (int) flag per movimento del grezzo
static const std::string GVAR_TOOL = ".TOOL" ; // (string) nome utensile
static const std::string GVAR_HEAD = ".HEAD" ; // (string) nome testa
static const std::string GVAR_EXIT = ".EXIT" ; // (int) indice uscita
static const std::string GVAR_TCPOS = ".TCPOS" ; // (string) eventuale posizione utensile nel TC
static const std::string GVAR_TCOMP = ".TCOMP" ; // (int) numero correttore utensile
static const std::string GVAR_TDIAM = ".TDIAM" ; // (num) diametro utensile
static const std::string GVAR_TTOTDIAM = ".TTOTDIAM" ; // (num) diametro totale utensile
static const std::string GVAR_TLEN = ".TLEN" ; // (num) lunghezza utensile
static const std::string GVAR_TTOTLEN = ".TTOTLEN" ; // (num) lunghezza totale utensile
static const std::string GVAR_TUSED = ".TUSED" ; // (bool) flag per indicare che l'utensile attrezzato è anche utilizzato
static const std::string GVAR_SMAX = ".SMAX" ; // (num) massima speed utensile
static const std::string GVAR_FIRST = ".FIRST" ; // (bool) flag per primo utensile
static const std::string GVAR_NEXTTOOL = ".NEXTTOOL" ; // (string) nome del prossimo utensile
static const std::string GVAR_NEXTHEAD = ".NEXTHEAD" ; // (string) nome testa del prossimo utensile
static const std::string GVAR_NEXTEXIT = ".NEXTEXIT" ; // (int) indice uscita su testa del prox utensile
static const std::string GVAR_NEXTTCPOS = ".NEXTTCPOS" ; // (string) eventuale posizione del prox utensile nel TC
static const std::string GVAR_MCHID = ".MCHID" ; // (int) identificativo lavorazione
static const std::string GVAR_MCHIND = ".MCHIND" ; // (int) indice lavorazione
static const std::string GVAR_MMIN = ".MMIN" ; // (Point3d) punto minimo di ingombro della lavorazione
static const std::string GVAR_MMAX = ".MMAX" ; // (Point3d) punto massimo di ingombro della lavorazione
static const std::string GVAR_VER = ".VER" ; // (string) versione della Dll
static const std::string GVAR_ERR = ".ERR" ; // (int) codice di errore (0=ok)
static const std::string GVAR_USETO1 = ".USETO1" ; // (bool) flag per utilizzo origine tavola
static const std::string GVAR_MODAL = ".MODAL" ; // (bool) flag per emissione modale dei valori
static const std::string GVAR_INCHES = ".INCHES" ; // (bool) flag unità di misura (true=inches, false=mm)
static const std::string GVAR_SPLITARCS = ".SPLITARCS" ; // (int) flag spezzatura archi (0=mai, 1=piani generici, 2=piani diversi da XY, 3=sempre)
static const std::string GVAR_NUM = ".NUM" ; // (bool) flag numerazione
static const std::string GVAR_NUMTOK = ".Nt" ; // (string) token per numerazione
static const std::string GVAR_LINENBR = ".LINENBR" ; // (int) numero progressivo di linea
static const std::string GVAR_LINEINC = ".LINEINC" ; // (int) incremento per numero di linea
static const std::string GVAR_F = ".F" ; // (num) valore della feed
static const std::string GVAR_FT = ".Ft" ; // (string) token per feed
static const std::string GVAR_S = ".S" ; // (num) valore della speed
static const std::string GVAR_ST = ".St" ; // (string) token per speed
static const std::string GVAR_MACHNAME = ".MACHNAME" ; // (string) nome macchina
static const std::string GVAR_FILE = ".FILE" ; // (string) path file di output
static const std::string GVAR_INFO = ".INFO" ; // (string) informazioni iniziali
static const std::string GVAR_SETUP = ".SETUP" ; // (bool) flag definizione setup
static const std::string GVAR_DISPID = ".DISPID" ; // (int) identificativo disposizione
static const std::string GVAR_DISPIND = ".DISPIND" ; // (int) indice disposizione
static const std::string GVAR_PHASE = ".PHASE" ; // (int) indice fase
static const std::string GVAR_EMPTY = ".EMPTY" ; // (bool) flag disposizione passiva
static const std::string GVAR_SBH = ".SBH" ; // (bool) flag disposizione con operazioni manuali
static const std::string GVAR_TABNAME = ".TABNAME" ; // (string) nome tavola
static const std::string GVAR_TABORI1 = ".TABORI1" ; // (Point3d) prima origine di tavola
static const std::string GVAR_TAIND = ".TAIND" ; // (int) indice asse tavola
static const std::string GVAR_TANAME = ".TANAME" ; // (string) nome asse tavola
static const std::string GVAR_TAPOS = ".TAPOS" ; // (double) posizione asse tavola
static const std::string GVAR_TAMOVED = ".TAMOVED" ; // (bool) flag asse tavola con movimento
static const std::string GVAR_FIXID = ".FIXID" ; // (int) identificativo bloccaggio (fixture)
static const std::string GVAR_FIXIND = ".FIXIND" ; // (int) indice bloccaggio
static const std::string GVAR_FIXNAME = ".FIXNAME" ; // (string) nome bloccaggio
static const std::string GVAR_FIXPOS = ".FIXPOS" ; // (Point3d) posizione bloccaggio
static const std::string GVAR_FIXANG = ".FIXANG" ; // (num) angolo di rotazione bloccaggio
static const std::string GVAR_FIXMOB = ".FIXMOB" ; // (num) movimento eventuale parte mobile del bloccaggio
static const std::string GVAR_FIXTAL = ".FIXTAL" ; // (string) nome dell'asse di tavola a cui è fissato
static const std::string GVAR_RAWID = ".RAWID" ; // (int) identificativo grezzo
static const std::string GVAR_RAWIND = ".RAWIND" ; // (int) indice movimento del grezzo
static const std::string GVAR_RAWTYPE = ".RAWTYPE" ; // (int) tipo di movimento del grezzo
static const std::string GVAR_RAWPOS = ".RAWPOS" ; // (Point3d) posizione di movimento del grezzo
static const std::string GVAR_RAWFLAG = ".RAWFLAG" ; // (int) flag per movimento del grezzo
static const std::string GVAR_TOOL = ".TOOL" ; // (string) nome utensile
static const std::string GVAR_HEAD = ".HEAD" ; // (string) nome testa
static const std::string GVAR_EXIT = ".EXIT" ; // (int) indice uscita
static const std::string GVAR_TCPOS = ".TCPOS" ; // (string) eventuale posizione utensile nel TC
static const std::string GVAR_TTYPE = ".TTYPE" ; // (int) tipo utensile
static const std::string GVAR_TFLOAT = ".TFLOAT" ; // (bool) flag per utensile flottante
static const std::string GVAR_TCOMP = ".TCOMP" ; // (int) numero correttore utensile
static const std::string GVAR_TDIAM = ".TDIAM" ; // (num) diametro utensile
static const std::string GVAR_TTOTDIAM = ".TTOTDIAM" ; // (num) diametro totale utensile
static const std::string GVAR_TLEN = ".TLEN" ; // (num) lunghezza utensile
static const std::string GVAR_TTOTLEN = ".TTOTLEN" ; // (num) lunghezza totale utensile
static const std::string GVAR_TDIST = ".TDIST" ; // (num) distanza utensile (per mortasatrice/sega a catena)
static const std::string GVAR_TUSED = ".TUSED" ; // (bool) flag per indicare che l'utensile attrezzato è anche utilizzato
static const std::string GVAR_SMAX = ".SMAX" ; // (num) massima speed utensile
static const std::string GVAR_FIRST = ".FIRST" ; // (bool) flag per primo utensile
static const std::string GVAR_NEXTTOOL = ".NEXTTOOL" ; // (string) nome del prossimo utensile
static const std::string GVAR_NEXTHEAD = ".NEXTHEAD" ; // (string) nome testa del prossimo utensile
static const std::string GVAR_NEXTEXIT = ".NEXTEXIT" ; // (int) indice uscita su testa del prox utensile
static const std::string GVAR_NEXTTCPOS = ".NEXTTCPOS" ; // (string) eventuale posizione del prox utensile nel TC
static const std::string GVAR_MCHID = ".MCHID" ; // (int) identificativo lavorazione
static const std::string GVAR_MCHIND = ".MCHIND" ; // (int) indice lavorazione
static const std::string GVAR_MMIN = ".MMIN" ; // (Point3d) punto minimo di ingombro della lavorazione
static const std::string GVAR_MMAX = ".MMAX" ; // (Point3d) punto massimo di ingombro della lavorazione
static const std::string GVAR_MAXMIN = ".MAXMIN" ; // (double/s) minimo di ingombro degli assi della lavorazione
static const std::string GVAR_MAXMAX = ".MAXMAX" ; // (double/s) massimo di ingombro degli assi della lavorazione
static const std::string GVAR_PATHID = ".PATHID" ; // (int) identificativo percorso di lavorazione
static const std::string GVAR_PATHIND = ".PATHIND" ; // (int) indice percorso di lavorazione
static const std::string GVAR_START = ".START" ; // (Point3d) punto iniziale del percorso originale
static const std::string GVAR_END = ".END" ; // (Point3d) punto finale del percorso originale
static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d)versore estrusione
static const std::string GVAR_PMIN = ".PMIN" ; // (Point3d) punto minimo di ingombro del percorso di lavorazione
static const std::string GVAR_PMAX = ".PMAX" ; // (Point3d) punto massimo di ingombro del percorso di lavorazione
static const std::string GVAR_PATHID = ".PATHID" ; // (int) identificativo percorso di lavorazione
static const std::string GVAR_PATHIND = ".PATHIND" ; // (int) indice percorso di lavorazione
static const std::string GVAR_START = ".START" ; // (Point3d) punto iniziale del percorso originale
static const std::string GVAR_END = ".END" ; // (Point3d) punto finale del percorso originale
static const std::string GVAR_EXTR = ".EXTR" ; // (Vector3d) versore estrusione
static const std::string GVAR_PMIN = ".PMIN" ; // (Point3d) punto minimo di ingombro del percorso di lavorazione
static const std::string GVAR_PMAX = ".PMAX" ; // (Point3d) punto massimo di ingombro del percorso di lavorazione
static const std::string GVAR_PAXMIN = ".PAXMIN" ; // (double/s) minimo di ingombro degli assi del percorso di lavorazione
static const std::string GVAR_PAXMAX = ".PAXMAX" ; // (double/s) massimo di ingombro degli assi del percorso di lavorazione
static const std::string GVAR_ELEV = ".ELEV" ; // (double) massima elevazione
static const std::string GVAR_AUXTOT = ".AUXTOT" ; // (int) numero totale dati ausiliari inizio/fine percorso di lavorazione
static const std::string GVAR_AUXIND = ".AUXIND" ; // (int) indice dato ausiliario inizio/fine percorso di lavorazione
static const std::string GVAR_AUX = ".AUX" ; // (string) dato ausiliario inizio/fine percorso di lavorazione
static const std::string GVAR_MOVEID = ".MOVEID" ; // (int) identificativo movimento
static const std::string GVAR_MOVEIND = ".MOVEIND" ; // (int) indice movimento
static const std::string GVAR_MOVE = ".MOVE" ; // (int) tipo di movimento (0,1,2,3)
static const std::string GVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
static const std::string GVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
static const std::string GVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
static const std::string GVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
static const std::string GVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
static const std::string GVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
static const std::string GVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
static const std::string GVAR_C1 = ".C1" ; // (num) valore del primo asse lineare per centro arco
static const std::string GVAR_C2 = ".C2" ; // (num) valore del secondo asse lineare per centro arco
static const std::string GVAR_C3 = ".C3" ; // (num) valore del terzo asse lineare per centro arco
static const std::string GVAR_M1 = ".M1" ; // (num) valore del primo asse lineare per punto medio arco
static const std::string GVAR_M2 = ".M2" ; // (num) valore del secondo asse lineare per punto medio arco
static const std::string GVAR_M3 = ".M3" ; // (num) valore del terzo asse lineare per punto medio arco
static const std::string GVAR_RR = ".RR" ; // (num) valore raggio per arco
static const std::string GVAR_AC = ".AC" ; // (num) valore angolo al centro per arco
static const std::string GVAR_L1P = ".L1p" ; // (num) valore precedente del primo asse lineare
static const std::string GVAR_L2P = ".L2p" ; // (num) valore precedente del secondo asse lineare
static const std::string GVAR_L3P = ".L3p" ; // (num) valore precedente del terzo asse lineare
static const std::string GVAR_R1P = ".R1p" ; // (num) valore precedente del primo asse rotante
static const std::string GVAR_R2P = ".R2p" ; // (num) valore precedente del secondo asse rotante
static const std::string GVAR_R3P = ".R3p" ; // (num) valore precedente del terzo asse rotante
static const std::string GVAR_R4P = ".R4p" ; // (num) valore precedente del quarto asse rotante
static const std::string GVAR_L1T = ".L1t" ; // (string) token del primo asse lineare
static const std::string GVAR_L2T = ".L2t" ; // (string) token del secondo asse lineare
static const std::string GVAR_L3T = ".L3t" ; // (string) token del terzo asse lineare
static const std::string GVAR_R1T = ".R1t" ; // (string) token del primo asse rotante
static const std::string GVAR_R2T = ".R2t" ; // (string) token del secondo asse rotante
static const std::string GVAR_R3T = ".R3t" ; // (string) token del terzo asse rotante
static const std::string GVAR_R4T = ".R4t" ; // (string) token del quarto asse rotante
static const std::string GVAR_C1T = ".C1t" ; // (string) token del primo asse lineare per centro arco
static const std::string GVAR_C2T = ".C2t" ; // (string) token del secondo asse lineare per centro arco
static const std::string GVAR_C3T = ".C3t" ; // (string) token del terzo asse lineare per centro arco
static const std::string GVAR_M1T = ".M1t" ; // (string) token del primo asse lineare per punto medio arco
static const std::string GVAR_M2T = ".M2t" ; // (string) token del secondo asse lineare per punto medio arco
static const std::string GVAR_M3T = ".M3t" ; // (string) token del terzo asse lineare per punto medio arco
static const std::string GVAR_RRT = ".RRt" ; // (string) token del raggio per arco
static const std::string GVAR_L1N = ".L1n" ; // (string) nome del primo asse lineare
static const std::string GVAR_L2N = ".L2n" ; // (string) nome del secondo asse lineare
static const std::string GVAR_L3N = ".L3n" ; // (string) nome del terzo asse lineare
static const std::string GVAR_R1N = ".R1n" ; // (string) nome del primo asse rotante
static const std::string GVAR_R2N = ".R2n" ; // (string) nome del secondo asse rotante
static const std::string GVAR_R3N = ".R3n" ; // (string) nome del terzo asse rotante
static const std::string GVAR_R4N = ".R4n" ; // (string) nome del quarto asse rotante
static const std::string GVAR_MASK = ".MASK" ; // (int) mask associato ai movimenti in rapido
static const std::string GVAR_FLAG = ".FLAG" ; // (int) flag associato ad ogni movimento
static const std::string GVAR_FLAG2 = ".FLAG2" ; // (int) secondo flag associato ad ogni movimento
static const std::string GVAR_INDEX = ".IDX" ; // (int) indice associato ad ogni movimento
static const std::string GVAR_TDIR = ".TDIR" ; // (Vector3d)versore utensile nel riferimento pezzo
static const std::string GVAR_CDIR = ".CDIR" ; // (Vector3d)versore correzione nel riferimento pezzo
static const std::string GVAR_ADIR = ".ADIR" ; // (Vector3d)versore ausiliario nel riferimento pezzo
static const std::string GVAR_ENABAXES = ".EnabAxes" ; // (bool) flag abilitazione assi attivi per simulazione
static const std::string GVAR_SHOWAXES = ".ShowAxes" ; // (bool) flag visualizzazione assi attivi per simulazione
static const std::string GVAR_AUXAXES = ".AuxAxes" ; // (int) numero assi ausiliari per simulazione
static const std::string GVAR_AN = ".AN" ; // (num) valore del N-esimo asse ausiliario per simulazione
static const std::string GVAR_ANN = ".ANn" ; // (string) nome del N-esimo asse ausiliario per simulazione
static const std::string GVAR_VMILL = ".VMILL" ; // (int/s) identificativi Zmap attivi per Virtual Milling
static const std::string GVAR_CODET = ".CODET" ; // (int/s) identificativi Zmap attivi per Collision Detection
static const std::string GVAR_SIM1ST = ".SIM1ST" ; // (bool) flag inizio simulazione
static const std::string GVAR_SIMSTEP = ".SIMSTEP" ; // (num) step di movimento durante la simulazione
static const std::string GVAR_SIMUISTAT = ".SIMUISTAT" ; // (num) stato simulazione imposto da utente
static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza di sicurezza per verifica di collisione
static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione
static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione
static const std::string GVAR_ELEV = ".ELEV" ; // (double) massima elevazione
static const std::string GVAR_DRACEX = ".DRACEX" ; // (int/s) vettore delle uscite selezionate (per gruppi a forare)
static const std::string GVAR_AUXTOT = ".AUXTOT" ; // (int) numero totale dati ausiliari inizio/fine percorso di lavorazione
static const std::string GVAR_AUXIND = ".AUXIND" ; // (int) indice dato ausiliario inizio/fine percorso di lavorazione
static const std::string GVAR_AUX = ".AUX" ; // (string) dato ausiliario inizio/fine percorso di lavorazione
static const std::string GVAR_MOVEID = ".MOVEID" ; // (int) identificativo movimento
static const std::string GVAR_MOVEIND = ".MOVEIND" ; // (int) indice movimento
static const std::string GVAR_MOVE = ".MOVE" ; // (int) tipo di movimento (0,1,2,3)
static const std::string GVAR_L1 = ".L1" ; // (num) valore del primo asse lineare
static const std::string GVAR_L2 = ".L2" ; // (num) valore del secondo asse lineare
static const std::string GVAR_L3 = ".L3" ; // (num) valore del terzo asse lineare
static const std::string GVAR_R1 = ".R1" ; // (num) valore del primo asse rotante
static const std::string GVAR_R2 = ".R2" ; // (num) valore del secondo asse rotante
static const std::string GVAR_R3 = ".R3" ; // (num) valore del terzo asse rotante
static const std::string GVAR_R4 = ".R4" ; // (num) valore del quarto asse rotante
static const std::string GVAR_R5 = ".R5" ; // (num) valore del quinto asse rotante
static const std::string GVAR_R6 = ".R6" ; // (num) valore del sesto asse rotante
static const std::string GVAR_R7 = ".R7" ; // (num) valore del settimo asse rotante
static const std::string GVAR_C1 = ".C1" ; // (num) valore del primo asse lineare per centro arco
static const std::string GVAR_C2 = ".C2" ; // (num) valore del secondo asse lineare per centro arco
static const std::string GVAR_C3 = ".C3" ; // (num) valore del terzo asse lineare per centro arco
static const std::string GVAR_M1 = ".M1" ; // (num) valore del primo asse lineare per punto medio arco
static const std::string GVAR_M2 = ".M2" ; // (num) valore del secondo asse lineare per punto medio arco
static const std::string GVAR_M3 = ".M3" ; // (num) valore del terzo asse lineare per punto medio arco
static const std::string GVAR_RR = ".RR" ; // (num) valore raggio per arco
static const std::string GVAR_AC = ".AC" ; // (num) valore angolo al centro per arco
static const std::string GVAR_L1P = ".L1p" ; // (num) valore precedente del primo asse lineare
static const std::string GVAR_L2P = ".L2p" ; // (num) valore precedente del secondo asse lineare
static const std::string GVAR_L3P = ".L3p" ; // (num) valore precedente del terzo asse lineare
static const std::string GVAR_R1P = ".R1p" ; // (num) valore precedente del primo asse rotante
static const std::string GVAR_R2P = ".R2p" ; // (num) valore precedente del secondo asse rotante
static const std::string GVAR_R3P = ".R3p" ; // (num) valore precedente del terzo asse rotante
static const std::string GVAR_R4P = ".R4p" ; // (num) valore precedente del quarto asse rotante
static const std::string GVAR_R5P = ".R5p" ; // (num) valore precedente del quinto asse rotante
static const std::string GVAR_R6P = ".R6p" ; // (num) valore precedente del sesto asse rotante
static const std::string GVAR_R7P = ".R7p" ; // (num) valore precedente del settimo asse rotante
static const std::string GVAR_MOVESUCC = ".MOVESUCC" ; // (int) tipo del movimento successivo (0,1,2,3)
static const std::string GVAR_L1S = ".L1s" ; // (num) valore successivo del primo asse lineare
static const std::string GVAR_L2S = ".L2s" ; // (num) valore successivo del secondo asse lineare
static const std::string GVAR_L3S = ".L3s" ; // (num) valore successivo del terzo asse lineare
static const std::string GVAR_R1S = ".R1s" ; // (num) valore successivo del primo asse rotante
static const std::string GVAR_R2S = ".R2s" ; // (num) valore successivo del secondo asse rotante
static const std::string GVAR_R3S = ".R3s" ; // (num) valore successivo del terzo asse rotante
static const std::string GVAR_R4S = ".R4s" ; // (num) valore successivo del quarto asse rotante
static const std::string GVAR_R5S = ".R5s" ; // (num) valore successivo del quinto asse rotante
static const std::string GVAR_R6S = ".R6s" ; // (num) valore successivo del sesto asse rotante
static const std::string GVAR_R7S = ".R7s" ; // (num) valore successivo del settimo asse rotante
static const std::string GVAR_L1T = ".L1t" ; // (string) token del primo asse lineare
static const std::string GVAR_L2T = ".L2t" ; // (string) token del secondo asse lineare
static const std::string GVAR_L3T = ".L3t" ; // (string) token del terzo asse lineare
static const std::string GVAR_R1T = ".R1t" ; // (string) token del primo asse rotante
static const std::string GVAR_R2T = ".R2t" ; // (string) token del secondo asse rotante
static const std::string GVAR_R3T = ".R3t" ; // (string) token del terzo asse rotante
static const std::string GVAR_R4T = ".R4t" ; // (string) token del quarto asse rotante
static const std::string GVAR_R5T = ".R5t" ; // (string) token del quinto asse rotante
static const std::string GVAR_R6T = ".R6t" ; // (string) token del sesto asse rotante
static const std::string GVAR_R7T = ".R7t" ; // (string) token del settimo asse rotante
static const std::string GVAR_C1T = ".C1t" ; // (string) token del primo asse lineare per centro arco
static const std::string GVAR_C2T = ".C2t" ; // (string) token del secondo asse lineare per centro arco
static const std::string GVAR_C3T = ".C3t" ; // (string) token del terzo asse lineare per centro arco
static const std::string GVAR_M1T = ".M1t" ; // (string) token del primo asse lineare per punto medio arco
static const std::string GVAR_M2T = ".M2t" ; // (string) token del secondo asse lineare per punto medio arco
static const std::string GVAR_M3T = ".M3t" ; // (string) token del terzo asse lineare per punto medio arco
static const std::string GVAR_RRT = ".RRt" ; // (string) token del raggio per arco
static const std::string GVAR_L1N = ".L1n" ; // (string) nome del primo asse lineare
static const std::string GVAR_L2N = ".L2n" ; // (string) nome del secondo asse lineare
static const std::string GVAR_L3N = ".L3n" ; // (string) nome del terzo asse lineare
static const std::string GVAR_R1N = ".R1n" ; // (string) nome del primo asse rotante
static const std::string GVAR_R2N = ".R2n" ; // (string) nome del secondo asse rotante
static const std::string GVAR_R3N = ".R3n" ; // (string) nome del terzo asse rotante
static const std::string GVAR_R4N = ".R4n" ; // (string) nome del quarto asse rotante
static const std::string GVAR_R5N = ".R5n" ; // (string) nome del quinto asse rotante
static const std::string GVAR_R6N = ".R6n" ; // (string) nome del sesto asse rotante
static const std::string GVAR_R7N = ".R7n" ; // (string) nome del settimo asse rotante
static const std::string GVAR_MASK = ".MASK" ; // (int) mask associato ai movimenti in rapido
static const std::string GVAR_FLAG = ".FLAG" ; // (int) flag associato ad ogni movimento
static const std::string GVAR_FLAG2 = ".FLAG2" ; // (int) secondo flag associato ad ogni movimento
static const std::string GVAR_INDEX = ".IDX" ; // (int) indice associato ad ogni movimento
static const std::string GVAR_TDIR = ".TDIR" ; // (Vector3d) versore utensile nel riferimento pezzo
static const std::string GVAR_CDIR = ".CDIR" ; // (Vector3d) versore correzione nel riferimento pezzo
static const std::string GVAR_ADIR = ".ADIR" ; // (Vector3d) versore ausiliario nel riferimento pezzo
static const std::string GVAR_TDIRP = ".TDIRp" ; // (Vector3d) precedente versore utensile nel riferimento pezzo
static const std::string GVAR_ENABAXES = ".EnabAxes" ; // (bool) flag abilitazione assi attivi per simulazione
static const std::string GVAR_SHOWAXES = ".ShowAxes" ; // (bool) flag visualizzazione assi attivi per simulazione
static const std::string GVAR_AUXAXES = ".AuxAxes" ; // (int) numero assi ausiliari per simulazione
static const std::string GVAR_AN = ".AN" ; // (num) valore del N-esimo asse ausiliario per simulazione
static const std::string GVAR_ANN = ".ANn" ; // (string) nome del N-esimo asse ausiliario per simulazione
static const std::string GVAR_ANM = ".ANm" ; // (string) asse master del N-esimo asse ausiliario per simulazione
static const std::string GVAR_VMILL = ".VMILL" ; // (int/s) identificativi Zmap attivi per Virtual Milling
static const std::string GVAR_CODET = ".CODET" ; // (int/s) identificativi Zmap attivi per Collision Detection
static const std::string GVAR_SIM1ST = ".SIM1ST" ; // (bool) flag inizio simulazione
static const std::string GVAR_SIMSTEP = ".SIMSTEP" ; // (num) step di movimento durante la simulazione
static const std::string GVAR_SIMUISTAT = ".SIMUISTAT" ; // (num) stato simulazione imposto da utente
static const std::string GVAR_SAFEDIST = ".SAFEDIST" ; // (num) distanza di sicurezza per verifica di collisione
static const std::string GVAR_SIMVMID = ".SIMVMID" ; // (int) identificativo grezzo Vmill in collisione
static const std::string GVAR_SIMCOBIND = ".SIMCOBIND" ; // (int) indice oggetto in collisione
static const std::string GVAR_MPSIM = ".MPSIM" ; // (bool) flag simulazione multiprocesso
static const std::string GVAR_MPSEST = ".MPSEST" ; // (string) path del file di stima speciale per simulazione multiprocesso
static const std::string GVAR_RECORD = ".RECORD" ; // (bool) flag modalità registrazione comandi in simulazione
static const std::string GVAR_OPERID = ".OPERID" ; // (int/s) identificativi ordinati operazioni per simulazione multiprocesso
// Funzioni generazione
static const std::string ON_START = "OnStart" ;
static const std::string ON_END = "OnEnd" ;
@@ -166,6 +204,7 @@ static const std::string ON_TOOL_DATA = "OnToolData" ;
static const std::string ON_DISPOSITION_START = "OnDispositionStart" ;
static const std::string ON_DISPOSITION_END = "OnDispositionEnd" ;
static const std::string ON_TABLE_DATA = "OnTableData" ;
static const std::string ON_TABLE_AXIS_DATA = "OnTableAxisData" ;
static const std::string ON_FIXTURE_DATA = "OnFixtureData" ;
static const std::string ON_RAWMOVE_DATA = "OnRawMoveData" ;
static const std::string ON_TOOL_SELECT = "OnToolSelect" ;
@@ -188,6 +227,7 @@ static const std::string ON_ESTIM_TOOL_DATA = "OnEstimToolData" ;
static const std::string ON_ESTIM_DISPOSITION_START = "OnEstimDispositionStart" ;
static const std::string ON_ESTIM_DISPOSITION_END = "OnEstimDispositionEnd" ;
static const std::string ON_ESTIM_TABLE_DATA = "OnEstimTableData" ;
static const std::string ON_ESTIM_TABLE_AXIS_DATA = "OnEstimTableAxisData" ;
static const std::string ON_ESTIM_FIXTURE_DATA = "OnEstimFixtureData" ;
static const std::string ON_ESTIM_RAWMOVE_DATA = "OnEstimRawMoveData" ;
static const std::string ON_ESTIM_TOOL_SELECT = "OnEstimToolSelect" ;
@@ -202,6 +242,8 @@ static const std::string ON_ESTIM_RAPID = "OnEstimRapid" ;
static const std::string ON_ESTIM_LINEAR = "OnEstimLinear" ;
static const std::string ON_ESTIM_ARC = "OnEstimArc" ;
// Funzioni simulazione
static const std::string ON_SIMUL_INIT = "OnSimulInit" ;
static const std::string ON_SIMUL_EXIT = "OnSimulExit" ;
static const std::string ON_SIMUL_START = "OnSimulStart" ;
static const std::string ON_SIMUL_END = "OnSimulEnd" ;
static const std::string ON_SIMUL_DISPOSITION_STARTING = "OnSimulDispositionStarting" ;
@@ -223,64 +265,150 @@ static const std::string ON_RESET_MACHINE = "OnResetMachine" ;
//----------------------------------------------------------------------------
inline std::string
GetGlobVarAxisValue( int nAx, const std::string& sVar = GLOB_VAR)
GetGlobVarAxisValue( int nAx, const std::string& sVar = GLOB_VAR, bool bIsRobot = false)
{
switch ( nAx) {
case 1 : return ( sVar + GVAR_L1) ;
case 2 : return ( sVar + GVAR_L2) ;
case 3 : return ( sVar + GVAR_L3) ;
case 4 : return ( sVar + GVAR_R1) ;
case 5 : return ( sVar + GVAR_R2) ;
case 6 : return ( sVar + GVAR_R3) ;
case 7 : return ( sVar + GVAR_R4) ;
default : return "" ;
}
if ( ! bIsRobot) {
switch ( nAx) {
case 1 : return ( sVar + GVAR_L1) ;
case 2 : return ( sVar + GVAR_L2) ;
case 3 : return ( sVar + GVAR_L3) ;
case 4 : return ( sVar + GVAR_R1) ;
case 5 : return ( sVar + GVAR_R2) ;
case 6 : return ( sVar + GVAR_R3) ;
case 7 : return ( sVar + GVAR_R4) ;
default : return "" ;
}
}
else {
switch ( nAx) {
case 1 : return ( sVar + GVAR_R1) ;
case 2 : return ( sVar + GVAR_R2) ;
case 3 : return ( sVar + GVAR_R3) ;
case 4 : return ( sVar + GVAR_R4) ;
case 5 : return ( sVar + GVAR_R5) ;
case 6 : return ( sVar + GVAR_R6) ;
case 7 : return ( sVar + GVAR_R7) ;
default : return "" ;
}
}
}
//----------------------------------------------------------------------------
inline std::string
GetGlobVarAxisPrev( int nAx, const std::string& sVar = GLOB_VAR)
GetGlobVarAxisPrev( int nAx, const std::string& sVar = GLOB_VAR, bool bIsRobot = false)
{
switch ( nAx) {
case 1 : return ( sVar + GVAR_L1P) ;
case 2 : return ( sVar + GVAR_L2P) ;
case 3 : return ( sVar + GVAR_L3P) ;
case 4 : return ( sVar + GVAR_R1P) ;
case 5 : return ( sVar + GVAR_R2P) ;
case 6 : return ( sVar + GVAR_R3P) ;
case 7 : return ( sVar + GVAR_R4P) ;
default : return "" ;
}
if ( ! bIsRobot) {
switch ( nAx) {
case 1 : return ( sVar + GVAR_L1P) ;
case 2 : return ( sVar + GVAR_L2P) ;
case 3 : return ( sVar + GVAR_L3P) ;
case 4 : return ( sVar + GVAR_R1P) ;
case 5 : return ( sVar + GVAR_R2P) ;
case 6 : return ( sVar + GVAR_R3P) ;
case 7 : return ( sVar + GVAR_R4P) ;
default : return "" ;
}
}
else {
switch ( nAx) {
case 1 : return ( sVar + GVAR_R1P) ;
case 2 : return ( sVar + GVAR_R2P) ;
case 3 : return ( sVar + GVAR_R3P) ;
case 4 : return ( sVar + GVAR_R4P) ;
case 5 : return ( sVar + GVAR_R5P) ;
case 6 : return ( sVar + GVAR_R6P) ;
case 7 : return ( sVar + GVAR_R7P) ;
default : return "" ;
}
}
}
//----------------------------------------------------------------------------
inline std::string
GetGlobVarAxisToken( int nAx)
GetGlobVarAxisNext( int nAx, const std::string& sVar = GLOB_VAR, bool bIsRobot = false)
{
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_L1T) ;
case 2 : return ( GLOB_VAR + GVAR_L2T) ;
case 3 : return ( GLOB_VAR + GVAR_L3T) ;
case 4 : return ( GLOB_VAR + GVAR_R1T) ;
case 5 : return ( GLOB_VAR + GVAR_R2T) ;
case 6 : return ( GLOB_VAR + GVAR_R3T) ;
case 7 : return ( GLOB_VAR + GVAR_R4T) ;
default : return "" ;
}
if ( ! bIsRobot) {
switch ( nAx) {
case 1 : return ( sVar + GVAR_L1S) ;
case 2 : return ( sVar + GVAR_L2S) ;
case 3 : return ( sVar + GVAR_L3S) ;
case 4 : return ( sVar + GVAR_R1S) ;
case 5 : return ( sVar + GVAR_R2S) ;
case 6 : return ( sVar + GVAR_R3S) ;
case 7 : return ( sVar + GVAR_R4S) ;
default : return "" ;
}
}
else {
switch ( nAx) {
case 1 : return ( sVar + GVAR_R1S) ;
case 2 : return ( sVar + GVAR_R2S) ;
case 3 : return ( sVar + GVAR_R3S) ;
case 4 : return ( sVar + GVAR_R4S) ;
case 5 : return ( sVar + GVAR_R5S) ;
case 6 : return ( sVar + GVAR_R6S) ;
case 7 : return ( sVar + GVAR_R7S) ;
default : return "" ;
}
}
}
//----------------------------------------------------------------------------
inline std::string
GetGlobVarAxisName( int nAx)
GetGlobVarAxisToken( int nAx, bool bIsRobot = false)
{
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_L1N) ;
case 2 : return ( GLOB_VAR + GVAR_L2N) ;
case 3 : return ( GLOB_VAR + GVAR_L3N) ;
case 4 : return ( GLOB_VAR + GVAR_R1N) ;
case 5 : return ( GLOB_VAR + GVAR_R2N) ;
case 6 : return ( GLOB_VAR + GVAR_R3N) ;
case 7 : return ( GLOB_VAR + GVAR_R4N) ;
default : return "" ;
}
if ( ! bIsRobot) {
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_L1T) ;
case 2 : return ( GLOB_VAR + GVAR_L2T) ;
case 3 : return ( GLOB_VAR + GVAR_L3T) ;
case 4 : return ( GLOB_VAR + GVAR_R1T) ;
case 5 : return ( GLOB_VAR + GVAR_R2T) ;
case 6 : return ( GLOB_VAR + GVAR_R3T) ;
case 7 : return ( GLOB_VAR + GVAR_R4T) ;
default : return "" ;
}
}
else {
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_R1T) ;
case 2 : return ( GLOB_VAR + GVAR_R2T) ;
case 3 : return ( GLOB_VAR + GVAR_R3T) ;
case 4 : return ( GLOB_VAR + GVAR_R4T) ;
case 5 : return ( GLOB_VAR + GVAR_R5T) ;
case 6 : return ( GLOB_VAR + GVAR_R6T) ;
case 7 : return ( GLOB_VAR + GVAR_R7T) ;
default : return "" ;
}
}
}
//----------------------------------------------------------------------------
inline std::string
GetGlobVarAxisName( int nAx, bool bIsRobot = false)
{
if ( ! bIsRobot) {
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_L1N) ;
case 2 : return ( GLOB_VAR + GVAR_L2N) ;
case 3 : return ( GLOB_VAR + GVAR_L3N) ;
case 4 : return ( GLOB_VAR + GVAR_R1N) ;
case 5 : return ( GLOB_VAR + GVAR_R2N) ;
case 6 : return ( GLOB_VAR + GVAR_R3N) ;
case 7 : return ( GLOB_VAR + GVAR_R4N) ;
default : return "" ;
}
}
else {
switch ( nAx) {
case 1 : return ( GLOB_VAR + GVAR_R1N) ;
case 2 : return ( GLOB_VAR + GVAR_R2N) ;
case 3 : return ( GLOB_VAR + GVAR_R3N) ;
case 4 : return ( GLOB_VAR + GVAR_R4N) ;
case 5 : return ( GLOB_VAR + GVAR_R5N) ;
case 6 : return ( GLOB_VAR + GVAR_R6N) ;
case 7 : return ( GLOB_VAR + GVAR_R7N) ;
default : return "" ;
}
}
}
+2287 -539
View File
File diff suppressed because it is too large Load Diff
+52 -15
View File
@@ -17,6 +17,7 @@
#include "PocketingData.h"
#include "ToolData.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EgtNumUtils.h"
//----------------------------------------------------------------------------
@@ -67,49 +68,80 @@ class Pocketing : public Machining
private :
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
bool SetCurveAllTempProp( int nCrvId, ICurve* pCurve) ;
bool SetCurveAllTempProp( int nCrvId, bool bForcedClose, ICurve* pCurve, bool* pbSomeOpen = nullptr) ;
bool ResetCurveAllTempProp( ICurve* pCurve) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) const ;
bool CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double dLen, double& dElev) const ;
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
bool GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) ;
bool AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
double dDepth, double dElev, double dOkStep, bool bSplitArcs, int nPathId) ;
bool CalcZigZag( const ICurveComposite* pOffs, ICRVCOMPOPOVECTOR& vpCrvs) ;
bool OptimizedZigZag( int nPathId, const Vector3d& vtTool, double dDepth, double dSafeZ,
Frame3d& frPocket, bool& bOptimizedZigZag, ICRVCOMPOPOVECTOR& vpCrvs, double& dOffs) ;
bool ZigZagOptimizedNoClosedEdges( ICurveComposite* pCrvPocket, bool& bOptimizedZigZag, Vector3d& vtDir, double& dOffs) ;
bool ZigZagOptimizedOneClosedEdge( ICurveComposite* pCrvPocket, int nClosedId, bool& bOptimizedZigZag, Vector3d& vtDir, double& dOffs) ;
bool ZigZagOptimizedTwoClosedEdges( ICurveComposite* pCrvPocket, const INTVECTOR& vnClosedIds, bool& bOptimizedZigZag,
bool& bOpposite, Vector3d& vtDir, double& dOffs) ;
bool ZigZagOptimizedThreeClosedEdges( ICurveComposite* pCrvPocket, const INTVECTOR& vnClosedIds, bool& bOptimizedZigZag,
bool& bOpposite, Vector3d& vtDir, double& dOffs) ;
bool ZigZagOptimizedComputeOffset( ICurveComposite* pCrvPocket, const Vector3d& vtMainDir, int nOffsettedEdgesOnY,
const INTVECTOR& vnClosedIds, double& dOffs) ;
bool CutCurveWithLine( ICurveComposite* pCrvA, const ICurveLine* pCrvB) ;
bool AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
bool AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bMidOpen,
const Point3d& ptMidOpen, const Vector3d& vtMidOut) ;
const Point3d& ptMidOpen, const Vector3d& vtMidOut, int nPathId) ;
bool AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
bool CalcSpiral( const ICurveComposite* pCompo, int nReg, bool bSplitArcs,
ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
double dDepth, double dElev, double dOkStep, bool bSplitArcs, int nPathId) ;
bool CalcSpiral( const ICurveComposite* pCompo, int nReg, bool bSplitArcs,
ICurveComposite* pMCrv, ICurveComposite* pRCrv, int nPathId, bool& bOptimizedTrap) ;
bool CalcBoundedLink( const Point3d& ptStart, const Point3d& ptEnd, const ICurve* pCrvBound,
ICurveComposite* pCrvLink) ;
bool CalcBoundedLinkWithBiArcs( const Point3d& ptStart, const Vector3d& vtStart, const Point3d& ptEnd, const Vector3d& vtEnd,
const ICurve* pCrvBound, ICurveComposite* pCrvLink) ;
bool CalcCircleSpiral( const Point3d& ptCen, const Vector3d& vtN, double dOutRad, double dIntRad,
bool bSplitArcs, ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
bool CalcTrapezoidSpiral( ICurveComposite* pCrvPocket, const Vector3d& vtDir, double dPocketSize,
ICurveComposite* pMCrv, ICurveComposite* pRCrv, bool& bOptimizedTrap) ;
bool CalcTrapezoidSpiralLocalFrame( ICurveComposite * pCrvPocket, const Vector3d& vtDir, Frame3d& frLoc) ;
bool CalcTrapezoidSpiralXCoord( const ICurveComposite * pCrvPocket, bool bStart, double dYCoord, double& dXCoord, double dPocketSize) ;
bool AdjustTrapezoidSpiralForAngles( ICurveComposite * pMCrv, const ICurveComposite * pCrvPocket, bool bStart) ;
bool SpecialAdjustTrapezoidSpiralForAngles( ICurveComposite* pMCrv, const ICurveComposite* pCrvPocket) ;
bool AdjustTrapezoidSpiralForLeadInLeadOut( ICurveComposite * pCompo, ICurveComposite * pRCrv, const Vector3d& vtTool,
double dDepth, int& nOutsideRaw) ;
bool ComputeTrapezoidSpiralLeadInLeadOut( ICurveComposite * pCompo, const Vector3d& vtMainDir, bool bLeadIn, const Vector3d& vtTool, double dDepth, bool& bIsOutsideRaw) ;
bool ComputePolishingPath( ICurveComposite* pMCrv, ICurveComposite* pRCrv, bool bSplitArcs) ;
bool AddEpicycles( ICurveComposite * pCompo, ICurveComposite * pCrv, ICurveComposite * pCrvBound = nullptr) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bOutStart) ;
double dElev, double dAppr, bool bSplitArcs, bool bOutStart) ;
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr) ;
double dElev, double dAppr, bool bSplitArcs, bool bOutStart = false) ;
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr) ;
double dElev, double dAppr, bool bSplitArcs) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr) ;
double dElev, double dAppr, bool bSplitArcs) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
const ICurveComposite* pRCrv, Point3d& ptP1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
const ICurveComposite* pCompo, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs, bool bNoneForced = false) ;
const ICurveComposite* pCompo, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs,
bool bNoneForced = false, bool bSkipControl = false) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
const ICurveComposite* pRCrv, bool bSplitArcs, Point3d& ptP1, double& dElev, bool bNoneForced = false) ;
const ICurveComposite* pRCrv, bool bSplitArcs, bool bNoneForced,
Point3d& ptP1, double& dElev) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
const ICurveComposite* pRCrv, bool bSplitArcs, bool bNoneForced,
Point3d& ptP1, double& dElev, bool& bOppositeHome) ;
double GetRadiusForStartEndElevation( void) const ;
bool GetForcedClosed( void) ;
bool GetMidOfLongestOpenSide( const ICurveComposite* pCompo, Point3d& ptMid, Vector3d& vtMidOut) ;
bool AdjustContourWithOpenEdges( ICurveComposite* pCompo) ;
bool AdjustContourStart( ICurveComposite* pCompo) ;
bool VerifyLeadInHelix( const ICurveComposite* pCompo, const Point3d& ptCen, double dRad) const ;
bool VerifyLeadInZigZag( const ICurveComposite* pCompo, const Point3d& ptPa, const Point3d& ptPb) const ;
bool CalcDistanceFromRawSurface( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist, Vector3d& vtNorm) ;
private :
double GetSpeed( void) const
@@ -134,10 +166,11 @@ class Pocketing : public Machining
if ( m_Params.m_nLeadInType != POCKET_LI_GLIDE && m_Params.m_dLiElev < 10 * EPS_SMALL)
return POCKET_LI_NONE ;
return m_Params.m_nLeadInType ; }
int LeadInIsOk( void) const
bool LeadInRawIsOk( void) const
{ if ( m_TParams.m_nType != TT_MILL_NOTIP)
return true ;
return ( GetLeadInType() == POCKET_LI_HELIX && m_Params.m_dLiTang >= 0.49 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
return (( GetLeadInType() == POCKET_LI_ZIGZAG || GetLeadInType() == POCKET_LI_HELIX) &&
m_Params.m_dLiTang >= 0.9 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
int GetLeadOutType( void) const
{ if ( m_Params.m_dLoTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0))
return POCKET_LO_NONE ;
@@ -147,14 +180,18 @@ class Pocketing : public Machining
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
PocketingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
double m_dTHoldBase ; // posizione base del porta-utensile
double m_dTHoldLen ; // lunghezza del porta-utensile
double m_dTHoldDiam ; // diametro del porta-utensile
double m_dMaxHelixRad ; // raggio massimo attacco ad elica nel caso di cerchi
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nPockets ; // numero di percorsi di svuotatura generati
bool m_bTiltingTab ; // flag utilizzo tavola basculante
Vector3d m_vtTiltingAx ; // versore direzione eventuale asse basculante
bool m_bAboveHead ; // flag utilizzo testa da sopra
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
bool m_bOpenOutRaw ; // flag forzatura lati aperti sempre fuori dal grezzo
double m_dOpenMinSafe ; // minima distanza di sicurezza di attacco su lato aperto
} ;
+16 -2
View File
@@ -29,6 +29,8 @@ enum nPocketingKey {
KEY_AB = 0,
KEY_AI,
KEY_DH,
KEY_EPCD,
KEY_EPCR,
KEY_F,
KEY_FE,
KEY_FS,
@@ -61,6 +63,8 @@ static const array<string,KEY_ZZZ> sPocketingKey = {
"AB",
"AI",
"DH",
"EPCD",
"EPCR",
"F",
"FE",
"FS",
@@ -241,6 +245,12 @@ PocketingData::FromString( const string& sString, int& nKey)
if ( m_sDepth.empty())
m_sDepth = "0" ;
break ;
case KEY_EPCD :
bOk = ::FromString( sVal, m_dEpicyclesDist) ;
break ;
case KEY_EPCR :
bOk = ::FromString( sVal, m_dEpicyclesRad) ;
break ;
case KEY_F :
bOk = ::FromString( sVal, m_dFeed) ;
break ;
@@ -335,6 +345,8 @@ PocketingData::ToString( int nInd) const
case KEY_AB : return ( sPocketingKey[KEY_AB] + "=" + m_sBlockedAxis) ;
case KEY_AI : return ( sPocketingKey[KEY_AI] + "=" + m_sInitAngs) ;
case KEY_DH : return ( sPocketingKey[KEY_DH] + "=" + m_sDepth) ;
case KEY_EPCD : return ( m_dEpicyclesRad < EPS_SMALL ? "" : sPocketingKey[KEY_EPCD] + "=" + ::ToString( m_dEpicyclesDist)) ;
case KEY_EPCR : return ( m_dEpicyclesRad < EPS_SMALL ? "" : sPocketingKey[KEY_EPCR] + "=" + ::ToString( m_dEpicyclesRad)) ;
case KEY_F : return ( sPocketingKey[KEY_F] + "=" + ::ToString( m_dFeed)) ;
case KEY_FE : return ( sPocketingKey[KEY_FE] + "=" + ::ToString( m_dEndFeed)) ;
case KEY_FS : return ( sPocketingKey[KEY_FS] + "=" + ::ToString( m_dStartFeed)) ;
@@ -369,7 +381,8 @@ PocketingData::ToString( int nInd) const
bool
PocketingData::IsOptional( int nKey) const
{
return ( nKey == KEY_AB || nKey == KEY_AI || nKey == KEY_LIEL || nKey == KEY_TI) ;
return ( nKey == KEY_AB || nKey == KEY_AI || nKey == KEY_EPCD || nKey == KEY_EPCR ||
nKey == KEY_LIEL || nKey == KEY_TI) ;
}
//----------------------------------------------------------------------------
@@ -384,7 +397,8 @@ bool
PocketingData::VerifySubType( int nVal) const
{
return ( nVal == POCKET_SUB_ZIGZAG || nVal == POCKET_SUB_ONEWAY ||
nVal == POCKET_SUB_SPIRALIN || nVal == POCKET_SUB_SPIRALOUT) ;
nVal == POCKET_SUB_SPIRALIN || nVal == POCKET_SUB_SPIRALOUT ||
nVal == POCKET_SUB_CONFORMAL_ZIGZAG || nVal == POCKET_SUB_CONFORMAL_ONEWAY) ;
}
//----------------------------------------------------------------------------
+9 -3
View File
@@ -43,6 +43,8 @@ struct PocketingData : public MachiningData
double m_dLiElev ; // elevazione di uno step di attacco
int m_nLeadOutType ; // tipo di uscita (come attacco, nessuno, lineare, tangente, inseguimento)
double m_dLoTang ; // distanza tangente verso fine uscita
double m_dEpicyclesRad ; // raggio epicicli lucidatura
double m_dEpicyclesDist ; // distanza epicicli lucidatura
std::string m_sSysNotes ; // note interne
std::string m_sUserNotes ; // note dell'utente
@@ -51,7 +53,7 @@ struct PocketingData : public MachiningData
m_dOffsR( UNKNOWN_PAR), m_dOffsL( UNKNOWN_PAR), m_bToolInvert( false), m_bInvert( false),
m_dStartPos( 0), m_dStep( 0), m_dSideStep( 0), m_nSubType( 0), m_dSideAngle( 0),
m_nLeadInType( 0), m_dLiTang( 0), m_dLiElev( 0),
m_nLeadOutType( 0), m_dLoTang( 0) {}
m_nLeadOutType( 0), m_dLoTang( 0), m_dEpicyclesRad( 0), m_dEpicyclesDist( 0) {}
PocketingData* Clone( void) const override ;
bool CopyFrom( const MachiningData* pMdata) override ;
bool SameAs(const MachiningData* pMdata) const override ;
@@ -81,6 +83,10 @@ struct PocketingData : public MachiningData
//----------------------------------------------------------------------------
inline const PocketingData* GetPocketingData( const MachiningData* pMdata)
{ return (dynamic_cast<const PocketingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_POCKETING)
return nullptr ;
return ( static_cast<const PocketingData*>( pMdata)) ; }
inline PocketingData* GetPocketingData( MachiningData* pMdata)
{ return (dynamic_cast<PocketingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_POCKETING)
return nullptr ;
return ( static_cast<PocketingData*>( pMdata)) ; }
+3969
View File
File diff suppressed because it is too large Load Diff
+198
View File
@@ -0,0 +1,198 @@
//----------------------------------------------------------------------------
// EgalTech 2017-2017
//----------------------------------------------------------------------------
// File :Pocketing.h Data : 04.02.17 Versione : 1.8b1
// Contenuto : Dichiarazione della classe Pocketing.
//
//
//
// Modifiche : 04.02.17 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "PocketingData.h"
#include "ToolData.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EGkIntersPlaneSurfTm.h"
// struttura informazioni sui singoli percorsi
struct PathInfoPO {
bool bOutStart ; // flag per entrata da fuori
bool bSingleCrv ; // se percorso formato da una curva singola ( in generale per SubSteps)
bool bOptTrap ; // flag per casi ottimizzati a trapezio ( per Spiral)
bool bIsZigZagOneWayBorder ; // curve di bordo dei lati chiusi ( per ZigZag e OneWay)
PtrOwner<ICurveComposite> pCrvPath ; // percorso del centro utensile
PtrOwner<ICurveComposite> pCrvRet ; // curva di ritorno per LeadIn/Out a guida
} ;
// tipo percorso
typedef std::vector<PathInfoPO> PATHINFOPOVECTOR ;
// struttura informazioni per Step/SubSteps complessivi
struct StepInfoPO {
double dDepth ; // profondità dello step attuale
double dRelativeDepth ; // profondità relativa allo step al di sopra
PtrOwner<ISurfFlatRegion> pSfrPock ; // regione piana di svuotatura
PtrOwner<ISurfFlatRegion> pSfrLimit ; // regione piana da non svuotare
PATHINFOPOVECTOR vPaths ; // percorsi di Pocketing
} ;
// tipo step
typedef std::vector<StepInfoPO> STEPINFOPOVECTOR ;
//----------------------------------------------------------------------------
class PocketingNT : public Machining
{
public : // IUserObj
PocketingNT* Clone( void) const override ;
const std::string& GetClassName( void) const override ;
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
bool ToSave( void) const override
{ return true ; }
bool Save( int nBaseId, STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
int GetType( void) const override
{ return OPER_POCKETING ; }
bool IsEmpty( void) const override
{ return ( m_nPockets == 0) ; }
bool UpdateStatus( int nModif) override
{ m_nStatus |= nModif ; return true ; }
protected : // Operation
int GetSolCh( void) const override
{ return m_Params.m_nSolCh ; }
public : // Machining
bool Prepare( const std::string& sMillName) override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool SetGeometry( const SELVECTOR& vIds) override ;
bool Preview( bool bRecalc) override ;
bool Apply( bool bRecalc, bool bPostApply) override ;
bool Update( bool bPostApply) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
bool UpdateToolData( bool* pbChanged = nullptr) override ;
const ToolData& GetToolData( void) const override ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
PocketingNT( void) ;
private :
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
bool SetCurveAllTempProp( int nCrvId, bool bForcedClose, ICurve* pCurve, bool* pbSomeOpen = nullptr) ;
bool SetSfrLoopsAllTempProp( int nSfrId, ISurfFlatRegion* pSfr) ;
bool ResetCurveAllTempProp( ICurve* pCurve) ;
bool Chain( int nGrpDestId) ;
ISurfTriMesh* GetRaw( void) ;
ISurfTriMesh* GetExtrusionStm( const ISurfFlatRegion* pSfr, const Vector3d& vtTrasl, const Vector3d& vtExtr) ;
ISurfFlatRegion* GetSfrByStmIntersection( const IntersParPlanesSurfTm& IPPStm, double dDist, double dSmallOffs = 0) ;
bool ChooseCloseOrOpenEdge( ISurfFlatRegion* pSfr, const ISurfTriMesh* pStmExtrusion) ;
bool CalcLimitRegion( const ISurfFlatRegion* pSfrPock, const ISurfFlatRegion* pSfrRaw, ISurfFlatRegion* pSfrLimit) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double dLen, double& dElev) ;
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
bool GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) ;
bool CalcPaths( STEPINFOPOVECTOR& vStepInfo) ;
bool AddPocket( STEPINFOPOVECTOR& vStepInfo, const Vector3d& vtTool, double dElev, double dStep, bool bSplitArcs) ;
double GetRightFeed( const Vector3d& vtMove, const Vector3d& vtTool) ;
bool CutCurveWithLine( ICurveComposite* pCrvA, const ICurveLine* pCrvB) ;
bool ComputePolishingPath( ICurveComposite* pMCrv, ICurveComposite* pRCrv, bool bSplitArcs) ;
bool AddEpicycles( ICurveComposite * pCompo, ICurveComposite * pCrv, ICurveComposite * pCrvBound = nullptr) ;
bool CalcBoundedLinkWithBiArcs( const Point3d& ptStart, const Vector3d& vtStart, const Point3d& ptEnd, const Vector3d& vtEnd,
const ICurve* pCrvBound, ICurveComposite* pCrvLink) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bSplitArcs, bool bOutStart) ;
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bSplitArcs, bool bOutStart = false) ;
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bSplitArcs) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bSplitArcs) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtTool, const ICurveComposite* pCrvPath, Point3d& ptP1) ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
const ISurfFlatRegion* pSfr, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs,
bool bNoneForced, bool bSkipControl) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
const ICurveComposite* pRCrv, bool bSplitArcs, bool bNoneForced, Point3d& ptP1) ;
double GetRadiusForStartEndElevation( void) ;
bool GetForcedClosed( void) ;
bool GetMidOfLongestOpenSide( const ICurveComposite* pCompo, Point3d& ptMid, Vector3d& vtMidOut) ;
bool AdjustContourWithOpenEdges( ICurveComposite* pCompo) ;
bool AdjustContourStart( ICurveComposite* pCompo) ;
bool CheckSafetyLinearLink( const Point3d& ptCurr, const ISurfFlatRegion* pSfrLimit, const Vector3d& vtTool,
const Point3d& ptDest, bool& bSafe) ;
bool VerifyLeadInHelix( const ISurfFlatRegion* pSfr, const Point3d& ptStart, const Point3d& ptCen, double dHelixRad) ;
bool VerifyLeadInZigZag( const ISurfFlatRegion* pSfr, const Point3d& ptStart, const Point3d& ptPa, const Point3d& ptPb) ;
bool CalcDistanceFromRawSurface( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist, Vector3d& vtNorm) ;
// debug
void _debug_draw_sfr( const ISurfFlatRegion* pSfr, bool bUniform) ;
void _debug_draw_loop( const ICurveComposite* pCrvCompo, bool bUniform) ;
private :
double GetSpeed( void) const
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
double GetFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetStartFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
double GetEndFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetOffsL( void) const
{ return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetOffsR( void) const
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
double GetSideStep( void) const
{ return Clamp( m_Params.m_dSideStep, std::min( 0.1 * m_TParams.m_dDiam, 1.0), m_TParams.m_dDiam) ; }
int GetLeadInType( void) const
{ if ( m_Params.m_dLiTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0))
return POCKET_LI_NONE ;
if ( m_Params.m_nLeadInType != POCKET_LI_GLIDE && m_Params.m_dLiElev < 10 * EPS_SMALL)
return POCKET_LI_NONE ;
return m_Params.m_nLeadInType ; }
bool LeadInRawIsOk( void) const
{ if ( m_TParams.m_nType != TT_MILL_NOTIP)
return true ;
return (( GetLeadInType() == POCKET_LI_ZIGZAG || GetLeadInType() == POCKET_LI_HELIX) &&
m_Params.m_dLiTang >= 0.9 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
int GetLeadOutType( void) const
{ if ( m_Params.m_dLoTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0))
return POCKET_LO_NONE ;
return m_Params.m_nLeadOutType ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
PocketingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
double m_dTHoldBase ; // posizione base del porta-utensile
double m_dTHoldLen ; // lunghezza del porta-utensile
double m_dTHoldDiam ; // diametro del porta-utensile
double m_dMaxHelixRad ; // raggio massimo attacco ad elica nel caso di cerchi
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nPockets ; // numero di percorsi di svuotatura generati
bool m_bTiltingTab ; // flag utilizzo tavola basculante
Vector3d m_vtTiltingAx ; // versore direzione eventuale asse basculante
bool m_bAboveHead ; // flag utilizzo testa da sopra
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
bool m_bOpenOutRaw ; // flag forzatura lati aperti sempre fuori dal grezzo
double m_dOpenMinSafe ; // minima distanza di sicurezza di attacco su lato aperto
bool _m_Debug = false ; // _debug
} ;
+186 -46
View File
@@ -84,6 +84,9 @@ Processor::Run( const string& sOutFile, const string& sInfo)
if ( ! VerifySetup())
return false ;
// imposto la fase iniziale come corrente
m_pMchMgr->SetCurrPhase( 1) ;
// evento inizio esecuzione
bool bOk = true ;
if ( ! OnStart()) {
@@ -145,6 +148,9 @@ Processor::Run( const string& sOutFile, const string& sInfo)
LOG_ERROR( GetEMkLogger(), "OnEnd error") ;
}
// imposto la fase iniziale come corrente
m_pMchMgr->SetCurrPhase( 1) ;
return bOk ;
}
@@ -165,7 +171,7 @@ Processor::VerifySetup( void)
string sErr = "Error with setup :" ;
for ( const auto& sTmp : vsErr)
sErr += " " + sTmp ;
m_pMchMgr->SetLastError( 1001, sErr) ;
m_pMchMgr->SetLastError( 1002, sErr) ;
return false ;
}
@@ -184,8 +190,8 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
bool bEmpty = pDisp->IsEmpty() ;
bool bSomeByHand = pDisp->GetSomeByHand() ;
// Se disposizione con movimenti macchina
if ( ! pDisp->IsEmpty()) {
// Se disposizione con movimenti autonomi e utensile associato
if ( ! pDisp->IsEmpty() && pDisp->IsWithTool()) {
// Recupero l'utensile della disposizione corrente
string sTool ; string sHead ; int nExit ; string sTcPos ;
if ( ! pDisp->GetToolData( sTool, sHead, nExit, sTcPos))
@@ -201,7 +207,7 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
return false ;
// Se utensile non definito o cambiato, emetto selezione nuovo utensile
if ( m_sTool.empty() || m_sTool != m_sPrevTool) {
if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos))
if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos, false))
return false ;
}
}
@@ -218,6 +224,38 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
if ( ! OnTableData( sTable, ptOri1))
return false ;
// Recupero assi tavola mossi nella disposizione
INTVECTOR vMovAxId ;
for ( int i = 0 ; ; ++ i) {
string sName ;
double dPos ;
if ( pDisp->GetMoveAxisData( i, sName, dPos)) {
int nAxId = m_pMachine->GetAxisId( sName) ;
if ( nAxId != GDB_ID_NULL)
vMovAxId.emplace_back( nAxId) ;
}
else
break ;
}
// Emetto posizioni assi di tavola
INTVECTOR vAxisId ;
m_pMachine->GetAllAxesIds( vAxisId) ;
int nTableId = m_pMachine->GetTableId( sTable) ;
int nInd = 0 ;
for ( int nAxId : vAxisId) {
string sName ;
double dPos ;
if ( m_pMachine->IsDispositionAxis( nAxId, nTableId) &&
m_pMachine->GetAxisName( nAxId, sName) &&
m_pMachine->GetAxisPos( sName, dPos)) {
++ nInd ;
bool bMoved = ( std::find( vMovAxId.begin(), vMovAxId.end(), nAxId) != vMovAxId.end()) ;
if ( ! OnTableAxisData( nInd, sName, dPos, bMoved))
return false ;
}
}
// Emetto dati bloccaggi
for ( int i = 0 ; ; ++ i) {
string sName ;
@@ -225,8 +263,9 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
Point3d ptPos ;
double dAngDeg ;
double dMov ;
if ( pDisp->GetFixtureData( i, sName, nId, ptPos, dAngDeg, dMov)) {
if ( ! OnFixtureData( nId, i + 1, sName, ptPos, dAngDeg, dMov))
string sTaLink ;
if ( pDisp->GetFixtureData( i, sName, nId, ptPos, dAngDeg, dMov, sTaLink)) {
if ( ! OnFixtureData( nId, i + 1, sName, ptPos, dAngDeg, dMov, sTaLink))
return false ;
}
else
@@ -240,7 +279,7 @@ Processor::ProcessDisposition( int nOpId, int nOpInd)
Point3d ptPos ;
int nFlag ;
if ( pDisp->GetMoveRawData( i, nRawId, nType, ptPos, nFlag)) {
if ( ! OnRawMoveData( nRawId, i + 1, nType, ptPos, nFlag))
if ( ! OnRawMoveData( nRawId, i + 1, nType, ptPos, nFlag))
return false ;
}
else
@@ -316,7 +355,8 @@ Processor::ProcessMachining( int nOpId, int nOpInd)
m_pMchMgr->TdbGetCurrToolParam( TPA_EXIT, nExit) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TCPOS, sTcPos) ;
}
if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos))
bool bFloating = m_pMachine->IsCurrToolFloating() ;
if ( ! OnToolSelect( sTool, sHead, nExit, sTcPos, bFloating))
return false ;
}
@@ -380,11 +420,15 @@ Processor::ProcessClPath( int nClPathId, int nClPathInd, int nOpId, int nOpInd)
// Recupero massima elevazione
double dElev = 0 ;
m_pGeomDB->GetInfo( nClPathId, KEY_ELEV, dElev) ;
// recupero eventuale attivazione uscite (gruppi a forare)
INTVECTOR vActiveExit ;
m_pGeomDB->GetInfo( nClPathId, KEY_DRACEX, vActiveExit) ;
// Recupero il numero di eventi ausiliari iniziali
int nAS = 0 ;
m_pGeomDB->GetInfo( nClPathId, KEY_AS_TOT, nAS) ;
// Emetto inizio percorso di lavoro
if ( ! OnPathStart( nClPathId, nClPathInd, nAS, ptStart, ptEnd, vtExtr, ptMin, ptMax, vAxMin, vAxMax, dElev))
if ( ! OnPathStart( nClPathId, nClPathInd, nAS, ptStart, ptEnd, vtExtr,
ptMin, ptMax, vAxMin, vAxMax, dElev, vActiveExit))
return false ;
// Emissione eventuali dati ausiliari di inizio
@@ -408,7 +452,7 @@ Processor::ProcessClPath( int nClPathId, int nClPathInd, int nOpId, int nOpInd)
// processo l'entità
if ( ! ProcessClEnt( nEntId, nEntInd, nClPathId, nClPathInd, nOpId, nOpInd))
bOk = false ;
// passo all'entità successivo
// passo all'entità successiva
nEntId = m_pGeomDB->GetNext( nEntId) ;
}
@@ -443,28 +487,34 @@ Processor::ProcessClEnt( int nEntId, int nEntInd, int nClPathId, int nClPathInd,
if ( pCamData == nullptr || pCamData->GetAxesStatus() != CamData::AS_OK)
return false ;
const DBLVECTOR& AxesEnd = pCamData->GetAxesVal() ;
// Emetto movimento
int nMove = pCamData->GetMoveType() ;
// Recupero i dati Cam del movimento successivo del percorso (se esiste)
CamData* pNextCamData = GetCamData( m_pGeomDB->GetUserObj( m_pGeomDB->GetNext( nEntId))) ;
int nMoveNext = ( pNextCamData != nullptr ? pNextCamData->GetMoveType() : -1) ;
DBLVECTOR AxesNull ;
const DBLVECTOR& AxesNext = ( pNextCamData != nullptr ? pNextCamData->GetAxesVal() : AxesNull) ;
// Emetto movimento
switch ( nMove) {
case 0 : // rapido
if ( ! OnRapid( nMove, AxesEnd, pCamData->GetAxesMask(),
if ( ! OnRapid( nEntId, nEntInd, nMove, AxesEnd, pCamData->GetAxesMask(),
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex(), nMoveNext, AxesNext))
return false ;
break ;
case 1 : // linea
if ( ! OnLinear( nMove, AxesEnd,
if ( ! OnLinear( nEntId, nEntInd, nMove, AxesEnd,
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex(), nMoveNext, AxesNext))
return false ;
break ;
case 2 : // arco CW
case 3 : // arco CCW
Point3d ptMid( AxesEnd[0], AxesEnd[1], AxesEnd[2]) ;
ptMid.Rotate( pCamData->GetAxesCen(), pCamData->GetAxesNormDir(), - pCamData->GetAxesAngCen() / 2) ;
if ( ! OnArc( nMove, AxesEnd, pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(),
if ( ! OnArc( nEntId, nEntInd, nMove, AxesEnd,
pCamData->GetAxesCen(), ptMid, pCamData->GetAxesRad(), pCamData->GetAxesAngCen(),
pCamData->GetToolDir(), pCamData->GetCorrDir(), pCamData->GetBackAuxDir(),
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex()))
pCamData->GetFeed(), pCamData->GetFlag(), pCamData->GetFlag2(), pCamData->GetIndex(), nMoveNext, AxesNext))
return false ;
break ;
}
@@ -514,8 +564,8 @@ bool
Processor::UpdateAxes( void)
{
// Carico i nomi degli assi macchina attivi
return m_pMachine->GetAllCurrAxesName( m_AxesName) &&
m_pMachine->GetAllCurrAxesToken( m_AxesToken) ;
return m_pMachine->GetAllCurrAxesNames( m_AxesName) &&
m_pMachine->GetAllCurrAxesTokens( m_AxesToken) ;
}
//----------------------------------------------------------------------------
@@ -569,7 +619,7 @@ Processor::OnProgramStart( const string& sMachName, const string& sCncFile, cons
// apro il file di output
bool bOk = m_pMachine->WriterOpen( sCncFile) ;
if ( ! bOk)
m_pMchMgr->SetLastError( 1002, "Error opening Cnc file") ;
m_pMchMgr->SetLastError( 1003, "Error opening Cnc file") ;
// assegno nome macchina
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MACHNAME, sMachName) ;
// assegno nome file
@@ -602,14 +652,16 @@ Processor::ProcessToolData( void)
string sHead ;
int nExit ;
string sTcPos ;
int nType ;
int nComp ;
double dDiam ;
double dTDiam ;
double dLen ;
double dTLen ;
double dDist ;
double dMaxSpeed ;
MyToolData( void)
: sName(), sHead(), nExit( 0), sTcPos(), nComp(0), dDiam( 0), dLen( 0), dMaxSpeed( 0) {}
: sName(), sHead(), nExit( 0), sTcPos(), nType(0), nComp(0), dDiam( 0), dLen( 0), dDist( 0), dMaxSpeed( 0) {}
} ;
typedef vector<MyToolData> TDATAVECTOR ;
TDATAVECTOR vTdata ;
@@ -634,11 +686,13 @@ Processor::ProcessToolData( void)
m_pMchMgr->TdbGetCurrToolParam( TPA_HEAD, Tdata.sHead) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_EXIT, Tdata.nExit) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TCPOS, Tdata.sTcPos) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TYPE, Tdata.nType) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_CORR, Tdata.nComp) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_DIAM, Tdata.dDiam) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TOTDIAM, Tdata.dTDiam) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_LEN, Tdata.dLen) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TOTLEN, Tdata.dTLen) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_DIST, Tdata.dDist) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_MAXSPEED, Tdata.dMaxSpeed) ;
vTdata.push_back( Tdata) ;
}
@@ -671,18 +725,22 @@ Processor::ProcessToolData( void)
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EXIT, nExit) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, sTcPos) ;
if ( m_pMchMgr->TdbSetCurrTool( sTool)) {
int nComp ; double dDiam ; double dTDiam ; double dLen ; double dTLen ; double dMaxSpeed ;
int nType ; int nComp ; double dDiam ; double dTDiam ; double dLen ; double dTLen ; double dDist ; double dMaxSpeed ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TYPE, nType) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_CORR, nComp) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_DIAM, dDiam) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TOTDIAM, dTDiam) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_LEN, dLen) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_TOTLEN, dTLen) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_DIST, dDist) ;
m_pMchMgr->TdbGetCurrToolParam( TPA_MAXSPEED, dMaxSpeed) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTYPE, nType) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCOMP, nComp) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TDIAM, dDiam) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTOTDIAM, dTDiam) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TLEN, dLen) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTOTLEN, dTLen) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TDIST, dDist) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_SMAX, dMaxSpeed) ;
}
bool bUsed = false ;
@@ -716,11 +774,13 @@ Processor::ProcessToolData( void)
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_HEAD, vTdata[i].sHead) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EXIT, vTdata[i].nExit) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, vTdata[i].sTcPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTYPE, vTdata[i].nType) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCOMP, vTdata[i].nComp) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TDIAM, vTdata[i].dDiam) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTOTDIAM, vTdata[i].dTDiam) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TLEN, vTdata[i].dLen) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TTOTLEN, vTdata[i].dTLen) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TDIST, vTdata[i].dDist) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_SMAX, vTdata[i].dMaxSpeed) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TUSED, true) ;
// se esiste, chiamo la funzione di emissione dati utensile
@@ -784,10 +844,24 @@ Processor::OnTableData( const string& sName, const Point3d& ptOri1)
return bOk ;
}
//----------------------------------------------------------------------------
bool
Processor::OnTableAxisData( int nAxisInd, const string& sName, double dPos, bool bMoved)
{
// assegno dati movimento asse di tavola
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAIND, nAxisInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TANAME, sName) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAPOS, dPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TAMOVED, bMoved) ;
// chiamo la funzione di gestione dati movimento asse di tavola
bOk = bOk && CallOnTableAxisData() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Processor::OnFixtureData( int nFixId, int nFixInd, const string& sName, const Point3d& ptPos,
double dAngDeg, double dMov)
double dAngDeg, double dMov, const string& sTaLink)
{
// assegno dati bloccaggio
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIXID, nFixId) ;
@@ -796,6 +870,10 @@ Processor::OnFixtureData( int nFixId, int nFixInd, const string& sName, const Po
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIXPOS, ptPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIXANG, dAngDeg) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIXMOB, dMov) ;
if ( ! IsEmptyOrSpaces( sTaLink))
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FIXTAL, sTaLink) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_FIXTAL) ;
// chiamo la funzione di gestione dati bloccaggio
bOk = bOk && CallOnFixtureData() ;
return bOk ;
@@ -803,11 +881,11 @@ Processor::OnFixtureData( int nFixId, int nFixInd, const string& sName, const Po
//----------------------------------------------------------------------------
bool
Processor::OnRawMoveData( int nRawId, int RawMoveInd, int nType, const Point3d& ptPos, int nFlag)
Processor::OnRawMoveData( int nRawId, int nRawMoveInd, int nType, const Point3d& ptPos, int nFlag)
{
// assegno dati bloccaggio
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWID, nRawId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWIND, RawMoveInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWIND, nRawMoveInd) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWTYPE, nType) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWPOS, ptPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_RAWFLAG, nFlag) ;
@@ -818,23 +896,25 @@ Processor::OnRawMoveData( int nRawId, int RawMoveInd, int nType, const Point3d&
//----------------------------------------------------------------------------
bool
Processor::OnToolSelect( const string& sTool, const string& sHead, int nExit, const string& sTcPos)
Processor::OnToolSelect( const string& sTool, const string& sHead, int nExit, const string& sTcPos, bool bFloating)
{
// assegno il nome dell'utensile, la testa, l'uscita e l'eventuale posizione nel toolchanger
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TOOL, sTool) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_HEAD, sHead) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_EXIT, nExit) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TCPOS, sTcPos) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TFLOAT, bFloating) ;
// assegno il token e il nome degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( m_AxesName.size()) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes) {
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisToken(i), m_AxesToken[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisName(i), m_AxesName[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisToken( i, bIsRobot), m_AxesToken[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisName( i, bIsRobot), m_AxesName[i-1]) ;
}
else {
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisToken(i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisName(i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisToken( i, bIsRobot)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisName( i, bIsRobot)) ;
}
}
// chiamo la funzione di selezione utensile
@@ -893,7 +973,7 @@ Processor::OnMachiningEnd( void)
bool
Processor::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev)
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit)
{
// assegno identificativo e indice percorso di lavorazione
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PATHID, nClPathId) ;
@@ -912,6 +992,8 @@ Processor::OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& p
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_PAXMAX, vAxMax) ;
// assegno la massima elevazione
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ELEV, dElev) ;
// assegno uscite attive per gruppi a forare
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_DRACEX, vActiveExit) ;
// chiamo la funzione di inizio percorso di lavorazione
bOk = bOk && CallOnPathStart() ;
return bOk ;
@@ -954,21 +1036,25 @@ Processor::OnPathEndAux( int nInd, const string& sAE)
//----------------------------------------------------------------------------
bool
Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
Processor::OnRapid( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
int nFlag, int nFlag2, int nIndex)
int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext)
{
// cancello variabili estranee
ResetArcData() ;
// assegno Id e indice entità di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ;
// assegno il tipo di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
// assegno il valore degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( AxesEnd.size()) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue(i), AxesEnd[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot), AxesEnd[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue(i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot)) ;
}
// assegno la mascheratura degli assi
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MASK, nAxesMask) ;
@@ -984,6 +1070,21 @@ Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
// assegno il valore dell'indice
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
// anticipazione di alcuni dati dell'eventuale movimento successivo dello stesso percorso
if ( nMoveNext != -1) {
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVESUCC, nMoveNext) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot), AxesNext[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
}
else {
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_MOVESUCC) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i)
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
// chiamo la funzione di movimento in rapido
bOk = bOk && CallOnRapid() ;
return bOk ;
@@ -991,21 +1092,25 @@ Processor::OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
//----------------------------------------------------------------------------
bool
Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
Processor::OnLinear( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
double dFeed, int nFlag, int nFlag2, int nIndex)
double dFeed, int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext)
{
// cancello variabili estranee
ResetArcData() ;
// assegno Id e indice entità di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ;
// assegno il tipo di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
// assegno il valore degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( AxesEnd.size()) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue(i), AxesEnd[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot), AxesEnd[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue(i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot)) ;
}
// assegno il valore del versore utensile
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_TDIR, vtTool) ;
@@ -1021,6 +1126,21 @@ Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
// assegno il valore dell'indice
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
// anticipazione di alcuni dati dell'eventuale movimento successivo dello stesso percorso
if ( nMoveNext != -1) {
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVESUCC, nMoveNext) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot), AxesNext[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
}
else {
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_MOVESUCC) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i)
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
// chiamo la funzione di movimento in rapido
bOk = bOk && CallOnLinear() ;
return bOk ;
@@ -1028,19 +1148,24 @@ Processor::OnLinear( int nMove, const DBLVECTOR& AxesEnd,
//----------------------------------------------------------------------------
bool
Processor::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
Processor::OnArc( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd,
const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
double dFeed, int nFlag, int nFlag2, int nIndex)
double dFeed, int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext)
{
// assegno Id e indice entità di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEID, nEntId) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVEIND, nEntInd) ;
// assegno il tipo di movimento
bool bOk = m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVE, nMove) ;
// assegno il valore degli assi
bool bIsRobot = m_pMchMgr->GetCurrIsRobot() ;
int nNumAxes = int( AxesEnd.size()) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue(i), AxesEnd[i-1]) ;
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot), AxesEnd[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue(i)) ;
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisValue( i, GLOB_VAR, bIsRobot)) ;
}
// assegno le coordinate del centro
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_C1, ptCen.x) ;
@@ -1068,6 +1193,21 @@ Processor::OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, con
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_FLAG2, nFlag2) ;
// assegno il valore dell'indice
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_INDEX, nIndex) ;
// anticipazione di alcuni dati dell'eventuale movimento successivo dello stesso percorso
if ( nMoveNext != -1) {
bOk = bOk && m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_MOVESUCC, nMoveNext) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i) {
if ( i <= nNumAxes)
bOk = bOk && m_pMachine->LuaSetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot), AxesNext[i-1]) ;
else
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
}
else {
bOk = bOk && m_pMachine->LuaResetGlobVar( GLOB_VAR + GVAR_MOVESUCC) ;
for ( int i = 1 ; i <= MAX_AXES ; ++ i)
bOk = bOk && m_pMachine->LuaResetGlobVar( GetGlobVarAxisNext( i, GLOB_VAR, bIsRobot)) ;
}
// chiamo la funzione di movimento in rapido
bOk = bOk && CallOnArc() ;
return bOk ;
+14 -10
View File
@@ -42,31 +42,34 @@ class Processor
bool OnProgramStart( const std::string& sMachName, const std::string& sCncFile, const std::string& sInfo, bool bSetup) ;
bool OnProgramEnd( void) ;
bool ProcessToolData( void) ;
bool OnToolSelect( const std::string& sTool, const std::string& sHead, int nExit, const std::string& sTcPos) ;
bool OnToolSelect( const std::string& sTool, const std::string& sHead, int nExit, const std::string& sTcPos, bool bFloating) ;
bool OnToolDeselect( const std::string& sNextTool, const std::string& sNextHead, int nNextExit, const std::string& sNextTcPos) ;
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionEnd( void) ;
bool OnTableData( const std::string& sName, const Point3d& ptOri1) ;
bool OnTableAxisData( int nAxisInd, const std::string& sName, double dPos, bool bMoved) ;
bool OnFixtureData( int nFixId, int nFixInd, const std::string& sName,
const Point3d& ptPos, double dAngDeg, double dMov) ;
bool OnRawMoveData( int nRawId, int RawMoveInd, int nType, const Point3d& ptPos, int nFlag) ;
const Point3d& ptPos, double dAngDeg, double dMov, const std::string& sTaLink) ;
bool OnRawMoveData( int nRawId, int nRawMoveInd, int nType, const Point3d& ptPos, int nFlag) ;
bool OnMachiningStart( int nOpId, int nOpInd, double dSpeed, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax) ;
bool OnMachiningEnd( void) ;
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev) ;
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit) ;
bool OnPathEnd( int nAE) ;
bool OnPathStartAux( int nInd, const std::string& sAS) ;
bool OnPathEndAux( int nInd, const std::string& sAE) ;
bool OnRapid( int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
bool OnRapid( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd, int nAxesMask,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
int nFlag, int nFlag2, int nIndex) ;
bool OnLinear( int nMove, const DBLVECTOR& AxesEnd, const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
double dFeed, int nFlag, int nFlag2, int nIndex) ;
bool OnArc( int nMove, const DBLVECTOR& AxesEnd, const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext) ;
bool OnLinear( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
double dFeed, int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext) ;
bool OnArc( int nEntId, int nEntInd, int nMove, const DBLVECTOR& AxesEnd,
const Point3d& ptCen, const Point3d& ptMid, double dRad, double dAngCen,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtAux,
double dFeed, int nFlag, int nFlag2, int nIndex) ;
double dFeed, int nFlag, int nFlag2, int nIndex, int nMoveNext, const DBLVECTOR& AxesNext) ;
bool ResetArcData( void) ;
protected :
@@ -78,6 +81,7 @@ class Processor
virtual bool CallOnDispositionStart( void) = 0 ;
virtual bool CallOnDispositionEnd( void) = 0 ;
virtual bool CallOnTableData( void) = 0 ;
virtual bool CallOnTableAxisData( void) = 0 ;
virtual bool CallOnFixtureData( void) = 0 ;
virtual bool CallOnRawMoveData( void) = 0 ;
virtual bool CallOnToolSelect( void) = 0 ;
+69 -41
View File
@@ -23,8 +23,8 @@
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EgkOffsetCurve.h"
#include "/EgtDev/Include/EgkOffsetCurveOnX.h"
#include "/EgtDev/Include/EGkOffsetCurve.h"
#include "/EgtDev/Include/EGkOffsetCurveOnX.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EGkIntervals.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
@@ -498,9 +498,17 @@ SawFinishing::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nCuts = nCurrCuts ;
LOG_DBG_INFO( GetEMkLogger(), "SawFinishing apply skipped : status already ok") ;
string sLog = string( "SawFinishing apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -582,6 +590,8 @@ SawFinishing::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "SawFinishing apply done") ;
return true ;
}
@@ -599,15 +609,11 @@ SawFinishing::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
@@ -790,15 +796,39 @@ SawFinishing::UpdateToolData( bool* pbChanged)
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
if ( pTMgr == nullptr)
return false ;
// recupero l'utensile nel DB utensili
// recupero l'utensile nel DB utensili (se fallisce con UUID provo con il nome)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
if ( pTdata == nullptr) {
pTdata = pTMgr->GetTool( m_Params.m_sToolName) ;
if ( pTdata == nullptr)
return false ;
m_Params.m_ToolUuid = m_TParams.m_Uuid ;
}
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in SawFinishing : tool name changed (" +
@@ -958,15 +988,15 @@ SawFinishing::AdjustGeometry( int nAuxId)
if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX))
return false ;
// verifiche sulla curva (che trasformo in composita)
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide)))
PtrOwner<ICurveComposite> pCompo ;
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide))))
return false ;
// converto in archi e rette
pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ;
// verifiche sull'ampiezza dell'angolo al centro degli eventuali archi
VerifyArcs( pCompo) ;
// reinserisco nella curva originale
pGuide.Set( Release( pCompo)) ;
pGuide.Set( pCompo) ;
}
// deve iniziare in comune con la prima sezione ed essere ivi perpendicolare
Vector3d vtGdDir ;
@@ -1301,7 +1331,7 @@ SawFinishing::CalculateStraightAcrossToolPath( int nAuxId, int nClId)
// se ZigZag aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// aggiungo retrazione
@@ -1622,7 +1652,7 @@ SawFinishing::CalculateCurvedAcrossToolPath( int nAuxId, int nClId)
double dEndElev = 0 ;
GetElevation( m_nPhase, ptPrev, vtPrev, dEndElev) ;
// aggiungo retrazione
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
double dAppr = m_Params.m_dStartPos ;
if ( ! AddRetract( ptPrev, vtPrev, dSafeZ, dEndElev, dAppr))
return false ;
@@ -1646,7 +1676,7 @@ SawFinishing::CalculateCurvedAcrossToolPath( int nAuxId, int nClId)
// se ZigZag aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// recupero punto e versore correzione finali
@@ -1774,7 +1804,7 @@ SawFinishing::TrimSection( ICurve* pCrv)
// calcolo la classificazione della curva rispetto alla regione
CRVCVECTOR ccClass ;
if ( ! pSfr->GetCurveClassification( *pCrv, ccClass))
if ( ! pSfr->GetCurveClassification( *pCrv, EPS_SMALL, ccClass))
return false ;
// determino l'intervallo di curva da conservare
@@ -1856,7 +1886,6 @@ SawFinishing::ClassifySection( ICurve* pCrv, INTVECTOR& vnClass)
{
const ICurveComposite* pCompo = GetCurveComposite( pCrv) ;
if ( pCompo != nullptr) {
int Ind = 0 ;
const ICurve* pSimpCrv = pCompo->GetFirstCurve() ;
while ( pSimpCrv != nullptr) {
// analizzo la curva
@@ -1874,7 +1903,6 @@ SawFinishing::ClassifySection( ICurve* pCrv, INTVECTOR& vnClass)
else
vnClass.push_back( CCL_FALL) ;
// passo alla curva successiva
++ Ind ;
pSimpCrv = pCompo->GetNextCurve() ;
}
}
@@ -1967,7 +1995,7 @@ SawFinishing::CalcAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax, const
// se ZigZag e non centrato aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG && m_Params.m_nLeadLinkType != SAWFIN_LL_CENT) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// aggiungo retrazione
@@ -2054,7 +2082,7 @@ SawFinishing::CalcAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
// se ZigZag e non centrato aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG && m_Params.m_nLeadLinkType != SAWFIN_LL_CENT) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// aggiungo retrazione
@@ -2072,7 +2100,7 @@ SawFinishing::CalcAlongOneWayCut( const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bVert)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -2121,7 +2149,7 @@ SawFinishing::CalcAlongZigZagCut( const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bVert, bool bFirst)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -2238,7 +2266,7 @@ SawFinishing::CalcAcrossOneWayCut( const PolyLine& PL, const Vector3d& vtMove,
const Vector3d& vtTool, const Vector3d& vtCorr, double dRawZ, double dDepth)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -2295,7 +2323,7 @@ SawFinishing::CalcAcrossZigZagCut( const PolyLine& PL, const Vector3d& vtMove,
const Vector3d& vtTool, const Vector3d& vtCorr, double dRawZ, double dDepth, bool bFirst)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -2379,8 +2407,8 @@ SawFinishing::CalcCurvedAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax,
Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ;
OffsetCurve OffsCrv ;
OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ;
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
PtrOwner<ICurveComposite> pCut ;
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
return false ;
VerifyArcs( pCut) ;
pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ;
@@ -2403,7 +2431,7 @@ SawFinishing::CalcCurvedAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax,
// se ZigZag e non centrato aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG && m_Params.m_nLeadLinkType != SAWFIN_LL_CENT) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// aggiungo retrazione
@@ -2454,8 +2482,8 @@ SawFinishing::CalcCurvedAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
Vector3d vtMove = ( ptP.y - m_TParams.m_dThick / 2) * Z_AX ;
OffsetCurve OffsCrv ;
OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ;
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
PtrOwner<ICurveComposite> pCut ;
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
return false ;
VerifyArcs( pCut) ;
pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ;
@@ -2478,7 +2506,7 @@ SawFinishing::CalcCurvedAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
// se ZigZag e non centrato aggiungo risalita
if ( m_Params.m_nStepType == SAWFIN_ST_ZIGZAG && m_Params.m_nLeadLinkType != SAWFIN_LL_CENT) {
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// aggiungo retrazione
@@ -2496,7 +2524,7 @@ bool
SawFinishing::CalcCurvedAlongZigZagCut( const ICurve* pCut, const Vector3d& vtTool, bool bVert, bool bFirst, double& dEndElev)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// verifico se passata da invertire (indice dispari)
@@ -2672,7 +2700,7 @@ SawFinishing::CalcCurvedAcrossZigZagCut( const PolyLine& PL, const Vector3d& vtM
bool bFirst, bool bCorner)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
+6 -2
View File
@@ -81,6 +81,10 @@ struct SawFinishingData : public MachiningData
//----------------------------------------------------------------------------
inline const SawFinishingData* GetSawFinishingData( const MachiningData* pMdata)
{ return (dynamic_cast<const SawFinishingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWFINISHING)
return nullptr ;
return ( static_cast<const SawFinishingData*>( pMdata)) ; }
inline SawFinishingData* GetSawFinishingData( MachiningData* pMdata)
{ return (dynamic_cast<SawFinishingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWFINISHING)
return nullptr ;
return ( static_cast<SawFinishingData*>( pMdata)) ; }
+57 -27
View File
@@ -23,8 +23,8 @@
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EgkOffsetCurve.h"
#include "/EgtDev/Include/EgkOffsetCurveOnX.h"
#include "/EgtDev/Include/EGkOffsetCurve.h"
#include "/EgtDev/Include/EGkOffsetCurveOnX.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EGkIntervals.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
@@ -481,9 +481,17 @@ SawRoughing::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nCuts = nCurrCuts ;
LOG_DBG_INFO( GetEMkLogger(), "SawRoughing apply skipped : status already ok") ;
string sLog = string( "SawRoughing apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -546,6 +554,8 @@ SawRoughing::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "SawRoughing apply done") ;
return true ;
}
@@ -563,15 +573,11 @@ SawRoughing::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
@@ -748,15 +754,39 @@ SawRoughing::UpdateToolData( bool* pbChanged)
ToolsMgr* pTMgr = m_pMchMgr->GetCurrToolsMgr() ;
if ( pTMgr == nullptr)
return false ;
// recupero l'utensile nel DB utensili
// recupero l'utensile nel DB utensili (se fallisce con UUID provo con il nome)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
if ( pTdata == nullptr) {
pTdata = pTMgr->GetTool( m_Params.m_sToolName) ;
if ( pTdata == nullptr)
return false ;
m_Params.m_ToolUuid = m_TParams.m_Uuid ;
}
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in SawRoughing : tool name changed (" +
@@ -916,15 +946,15 @@ SawRoughing::AdjustGeometry( int nAuxId)
if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX))
return false ;
// verifiche sulla curva (che trasformo in composita)
PtrOwner<ICurveComposite> pCompo( CreateCurveComposite()) ;
if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide)))
PtrOwner<ICurveComposite> pCompo ;
if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide))))
return false ;
// converto in archi e rette
pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ;
// verifiche sull'ampiezza dell'angolo al centro degli eventuali archi
VerifyArcs( pCompo) ;
// reinserisco nella curva originale
pGuide.Set( Release( pCompo)) ;
pGuide.Set( pCompo) ;
}
// deve iniziare in comune con la prima sezione ed essere ivi perpendicolare
Vector3d vtGdDir ;
@@ -1306,8 +1336,8 @@ SawRoughing::CalculateCurvedToolPath( int nAuxId, int nClId)
// creo la curva di taglio
OffsetCurve OffsCrv ;
OffsCrv.Make( pGuide, dX, ICurve::OFF_FILLET) ;
PtrOwner<ICurveComposite> pCut( CreateCurveComposite()) ;
if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve()))
PtrOwner<ICurveComposite> pCut ;
if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve())))
return false ;
VerifyArcs( pCut) ;
Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ;
@@ -1459,7 +1489,7 @@ SawRoughing::TrimSection( ICurve* pCrv)
// calcolo la classificazione della curva rispetto alla regione
CRVCVECTOR ccClass ;
if ( ! pSfr->GetCurveClassification( *pCrv, ccClass))
if ( ! pSfr->GetCurveClassification( *pCrv, EPS_SMALL, ccClass))
return false ;
// determino l'intervallo di curva da conservare
@@ -1536,7 +1566,7 @@ SawRoughing::CalculateOneWayCut( const Point3d& ptStart, const Point3d& ptEnd, c
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bFirst, bool bLast)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -1630,7 +1660,7 @@ SawRoughing::CalculateZigZagCut( const Point3d& ptStart, const Point3d& ptEnd, c
int& nCount)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -1841,7 +1871,7 @@ SawRoughing::CalculateCurvedZigZagCut( const ICurve* pCut, const Vector3d& vtToo
int& nCount)
{
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// verifico se passata da invertire (indice dispari)
+6 -2
View File
@@ -78,6 +78,10 @@ struct SawRoughingData : public MachiningData
//----------------------------------------------------------------------------
inline const SawRoughingData* GetSawRoughingData( const MachiningData* pMdata)
{ return (dynamic_cast<const SawRoughingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWROUGHING)
return nullptr ;
return ( static_cast<const SawRoughingData*>( pMdata)) ; }
inline SawRoughingData* GetSawRoughingData( MachiningData* pMdata)
{ return (dynamic_cast<SawRoughingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWROUGHING)
return nullptr ;
return ( static_cast<SawRoughingData*>( pMdata)) ; }
+244 -118
View File
@@ -4,7 +4,7 @@
// File : Sawing.cpp Data : 24.10.15 Versione : 1.6j3
// Contenuto : Implementazione gestione tagli con lama.
//
// Note : Questa lavorazione è sempre espressa nel riferimento globale.
// Note : Questa lavorazione è sempre espressa nel riferimento globale.
//
// Modifiche : 07.06.15 DS Creazione modulo.
//
@@ -16,6 +16,7 @@
#include "MachMgr.h"
#include "DllMain.h"
#include "Sawing.h"
#include "GeoConst.h"
#include "OperationConst.h"
#include "/EgtDev/Include/EXeCmdLogOff.h"
#include "/EgtDev/Include/EXeConst.h"
@@ -98,6 +99,7 @@ Sawing::Clone( void) const
pSaw->m_nPhase = m_nPhase ;
pSaw->m_Params = m_Params ;
pSaw->m_TParams = m_TParams ;
pSaw->m_bDownSE = m_bDownSE ;
pSaw->m_nStatus = m_nStatus ;
pSaw->m_nCuts = m_nCuts ;
}
@@ -211,6 +213,7 @@ Sawing::Sawing( void)
m_Params.m_sToolName = "*" ;
m_TParams.m_sName = "*" ;
m_TParams.m_sHead = "*" ;
m_bDownSE = false ;
m_nStatus = MCH_ST_TO_VERIFY ;
m_nCuts = 0 ;
}
@@ -532,15 +535,15 @@ Sawing::SetParam( int nType, const string& sVal)
bool
Sawing::SetGeometry( const SELVECTOR& vIds)
{
// verifico validità gestore DB geometrico
// verifico validità gestore DB geometrico
if ( m_pGeomDB == nullptr)
return false ;
// reset della geometria corrente
m_vId.clear() ;
// verifico che gli identificativi rappresentino delle entità ammissibili
// verifico che gli identificativi rappresentino delle entità ammissibili
int nType = GEO_NONE ;
for ( const auto& Id : vIds) {
// test sull'entità
// test sull'entità
int nSubs ;
if ( ! VerifyGeometry( Id, nSubs, nType)) {
string sInfo = "Warning in Sawing : Skipped entity " + ToString( Id) ;
@@ -563,14 +566,14 @@ Sawing::Preview( bool bRecalc)
// reset numero tagli nella lavorazione
m_nCuts = 0 ;
// verifico validità gestore DB geometrico e Id del gruppo
// verifico validità gestore DB geometrico e Id del gruppo
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
return false ;
// recupero gruppo per geometria ausiliaria
int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ;
bool bChain = false ;
// se non c'è, lo aggiungo
// se non c'è, lo aggiungo
if ( nAuxId == GDB_ID_NULL) {
nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
if ( nAuxId == GDB_ID_NULL)
@@ -603,7 +606,7 @@ Sawing::Preview( bool bRecalc)
// recupero gruppo per anteprima di lavorazione (PreView)
int nPvId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_PV) ;
// se non c'è, lo aggiungo
// se non c'è, lo aggiungo
if ( nPvId == GDB_ID_NULL) {
nPvId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
if ( nPvId == GDB_ID_NULL)
@@ -633,7 +636,7 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
int nCurrCuts = m_nCuts ;
m_nCuts = 0 ;
// verifico validità gestore DB geometrico e Id del gruppo
// verifico validità gestore DB geometrico e Id del gruppo
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
return false ;
@@ -646,9 +649,17 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
// verifico se necessario continuare nell'aggiornamento
if ( ! bRecalc && ! bToolChanged &&
( m_nStatus == MCH_ST_OK || ( ! bPostApply && m_nStatus == MCH_ST_NO_POSTAPPL))) {
( m_nStatus == MCH_ST_OK || m_nStatus == MCH_ST_NO_POSTAPPL)) {
// confermo i percorsi di lavorazione
m_nCuts = nCurrCuts ;
LOG_DBG_INFO( GetEMkLogger(), "Sawing apply skipped : status already ok") ;
string sLog = string( "Sawing apply skipped : status ") + ( m_nStatus == MCH_ST_OK ? "already ok" : "no postapply") ;
LOG_DBG_INFO( GetEMkLogger(), sLog.c_str()) ;
// eseguo aggiornamento assi macchina e collegamento con operazione precedente
if ( ! Update( bPostApply))
return false ;
m_nStatus = ( bPostApply ? MCH_ST_OK : MCH_ST_NO_POSTAPPL) ;
LOG_DBG_INFO( GetEMkLogger(), "Update done") ;
// esco con successo
return true ;
}
m_nStatus = MCH_ST_TO_VERIFY ;
@@ -656,7 +667,7 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
// recupero gruppo per geometria ausiliaria
int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ;
bool bChain = false ;
// se non c'è, lo aggiungo
// se non c'è, lo aggiungo
if ( nAuxId == GDB_ID_NULL) {
nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
if ( nAuxId == GDB_ID_NULL)
@@ -681,9 +692,14 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
if ( ! VerifySideAngle())
return false ;
// verifiche per attacchi/uscite senza approcci e retrazioni
int nDownSE = 0 ;
GetValInNotes( m_Params.m_sUserNotes, "DownSE", nDownSE) ;
m_bDownSE = ( nDownSE != 0 && m_Params.m_nStepType == SAW_ST_TOANDFROM) ;
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ;
// se non c'è, lo aggiungo
// se non c'è, lo aggiungo
if ( nClId == GDB_ID_NULL) {
nClId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
if ( nClId == GDB_ID_NULL)
@@ -717,6 +733,8 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
// dichiaro successiva da aggiornare
UpdateFollowingOperationsStatus( MCH_ST_OTH_MODIF) ;
LOG_DBG_INFO( GetEMkLogger(), "Sawing apply done") ;
return true ;
}
@@ -724,7 +742,7 @@ Sawing::Apply( bool bRecalc, bool bPostApply)
bool
Sawing::Update( bool bPostApply)
{
// verifico validità gestore DB geometrico e Id del gruppo
// verifico validità gestore DB geometrico e Id del gruppo
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
return false ;
@@ -734,15 +752,11 @@ Sawing::Update( bool bPostApply)
return true ;
}
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
RemoveClimbRiseHome() ;
// imposto eventuale asse bloccato da lavorazione
if ( ! m_Params.m_sBlockedAxis.empty()) {
string sAxis, sVal ;
Split( m_Params.m_sBlockedAxis, "=", true, sAxis, sVal) ;
double dVal = 0 ;
FromString( sVal, dVal) ;
m_pMchMgr->ClearRotAxisBlock() ;
m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ;
}
SetBlockedRotAxis( m_Params.m_sBlockedAxis) ;
// calcolo gli assi macchina
string sHint = ExtractHint( m_Params.m_sUserNotes) ;
@@ -790,7 +804,7 @@ Sawing::Update( bool bPostApply)
bool
Sawing::AdjustFeeds( void)
{
// controlli su GeomDB e simili non ripetuti perchè già fatti
// controlli su GeomDB e simili non ripetuti perchè già fatti
// recupero gruppo della geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
@@ -800,11 +814,11 @@ Sawing::AdjustFeeds( void)
// ciclo sui gruppi CL
int nClPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ;
while ( nClPathId != GDB_ID_NULL) {
// ciclo su tutte le entità del percorso CL
// ciclo su tutte le entità del percorso CL
for ( int nEntId = m_pGeomDB->GetFirstInGroup( nClPathId) ;
nEntId != GDB_ID_NULL ;
nEntId = m_pGeomDB->GetNext( nEntId)) {
// recupero i dati Cam dell'entità
// recupero i dati Cam dell'entità
CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
if ( pCamData == nullptr)
continue ;
@@ -1024,11 +1038,31 @@ Sawing::UpdateToolData( bool* pbChanged)
const ToolData* pTdata = pTMgr->GetTool( m_Params.m_ToolUuid) ;
if ( pTdata == nullptr)
return false ;
// verifico se sono diversi (ad esclusione del nome)
m_TParams.m_sName = pTdata->m_sName ;
bool bChanged = ! SameTool( m_TParams, *pTdata) ;
// salvo posizione TC, testa e uscita originali
string sOrigTcPos = m_TParams.m_sTcPos ;
string sOrigHead = m_TParams.m_sHead ;
int nOrigExit = m_TParams.m_nExit ;
// verifico se sono diversi (ad esclusione di nome, posizione TC, testa e uscita)
bool bChanged = ( ! SameTool( m_TParams, *pTdata, false)) ;
// aggiorno comunque i parametri
m_TParams = *pTdata ;
// se definito attrezzaggio, aggiorno i parametri che ne possono derivare
string sTcPos ; string sHead ; int nExit ;
if ( m_pMchMgr->GetCurrSetupMgr().GetToolData( m_TParams.m_sName, sTcPos, sHead, nExit)) {
if ( sOrigTcPos != sTcPos ||
sOrigHead != sHead ||
nOrigExit != nExit)
bChanged = true ;
m_TParams.m_sTcPos = sTcPos ;
m_TParams.m_sHead = sHead ;
m_TParams.m_nExit = nExit ;
}
else {
if ( sOrigTcPos != pTdata->m_sTcPos ||
sOrigHead != pTdata->m_sHead ||
nOrigExit != pTdata->m_nExit)
bChanged = true ;
}
// eventuali segnalazioni
if ( ! EqualNoCase( m_Params.m_sToolName, m_TParams.m_sName)) {
string sInfo = "Warning in Sawing : tool name changed (" +
@@ -1051,7 +1085,7 @@ Sawing::UpdateToolData( bool* pbChanged)
bool
Sawing::GetGeometry( SELVECTOR& vIds) const
{
// restituisco l'elenco delle entità
// restituisco l'elenco delle entità
vIds = m_vId ;
return true ;
}
@@ -1074,7 +1108,7 @@ Sawing::VerifyGeometry( SelData Id, int& nSubs, int& nType)
const IGeoObj* pGObj = m_pGeomDB->GetGeoObj( Id.nId) ;
if ( pGObj == nullptr)
return false ;
// se ammesse curve ed è tale
// se ammesse curve ed è tale
if ( ( nType == GEO_NONE || nType == GEO_CURVE) && ( pGObj->GetType() & GEO_CURVE) != 0) {
nType = GEO_CURVE ;
const ICurve* pCurve = nullptr ;
@@ -1098,7 +1132,7 @@ Sawing::VerifyGeometry( SelData Id, int& nSubs, int& nType)
}
return ( pCurve != nullptr) ;
}
// se altrimenti ammesse superfici trimesh ed è tale
// se altrimenti ammesse superfici trimesh ed è tale
else if ( ( nType == GEO_NONE || nType == GEO_SURF) && pGObj->GetType() == SRF_TRIMESH) {
nType = GEO_SURF ;
const ISurfTriMesh* pSurf = ::GetSurfTriMesh( pGObj) ;
@@ -1118,7 +1152,7 @@ Sawing::VerifyGeometry( SelData Id, int& nSubs, int& nType)
}
return true ;
}
// se altrimenti ammesse regioni ed è tale
// se altrimenti ammesse regioni ed è tale
else if ( ( nType == GEO_NONE || nType == GEO_SURF) && pGObj->GetType() == SRF_FLATRGN) {
nType = GEO_SURF ;
const ISurfFlatRegion* pReg = ::GetSurfFlatRegion( pGObj) ;
@@ -1221,7 +1255,7 @@ Sawing::GetCurve( SelData Id)
pCrvCompo->ToGlob( frGlob) ;
vtN.ToGlob( frGlob) ;
// sistemazioni varie
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTUP, FACE_DOWN, 0) ;
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTUP, FACE_DOWN, V_NULL, 0, 1) ;
// aggiusto lato lavoro e inverti, angolo di fianco e lato mandrino
if ( m_Params.m_nWorkSide == SAW_WS_CENTER)
m_Params.m_nWorkSide = SAW_WS_RIGHT ;
@@ -1255,8 +1289,8 @@ Sawing::GetCurve( SelData Id)
// recupero l'indice del chunk
int nChunk = ( ( Id.nSub == SEL_SUB_ALL) ? 0 : Id.nSub) ;
// recupero il contorno esterno del chunk
PtrOwner<ICurveComposite> pCrvCompo( CreateCurveComposite()) ;
if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nChunk, 0)))
PtrOwner<ICurveComposite> pCrvCompo ;
if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nChunk, 0))))
return nullptr ;
// recupero la normale della regione
Vector3d vtN = pReg->GetNormVersor() ;
@@ -1270,7 +1304,7 @@ Sawing::GetCurve( SelData Id)
pCrvCompo->ToGlob( frGlob) ;
vtN.ToGlob( frGlob) ;
// sistemazioni varie
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTUP, FACE_DOWN, 0) ;
AdjustCurveFromSurf( pCrvCompo, TOOL_ORTUP, FACE_DOWN, V_NULL, 0, 1) ;
// aggiusto lato lavoro e inverti, angolo di fianco e lato mandrino
if ( m_Params.m_nWorkSide == SAW_WS_CENTER)
m_Params.m_nWorkSide = SAW_WS_RIGHT ;
@@ -1311,7 +1345,7 @@ Sawing::Chain( int nGrpDestId)
for ( const auto& Id : m_vId) {
// prendo curva
vpCrvs.emplace_back( GetCurve( Id)) ;
// ne verifico la validità
// ne verifico la validità
if ( IsNull( vpCrvs.back())) {
string sInfo = "Warning in Sawing : Skipped entity " + ToString( Id) ;
m_pMchMgr->SetWarning( 2251, sInfo) ;
@@ -1453,7 +1487,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
// recupero gruppo per geometria temporanea
const string GRP_TEMP = "Temp" ;
int nTempId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, GRP_TEMP) ;
// se non c'è, lo aggiungo
// se non c'è, lo aggiungo
if ( nTempId == GDB_ID_NULL) {
nTempId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
if ( nTempId == GDB_ID_NULL)
@@ -1477,7 +1511,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
ICurveComposite* pCompo = GetCurveComposite( m_pGeomDB->GetGeoObj( nCopyId)) ;
// unisco le parti allineate
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL))
if ( ! pCompo->MergeCurves( 100 * EPS_SMALL, 100 * EPS_ANG_SMALL))
return false ;
// eventuale inversione percorso
@@ -1518,7 +1552,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
// elaboro la curva composita e la esplodo nelle curve componenti
if ( m_Params.m_nCurveUse == SAW_CRV_APPROX ||
m_Params.m_nCurveUse == SAW_CRV_CONVEX) {
// calcolo l'approssimazione lineare con eventuale convessità
// calcolo l'approssimazione lineare con eventuale convessità
PolyLine PL ;
int nType = ICurve::APL_STD ;
if ( m_Params.m_nWorkSide == SAW_WS_LEFT)
@@ -1607,7 +1641,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
// flag di curva chiusa
bool bClosed = pCompo->IsClosed() ;
// calcolo gli eventuali punti di perdita di tangenza e di cambio di concavità
// calcolo gli eventuali punti di perdita di tangenza e di cambio di concavità
DBLVECTOR vU ;
const double ANG_PERD_TG = 1.0 ;
const ICurveArc* pArc = ( bClosed ? GetCurveArc( pCompo->GetLastCurve()) : nullptr) ;
@@ -1623,7 +1657,7 @@ Sawing::ProcessPath( int nPathId, int nPvId, int nClId)
nCurrConv = 0 ;
continue ;
}
// verifico cambio di concavità e/o lavorazione interna
// verifico cambio di concavità e/o lavorazione interna
const ICurve* pCrv = pCompo->GetCurve( i) ;
if ( pCrv->GetType() == CRV_ARC) {
if ( GetCurveArc( pCrv)->GetAngCenter() > 0) {
@@ -1705,7 +1739,7 @@ Sawing::ProcessEntity( const ICurve* pCrvP, const ICurve* pCrvC, const ICurve* p
// altrimenti
else {
if ( m_Params.m_nCurveUse == SAW_CRV_KEEP) {
// determino la convessità
// determino la convessità
int nConv = 0 ;
for ( int i = 0 ; i < pCompo->GetCurveCount() ; ++ i) {
const ICurveArc* pArc = GetCurveArc( pCompo->GetCurve( i)) ;
@@ -1767,10 +1801,11 @@ Sawing::ProcessLine( const ICurve* pCrvP, const ICurveLine* pLineC, const ICurve
// aggiungo affondamento
pLine->Translate( - vtCorr * dDepth) ;
// calcolo elevazione (sui due bordi della striscia, leggermente allargata)
const double DELTA_ELEV_THICK = 2.0 ;
double dElev, dElev2 ;
Vector3d vtToolH( vtTool.x, vtTool.y, 0) ;
Vector3d vtSafe = vtToolH * ( 10 * EPS_SMALL) ;
Vector3d vtThick = vtToolH * ( m_TParams.m_dThick / vtToolH.SqLen() + 10 * EPS_SMALL) ;
Vector3d vtSafe = vtToolH * DELTA_ELEV_THICK ;
Vector3d vtThick = vtToolH * ( m_TParams.m_dThick / vtToolH.SqLen() + DELTA_ELEV_THICK) ;
if ( ! GetElevation( m_nPhase, pLine->GetStart() - vtSafe, pLine->GetEnd() - vtSafe, vtCorr, dElev) ||
! GetElevation( m_nPhase, pLine->GetStart() + vtThick, pLine->GetEnd() + vtThick, vtCorr, dElev2) ) {
m_pMchMgr->SetLastError( 2210, "Error in Sawing : Entity GetElevation") ;
@@ -1805,7 +1840,7 @@ Sawing::ProcessLine( const ICurve* pCrvP, const ICurveLine* pLineC, const ICurve
( m_Params.m_nWorkSide == SAW_WS_RIGHT && dAngCN < - EPS_ANG_SMALL))
bExtAngCN = false ;
}
// verifico eventuale attacco speciale a step (se parametri validi e su entità linea singola)
// verifico eventuale attacco speciale a step (se parametri validi e su entità linea singola)
double dLiStep = 0 ;
double dLiElev = 0 ;
if ( m_Params.m_dLiTang > 10 * EPS_SMALL && m_Params.m_dLiElev > 10 * EPS_SMALL &&
@@ -1826,38 +1861,38 @@ Sawing::ProcessLine( const ICurve* pCrvP, const ICurveLine* pLineC, const ICurve
return true ;
}
// Eventuale variazioni di velocità all'inizio e alla fine del percorso
// Eventuale variazioni di velocità all'inizio e alla fine del percorso
FseVar FvVar ;
if ( pCrvP == nullptr) {
string sFsta = ExtractInfo( m_Params.m_sUserNotes, "Fsta:") ;
string sFsta = ExtractInfo( m_Params.m_sUserNotes, "Fsta=") ;
if ( ! sFsta.empty()) {
string sLen, sPu ;
SplitFirst( sFsta, "=", sLen, sPu) ;
FromString( sLen, FvVar.dLenStart) ;
FvVar.dLenStart = max( FvVar.dLenStart, 0.) ;
FromString( sPu, FvVar.dPuStart) ;
FvVar.dPuStart = max( FvVar.dPuStart, 0.) ;
SplitFirst( sFsta, ",", sLen, sPu) ;
if ( FromString( sLen, FvVar.dLenStart))
FvVar.dLenStart = max( FvVar.dLenStart, 0.) ;
if ( FromString( sPu, FvVar.dPuStart))
FvVar.dPuStart = max( FvVar.dPuStart, 0.) ;
}
}
if ( pCrvN == nullptr) {
string sFend = ExtractInfo( m_Params.m_sUserNotes, "Fend:") ;
string sFend = ExtractInfo( m_Params.m_sUserNotes, "Fend=") ;
if ( ! sFend.empty()) {
string sLen, sPu ;
SplitFirst( sFend, "=", sLen, sPu) ;
FromString( sLen, FvVar.dLenEnd) ;
FvVar.dLenEnd = max( FvVar.dLenEnd, 0.) ;
FromString( sPu, FvVar.dPuEnd) ;
FvVar.dPuEnd = max( FvVar.dPuEnd, 0.) ;
SplitFirst( sFend, ",", sLen, sPu) ;
if ( FromString( sLen, FvVar.dLenEnd))
FvVar.dLenEnd = max( FvVar.dLenEnd, 0.) ;
if ( FromString( sPu, FvVar.dPuEnd))
FvVar.dPuEnd = max( FvVar.dPuEnd, 0.) ;
}
}
// recupero eventuali estensioni dei baffi (whiskers)
double dStartWhiskExt = 0 ;
if ( m_Params.m_nLeadInType == SAW_LI_CENT)
FromString( ExtractInfo( m_Params.m_sUserNotes, "SWE="), dStartWhiskExt) ;
GetValInNotes( m_Params.m_sUserNotes, "SWE", dStartWhiskExt) ;
double dEndWhiskExt = 0 ;
if ( m_Params.m_nLeadOutType == SAW_LO_CENT)
FromString( ExtractInfo( m_Params.m_sUserNotes, "EWE="), dEndWhiskExt) ;
GetValInNotes( m_Params.m_sUserNotes, "EWE", dEndWhiskExt) ;
// Se richiesto Preview
if ( nPvId != GDB_ID_NULL) {
@@ -1937,7 +1972,7 @@ Sawing::GenerateLinePv( const ICurveLine* pLine, const Vector3d& vtTool, const V
m_pGeomDB->SetMaterial( nId3, BLUE) ;
// valore di allungamento
double dExtraL = m_pMchMgr->GetCurrMachiningsMgr()->GetExtraLOnCutRegion() ;
double dExtraL = GetExtraLOnCutRegion() ;
// punti notevoli per regioni
Point3d ptRIni = ptIni ;
@@ -1974,14 +2009,17 @@ Sawing::GenerateLinePv( const ICurveLine* pLine, const Vector3d& vtTool, const V
ptREnd + vtDir * ( dDtEnd + dExtraL) , RTY_LOC) ;
m_pGeomDB->SetName( nReId, MCH_PV_RLOCUT) ;
m_pGeomDB->SetMaterial( nReId, INVISIBLE) ;
// eventuali ripetizioni in basso per tagli inclinati
if ( abs( m_Params.m_dSideAngle) > EPS_ANG_SMALL) {
// lunghezza movimento
double dMove = ( dElev - dExtraCut) ;
// se sottosquadra (controllo il lato opposto della lama, quindi ...)
if ( m_Params.m_dSideAngle < 0)
dMove -= m_TParams.m_dThick * tan( abs( m_Params.m_dSideAngle) * DEGTORAD) ;
dMove = dElev - dExtraCut - m_TParams.m_dThick * tan( abs( m_Params.m_dSideAngle) * DEGTORAD) ;
// altrimenti tengo conto di dove si trova il sopra del lato esterno
else
dMove = dElev - max( dExtraCut, m_TParams.m_dThick * tan( abs( m_Params.m_dSideAngle) * DEGTORAD)) ;
// vettore movimento
Vector3d vtMove = - dMove * vtCorr ; vtMove.z = 0 ;
// rettangolo per parte di taglio completo
@@ -2012,6 +2050,38 @@ Sawing::GenerateLinePv( const ICurveLine* pLine, const Vector3d& vtTool, const V
int nDwnReId = m_pGeomDB->Copy( nReId, GDB_ID_NULL, nPxId) ;
m_pGeomDB->Translate( nDwnReId, vtMove) ;
m_pGeomDB->SetName( nDwnReId, MCH_PV_DOWN_RLOCUT) ;
// riduzione larghezza regioni per tagli da sopra
if ( m_Params.m_dSideAngle > 0) {
double dRefH = max( m_TParams.m_dThick * sin( m_Params.m_dSideAngle * DEGTORAD) - dExtraCut * cos( m_Params.m_dSideAngle * DEGTORAD), 0.) ;
if ( dRefH > EPS_SMALL) {
double dLargh = vtToolH.LenXY() ;
double dRedLargh = dLargh - dRefH * tan( m_Params.m_dSideAngle * DEGTORAD) - EPS_SMALL ;
double dCoeff = dRedLargh / dLargh ;
Frame3d frScale ;
frScale.Set( ptRCross + vtMove, Z_AX, vtDir) ;
m_pGeomDB->Scale( nDwnRId, frScale, 1, dCoeff, 1) ;
m_pGeomDB->Scale( nDwnRrId, frScale, 1, dCoeff, 1) ;
m_pGeomDB->Scale( nDwnRsId, frScale, 1, dCoeff, 1) ;
m_pGeomDB->Scale( nDwnReId, frScale, 1, dCoeff, 1) ;
}
}
}
// creo regioni di lavorazione che interessano le superfici superiore e inferiore del grezzo considerando anche gli
// allungamenti dei baffi
int nSurfUpId = ExeCreateSurfFrRectangle3P( nPxId, ptIni - vtDir * ( dStartWhiskExt + 5 * EPS_SMALL),
ptCross + vtDir * ( dEndWhiskExt + 5 * EPS_SMALL),
ptEnd + vtDir * ( dEndWhiskExt + 5 * EPS_SMALL), RTY_LOC) ;
m_pGeomDB->SetName( nSurfUpId, MCH_PV_UP_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfUpId, INVISIBLE) ;
// solo se la lavorazione interessa il fondo del grezzo creo la superficie down
if ( dRbHeight < EPS_SMALL) {
int nSurfDownId = m_pGeomDB->CopyGlob( nSurfUpId, GDB_ID_NULL, nPxId) ;
double dMove = dElev + dRbHeight / cos( m_Params.m_dSideAngle * DEGTORAD) ;
Vector3d vtMove = - dMove * vtCorr ; vtMove.z = 0 ;
ExeMove( {nSurfDownId}, vtMove, RTY_LOC) ;
m_pGeomDB->SetName( nSurfDownId, MCH_PV_DOWN_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfDownId, INVISIBLE) ;
}
// salvo in info gruppo : larghezza XY del taglio, distanza XY tra centro e bordo taglio, extra taglio e quota minima della lama
@@ -2052,7 +2122,7 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V
SetToolDir( vtTool) ;
SetCorrAuxDir( vtCorr) ;
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// distanza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
// flag di taglio inclinato
@@ -2068,12 +2138,14 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V
}
if ( dActBstep < EPS_SMALL)
dActBstep = dActStep ;
double dActLstep = GetStepLast() ;
// direzione della linea
Vector3d vtDir ; pLine->GetStartDir( vtDir) ;
// Se una sola passata
if ( dActStep < EPS_SMALL || ( dElev - dExtraCut) <= dActStep ||
( ! bSideAng && m_Params.m_dStepLast > EPS_SMALL && ( dElev - dExtraCut) <= m_Params.m_dStepLast)) {
if ( m_Params.m_nStepType != SAW_ST_TOANDFROM &&
( dActStep < EPS_SMALL || ( dElev - dExtraCut) <= dActStep ||
( ! bSideAng && dActLstep > EPS_SMALL && ( dElev - dExtraCut) <= dActLstep))) {
// 1 -> approccio
Point3d ptP1 = pLine->GetStart() - vtDir * m_Params.m_dLiTang ;
if ( ! AddApproach( ptP1, vtCorr, dSafeZ, dElev, dAppr))
@@ -2170,11 +2242,17 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V
int nStep = 2 ;
if ( m_Params.m_nStepType == SAW_ST_ZIGZAG)
nStep = 2 * static_cast<int>( ceil( dCutH / ( dActStep + dActBstep + EPS_SMALL))) ;
else {
if ( dActStep < EPS_SMALL)
dActStep = dCutH / nStep ;
if ( dActBstep < EPS_SMALL)
dActBstep = dCutH / nStep ;
}
double dMeanStep = dCutH / nStep ;
double dBstep = dActBstep * 2 * dMeanStep / ( dActStep + dActBstep) ;
double dLastStep = dBstep ;
if ( ! bSideAng && m_Params.m_dStepLast > EPS_SMALL) {
dLastStep = m_Params.m_dStepLast ;
if ( ! bSideAng && dActLstep > EPS_SMALL) {
dLastStep = dActLstep ;
double dCoeff = ( dCutH - dLastStep) / ( nStep / 2 * dActStep + ( nStep / 2 - 1) * dActBstep) ;
dMeanStep = dCoeff * ( dActStep + dActBstep) / 2 ;
dBstep = dCoeff * dActBstep ;
@@ -2216,8 +2294,8 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V
int nStep = static_cast<int>( ceil( dCutH / ( dActStep + EPS_SMALL))) ;
double dStep = dCutH / nStep ;
double dLastStep = dStep ;
if ( ! bSideAng && m_Params.m_dStepLast > EPS_SMALL) {
dLastStep = m_Params.m_dStepLast ;
if ( ! bSideAng && dActLstep > EPS_SMALL) {
dLastStep = dActLstep ;
nStep = static_cast<int>( ceil( ( dCutH - dLastStep) / ( dActStep + EPS_SMALL))) + 1 ;
dStep = ( dCutH - dLastStep) / ( nStep - 1) ;
}
@@ -2236,17 +2314,16 @@ Sawing::GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const V
Point3d ptP3 = pLine->GetEnd() + vtCorr * dDelta ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
return false ;
// se non è ultimo passo
// se non è ultimo passo
if ( i != 0) {
// movimento di risalita sopra il punto finale
SetFeed( GetEndFeed()) ;
Point3d ptP4 = pLine->GetEnd() + vtCorr * ( dElev + dAppr / vtCorr.z) ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
return false ;
// movimento di ritorno spora il punto iniziale
SetFeed( GetEndFeed()) ;
// movimento di ritorno in rapido sopra il punto iniziale
Point3d ptP5 = pLine->GetStart() + vtCorr * ( dElev + dAppr / vtCorr.z) ;
if ( AddLinearMove( ptP5) == GDB_ID_NULL)
if ( AddRapidMove( ptP5) == GDB_ID_NULL)
return false ;
}
}
@@ -2279,7 +2356,7 @@ Sawing::ProcessExtCurve( const ICurve* pCrvP, const ICurveComposite* pCrvC, cons
dMinRad = dRad ;
}
}
if ( dMinRad < m_pMchMgr->GetCurrMachiningsMgr()->GetExtSawArcMinRad()) {
if ( dMinRad < GetExtSawArcMinRad()) {
m_pMchMgr->SetWarning( 2258, "Warning in Sawing : Radius too small in ExtSawArc") ;
return true ;
}
@@ -2432,8 +2509,8 @@ Sawing::GenerateExtCurvePv( const ICurveComposite* pCrv, double dOffs,
if ( abs( m_Params.m_dSideAngle) > EPS_ANG_SMALL)
colCut = FUCHSIA ;
// dimensione da aggiungere alle regioni nelle parti in cui la lama è inclinata
double dExtraL = m_pMchMgr->GetCurrMachiningsMgr()->GetExtraLOnCutRegion() ;
// dimensione da aggiungere alle regioni nelle parti in cui la lama è inclinata
double dExtraL = GetExtraLOnCutRegion() ;
// lunghezza taglio parziale
double dDeltaT = (( dElev < 0.5 * m_TParams.m_dDiam) ? sqrt( dElev * m_TParams.m_dDiam - dElev * dElev) : 0) ;
@@ -2580,6 +2657,17 @@ Sawing::GenerateExtCurvePv( const ICurveComposite* pCrv, double dOffs,
return false ;
if ( ! ExeSurfFrAdd( nRId, nRsId) || ! ExeSurfFrAdd( nRId, nReId))
return false ;
// creo regioni di lavorazione che interessano le superfici superiore e inferiore del grezzo
int nSurfUpId = m_pGeomDB->CopyGlob( nRrId, GDB_ID_NULL, nPxId) ;
m_pGeomDB->SetName( nSurfUpId, MCH_PV_UP_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfUpId, INVISIBLE) ;
// solo se lavorazione interessa il fondo del grezzo creo la superficie down
if ( dRbHeight < EPS_SMALL) {
int nSurfDownId = m_pGeomDB->CopyGlob( nSurfUpId, GDB_ID_NULL, nPxId) ;
m_pGeomDB->SetName( nSurfDownId, MCH_PV_DOWN_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfDownId, INVISIBLE) ;
}
}
// altrimenti errore
@@ -2794,7 +2882,7 @@ Sawing::GenerateExtCurveCl( const ICurveComposite* pCrv,
SetPathId( nPxId) ;
SetCorrAuxDir( vtStaCorr) ;
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -2825,7 +2913,7 @@ Sawing::GenerateExtCurveCl( const ICurveComposite* pCrv,
CalculateToolAndCorrVersors( vtCurrDir, m_Params.m_nHeadSide, m_Params.m_nWorkSide, m_Params.m_dSideAngle, vtCurrTool, vtCurrCorr) ;
SetToolDir( vtCurrTool) ;
SetCorrAuxDir( vtCurrCorr) ;
if ( AddCurveMove( pSmpCrv, true) == GDB_ID_NULL)
if ( AddCurveMove( pSmpCrv) == GDB_ID_NULL)
return false ;
}
// 4 -> retrazione
@@ -2903,7 +2991,7 @@ Sawing::GenerateExtCurveCl( const ICurveComposite* pCrv,
pCopy->SimpleOffset( dOffs) ;
}
// emissione
if ( AddCurveMove( pCopy, true) == GDB_ID_NULL)
if ( AddCurveMove( pCopy) == GDB_ID_NULL)
return false ;
}
}
@@ -2936,7 +3024,7 @@ Sawing::GenerateExtCurveCl( const ICurveComposite* pCrv,
// inversione
pCopy->Invert() ;
// emissione
if ( AddCurveMove( pCopy, true) == GDB_ID_NULL)
if ( AddCurveMove( pCopy) == GDB_ID_NULL)
return false ;
}
}
@@ -3003,10 +3091,10 @@ Sawing::GenerateExtCurveCl( const ICurveComposite* pCrv,
pCopy->SimpleOffset( dOffs) ;
}
// emissione
if ( AddCurveMove( pCopy, true) == GDB_ID_NULL)
if ( AddCurveMove( pCopy) == GDB_ID_NULL)
return false ;
}
// se non è ultimo passo
// se non è ultimo passo
if ( i != 0) {
// ricavo punto di risalita e punto iniziale
Point3d ptP4 ;
@@ -3054,7 +3142,7 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
if ( IsNull( pArc))
return false ;
// determino l'inclinazione per ottenere il raggio e ne verifico il limite
double dMaxSideAng = m_pMchMgr->GetCurrMachiningsMgr()->GetIntSawArcMaxSideAng()+ EPS_ANG_SMALL ;
double dMaxSideAng = GetIntSawArcMaxSideAng() + EPS_ANG_SMALL ;
double dSawRad = m_TParams.m_dDiam / 2 ;
double dRad = pArc->GetRadius() ;
double dSinA = dSawRad / dRad ;
@@ -3150,7 +3238,7 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
m_pMchMgr->SetWarning( 2257, "Warning in Sawing : skipped Entity too small") ;
return true ;
}
// ricalcolo i versori fresa alle estremità (potrebbero essere cambiate)
// ricalcolo i versori fresa alle estremità (potrebbero essere cambiate)
pArc->GetStartDir( vtStaDirC) ;
pArc->GetMidDir( vtMidDirC) ;
pArc->GetEndDir( vtEndDirC) ;
@@ -3242,8 +3330,8 @@ Sawing::GenerateIntArcPv( const ICurveArc* pArc,
m_pGeomDB->SetName( nId3, MCH_PV_POST_CUT) ;
m_pGeomDB->SetMaterial( nId3, BLUE) ;
// dimensione da aggiungere alle regioni nelle parti in cui la lama è inclinata
double dExtraL = m_pMchMgr->GetCurrMachiningsMgr()->GetExtraLOnCutRegion() ;
// dimensione da aggiungere alle regioni nelle parti in cui la lama è inclinata
double dExtraL = GetExtraLOnCutRegion() ;
// regione ridotta di taglio per nesting (escluse parti iniziali e finali)
PtrOwner<ICurveComposite> pCmpRr( GenerateIntArcPvTrueCut( pArc, dDeltaInt, dDeltaExt, dExtraL)) ;
@@ -3296,6 +3384,17 @@ Sawing::GenerateIntArcPv( const ICurveArc* pArc,
if ( ! ExeSurfFrAdd( nRId, nRsId) || ! ExeSurfFrAdd( nRId, nReId))
return false ;
// creo regioni di lavorazione che interessano le superfici superiore e inferiore del grezzo
int nSurfUpId = m_pGeomDB->CopyGlob( nRrId, GDB_ID_NULL, nPxId) ;
m_pGeomDB->SetName( nSurfUpId, MCH_PV_UP_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfUpId, INVISIBLE) ;
// solo se lavorazione interessa il fondo del grezzo creo la superficie down
if ( dRbHeight < EPS_SMALL) {
int nSurfDownId = m_pGeomDB->CopyGlob( nSurfUpId, GDB_ID_NULL, nPxId) ;
m_pGeomDB->SetName( nSurfDownId, MCH_PV_DOWN_RAWCUT) ;
m_pGeomDB->SetMaterial( nSurfDownId, INVISIBLE) ;
}
// salvo in info gruppo : larghezza XY del taglio, distanza XY tra centro e bordo taglio, extra taglio e quota minima della lama
m_pGeomDB->SetInfo( nPxId, MCH_PV_KEY_WT, dDeltaInt + dDeltaExt) ;
m_pGeomDB->SetInfo( nPxId, MCH_PV_KEY_DT, dDeltaT * dLenCoeff) ;
@@ -3490,7 +3589,7 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc,
// Imposto dati comuni
SetPathId( nPxId) ;
// recupero distanza di sicurezza
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
double dSafeZ = GetSafeZ() ;
// lunghezza di approccio/retrazione
double dAppr = m_Params.m_dStartPos ;
@@ -3528,12 +3627,12 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc,
else {
Point3d ptMid ;
pArc->GetMidPoint( ptMid) ;
// prima metà arco
// prima metà arco
SetToolDir( vtMidTool) ;
SetCorrAuxDir( vtMidCorr) ;
if ( AddArcMove( ptMid, ptCen, dAngCen / 2, vtN) == GDB_ID_NULL)
return false ;
// seconda metà arco
// seconda metà arco
SetToolDir( vtEndTool) ;
SetCorrAuxDir( vtEndCorr) ;
if ( AddArcMove( ptP3, ptCen, dAngCen / 2, vtN) == GDB_ID_NULL)
@@ -3614,12 +3713,12 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc,
pArc->GetMidPoint( ptMid) ;
ptMid += Z_AX * dDelta ;
double dCurrAngCen = dAngCen / 2 * ((( i % 2) == 0) ? -1 : 1) ;
// prima metà arco
// prima metà arco
SetToolDir( vtMidTool) ;
SetCorrAuxDir( vtMidCorr) ;
if ( AddArcMove( ptMid, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
return false ;
// seconda metà arco
// seconda metà arco
SetToolDir( ( ( i % 2) == 0) ? vtStaTool : vtEndTool) ;
SetCorrAuxDir( ( ( i % 2) == 0) ? vtStaCorr : vtEndCorr) ;
if ( AddArcMove( ptP3, ptCen, dCurrAngCen, vtN) == GDB_ID_NULL)
@@ -3703,18 +3802,18 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc,
Point3d ptMid ;
pArc->GetMidPoint( ptMid) ;
ptMid += Z_AX * dDelta ;
// prima metà arco
// prima metà arco
SetToolDir( vtMidTool) ;
SetCorrAuxDir( vtMidCorr) ;
if ( AddArcMove( ptMid, ptCen, dAngCen / 2, vtN) == GDB_ID_NULL)
return false ;
// seconda metà arco
// seconda metà arco
SetToolDir( vtEndTool) ;
SetCorrAuxDir( vtEndCorr) ;
if ( AddArcMove( ptP3, ptCen, dAngCen / 2, vtN) == GDB_ID_NULL)
return false ;
}
// se non è ultimo passo
// se non è ultimo passo
if ( i != 0) {
// movimento di risalita sopra il punto finale
SetFeed( GetEndFeed()) ;
@@ -3739,8 +3838,16 @@ Sawing::GenerateIntArcCl( const ICurveArc* pArc,
bool
Sawing::AddApproach( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr)
{
// se distanza di sicurezza minore di distanza di inizio
if ( dSafeZ < m_Params.m_dStartPos + 10 * EPS_SMALL) {
// se abilitato approccio diretto fuori dal grezzo (solo per lavorazione ToAndFrom)
if ( m_bDownSE) {
// 1 -> punto sopra inizio
SetFlag( 1) ;
Point3d ptP1 = ptP + vtCorr * ( dElev / 2 + dAppr / vtCorr.z) ;
if ( AddRapidStart( ptP1) == GDB_ID_NULL)
return false ;
}
// se distanza di sicurezza minore di distanza di inizio
else if ( dSafeZ < m_Params.m_dStartPos + 10 * EPS_SMALL) {
// 1 -> punto sopra inizio
SetFlag( 1) ;
Point3d ptP1 = ptP + vtCorr * ( dElev + dAppr / vtCorr.z) ;
@@ -3766,7 +3873,15 @@ Sawing::AddApproach( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ,
bool
Sawing::AddRetract( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr)
{
if ( dSafeZ < m_Params.m_dStartPos + 10 * EPS_SMALL) {
// se abilitato retrazione diretta fuori dal grezzo (solo per lavorazione ToAndFrom)
if ( m_bDownSE) {
// 4 -> movimento di risalita sopra il punto finale
SetFeed( GetEndFeed()) ;
Point3d ptP4 = ptP + vtCorr * ( dElev / 2 + dAppr / vtCorr.z) ;
if ( AddRapidMove( ptP4) == GDB_ID_NULL)
return false ;
}
else if ( dSafeZ < m_Params.m_dStartPos + 10 * EPS_SMALL) {
// 4 -> movimento di risalita sopra il punto finale
SetFeed( GetEndFeed()) ;
Point3d ptP4 = ptP + vtCorr * ( dElev + dAppr / vtCorr.z) ;
@@ -3792,29 +3907,40 @@ bool
Sawing::CalculateToolAndCorrVersors( const Vector3d& vtTang, int nHeadSide, int nWorkSide, double dSideAng,
Vector3d& vtTool, Vector3d& vtCorr)
{
// Versore fresa : annullo la componente in Z e normalizzo
vtTool = vtTang ;
vtTool.z = 0 ;
if ( ! vtTool.Normalize())
// Direzione tangente nel piano XY
Vector3d vtXYTg = vtTang ;
vtXYTg.z = 0 ;
double dLenXYTg = vtXYTg.Len() ;
if ( dLenXYTg < EPS_SMALL)
return false ;
// ruoto attorno a Zglob+ a seconda del lato mandrino
vtXYTg /= dLenXYTg ;
// se direzione tangente inclinata in Z e SideAng non nullo devo calcolare la vera tangente nel piano XY
if ( abs( vtTang.z) > EPS_SMALL && abs( dSideAng) > EPS_ANG_SMALL) {
double dSinDelta = vtTang.z * tan( dSideAng * DEGTORAD) / dLenXYTg ;
double dCosDelta = sqrt( 1 - dSinDelta * dSinDelta) ;
if ( nHeadSide == SAW_HS_LEFT)
vtXYTg.Rotate( Z_AX, dCosDelta, dSinDelta) ;
else
vtXYTg.Rotate( Z_AX, dCosDelta, -dSinDelta) ;
}
// Versore fresa : ruoto direzione nel piano XY attorno a Zglob+ a seconda del lato mandrino
vtTool = vtXYTg ;
if ( nHeadSide == SAW_HS_LEFT)
vtTool.Rotate( Z_AX, 0, 1) ;
else
vtTool.Rotate( Z_AX, 0, -1) ;
// Versore correzione
// Versore correzione : se lama sbandata devo aggiustare
vtCorr = Z_AX ;
// Se lama sbandata
if ( abs( dSideAng) > EPS_ANG_SMALL) {
if ( nWorkSide == SAW_WS_RIGHT) {
vtTool.Rotate( vtTang, - dSideAng) ;
vtCorr.Rotate( vtTang, - dSideAng) ;
vtTool.Rotate( vtXYTg, - dSideAng) ;
vtCorr.Rotate( vtXYTg, - dSideAng) ;
}
else {
vtTool.Rotate( vtTang, dSideAng) ;
vtCorr.Rotate( vtTang, dSideAng) ;
vtTool.Rotate( vtXYTg, dSideAng) ;
vtCorr.Rotate( vtXYTg, dSideAng) ;
}
}
@@ -3825,7 +3951,7 @@ Sawing::CalculateToolAndCorrVersors( const Vector3d& vtTang, int nHeadSide, int
bool
Sawing::AdjustForSide( ICurve* pCurve)
{
// se lato lavoro e lato mandrino coincidono, non devo fare alcunché
// se lato lavoro e lato mandrino coincidono, non devo fare alcunché
if ( ( m_Params.m_nWorkSide == SAW_WS_LEFT && m_Params.m_nHeadSide == SAW_HS_LEFT) ||
( m_Params.m_nWorkSide == SAW_WS_RIGHT && m_Params.m_nHeadSide == SAW_HS_RIGHT))
return true ;
@@ -3870,7 +3996,7 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
bool& bToSkip, double& dDeltaLiExt, double& dDeltaLoExt)
{
// distanza XY tra centro e bordo taglio
double dDeltaT = (( dElev < 0.5 * m_TParams.m_dDiam) ? sqrt( dElev * m_TParams.m_dDiam - dElev * dElev) : 0) ;
double dDeltaT = (( dElev < 0.5 * m_TParams.m_dDiam) ? sqrt( dElev * m_TParams.m_dDiam - dElev * dElev) : 0.5 * m_TParams.m_dDiam) ;
// lunghezza aggiuntiva per attacco speciale a zigzag
double dDeltaLi = 0 ;
if ( dLiElev > EPS_SMALL)
@@ -3906,7 +4032,7 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
for ( int i = 0 ; i < 4 ; ++i)
dDeltaI = max( dDeltaI, dDist[i]) ;
if ( m_Params.m_nLeadInType == SAW_LI_EXT_OUT)
dDeltaI += dDeltaT ;
dDeltaI += dDeltaT + ( m_bDownSE ? MIN_SAFEDIST : 0) ;
dDeltaLiExt = dDeltaI ;
}
}
@@ -3930,7 +4056,7 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
for ( int i = 0 ; i < 4 ; ++i)
dDeltaI = max( dDeltaI, dDist[i]) ;
if ( m_Params.m_nLeadInType == SAW_LI_EXT_OUT)
dDeltaI += dDeltaT ;
dDeltaI += dDeltaT + ( m_bDownSE ? MIN_SAFEDIST : 0) ;
dDeltaLiExt = dDeltaI ;
}
}
@@ -3965,7 +4091,7 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
for ( int i = 0 ; i < 4 ; ++i)
dDeltaF = max( dDeltaF, dDist[i]) ;
if ( m_Params.m_nLeadOutType == SAW_LO_EXT_OUT)
dDeltaF += dDeltaT ;
dDeltaF += dDeltaT + ( m_bDownSE ? MIN_SAFEDIST : 0) ;
dDeltaLoExt = dDeltaF ;
}
}
@@ -3990,11 +4116,11 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
dDeltaF = max( dDeltaF, dDist[i]) ;
// se LeadOut EXT_OUT vado all'esterno
if ( m_Params.m_nLeadOutType == SAW_LO_EXT_OUT)
dDeltaF += dDeltaT ;
dDeltaF += dDeltaT + ( m_bDownSE ? MIN_SAFEDIST : 0) ;
dDeltaLoExt = dDeltaF ;
}
}
// controllo se lunghezza entità accettabile
// controllo se lunghezza entità accettabile
const double MIN_LEN = 1 ;
double dLenXY = DistXY( pLine->GetStart(), pLine->GetEnd()) ;
if ( dDeltaI + dLenXY + dDeltaF < MIN_LEN) {
@@ -4065,7 +4191,7 @@ Sawing::AdjustCurveForEdges( ICurve* pCrv, double dElev, double dLenCoeff,
dDeltaF = dDeltaT ;
}
dDeltaF *= dLenCoeff ;
// controllo se lunghezza entità accettabile
// controllo se lunghezza entità accettabile
const double MIN_LEN = 1 ;
double dLenXY ;
pCrv->GetLength( dLenXY) ;
+1
View File
@@ -164,6 +164,7 @@ class Sawing : public Machining
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
SawingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
bool m_bDownSE ; // flag per attacco/uscita senza risalite se fuori dal grezzo
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nCuts ; // numero di tagli generati
} ;
+6 -2
View File
@@ -99,6 +99,10 @@ struct SawingData : public MachiningData
//----------------------------------------------------------------------------
inline const SawingData* GetSawingData( const MachiningData* pMdata)
{ return (dynamic_cast<const SawingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWING)
return nullptr ;
return ( static_cast<const SawingData*>( pMdata)) ; }
inline SawingData* GetSawingData( MachiningData* pMdata)
{ return (dynamic_cast<SawingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SAWING)
return nullptr ;
return ( static_cast<SawingData*>( pMdata)) ; }
+21 -11
View File
@@ -181,16 +181,12 @@ SetupMgr::Import( const string& sFileName)
m_pMchMgr->GetCurrMachGroup() == GDB_ID_NULL)
return false ;
// recupero il gruppo di setup
int nSetupId = m_pMchMgr->GetCurrSetupGroupId() ;
// inizializzo lo scanner
Scanner TheScanner ;
if ( ! TheScanner.Init( sFileName, ";"))
return false ;
// eseguo la lettura dei campi di attrezzaggio
int nPos = 1 ;
string sLine ;
while ( TheScanner.GetLine( sLine)) {
// salto dichiarazione sezione
@@ -228,8 +224,6 @@ SetupMgr::Import( const string& sFileName)
stuData.m_nExit = 0 ;
m_vStuData.emplace_back( stuData) ;
}
// passo alla successiva posizione
++ nPos ;
}
return true ;
@@ -277,14 +271,20 @@ SetupMgr::GetPosData( int nPos, string& sTcPos, string& sHead, int& nExit, strin
bool
SetupMgr::GetToolData( const string& sName, string& sTcPos, string& sHead, int& nExit, int* pnPos) const
{
// reset valori di ritorno
sTcPos.clear() ;
sHead.clear() ;
nExit = 0 ;
if ( pnPos != nullptr)
*pnPos = 0 ;
// verifico validità utensile
if ( IsEmptyOrSpaces( sName))
return false ;
// cerco l'utensile
int nI = - 1 ;
for ( size_t i = 0 ; i < m_vStuData.size() ; ++ i) {
for ( int i = 0 ; i < int( m_vStuData.size()) ; ++ i) {
if ( m_vStuData[i].m_nExit > 0 && EqualNoCase( sName, m_vStuData[i].m_sName)) {
nI = int( i) ;
nI = i ;
break ;
}
}
@@ -318,11 +318,21 @@ SetupMgr::GetToolName( const string& sHead, int nExit, string& sName) const
bool
SetupMgr::GetToolsInSetupPos( const string& sTcPos, STRVECTOR& vsTools) const
{
// default vettore vuoto
vsTools.clear() ;
// eseguo ricerca
// verifico macchina
if ( m_pMachine == nullptr)
return false ;
// eseguo ricerca (con inserimento nel vettore secondo indice dell'uscita)
for ( int i = 0 ; i < int( m_vStuData.size()) ; ++ i) {
if ( EqualNoCase( sTcPos, m_vStuData[i].m_sTcPos)) {
vsTools.emplace_back( m_vStuData[i].m_sName) ;
if ( ! IsEmptyOrSpaces( m_vStuData[i].m_sHead) && EqualNoCase( sTcPos, m_vStuData[i].m_sTcPos)) {
if ( vsTools.empty()) {
int nExitCnt = m_pMachine->GetHeadExitCount( m_vStuData[i].m_sHead) ;
vsTools.resize( nExitCnt) ;
}
int nExit = m_vStuData[i].m_nExit ;
if ( nExit > 0 && nExit <= int( vsTools.size()))
vsTools[nExit - 1] = m_vStuData[i].m_sName ;
}
}
return true ;
+44 -129
View File
@@ -1,148 +1,63 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : Simulator.h Data : 19.10.15 Versione : 1.6j2
// Contenuto : Dichiarazione della classe Simulator.
// File : Simulator.h Data : 01.09.24 Versione : 2.6i1
// Contenuto : Dichiarazione della classe interfaccia ISimulator.
//
//
//
// Modifiche : 19.10.15 DS Creazione modulo.
// Modifiche : 01.09.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "CamData.h"
#include "/EgtDev/Include/EGkVector3d.h"
#include "/EgtDev/Include/EMkSimuGenConst.h"
#include "/EgtDev/Include/EgtNumCollection.h"
#include <string>
class MachMgr ;
class IGeomDB ;
class Machine ;
class PerformanceCounter ;
//------------------------ Struttura per movimento esterno assi --------------
struct SimAxMv
{
std::string sName ;
double dEndPos ;
double dStep ;
SimAxMv( void) : dEndPos( 0), dStep( 0) { }
SimAxMv( std::string sN, double dE, double dS) : sName( sN), dEndPos( dE), dStep( dS) {}
} ;
typedef std::vector<SimAxMv> SAMVECTOR ;
//------------------------ Risultato movimento esterno assi -------------------
enum SimAxMvRes { SIM_AXMV_RES_STOP = -1,
SIM_AXMV_RES_ERR = 0,
SIM_AXMV_RES_OK = 1} ;
//----------------------------------------------------------------------------
class Simulator
class __declspec( novtable) ISimulator
{
public :
Simulator( void) ;
~Simulator( void) ;
bool Init( MachMgr* pMchMgr) ;
bool Start( bool bFirst) ;
bool Move( int& nStatus) ;
bool GoHome( void) ;
bool SetStep( double dStep) ;
bool SetUiStatus( int nUiStatus) ;
bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const ;
bool GetToolInfo( std::string& sName, double& dSpeed) const ;
bool GetOperationInfo( std::string& sName, int& nType) const ;
bool GetMoveInfo( int& nGmove, double& dFeed) const ;
bool AddCollisionObj( int nInd, int nFrameId, int nType, const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) ;
bool ExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType) ;
bool OnCollision( int nCdInd, int nObjInd, int& nErr) ;
private :
bool UpdateTool( bool bFirst, int& nErr) ;
bool UpdateAxes( void) ;
bool UpdateAxesPos( void) ;
bool ResetInterpolation( void) ;
bool ResetAxes( void) ;
bool ResetAuxAxes( void) ;
private :
bool VerifySetup( void) ;
bool FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus) ;
bool ManageOperationEnd( int& nStatus) ;
bool FindAndManagePathStart( int& nStatus) ;
bool ManagePathEnd( int& nStatus) ;
bool ManagePathStartAux( int& nStatus) ;
bool ManagePathEndAux( int& nStatus) ;
bool ManageMove( int& nStatus) ;
bool ManageSingleMove( int& nStatus, double& dMove) ;
int CalcStatusOnError( int nErr) ;
bool GetHeadCurrPosDirAux( Point3d& ptH, Vector3d& vtH, Vector3d& vtA) ;
bool ExecLineVmill( int nVmId, const Point3d& ptHi, const Vector3d& vtHi, const Vector3d& vtAi, const Frame3d& frVzmI,
const Point3d& ptHf, const Vector3d& vtHf, const Vector3d& vtAf, const Frame3d& frVzmF) ;
bool NeedCollisionCheck( void) const
{ return ( ! m_CollObj.empty() && ! m_CdId.empty()) ; }
bool Stopped( void)
{ return ( m_nUiStatus == MCH_UISIM_STOP) ; }
bool OnStart( bool bFirst) ;
bool OnEnd( void) ;
bool OnDispositionStarting( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionEnd( void) ;
bool OnToolSelect( const std::string& sTool, const std::string& sHead, int nExit, const std::string& sTcPos, bool bFirst, int& nErr) ;
bool OnToolDeselect( const std::string& sNextTool, const std::string& sNextHead, int nNextExit, const std::string& sNextTcPos, int& nErr) ;
bool OnMachiningStart( int nOpId, int nOpInd, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax) ;
bool OnMachiningEnd( void) ;
bool OnPathStartAux( int nInd, const std::string& sAS, int& nErr) ;
bool OnPathEndAux( int nInd, const std::string& sAE, int& nErr) ;
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev) ;
bool OnPathEnd( int nAE) ;
bool OnMoveStart( const CamData* pCamData, int& nErr) ;
bool OnMoveEnd( int& nErr) ;
bool OnResetMachine( void) ;
private :
struct CollObj {
int nInd ;
int nFrameId ;
int nType ;
Vector3d vtMove ;
double dPar1 ;
double dPar2 ;
double dPar3 ;
CollObj( void) : nInd( 0), nFrameId( -1), nType( 0), vtMove(), dPar1( 0), dPar2( 0), dPar3( 0) {}
CollObj( int nI, int nF, int nT, const Vector3d& vtM, double dP1, double dP2, double dP3)
: nInd( nI), nFrameId( nF), nType( nT), vtMove( vtM), dPar1( dP1), dPar2( dP2), dPar3( dP3) {}
} ;
typedef std::vector< CollObj> COBVECTOR ;
private :
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
Machine* m_pMachine ; // puntatore alla macchina
PerformanceCounter* m_pPerfCnt ; // timer per calcolo FPS
double m_dStep ; // lunghezza di riferimento per la velocità di simulazione
int m_nUiStatus ; // stato simulazione a livello utente
int m_nOpId ; // identificativo della operazione (lavoraz.) corrente
int m_nOpInd ; // contatore della operazione (lavoraz.) corrente
int m_nCLPathId ; // identificativo del percorso di lavoro corrente
int m_nCLPathInd ; // contatore del percorso di lavoro corrente nell'operazione
int m_nEntId ; // identificativo dell'entità corrente
int m_nEntInd ; // contatore dell'entità corrente nel percorso di lavoro
double m_dCoeff ; // coefficiente di esecuzione del movimento corrente (0...1)
int m_nAuxSTot ; // numero totale movimenti ausiliari di inizio percorso
int m_nAuxSInd ; // indice del movimento ausiliario di inizio percorso corrente
int m_nAuxETot ; // numero totale movimenti ausiliari di fine percorso
int m_nAuxEInd ; // indice del movimento ausiliario di fine percorso corrente
std::string m_sTool ; // nome dell'utensile corrente
std::string m_sHead ; // nome della testa corrente
int m_nExit ; // indice dell'uscita corrente
double m_dTDiam ; // diametro dell'utensile corrente
INTVECTOR m_VmId ; // vettore identificativi Zmap per Virtual Milling
INTVECTOR m_CdId ; // vettore identificativi Zmap per Collision Detection
double m_dVmTdOffs ; // offset utensile in direzione principale per VM
double m_dVmAdOffs ; // offset utensile in direzione ausiliaria per VM
COBVECTOR m_CollObj ; // vettore oggetti da testare per collisione con grezzo
double m_dSafeDist ; // distanza di sicurezza per verifica collisioni
bool m_bEnabAxes ; // flag abilitazione movimento assi attivi
bool m_bShowAxes ; // flag visualizzazione assi attivi
STRVECTOR m_AxesName ; // nomi degli assi macchina attivi
STRVECTOR m_AxesToken ; // token degli assi macchina attivi
BOOLVECTOR m_AxesInvert ; // flag di asse con verso invertito
BOOLVECTOR m_AxesLinear ; // flag di lineare degli assi macchina attivi
DBLVECTOR m_AxesVal ; // valori degli assi macchina all'inizio del movimento corrente
STRVECTOR m_AuxAxesName ; // nomi degli assi macchina ausiliari abilitati
STRVECTOR m_AuxAxesToken ; // token degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesInvert ; // flag di asse con verso invertito degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesLinear ; // flag di lineare degli assi macchina ausiliari abilitati
DBLVECTOR m_AuxAxesVal ; // valori degli assi macchina ausiliari all'inizio del movimento corrente
DBLVECTOR m_AuxAxesEnd ; // valori degli assi macchina ausiliari alla fine del movimento corrente
virtual ~ISimulator( void) {}
virtual bool Init( MachMgr* pMchMgr) = 0 ;
virtual bool Start( bool bFirst) = 0 ;
virtual bool Move( int& nStatus) = 0 ;
virtual bool GoHome( void) = 0 ;
virtual bool SetStep( double dStep) = 0 ;
virtual bool SetUiStatus( int nUiStatus) = 0 ;
virtual bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const = 0 ;
virtual bool GetToolInfo( std::string& sName, double& dSpeed) const = 0 ;
virtual bool GetOperationInfo( std::string& sName, int& nType) const = 0 ;
virtual bool GetMoveInfo( int& nGmove, double& dFeed) const = 0 ;
virtual bool AddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType,
const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) = 0 ;
virtual bool ExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType) = 0 ;
virtual bool OnCollision( int nCdInd, int nObjInd, int& nErr) = 0 ;
virtual bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) = 0 ;
virtual bool EnableToolsForVmill( bool bEnable) = 0 ;
virtual int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) = 0 ;
virtual bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) = 0 ;
} ;
+2698
View File
File diff suppressed because it is too large Load Diff
+215
View File
@@ -0,0 +1,215 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : SimulatorMP.h Data : 01.09.24 Versione : 2.6i1
// Contenuto : Dichiarazione della classe SimulatorMP.
// Simulatore multi-processo.
//
//
// Modifiche : 01.09.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Simulator.h"
#include "CamData.h"
class IGeomDB ;
class Machine ;
class PerformanceCounter ;
//----------------------------------------------------------------------------
ISimulator* CreateSimulatorMP( void) ;
//----------------------------------------------------------------------------
class SimulatorMP : public ISimulator
{
public : // ISimulator
~SimulatorMP( void) override ;
bool Init( MachMgr* pMchMgr) override ;
bool Start( bool bFirst) override ;
bool Move( int& nStatus) override ;
bool GoHome( void) override ;
bool SetStep( double dStep) override ;
bool SetUiStatus( int nUiStatus) override ;
bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const override ;
bool GetToolInfo( std::string& sName, double& dSpeed) const override ;
bool GetOperationInfo( std::string& sName, int& nType) const override ;
bool GetMoveInfo( int& nGmove, double& dFeed) const override ;
bool AddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType,
const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) override ;
bool ExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType) override ;
bool OnCollision( int nCdInd, int nObjInd, int& nErr) override ;
bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) override ;
bool EnableToolsForVmill( bool bEnable) override ;
int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) override ;
bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) override ;
public :
SimulatorMP( void) ;
private :
bool UpdateMachiningTool( bool bFirst, int& nChangeTool, int& nErr) ;
bool UpdateDispositionTool( bool bFirst, int& nErr) ;
bool UpdateAxes( void) ;
bool UpdateAxesPos( void) ;
bool ResetInterpolation( void) ;
bool ResetAxes( void) ;
bool ResetAuxAxes( void) ;
private :
bool VerifySetup( void) ;
bool FindAndManageOperationStart( bool bStart, bool bFirst, int& nChangeTool, int& nStatus) ;
bool ManageOperationEnd( int& nStatus) ;
bool FindAndManagePathStart( int& nStatus) ;
bool ManagePathEnd( int& nStatus) ;
bool ManagePathStartAux( int& nStatus) ;
bool ManagePathEndAux( int& nStatus) ;
bool ManageMove( int& nStatus) ;
bool ManageSingleMove( int& nStatus, double& dMove) ;
int CalcStatusOnError( int nErr) ;
bool GetHeadCurrPosDirAux( const std::string& sHead, int nExit, Point3d& ptH, Vector3d& vtH, Vector3d& vtA) ;
bool ExecLineVmill( int nVmId, int nCurrTool, double dVmTdOffs, double dVmAdOffs,
const Point3d& ptHi, const Vector3d& vtHi, const Vector3d& vtAi, const Frame3d& frVzmI,
const Point3d& ptHf, const Vector3d& vtHf, const Vector3d& vtAf, const Frame3d& frVzmF) ;
bool NeedCollisionCheck( void) const
{ return ( ! m_CollObj.empty() && ! m_CdId.empty()) ; }
bool Stopped( void)
{ return ( m_nUiStatus == MCH_UISIM_STOP) ; }
bool SetCollisionMark( int nCdInd, int nObjInd) ;
bool ResetCollisionMark( void) ;
bool CallFunction( const std::string& sFun, bool bSetRecord = false, bool bSetModifiedOff = true) ;
bool OnInit( void) ;
bool OnExit( void) ;
bool OnProgramStart( bool bFirst) ;
bool OnProgramEnd( void) ;
bool OnDispositionStarting( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionEnd( void) ;
bool OnToolSelect( const std::string& sTool, const std::string& sHead, int nExit, const std::string& sTcPos,
bool bFirst, bool bFloating, int& nErr) ;
bool OnToolDeselect( const std::string& sNextTool, const std::string& sNextHead, int nNextExit, const std::string& sNextTcPos, int& nErr) ;
bool OnMachiningStart( int nOpId, int nOpInd, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax) ;
bool OnMachiningEnd( void) ;
bool OnPathStartAux( int nInd, const std::string& sAS, int& nErr) ;
bool OnPathEndAux( int nInd, const std::string& sAE, int& nErr) ;
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit) ;
bool OnPathEnd( int nAE) ;
bool OnMoveStart( const CamData* pCamData, const CamData* pNextCamData, int& nErr) ;
bool OnMoveEnd( int& nErr) ;
bool OnResetMachine( void) ;
bool ReadAuxAxesData( int& nErr) ;
bool ExecCmdData( int& nStatus) ;
bool ExecAllCmdData( int& nStatus) ;
private :
struct CollObj {
int nInd ;
bool bToolOn ;
int nFrameId ;
int nType ;
Vector3d vtMove ;
double dPar1 ;
double dPar2 ;
double dPar3 ;
CollObj( void) : nInd( 0), bToolOn( false), nFrameId( -1), nType( 0), vtMove(), dPar1( 0), dPar2( 0), dPar3( 0) {}
CollObj( int nI, bool bTOn, int nF, int nT, const Vector3d& vtM, double dP1, double dP2, double dP3)
: nInd( nI), bToolOn( bTOn), nFrameId( nF), nType( nT), vtMove( vtM), dPar1( dP1), dPar2( dP2), dPar3( dP3) {}
} ;
typedef std::vector<CollObj> COBVECTOR ;
struct VmTool
{
std::string sName ;
std::string sHead ;
int nExit ;
double dTdOffs ;
double dAdOffs ;
VmTool( void) : nExit( 0), dTdOffs( 0), dAdOffs( 0) {}
VmTool( std::string sN, std::string sH, int nE, double dT, double dA)
: sName( sN), sHead( sH), nExit( nE), dTdOffs( dT), dAdOffs( dA) {}
} ;
typedef std::vector<VmTool> VMTVECTOR ;
enum { SIS_CREATED = 0,
SIS_INITIALIZED = 1,
SIS_READYTOSTART = 2,
SIS_READYTORUN = 3} ;
private :
struct CmdData {
int nType ;
int nMoveType ;
SAMVECTOR vAxNaEpSt ;
int nPar ;
std::string sPar ;
std::string sPar2 ;
CmdData( void) : nType(0) {}
CmdData( int nM, const SAMVECTOR& vAx)
: nType( 1), nMoveType( nM), vAxNaEpSt( vAx) {}
CmdData( int nT, int nP, const std::string& sP, const std::string& sP2)
: nType( nT), nPar( nP), sPar( sP), sPar2( sP2) {}
} ;
typedef std::vector<CmdData> CMDVECTOR ;
private :
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
Machine* m_pMachine ; // puntatore alla macchina
PerformanceCounter* m_pPerfCnt ; // timer per calcolo FPS
std::string m_sSpecEstim ; // path del file con i dati della stima speciale
int m_nStatus ; // stato interno del simulatore (creato, inizializzato, pronto al movimento)
double m_dStep ; // lunghezza di riferimento per la velocità di simulazione
int m_nUiStatus ; // stato simulazione a livello utente
INTVECTOR m_vOperId ; // vettore identificativi operazioni ordinate per simulazione
int m_nOpId ; // identificativo della operazione (lavoraz.) corrente
int m_nOpInd ; // contatore della operazione (lavoraz.) corrente
int m_nCLPathId ; // identificativo del percorso di lavoro corrente
int m_nCLPathInd ; // contatore del percorso di lavoro corrente nell'operazione
int m_nEntId ; // identificativo dell'entità corrente
int m_nEntInd ; // contatore dell'entità corrente nel percorso di lavoro
double m_dCoeff ; // coefficiente di esecuzione del movimento corrente (0...1)
int m_nChangeTool ; // stato di carico e scarico dell'utensile
int m_nAuxSTot ; // numero totale movimenti ausiliari di inizio percorso
int m_nAuxSInd ; // indice del movimento ausiliario di inizio percorso corrente
int m_nAuxETot ; // numero totale movimenti ausiliari di fine percorso
int m_nAuxEInd ; // indice del movimento ausiliario di fine percorso corrente
std::string m_sTool ; // nome dell'utensile corrente
std::string m_sHead ; // nome della testa corrente
int m_nExit ; // indice dell'uscita corrente
double m_dTDiam ; // diametro dell'utensile corrente
bool m_bCutOnTip ; // flag capacità di lavorare di testa dell'utensile corrente
bool m_bEnableVm ; // flag abilitazione Virtual Milling
INTVECTOR m_VmId ; // vettore identificativi Zmap per Virtual Milling
INTVECTOR m_CdId ; // vettore identificativi Zmap per Collision Detection
VMTVECTOR m_VmTool ; // vettore utensili attivi per virtual milling
COBVECTOR m_CollObj ; // vettore oggetti da testare per collisione con grezzo
double m_dSafeDist ; // distanza di sicurezza per verifica collisioni
INTVECTOR m_nCollMarkId ; // elenco oggetti marcati per visualizzare meglio la collisione rilevata
int m_nAxesMask ; // maschera a bit di abilitazione movimento assi (solo se rapido)
bool m_bEnabAxes ; // flag abilitazione movimento assi attivi
bool m_bShowAxes ; // flag visualizzazione assi attivi
STRVECTOR m_AxesName ; // nomi degli assi macchina attivi
STRVECTOR m_AxesToken ; // token degli assi macchina attivi
BOOLVECTOR m_AxesInvert ; // flag di asse con verso invertito degli assi macchina attivi
DBLVECTOR m_AxesOffset ; // valore di offset delgli assi macchina ttivi
BOOLVECTOR m_AxesLinear ; // flag di lineare degli assi macchina attivi
DBLVECTOR m_AxesVal ; // valori degli assi macchina all'inizio del movimento corrente
STRVECTOR m_AuxAxesName ; // nomi degli assi macchina ausiliari abilitati
STRVECTOR m_AuxAxesToken ; // token degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesInvert ; // flag di asse con verso invertito degli assi macchina ausiliari abilitati
DBLVECTOR m_AuxAxesOffset ; // valore di offset degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesLinear ; // flag di lineare degli assi macchina ausiliari abilitati
DBLVECTOR m_AuxAxesVal ; // valori degli assi macchina ausiliari all'inizio del movimento corrente
DBLVECTOR m_AuxAxesEnd ; // valori degli assi macchina ausiliari alla fine del movimento corrente
INTVECTOR m_AuxAxesLink ; // indice + 1 asse principale di aggancio (negativo valore opposto, 0 nessuno)
CMDVECTOR m_CmdData ; // vettore comandi in attesa di esecuzione
int m_nCmdInd ; // indice prossimo comando da eseguire
double m_dCmdCoeff ; // coefficiente di movimento nel comando
} ;
File diff suppressed because it is too large Load Diff
+189
View File
@@ -0,0 +1,189 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2024
//----------------------------------------------------------------------------
// File : SimulatorSP.h Data : 16.01.23 Versione : 2.5a2
// Contenuto : Dichiarazione della classe Simulator.
//
//
//
// Modifiche : 19.10.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Simulator.h"
#include "CamData.h"
class IGeomDB ;
class Machine ;
class PerformanceCounter ;
//----------------------------------------------------------------------------
ISimulator* CreateSimulatorSP( void) ;
//----------------------------------------------------------------------------
class SimulatorSP : public ISimulator
{
public :
~SimulatorSP( void) override ;
bool Init( MachMgr* pMchMgr) override ;
bool Start( bool bFirst) override ;
bool Move( int& nStatus) override ;
bool GoHome( void) override ;
bool SetStep( double dStep) override ;
bool SetUiStatus( int nUiStatus) override ;
bool GetAxisInfoPos( int nI, std::string& sName, std::string& sToken, bool& bLinear, double& dVal) const override ;
bool GetToolInfo( std::string& sName, double& dSpeed) const override ;
bool GetOperationInfo( std::string& sName, int& nType) const override ;
bool GetMoveInfo( int& nGmove, double& dFeed) const override ;
bool AddCollisionObj( int nInd, bool bToolOn, int nFrameId, int nType,
const Vector3d& vtMove, double dPar1, double dPar2, double dPar3) override ;
bool ExecCollisionCheck( int& nCdInd, int& nObjInd, int nMoveType) override ;
bool OnCollision( int nCdInd, int nObjInd, int& nErr) override ;
bool SetToolForVmill( const std::string& sTool, const std::string& sHead, int nExit, int nFlag,
double dPar1, double dPar2, const INTVECTOR& vVmill, bool bFirst) override ;
bool EnableToolsForVmill( bool bEnable) override ;
int MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt) override ;
bool SaveCmd( int nType, int nPar, const std::string& sPar, const std::string& sPar2) override
{ return false ; }
public :
SimulatorSP( void) ;
private :
bool UpdateTool( bool bFirst, int& nErr) ;
bool UpdateAxes( void) ;
bool UpdateAxesPos( void) ;
bool ResetInterpolation( void) ;
bool ResetAxes( void) ;
bool ResetAuxAxes( void) ;
private :
bool VerifySetup( void) ;
bool FindAndManageOperationStart( bool bStart, bool bFirst, int& nStatus) ;
bool ManageOperationEnd( int& nStatus) ;
bool FindAndManagePathStart( int& nStatus) ;
bool ManagePathEnd( int& nStatus) ;
bool ManagePathStartAux( int& nStatus) ;
bool ManagePathEndAux( int& nStatus) ;
bool ManageMove( int& nStatus) ;
bool ManageSingleMove( int& nStatus, double& dMove) ;
int CalcStatusOnError( int nErr) ;
bool GetHeadCurrPosDirAux( const std::string& sHead, int nExit, Point3d& ptH, Vector3d& vtH, Vector3d& vtA) ;
bool ExecLineVmill( int nVmId, int nCurrTool, double dVmTdOffs, double dVmAdOffs,
const Point3d& ptHi, const Vector3d& vtHi, const Vector3d& vtAi, const Frame3d& frVzmI,
const Point3d& ptHf, const Vector3d& vtHf, const Vector3d& vtAf, const Frame3d& frVzmF) ;
bool NeedCollisionCheck( void) const
{ return ( ! m_CollObj.empty() && ! m_CdId.empty()) ; }
bool Stopped( void)
{ return ( m_nUiStatus == MCH_UISIM_STOP) ; }
bool SetCollisionMark( int nCdInd, int nObjInd) ;
bool ResetCollisionMark( void) ;
bool OnInit( void) ;
bool OnExit( void) ;
bool OnProgramStart( bool bFirst) ;
bool OnProgramEnd( void) ;
bool OnDispositionStarting( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionStart( int nOpId, int nOpInd, int nPhase,
const std::string& sTable, const Point3d& ptOri1, bool bEmpty, bool bSomeByHand) ;
bool OnDispositionEnd( void) ;
bool OnToolSelect( const std::string& sTool, const std::string& sHead, int nExit, const std::string& sTcPos,
bool bFirst, bool bFloating, int& nErr) ;
bool OnToolDeselect( const std::string& sNextTool, const std::string& sNextHead, int nNextExit, const std::string& sNextTcPos, int& nErr) ;
bool OnMachiningStart( int nOpId, int nOpInd, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax) ;
bool OnMachiningEnd( void) ;
bool OnPathStartAux( int nInd, const std::string& sAS, int& nErr) ;
bool OnPathEndAux( int nInd, const std::string& sAE, int& nErr) ;
bool OnPathStart( int nClPathId, int nClPathInd, int nAS, const Point3d& ptStart, const Point3d& ptEnd,
const Vector3d& vtExtr, const Point3d& ptMin, const Point3d& ptMax,
const DBLVECTOR& vAxMin, const DBLVECTOR& vAxMax, double dElev, const INTVECTOR& vActiveExit) ;
bool OnPathEnd( int nAE) ;
bool OnMoveStart( const CamData* pCamData, const CamData* pNextCamData, int& nErr) ;
bool OnMoveEnd( int& nErr) ;
bool OnResetMachine( void) ;
private :
struct CollObj {
int nInd ;
bool bToolOn ;
int nFrameId ;
int nType ;
Vector3d vtMove ;
double dPar1 ;
double dPar2 ;
double dPar3 ;
CollObj( void) : nInd( 0), bToolOn( false), nFrameId( -1), nType( 0), vtMove(), dPar1( 0), dPar2( 0), dPar3( 0) {}
CollObj( int nI, bool bTOn, int nF, int nT, const Vector3d& vtM, double dP1, double dP2, double dP3)
: nInd( nI), bToolOn( bTOn), nFrameId( nF), nType( nT), vtMove( vtM), dPar1( dP1), dPar2( dP2), dPar3( dP3) {}
} ;
typedef std::vector<CollObj> COBVECTOR ;
struct VmTool
{
std::string sName ;
std::string sHead ;
int nExit ;
double dTdOffs ;
double dAdOffs ;
VmTool( void) : nExit( 0), dTdOffs( 0), dAdOffs( 0) {}
VmTool( std::string sN, std::string sH, int nE, double dT, double dA)
: sName( sN), sHead( sH), nExit( nE), dTdOffs( dT), dAdOffs( dA) {}
} ;
typedef std::vector<VmTool> VMTVECTOR ;
enum { SIS_CREATED = 0,
SIS_INITIALIZED = 1,
SIS_READYTOSTART = 2,
SIS_READYTORUN = 3} ;
private :
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
Machine* m_pMachine ; // puntatore alla macchina
PerformanceCounter* m_pPerfCnt ; // timer per calcolo FPS
int m_nStatus ; // stato interno del simulatore (creato, inizializzato, pronto al movimento)
double m_dStep ; // lunghezza di riferimento per la velocità di simulazione
int m_nUiStatus ; // stato simulazione a livello utente
int m_nOpId ; // identificativo della operazione (lavoraz.) corrente
int m_nOpInd ; // contatore della operazione (lavoraz.) corrente
int m_nCLPathId ; // identificativo del percorso di lavoro corrente
int m_nCLPathInd ; // contatore del percorso di lavoro corrente nell'operazione
int m_nEntId ; // identificativo dell'entità corrente
int m_nEntInd ; // contatore dell'entità corrente nel percorso di lavoro
double m_dCoeff ; // coefficiente di esecuzione del movimento corrente (0...1)
int m_nAuxSTot ; // numero totale movimenti ausiliari di inizio percorso
int m_nAuxSInd ; // indice del movimento ausiliario di inizio percorso corrente
int m_nAuxETot ; // numero totale movimenti ausiliari di fine percorso
int m_nAuxEInd ; // indice del movimento ausiliario di fine percorso corrente
std::string m_sTool ; // nome dell'utensile corrente
std::string m_sHead ; // nome della testa corrente
int m_nExit ; // indice dell'uscita corrente
double m_dTDiam ; // diametro dell'utensile corrente
bool m_bCutOnTip ; // flag capacità di lavorare di testa dell'utensile corrente
bool m_bEnableVm ; // flag abilitazione Virtual Milling
INTVECTOR m_VmId ; // vettore identificativi Zmap per Virtual Milling
INTVECTOR m_CdId ; // vettore identificativi Zmap per Collision Detection
VMTVECTOR m_VmTool ; // vettore utensili attivi per virtual milling
COBVECTOR m_CollObj ; // vettore oggetti da testare per collisione con grezzo
double m_dSafeDist ; // distanza di sicurezza per verifica collisioni
INTVECTOR m_nCollMarkId ; // elenco oggetti marcati per visualizzare meglio la collisione rilevata
int m_nAxesMask ; // maschera a bit di abilitazione movimento assi (solo se rapido)
bool m_bEnabAxes ; // flag abilitazione movimento assi attivi
bool m_bShowAxes ; // flag visualizzazione assi attivi
STRVECTOR m_AxesName ; // nomi degli assi macchina attivi
STRVECTOR m_AxesToken ; // token degli assi macchina attivi
BOOLVECTOR m_AxesInvert ; // flag di asse con verso invertito degli assi macchina attivi
DBLVECTOR m_AxesOffset ; // valore di offset delgli assi macchina ttivi
BOOLVECTOR m_AxesLinear ; // flag di lineare degli assi macchina attivi
DBLVECTOR m_AxesVal ; // valori degli assi macchina all'inizio del movimento corrente
STRVECTOR m_AuxAxesName ; // nomi degli assi macchina ausiliari abilitati
STRVECTOR m_AuxAxesToken ; // token degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesInvert ; // flag di asse con verso invertito degli assi macchina ausiliari abilitati
DBLVECTOR m_AuxAxesOffset ; // valore di offset degli assi macchina ausiliari abilitati
BOOLVECTOR m_AuxAxesLinear ; // flag di lineare degli assi macchina ausiliari abilitati
DBLVECTOR m_AuxAxesVal ; // valori degli assi macchina ausiliari all'inizio del movimento corrente
DBLVECTOR m_AuxAxesEnd ; // valori degli assi macchina ausiliari alla fine del movimento corrente
INTVECTOR m_AuxAxesLink ; // indice + 1 asse principale di aggancio (negativo valore opposto, 0 nessuno)
} ;
+3949 -691
View File
File diff suppressed because it is too large Load Diff
+86 -13
View File
@@ -13,14 +13,39 @@
#pragma once
#include "set"
#include "Machining.h"
#include "SurfFinishingData.h"
#include "ToolData.h"
#include "MachiningConst.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EGkSurfLocal.h"
class ICAvToolSurfTm ;
class ISurfFlatRegion ;
class ISurfTriMesh ;
class ICAvParSilhouettesSurfTm ;
class StmFromTriangleSoup ;
// struttura percorsi da calcolare per finiture ottimizzate
struct PATH {
PtrOwner<ICurveComposite> pCrvPath ;
int nType ;
double dSideAng ;
} ;
// vettore associato
typedef std::vector<PATH> VECTORPATHS ;
// struttura per collisioni per finiture ottimizzate
struct CollisionSfr {
PNTUVVECT CollisionInfo ;
bool bInSpiral ;
bool bInZConst ;
} ;
// vettore associato
typedef std::vector<CollisionSfr> VECTORCOLLISIONSFR ;
//----------------------------------------------------------------------------
class SurfFinishing : public Machining
@@ -69,27 +94,71 @@ class SurfFinishing : public Machining
SurfFinishing( void) ;
private :
bool MyApply( bool bRecalc, bool bPostApply) ;
bool VerifyGeometry( SelData Id, int& nSubs) ;
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool AddZigZag( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev) ;
bool CalcZigZag( const ICurveComposite* pOffs, ICRVCOMPOPOVECTOR& vpCrvs) ;
bool AddSpiral( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
double dDepth, double dElev, bool bInVsOut) ;
bool CalcSpiral( const ICurveComposite* pCompo, bool bSplitArcs,
ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
bool ProcessSfr( int nPathId, int nPvId, int nClId) ;
bool ProcessCrvCompo( int nPathId, int nPvId, int nClId) ;
bool SimplifyCurve( ICurveComposite* pCompo) const ;
bool CalcZConstProjectedLink( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frPocket,
const Frame3d& frSurf, const Vector3d& vtTool, double dDepth,
const Point3d ptStart_forced, const Point3d ptEnd_forced,
ICurveComposite* pCrv) ;
// lavorazioni per superfici
bool AddZigZag( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, const ISurfFlatRegion* pSfrPock,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs) ;
bool AddOneWay( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, const ISurfFlatRegion* pSfrPock,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs) ;
bool AddSpiral( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, const ISurfFlatRegion* pSfrPock,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs, bool bInVsOut) ;
bool AddZConst( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ISurfFlatRegion* pSfr,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs) ;
bool AddOptimal( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ISurfFlatRegion* pSfr,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs) ;
// lavorazioni per curve
bool AddProjection( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ICurveComposite* pCompo,
const Vector3d& vtTool, double dDepth, double dElev, bool bSplitArcs) ;
bool ChooseFinishingForOptimal( const ISurfFlatRegion* pSfr, int nChunk, bool& bSpiral, double& dSideAng) ;
bool OrderOptimalPathsByZLoc( const ISurfFlatRegion* pSfr, VECTORPATHS& vCrvPaths) ;
bool GetSfrBySilhouette( ICAvParSilhouettesSurfTm* pCavParSilh, double dDepth, double dSilTolSamp,
double dSilTolLin, double dSilTolAng, ISurfFlatRegion* pSfrSil) ;
bool ApproxSilhouetteClosedPLForOptimal( PolyLine& PL, double dSampleTol, double dMaxLinTol, double dAngTol, double dLinFeaTol, ICurveComposite* pCompoPL) ;
bool SplitStmTrianglesByClippingAngle( const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ISurfFlatRegion* pSfrCnt,
const Vector3d& vtTool, double dDepth, double dClippingAngle, double dTolerAngle,
ISURFTMPOVECTOR& vpStm1, ISURFTMPOVECTOR& vpStm2, double& dMaxFrontTriaRad) const ;
bool GetZConstQuotesInsideSfrParallelToTool( const SURFLOCALVECTOR&, const Frame3d& frSurf, const ISurfFlatRegion* pSfr,
const Vector3d& vtTool, std::set<double>& setZAmbiguos) ;
ICAvParSilhouettesSurfTm* GetParSilhouettesForZConst( const ISURFTMPOVECTOR& vStm, const ISurfFlatRegion* pSfr) const ;
ISurfFlatRegion* GetSfrSilhouette( const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frLvl0, double dDepth) const ;
ISurfFlatRegion* GetSfrProjectedStmLoops( const ISURFTMPOVECTOR& vStm, const ISurfFlatRegion* pSfrContour,
const DBLVECTOR& vdLinFeaTol, const DBLVECTOR& vdAngTol, const DBLVECTOR& vdMaxLinTol) const ;
ISurfTriMesh* SplitStmTriaUnderClippingAngle( const SurfLocal SrfLoc, const Vector3d& vtTest, double dClippingAngle,
double dFrontTriaTolerAng, double& dMaxFrontTriaRad) const ;
bool GetOptimalSfr( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ISurfFlatRegion* pSfrLoc, const Vector3d& vtTool,
double dDepth, double dElev, ISurfFlatRegion* pSfrSpiral, ISurfFlatRegion* pSfrZConst) const ;
bool CalcZConstSilCrv( ICAvParSilhouettesSurfTm* pCavParSilh, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf,
const ISurfFlatRegion* pSfrClass, const Vector3d& vtTool, double dDepth, std::vector<ICRVCOMPOPOVECTOR>& vCrvCompo) ;
bool CreateZConstPaths( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, std::vector<ICRVCOMPOPOVECTOR>& vCrvCompo, const Vector3d& vtTool,
const ISurfFlatRegion* pSfr, double dDepth, ICRVCOMPOPOVECTOR& vCrvPath) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN, Point3d& ptP1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, Point3d& ptP1) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool, const Vector3d& vtNorm, Point3d& ptP1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool, bool bSplitArcs) ;
bool CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool, const Vector3d& vtNorm, Point3d& ptP1) const ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Point3d& ptP1, const Vector3d& vtTool, bool bSplitArcs) ;
bool GetLastGoodPoint( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtTool, Point3d& ptP1) const ;
bool GetSurfaceNormalAtPoint( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
const Point3d& ptTool, const Vector3d& vtTool, Vector3d& vtNorm) const ;
bool GetActiveSurfaces( INTVECTOR& vSurfId) const ;
bool MarchingSquares( const VECTORCOLLISIONSFR& vPntM, bool bSpiral, int nStepX, int nStepY, double dClippingAngle,
const Vector3d& vtAxL, const Vector3d& vtMoveL, ICAvToolSurfTm* pCAvTlStm,
ICRVCOMPOPOVECTOR& vCrvCompo) const ;
bool CalcShapedPoint( const PNTUVVECT& myInfoStart, const PNTUVVECT& myInfoEnd, bool bSpiral, const Vector3d& vtAxL,
const Vector3d& vtMoveL, double dClippingAngle, ICAvToolSurfTm* pCAvTlStm, Point3d& ptShaped, int _debug_ind = -1) const ;
double GetRightFeed( const Vector3d& vtMove, const Vector3d& vtTool) const ;
double GetRadiusForStartEndElevation( void) const ;
@@ -108,13 +177,17 @@ class SurfFinishing : public Machining
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
double GetSideStep( void) const
{ return Clamp( m_Params.m_dSideStep, 0.1, m_TParams.m_dTDiam) ; }
int GetLeadInType( void) const ;
int GetLeadOutType( void) const ;
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
SurfFinishingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
double m_dTHoldBase ; // posizione base del porta-utensile
double m_dTHoldLen ; // lunghezza del porta-utensile
double m_dTHoldDiam ; // diametro del porta-utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nPaths ; // numero di percorsi di lavoro generati
bool m_bRunning ; // flag di calcoli in corso
} ;
+5 -20
View File
@@ -147,7 +147,6 @@ SurfFinishingData::CopyFrom( const MachiningData* pMdata)
m_nLeadOutType = pSdata->m_nLeadOutType ;
m_dLoTang = pSdata->m_dLoTang ;
m_dLoPerp = pSdata->m_dLoPerp ;
m_nLeadLinkType = pSdata->m_nLeadLinkType ;
m_dApprox = pSdata->m_dApprox ;
m_sSysNotes = pSdata->m_sSysNotes ;
m_sUserNotes = pSdata->m_sUserNotes ;
@@ -192,7 +191,6 @@ SurfFinishingData::SameAs(const MachiningData* pMdata) const
m_nLeadOutType == pSdata->m_nLeadOutType &&
abs( m_dLoTang - pSdata->m_dLoTang) < EPS_MACH_LEN_PAR &&
abs( m_dLoPerp - pSdata->m_dLoPerp) < EPS_MACH_LEN_PAR &&
m_nLeadLinkType == pSdata->m_nLeadLinkType &&
abs( m_dApprox - pSdata->m_dApprox) < EPS_MACH_LEN_PAR &&
m_sSysNotes == pSdata->m_sSysNotes &&
m_sUserNotes == pSdata->m_sUserNotes) ;
@@ -273,7 +271,7 @@ SurfFinishingData::FromString( const string& sString, int& nKey)
bOk = ::FromString( sVal, m_nLeadInType) ;
break ;
case KEY_LLTY :
bOk = ::FromString( sVal, m_nLeadLinkType) ;
// campo non più usato
break ;
case KEY_LOPR :
bOk = ::FromString( sVal, m_dLoPerp) ;
@@ -351,7 +349,7 @@ SurfFinishingData::ToString( int nInd) const
case KEY_LIPR : return ( sSurfFinishingKey[KEY_LIPR] + "=" + ::ToString( m_dLiPerp)) ;
case KEY_LITG : return ( sSurfFinishingKey[KEY_LITG] + "=" + ::ToString( m_dLiTang)) ;
case KEY_LITY : return ( sSurfFinishingKey[KEY_LITY] + "=" + ::ToString( m_nLeadInType)) ;
case KEY_LLTY : return ( sSurfFinishingKey[KEY_LLTY] + "=" + ::ToString( m_nLeadLinkType)) ;
case KEY_LLTY : return ( sSurfFinishingKey[KEY_LLTY] + "=" + ::ToString( 0)) ;
case KEY_LOPR : return ( sSurfFinishingKey[KEY_LOPR] + "=" + ::ToString( m_dLoPerp)) ;
case KEY_LOTG : return ( sSurfFinishingKey[KEY_LOTG] + "=" + ::ToString( m_dLoTang)) ;
case KEY_LOTY : return ( sSurfFinishingKey[KEY_LOTY] + "=" + ::ToString( m_nLeadOutType)) ;
@@ -392,7 +390,9 @@ bool
SurfFinishingData::VerifySubType( int nVal) const
{
return ( nVal == SURFFIN_SUB_ZIGZAG || nVal == SURFFIN_SUB_ONEWAY ||
nVal == SURFFIN_SUB_SPIRALIN || nVal == SURFFIN_SUB_SPIRALOUT) ;
nVal == SURFFIN_SUB_SPIRALIN || nVal == SURFFIN_SUB_SPIRALOUT ||
nVal == SURFFIN_SUB_Z_CONST || nVal == SURFFIN_SUB_OPTIMAL ||
nVal == SURFFIN_SUB_PROJECT) ;
}
//----------------------------------------------------------------------------
@@ -403,13 +403,6 @@ SurfFinishingData::VerifyLeadInType( int nVal) const
nVal == SURFFIN_LI_TANGENT) ;
}
//----------------------------------------------------------------------------
bool
SurfFinishingData::VerifyLeadLinkType( int nVal) const
{
return ( nVal == SURFFIN_LL_STD || nVal == SURFFIN_LL_CENT) ;
}
//----------------------------------------------------------------------------
bool
SurfFinishingData::VerifyLeadOutType( int nVal) const
@@ -464,11 +457,6 @@ SurfFinishingData::SetParam( int nType, int nVal)
return false ;
m_nLeadInType = nVal ;
return true ;
case MPA_LEADLINKTYPE :
if ( ! VerifyLeadInType( nVal))
return false ;
m_nLeadLinkType = nVal ;
return true ;
case MPA_LEADOUTTYPE :
if ( ! VerifyLeadOutType( nVal))
return false ;
@@ -615,9 +603,6 @@ SurfFinishingData::GetParam( int nType, int& nVal) const
case MPA_LEADINTYPE :
nVal = m_nLeadInType ;
return true ;
case MPA_LEADLINKTYPE :
nVal = m_nLeadLinkType ;
return true ;
case MPA_LEADOUTTYPE :
nVal = m_nLeadOutType ;
return true ;
+7 -5
View File
@@ -42,7 +42,6 @@ struct SurfFinishingData : public MachiningData
int m_nLeadOutType ; // tipo di uscita (come attacco, nessuno, lineare, tangente, inseguimento)
double m_dLoTang ; // distanza tangente verso fine uscita
double m_dLoPerp ; // distanza perpendicolare verso fine uscita
int m_nLeadLinkType ; // tipo di collegamento ( centro, fuori)
double m_dApprox ; // valore di approssimazione per superfici
std::string m_sSysNotes ; // note interne
std::string m_sUserNotes ; // note dell'utente
@@ -52,7 +51,7 @@ struct SurfFinishingData : public MachiningData
m_dOffsR( UNKNOWN_PAR), m_bInvert( false),
m_dStartPos( 0), m_dOverlap(0), m_dSideStep( 0), m_nSubType( 0), m_dSideAngle( 0),
m_nLeadInType( 0), m_dLiTang( 0), m_dLiPerp( 0),
m_nLeadOutType( 0), m_dLoTang( 0), m_dLoPerp( 0), m_nLeadLinkType( 0), m_dApprox( 0) {}
m_nLeadOutType( 0), m_dLoTang( 0), m_dLoPerp( 0), m_dApprox( 0) {}
SurfFinishingData* Clone( void) const override ;
bool CopyFrom( const MachiningData* pMdata) override ;
bool SameAs(const MachiningData* pMdata) const override ;
@@ -77,12 +76,15 @@ struct SurfFinishingData : public MachiningData
bool VerifySolCh( int nVal) const ;
bool VerifySubType( int nVal) const ;
bool VerifyLeadInType( int nVal) const ;
bool VerifyLeadLinkType( int nVal) const ;
bool VerifyLeadOutType( int nVal) const ;
} ;
//----------------------------------------------------------------------------
inline const SurfFinishingData* GetSurfFinishingData( const MachiningData* pMdata)
{ return (dynamic_cast<const SurfFinishingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SURFFINISHING)
return nullptr ;
return ( static_cast<const SurfFinishingData*>( pMdata)) ; }
inline SurfFinishingData* GetSurfFinishingData( MachiningData* pMdata)
{ return (dynamic_cast<SurfFinishingData*>( pMdata)) ; }
{ if ( pMdata == nullptr || pMdata->GetType() != MT_SURFFINISHING)
return nullptr ;
return ( static_cast<SurfFinishingData*>( pMdata)) ; }
+3629
View File
File diff suppressed because it is too large Load Diff
+205
View File
@@ -0,0 +1,205 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : SurfRoughing.h Data : 24.05.24 Versione : 2.6e5
// Contenuto : Dichiarazione della classe SurfRoughing.
//
//
//
// Modifiche : 24.05.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "SurfRoughingData.h"
#include "ToolData.h"
#include "MachiningConst.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
#include "/EgtDev/Include/EGkSurfTriMesh.h"
#include "/EgtDev/Include/EGkIntersPlaneSurfTm.h"
class ICAvToolSurfTm ;
class ICAvParSilhouettesSurfTm ;
// struttura informazioni sui singoli percorsi
struct PathInfoSR {
bool bOutStart ; // flag per entrata da fuori
bool bSingleCrv ; // se percorso formato da una curva singola ( in generale per SubSteps)
bool bOptTrap ; // flag per casi ottimizzati a trapezio ( per Spiral)
bool bIsZigZagOneWayBorder ; // curve di bordo dei lati chiusi ( per ZigZag e OneWay)
PtrOwner<ICurveComposite> pCrvPath ; // percorso del centro utensile
PtrOwner<ICurveComposite> pCvrRet ; // curva di ritorno per LeadIn/Out a guida
} ;
// tipo percorso
typedef std::vector<PathInfoSR> PATHINFOSRVECTOR ;
// struttura informazioni per Step/SubSteps complessivi
struct StepInfoSR {
double dDepth ; // profondità dello step attuale
double dRelativeDepth ; // profondità relativa allo step al di sopra
double dZlocCoeffFeed ; // coeffiziente riduzione Feed lungo Zloc
int nSubType ; // tipo di lavorazione dello Step corrente
bool bIsExtraStep ; // flag per SubStep o PlaneZStep
bool bInverted ; // se percorsi invertiti
PtrOwner<ISurfFlatRegion> pSfrPock ; // regione piana di svuotatura
PtrOwner<ISurfFlatRegion> pSfrLimit ; // regione piana da non svuotare
PATHINFOSRVECTOR vPaths ; // percorsi di Pocketing
} ;
// tipo step
typedef std::vector<StepInfoSR> STEPINFOSRVECTOR ;
// planeZ detection <SfrFace, dDepth>
typedef std::pair<PtrOwner<ISurfFlatRegion>, double> PLANEZFACE ;
typedef std::vector<PLANEZFACE> PLANEZFACEVECTOR ;
//----------------------------------------------------------------------------
class SurfRoughing : public Machining
{
public : // IUserObj
SurfRoughing* Clone( void) const override ;
const std::string& GetClassName( void) const override ;
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
bool ToSave( void) const override
{ return true ; }
bool Save( int nBaseId, STRVECTOR& vString) const override ;
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
public : // Operation
int GetType( void) const override
{ return OPER_SURFROUGHING ; }
bool IsEmpty( void) const override
{ return ( m_nPaths == 0) ; }
bool UpdateStatus( int nModif) override
{ m_nStatus |= nModif ; return true ; }
protected : // Operation
int GetSolCh( void) const override
{ return m_Params.m_nSolCh ; }
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
public : // Machining
bool Prepare( const std::string& sSawName) override ;
bool SetParam( int nType, bool bVal) override ;
bool SetParam( int nType, int nVal) override ;
bool SetParam( int nType, double dVal) override ;
bool SetParam( int nType, const std::string& sVal) override ;
bool SetGeometry( const SELVECTOR& vIds) override ;
bool Preview( bool bRecalc) override ;
bool Apply( bool bRecalc, bool bPostApply) override ;
bool Update( bool bPostApply) override ;
bool GetParam( int nType, bool& bVal) const override ;
bool GetParam( int nType, int& nVal) const override ;
bool GetParam( int nType, double& dVal) const override ;
bool GetParam( int nType, std::string& sVal) const override ;
bool UpdateToolData( bool* pbChanged = nullptr) override ;
const ToolData& GetToolData( void) const override ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
SurfRoughing( void) ;
private :
bool MyApply( bool bRecalc, bool bPostApply) ;
bool VerifyGeometry( SelData Id, int& nSubs) ;
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
bool Chain( int nGrpDestId) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool DetectPlaneZ( const CISURFTMPVECTOR& vpStm, const Frame3d& frCompo, const Vector3d& vtTool, PLANEZFACEVECTOR& vPlaneZ,
double dMinDepth, double dMaxDepth) const ;
bool CalcPaths( const INTINTVECTOR& vPocket, STEPINFOSRVECTOR& vStepInfo) const ;
bool CalcRegionElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double dLen, double& dElev) const ;
bool AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, double dElev, double dStep, double dSubStep, bool bSplitArcs) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr, bool bOutStart, bool bAbsFirst) ;
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr, bool bOutMove) ;
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtTool, const ICurveComposite* pCrvPath, Point3d& ptP1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
const ISurfFlatRegion* pSfr, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs,
bool bNoneForced, bool bSkipControl) ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
const ICurveComposite* pRCrv, bool bSplitArcs, bool bNoneForced, Point3d& ptP1) ;
ISurfTriMesh* GetRaw( void) const ;
ISurfTriMesh* GetStmOutSideSfr( const ISurfFlatRegion* pSfr, const ISurfTriMesh* pStmRaw, const Vector3d& vtExtr) const ;
ISurfFlatRegion* GetSfrByStmIntersection( const IntersParPlanesSurfTm& IPPStm, double dDist, double dSmallOffs = 0) const ;
ISurfFlatRegion* GetSfrSilhouette( ICAvParSilhouettesSurfTm* pCavParSilh, double dDepth, double Sil_tol, bool& bOk) const ;
bool GetActiveSurfaces( INTVECTOR& vSurfId) const ;
double GetRightFeed( const Vector3d& vtMove, const Vector3d& vtTool) const ;
double GetRadiusForStartEndElevation( void) const ;
bool ResetCurveAllTempProp( ICurve* pCurve) const ;
bool RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, double dTol, ISurfFlatRegion* pSfrLimit,
ISurfFlatRegion* pSfrToUpdate = nullptr) const ;
bool CloseOpenEdgesUnderTolerance( ISurfFlatRegion* pSfr, double dToler) ;
bool ModifySurfForOpenCloseEdges( ISurfFlatRegion* pSfr, const Vector3d& vtTool, const ICurveComposite* pCrvCompo) const ;
bool ChooseCloseOrOpenEdge( ISurfFlatRegion* pSfr, const ISurfFlatRegion* pSfrRef) const ;
bool SimplifyCurve( ICurveComposite* pCompo, const ICRVCOMPOPOVECTOR& vCrvCheck) const ;
bool SimplyfySfr( ISurfFlatRegion* pSfr) const ;
bool CheckSafetyLinearLink( const Point3d& ptCurr, const ISurfFlatRegion* pSfrLimit, const Vector3d& vtTool,
const Point3d& ptDest, bool& bSafe) const ;
bool GetHomogeneousParts( const ICurveComposite* pCrvCompo, ICRVCOMPOPOVECTOR& vpCrvs) const ;
bool VerifyLeadInHelix( const ISurfFlatRegion* pSfr, const Point3d& ptStart, const Point3d& ptCen, double dHelixRad) const ;
bool VerifyLeadInZigZag( const ISurfFlatRegion* pSfr, const Point3d& ptStart, const Point3d& ptPa, const Point3d& ptPb) const ;
private :
double GetSpeed() const
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
double GetFeed() const
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetAdaptedCoeffFeed( bool bExtraStep, double dDepth, double dStep) const
{ if ( ! bExtraStep || dStep < 10 * EPS_SMALL)
return 1. ;
return ( 1. + ( - dDepth / dStep) - std::floor( - dDepth / dStep)) ; } ;
double GetStartFeed() const
{ return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
double GetEndFeed() const
{ return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed() const
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetOffsR() const
{ double dCurrOffsR = IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR ;
return std::max( 0.1, dCurrOffsR) ; }
double GetOffsL() const
{ return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetSideStep( void) const
{ return Clamp( m_Params.m_dSideStep, 0.1, m_TParams.m_dTDiam) ; }
int GetLeadInType( void) const
{ if ( m_Params.m_dLiTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0))
return SURFROU_LI_NONE ;
if ( m_Params.m_nLeadInType != SURFROU_LI_GLIDE && m_Params.m_dLiElev < 10 * EPS_SMALL)
return SURFROU_LI_NONE ;
return m_Params.m_nLeadInType ; }
bool LeadInRawIsOk( void) const
{ if ( m_TParams.m_nType != TT_MILL_NOTIP)
return true ;
return (( GetLeadInType() == SURFROU_LI_ZIGZAG || GetLeadInType() == SURFROU_LI_HELIX) &&
m_Params.m_dLiTang >= 0.9 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
int GetLeadOutType( void) const
{ if ( m_Params.m_dLoTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0))
return SURFROU_LO_NONE ;
return m_Params.m_nLeadOutType ; }
/* debug functions */
void DrawLoopsSurf( const ISurfFlatRegion* pSfr, bool bWithSurf, Color Col, bool bAlphaCoverage, std::string sName) ;
void DrawFeed( const ICurve* pCrv, double dFeed) ;
void DrawNormalShaderSurfTm( const ISurfTriMesh* pStm, std::string sName) ;
/* end debug functions */
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
SurfRoughingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
double m_dTHoldBase ; // posizione base del porta-utensile
double m_dTHoldLen ; // lunghezza del porta-utensile
double m_dTHoldDiam ; // diametro del porta-utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nPaths ; // numero di percorsi di lavoro generati
double m_dMaxHelixRad ; // raggio massimo attacco ad elica nel caso di cerchi
double m_dStepToler ; // tolleranza di rimozione chunk per Steps
double m_dSubStepToler ; // tolleranza di rimozione chunk per SubSteps
bool m_bDetectPlaneZ ; // flag per calcolo piani in Zloc di Pocketing
bool m_bRunning ; // flag di calcoli in corso
} ;
+713
View File
@@ -0,0 +1,713 @@
//----------------------------------------------------------------------------
// EgalTech 2024-2024
//----------------------------------------------------------------------------
// File : SurfRoughingData.cpp Data : 24.05.24 Versione : 2.6e5
// Contenuto : Implementazione struttura dati lavorazione sgrossatura superfici.
//
//
//
// Modifiche : 24.05.24 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "SurfRoughingData.h"
#include "MachiningDataFactory.h"
#include "MachiningConst.h"
#include "/EgtDev/Include/EmkToolConst.h"
#include "/EgtDev/Include/EmkSimuGenConst.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include <array>
#include <cassert>
using namespace std ;
//----------------------------------------------------------------------------
enum nSurfRoughingKey {
KEY_AB = 0,
KEY_AI,
KEY_APPR,
KEY_DH,
KEY_F,
KEY_FE,
KEY_FS,
KEY_FT,
KEY_INV,
KEY_LIEL,
KEY_LITG,
KEY_LITY,
KEY_LOTG,
KEY_LOTY,
KEY_NAME,
KEY_NNS,
KEY_NNU,
KEY_OL,
KEY_OR,
KEY_PS,
KEY_S,
KEY_SA,
KEY_SCC,
KEY_SS,
KEY_SST,
KEY_ST,
KEY_SUBTYPE,
KEY_TNAME,
KEY_TUUID,
KEY_UUID,
KEY_ZZZ} ; // rappresenta il numero di elementi
static const array<string,KEY_ZZZ> sSurfRoughingKey = {
"AB",
"AI",
"APPR",
"DH",
"F",
"FE",
"FS",
"FT",
"INV",
"LIEL",
"LITG",
"LITY",
"LOTG",
"LOTY",
"NAME",
"NNS",
"NNU",
"OL",
"OR",
"PS",
"S",
"SA",
"SCC",
"SS",
"SST",
"ST",
"SUB",
"TN",
"TU",
"UUID"} ;
//----------------------------------------------------------------------------
MCHDATA_REGISTER( MT_SURFROUGHING, "SURFROUGHING", SurfRoughingData) ;
//----------------------------------------------------------------------------
SurfRoughingData*
SurfRoughingData::Clone( void) const
{
// alloco oggetto
SurfRoughingData* pMdata = new(nothrow) SurfRoughingData ;
// copio i dati
if ( pMdata != nullptr) {
if ( ! pMdata->CopyFrom( this)) {
delete pMdata ;
return nullptr ;
}
}
return pMdata ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::CopyFrom( const MachiningData* pMdata)
{
// è inutile copiare se sorgente coincide con destinazione
if ( pMdata == this)
return true ;
// la sorgente deve essere dello stesso tipo
const SurfRoughingData* pSdata = GetSurfRoughingData( pMdata) ;
if ( pSdata == nullptr)
return false ;
// eseguo copia
m_Uuid = pSdata->m_Uuid ;
m_sName = pSdata->m_sName ;
m_ToolUuid = pSdata->m_ToolUuid ;
m_sToolName = pSdata->m_sToolName ;
m_sBlockedAxis = pSdata->m_sBlockedAxis ;
m_sInitAngs = pSdata->m_sInitAngs ;
m_nSolCh = pSdata->m_nSolCh ;
m_dSpeed = pSdata->m_dSpeed ;
m_dFeed = pSdata->m_dFeed ;
m_dEndFeed = pSdata->m_dEndFeed ;
m_dStartFeed = pSdata->m_dStartFeed ;
m_dTipFeed = pSdata->m_dTipFeed ;
m_dOffsR = pSdata->m_dOffsR ;
m_dOffsL = pSdata->m_dOffsL ;
m_bInvert = pSdata->m_bInvert ;
m_sDepth = pSdata->m_sDepth ;
m_dStartPos = pSdata->m_dStartPos ;
m_dStep = pSdata->m_dStep ;
m_dSubStep = pSdata->m_dSubStep ;
m_dSideStep = pSdata->m_dSideStep ;
m_nSubType = pSdata->m_nSubType ;
m_dSideAngle = pSdata->m_dSideAngle ;
m_nLeadInType = pSdata->m_nLeadInType ;
m_dLiElev = pSdata->m_dLiElev ;
m_dLiTang = pSdata->m_dLiTang ;
m_nLeadOutType = pSdata->m_nLeadOutType ;
m_dLoTang = pSdata->m_dLoTang ;
m_dApprox = pSdata->m_dApprox ;
m_sSysNotes = pSdata->m_sSysNotes ;
m_sUserNotes = pSdata->m_sUserNotes ;
return true ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::SameAs(const MachiningData* pMdata) const
{
// se coincide con altro -> uguali
if ( pMdata == this)
return true ;
// se sono di tipo diverso -> diversi
const SurfRoughingData* pSdata = GetSurfRoughingData( pMdata) ;
if ( pSdata == nullptr)
return false ;
// confronto termine a termine
return ( m_Uuid == pSdata->m_Uuid &&
m_sName == pSdata->m_sName &&
m_ToolUuid == pSdata->m_ToolUuid &&
m_sToolName == pSdata->m_sToolName &&
m_sBlockedAxis == pSdata->m_sBlockedAxis &&
m_sInitAngs == pSdata->m_sInitAngs &&
m_nSolCh == pSdata->m_nSolCh &&
abs( m_dSpeed - pSdata->m_dSpeed) < EPS_MACH_ANG_PAR &&
abs( m_dFeed - pSdata->m_dFeed) < EPS_MACH_LEN_PAR &&
abs( m_dEndFeed - pSdata->m_dEndFeed) < EPS_MACH_LEN_PAR &&
abs( m_dStartFeed - pSdata->m_dStartFeed) < EPS_MACH_LEN_PAR &&
abs( m_dTipFeed - pSdata->m_dTipFeed) < EPS_MACH_LEN_PAR &&
abs( m_dOffsR - pSdata->m_dOffsR) < EPS_MACH_LEN_PAR &&
abs( m_dOffsL - pSdata->m_dOffsL) < EPS_MACH_LEN_PAR &&
m_bInvert == pSdata->m_bInvert &&
m_sDepth == pSdata->m_sDepth &&
abs( m_dStartPos - pSdata->m_dStartPos) < EPS_MACH_LEN_PAR &&
abs( m_dStep - pSdata->m_dStep) < EPS_MACH_LEN_PAR &&
abs( m_dSubStep - pSdata->m_dSubStep) < EPS_MACH_LEN_PAR &&
abs( m_dSideStep - pSdata->m_dSideStep) < EPS_MACH_LEN_PAR &&
m_nSubType == pSdata->m_nSubType &&
abs( m_dSideAngle - pSdata->m_dSideAngle) < EPS_MACH_ANG_PAR &&
m_nLeadInType == pSdata->m_nLeadInType &&
abs( m_dLiElev - pSdata->m_dLiElev) < EPS_MACH_LEN_PAR &&
abs( m_dLiTang - pSdata->m_dLiTang) < EPS_MACH_LEN_PAR &&
m_nLeadOutType == pSdata->m_nLeadOutType &&
abs( m_dLoTang - pSdata->m_dLoTang) < EPS_MACH_LEN_PAR &&
abs( m_dApprox - pSdata->m_dApprox) < EPS_MACH_LEN_PAR &&
m_sSysNotes == pSdata->m_sSysNotes &&
m_sUserNotes == pSdata->m_sUserNotes) ;
}
//----------------------------------------------------------------------------
int
SurfRoughingData::GetSize( void) const
{
// in debug verifico validità ultimo campo
assert( sSurfRoughingKey[KEY_UUID] == "UUID") ;
return KEY_ZZZ ;
}
//----------------------------------------------------------------------------
string
SurfRoughingData::GetTitle( void) const
{
return MCHDATA_GETNAME( SurfRoughingData) ;
}
//----------------------------------------------------------------------------
int
FindSurfRoughingKey( const string& sKey)
{
auto TheRange = equal_range( sSurfRoughingKey.cbegin(), sSurfRoughingKey.cend(), sKey) ;
if ( TheRange.first == TheRange.second)
return -1 ;
return int( TheRange.first - sSurfRoughingKey.cbegin()) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::FromString( const string& sString, int& nKey)
{
// separo chiave da valore
string sKey, sVal ;
SplitFirst( sString, "=", sKey, sVal) ;
// riconosco la chiave
nKey = FindSurfRoughingKey( ToUpper( sKey)) ;
bool bOk = ( nKey >= 0) ;
switch ( nKey) {
case KEY_AB :
m_sBlockedAxis = sVal ;
break ;
case KEY_AI :
m_sInitAngs = sVal ;
break ;
case KEY_APPR :
bOk = ::FromString( sVal, m_dApprox) ;
break ;
case KEY_DH :
m_sDepth = sVal ;
if ( m_sDepth.empty())
m_sDepth = "0" ;
break ;
case KEY_F :
bOk = ::FromString( sVal, m_dFeed) ;
break ;
case KEY_FE :
bOk = ::FromString( sVal, m_dEndFeed) ;
break ;
case KEY_FS :
bOk = ::FromString( sVal, m_dStartFeed) ;
break ;
case KEY_FT :
bOk = ::FromString( sVal, m_dTipFeed) ;
break ;
case KEY_INV :
bOk = ::FromString( sVal, m_bInvert) ;
break ;
case KEY_LIEL :
bOk = ::FromString( sVal, m_dLiElev) ;
break ;
case KEY_LITG :
bOk = ::FromString( sVal, m_dLiTang) ;
break ;
case KEY_LITY :
bOk = ::FromString( sVal, m_nLeadInType) ;
break ;
case KEY_LOTG :
bOk = ::FromString( sVal, m_dLoTang) ;
break ;
case KEY_LOTY :
bOk = ::FromString( sVal, m_nLeadOutType) ;
break ;
case KEY_NAME :
m_sName = sVal ;
bOk = ! m_sName.empty() ;
break ;
case KEY_NNS :
m_sSysNotes = sVal ;
break ;
case KEY_NNU :
m_sUserNotes = sVal ;
break ;
case KEY_OR :
bOk = ::FromString( sVal, m_dOffsR) ;
break ;
case KEY_OL :
bOk = ::FromString( sVal, m_dOffsL) ;
break ;
case KEY_PS :
bOk = ::FromString( sVal, m_dStartPos) ;
break ;
case KEY_S :
bOk = ::FromString( sVal, m_dSpeed) ;
break ;
case KEY_SA :
bOk = ::FromString( sVal, m_dSideAngle) ;
break ;
case KEY_SCC :
bOk = ::FromString( sVal, m_nSolCh) ;
break ;
case KEY_SST :
bOk = ::FromString( sVal, m_dSubStep) ;
break ;
case KEY_SS :
bOk = ::FromString( sVal, m_dSideStep) ;
break ;
case KEY_ST :
bOk = ::FromString( sVal, m_dStep) ;
break ;
case KEY_SUBTYPE :
bOk = ::FromString( sVal, m_nSubType) ;
break ;
case KEY_TNAME :
m_sToolName = sVal ;
break ;
case KEY_TUUID :
bOk = ::FromString( sVal, m_ToolUuid) ;
break ;
case KEY_UUID :
bOk = ::FromString( sVal, m_Uuid) ;
break ;
default :
bOk = false ;
break ;
}
return bOk ;
}
//----------------------------------------------------------------------------
string
SurfRoughingData::ToString( int nInd) const
{
switch ( nInd) {
case KEY_AB : return ( sSurfRoughingKey[KEY_AB] + "=" + m_sBlockedAxis) ;
case KEY_AI : return ( sSurfRoughingKey[KEY_AI] + "=" + m_sInitAngs) ;
case KEY_APPR : return ( sSurfRoughingKey[KEY_APPR] + "=" + ::ToString(m_dApprox)) ;
case KEY_DH : return ( sSurfRoughingKey[KEY_DH] + "=" + m_sDepth) ;
case KEY_F : return ( sSurfRoughingKey[KEY_F] + "=" + ::ToString( m_dFeed)) ;
case KEY_FE : return ( sSurfRoughingKey[KEY_FE] + "=" + ::ToString( m_dEndFeed)) ;
case KEY_FS : return ( sSurfRoughingKey[KEY_FS] + "=" + ::ToString( m_dStartFeed)) ;
case KEY_FT : return ( sSurfRoughingKey[KEY_FT] + "=" + ::ToString( m_dTipFeed)) ;
case KEY_INV : return ( sSurfRoughingKey[KEY_INV] + "=" + ::ToString( m_bInvert)) ;
case KEY_LIEL : return ( sSurfRoughingKey[KEY_LIEL] + "=" + ::ToString( m_dLiElev)) ;
case KEY_LITG : return ( sSurfRoughingKey[KEY_LITG] + "=" + ::ToString( m_dLiTang)) ;
case KEY_LITY : return ( sSurfRoughingKey[KEY_LITY] + "=" + ::ToString( m_nLeadInType)) ;
case KEY_LOTG : return ( sSurfRoughingKey[KEY_LOTG] + "=" + ::ToString( m_dLoTang)) ;
case KEY_LOTY : return ( sSurfRoughingKey[KEY_LOTY] + "=" + ::ToString( m_nLeadOutType)) ;
case KEY_NAME : return ( sSurfRoughingKey[KEY_NAME] + "=" + m_sName) ;
case KEY_NNS : return ( sSurfRoughingKey[KEY_NNS] + "=" + m_sSysNotes) ;
case KEY_NNU : return ( sSurfRoughingKey[KEY_NNU] + "=" + m_sUserNotes) ;
case KEY_OL : return ( sSurfRoughingKey[KEY_OL] + "=" + ::ToString( m_dOffsL)) ;
case KEY_OR : return ( sSurfRoughingKey[KEY_OR] + "=" + ::ToString( m_dOffsR)) ;
case KEY_PS : return ( sSurfRoughingKey[KEY_PS] + "=" + ::ToString( m_dStartPos)) ;
case KEY_S : return ( sSurfRoughingKey[KEY_S] + "=" + ::ToString( m_dSpeed)) ;
case KEY_SA : return ( sSurfRoughingKey[KEY_SA] + "=" + ::ToString( m_dSideAngle)) ;
case KEY_SCC : return ( sSurfRoughingKey[KEY_SCC] + "=" + ::ToString( m_nSolCh)) ;
case KEY_SST : return ( sSurfRoughingKey[KEY_SST] + "=" + ::ToString( m_dSubStep)) ;
case KEY_SS : return ( sSurfRoughingKey[KEY_SS] + "=" + ::ToString( m_dSideStep)) ;
case KEY_ST : return ( sSurfRoughingKey[KEY_ST] + "=" + ::ToString( m_dStep)) ;
case KEY_SUBTYPE : return ( sSurfRoughingKey[KEY_SUBTYPE] + "=" + ::ToString( m_nSubType)) ;
case KEY_TNAME : return ( sSurfRoughingKey[KEY_TNAME] + "=" + m_sToolName) ;
case KEY_TUUID : return ( sSurfRoughingKey[KEY_TUUID] + "=" + ::ToString( m_ToolUuid)) ;
case KEY_UUID : return ( sSurfRoughingKey[KEY_UUID] + "=" + ::ToString( m_Uuid)) ;
default : return "" ;
}
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::IsOptional( int nKey) const
{
return ( nKey == KEY_LIEL || nKey == KEY_SST) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::VerifySolCh( int nVal) const
{
return IsValidOperationScc( nVal) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::VerifySubType( int nVal) const
{
return ( nVal == SURFROU_SUB_ZIGZAG || nVal == SURFROU_SUB_ONEWAY ||
nVal == SURFROU_SUB_SPIRALIN || nVal == SURFROU_SUB_SPIRALOUT ||
nVal == SURFROU_SUB_CONFORMAL_ZIGZAG || nVal == SURFROU_SUB_CONFORMAL_ONEWAY) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::VerifyLeadInType( int nVal) const
{
return ( nVal == SURFROU_LI_NONE || nVal == SURFROU_LI_GLIDE ||
nVal == SURFROU_LI_ZIGZAG || nVal == SURFROU_LI_HELIX) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::VerifyLeadOutType( int nVal) const
{
return ( nVal == SURFROU_LO_NONE || nVal == SURFROU_LO_GLIDE) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::VerifyTool( const ToolsMgr* pToolsMgr, const string& sVal, const ToolData*& pTdata) const
{
if ( pToolsMgr == nullptr)
return false ;
pTdata = pToolsMgr->GetTool( sVal) ;
if ( pTdata == nullptr)
return false ;
if ( ( pTdata->m_nType & TF_MILL) == 0)
return false ;
return true ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::GetTool( const ToolsMgr* pToolsMgr, const ToolData*& pTdata) const
{
if ( pToolsMgr == nullptr)
return false ;
pTdata = pToolsMgr->GetTool( m_ToolUuid) ;
return ( pTdata != nullptr) ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::SetParam( int nType, bool bVal)
{
switch ( nType) {
case MPA_INVERT :
m_bInvert = bVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::SetParam( int nType, int nVal)
{
switch ( nType) {
case MPA_LEADINTYPE :
if ( ! VerifyLeadInType( nVal))
return false ;
m_nLeadInType = nVal ;
return true ;
case MPA_LEADOUTTYPE :
if ( ! VerifyLeadOutType( nVal))
return false ;
m_nLeadOutType = nVal ;
return true ;
case MPA_SCC :
if ( ! VerifySolCh( nVal))
return false ;
m_nSolCh = nVal ;
return true ;
case MPA_SUBTYPE :
if ( ! VerifySubType( nVal))
return false ;
m_nSubType = nVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::SetParam( int nType, double dVal)
{
switch ( nType) {
case MPA_SPEED :
m_dSpeed = dVal ;
return true ;
case MPA_FEED :
m_dFeed = dVal ;
return true ;
case MPA_STARTFEED :
m_dStartFeed = dVal ;
return true ;
case MPA_ENDFEED :
m_dEndFeed = dVal ;
return true ;
case MPA_TIPFEED :
m_dTipFeed = dVal ;
return true ;
case MPA_OFFSR :
m_dOffsR = dVal ;
return true ;
case MPA_OFFSL :
m_dOffsL = dVal ;
return true ;
case MPA_DEPTH :
m_sDepth = ::ToString( dVal) ;
return true ;
case MPA_STARTPOS :
m_dStartPos = dVal ;
return true ;
case MPA_STEP :
m_dStep = dVal ;
return true ;
case MPA_SUBSTEP :
m_dSubStep = dVal ;
return true ;
case MPA_SIDESTEP :
m_dSideStep = dVal ;
return true ;
case MPA_SIDEANGLE :
m_dSideAngle = dVal ;
return true ;
case MPA_LIELEV :
m_dLiElev = dVal ;
return true ;
case MPA_LITANG :
m_dLiTang = dVal ;
return true ;
case MPA_LOTANG :
m_dLoTang = dVal ;
return true ;
case MPA_APPROX :
m_dApprox = dVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::SetParam( int nType, const string& sVal)
{
switch ( nType) {
case MPA_NAME :
m_sName = sVal ;
return true ;
case MPA_TOOL :
m_sToolName = sVal ;
return true ;
case MPA_DEPTH_STR :
m_sDepth = sVal ;
return true ;
case MPA_TUUID :
return ::FromString( sVal, m_ToolUuid) ;
case MPA_UUID :
return ::FromString( sVal, m_Uuid) ;
case MPA_SYSNOTES :
m_sSysNotes = sVal ;
return true ;
case MPA_USERNOTES :
m_sUserNotes = sVal ;
return true ;
case MPA_INITANGS :
m_sInitAngs = sVal ;
return true ;
case MPA_BLOCKEDAXIS :
m_sBlockedAxis = sVal ;
return true ;
}
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::ResetTool( void)
{
m_sToolName.clear() ;
m_ToolUuid.Clear() ;
return true ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::GetParam( int nType, bool& bVal) const
{
switch ( nType) {
case MPA_INVERT :
bVal = m_bInvert ;
return true ;
}
bVal = false ;
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::GetParam( int nType, int& nVal) const
{
switch ( nType) {
case MPA_TYPE :
nVal = MT_SURFROUGHING ;
return true ;
case MPA_SUBTYPE :
nVal = m_nSubType ;
return true ;
case MPA_LEADINTYPE :
nVal = m_nLeadInType ;
return true ;
case MPA_LEADOUTTYPE :
nVal = m_nLeadOutType ;
return true ;
case MPA_SCC :
nVal = m_nSolCh ;
return true ;
}
nVal = 0 ;
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::GetParam( int nType, double& dVal) const
{
switch ( nType) {
case MPA_SPEED :
dVal = m_dSpeed ;
return true ;
case MPA_FEED :
dVal = m_dFeed ;
return true ;
case MPA_STARTFEED :
dVal = m_dStartFeed ;
return true ;
case MPA_ENDFEED :
dVal = m_dEndFeed ;
return true ;
case MPA_TIPFEED :
dVal = m_dTipFeed ;
return true ;
case MPA_OFFSR :
dVal = m_dOffsR ;
return true ;
case MPA_OFFSL :
dVal = m_dOffsL ;
return true ;
case MPA_STARTPOS :
dVal = m_dStartPos ;
return true ;
case MPA_STEP :
dVal = m_dStep ;
return true ;
case MPA_SUBSTEP :
dVal = m_dSubStep ;
return true ;
case MPA_SIDESTEP :
dVal = m_dSideStep ;
return true ;
case MPA_SIDEANGLE :
dVal = m_dSideAngle ;
return true ;
case MPA_LIELEV :
dVal = m_dLiElev ;
return true ;
case MPA_LITANG :
dVal = m_dLiTang ;
return true ;
case MPA_LOTANG :
dVal = m_dLoTang ;
return true ;
case MPA_APPROX :
dVal = m_dApprox ;
return true ;
}
dVal = 0 ;
return false ;
}
//----------------------------------------------------------------------------
bool
SurfRoughingData::GetParam( int nType, string& sVal) const
{
switch ( nType) {
case MPA_NAME :
sVal = m_sName ;
return true ;
case MPA_TOOL :
sVal = m_sToolName ;
return true ;
case MPA_DEPTH_STR :
sVal = m_sDepth ;
return true ;
case MPA_TUUID :
sVal = ::ToString( m_ToolUuid) ;
return true ;
case MPA_UUID :
sVal = ::ToString( m_Uuid) ;
return true ;
case MPA_SYSNOTES :
sVal = m_sSysNotes ;
return true ;
case MPA_USERNOTES :
sVal = m_sUserNotes ;
return true ;
case MPA_INITANGS :
sVal = m_sInitAngs ;
return true ;
case MPA_BLOCKEDAXIS :
sVal = m_sBlockedAxis ;
return true ;
}
sVal = "" ;
return false ;
}

Some files were not shown because too many files have changed in this diff Show More