Compare commits

...

76 Commits

Author SHA1 Message Date
NicolaP 24ab2e0ba8 Aggiunto comando per gestione ExecLua 2022-11-21 10:32:12 +01:00
NicolaP 8aec6c87b0 Merge commit '24fa5e089a30ddf6238c5996001fbc42c9359ef8' into develop 2022-11-18 17:51:36 +01:00
NicolaP 24fa5e089a Inserito comando Parking nella pagina TagliDiretti 2022-11-17 20:03:45 +01:00
NicolaP 1ce036a0f6 Cambio versione 2.4k1 2022-11-03 19:33:02 +01:00
NicolaP dd5dd7c93c Merge branch 'Features/Engrave_Angle' into develop 2022-11-03 19:30:34 +01:00
NicolaP 393559d41a Merge branch 'develop' into Features/Engrave_Angle 2022-11-03 19:30:10 +01:00
NicolaP 45f6639dcd Migliorata gestione deposito su tavola ausiliaria 2022-11-02 16:20:09 +01:00
NicolaP de989f5762 Correzione definizione funzioni 2022-10-27 19:12:51 +02:00
NicolaP c33d6c1e77 Correzione nome funzioni in VacuumCups 2022-10-26 11:15:50 +02:00
NicolaP a1b2158404 Merge branch 'master' into develop 2022-10-26 10:57:07 +02:00
DarioS 05e94943e0 OmagCUT :
- migliorati controlli per chiave di rete.
2022-10-25 20:11:02 +02:00
DarioS 6bba5143f9 OmagCUT 2.4j1 :
- aggiunta gestione chiave di rete.
2022-10-25 15:20:28 +02:00
NicolaP 3957f66ec1 Merge branch 'develop' 2022-10-25 15:06:02 +02:00
NicolaP 46f7e78efc Correzione inserimento pausa in movimenti finali 2022-10-25 15:05:41 +02:00
NicolaP 02a8e3a274 Migliorata gestione/visualizzazione giunzione dei tagli inclinati 2022-10-24 18:03:25 +02:00
NicolaP 00bbe3ad70 Migliorata visualizzazione e invertito segno degli angoli 2022-10-20 10:28:19 +02:00
NicolaP f81970accc Merge branch 'develop' 2022-10-19 13:13:39 +02:00
NicolaP 165ed71234 Correzione pezzi parcheggio macchina 2 Tab 2022-10-19 13:13:26 +02:00
NicolaP 01b04e6a9d Merge branch 'develop' 2022-10-12 12:41:13 +02:00
NicolaP 8a8ff33110 Correzione gestione visibilità comando Scrap 2022-10-12 12:40:54 +02:00
NicolaP 4ca3b4ee47 Gestione primo taglio inclinato 2022-10-11 18:34:32 +02:00
NicolaP 6b6031379b Merge branch 'master' into develop 2022-10-06 13:02:48 +02:00
NicolaP 7e96fb2385 Cambio versione: 2.4i4 2022-10-06 13:02:11 +02:00
NicolaP 7ee4a2e552 Merge branch 'develop' 2022-10-06 12:59:49 +02:00
NicolaP 105a12c497 Merge branch 'Features/Manage_Pause_Unloading' into develop 2022-10-06 11:09:59 +02:00
NicolaP e0f380ed1d Merge branch 'Features/StartEnd_Modify_On_Internal_Corner' into develop 2022-10-06 10:48:08 +02:00
NicolaP a568c614fb Migliorata gestione deposito su tavola ausiliaria 2022-10-03 19:14:22 +02:00
NicolaP 6dc5fe5a12 Gestione modifica per scarico su tavola 2 2022-10-03 18:23:20 +02:00
NicolaP a1db5945df Gestione allungamenti tagli sugli angoli interni 2022-10-03 13:11:23 +02:00
NicolaP fba8b377f9 Correzione Merge 2022-10-03 11:53:55 +02:00
NicolaP 401b171c4e Merge branch 'Features/Manage_General_Cut_Param' into develop 2022-09-30 19:55:41 +02:00
NicolaP 3285d72817 Merge branch 'Features/Scraps_From_Cut' into develop 2022-09-30 19:55:15 +02:00
NicolaP 17229ab9bc Migliorata gestione scene e eliminazione Slab 2022-09-28 11:59:11 +02:00
NicolaP c3abca3cee Inizio gestione modifica per spostamenti 2022-09-22 20:16:19 +02:00
NicolaP 2e0f2eab1b Gestione riconoscimento sfridi da progetto 2022-09-22 17:33:17 +02:00
NicolaP 9c60ef020f Sacrico tutti i pezzi da tavola ausiliaria 2022-09-21 18:56:49 +02:00
NicolaP 58c62ebd5c Carico coordinate punti del grezzo (Da verificare) 2022-09-21 18:23:05 +02:00
NicolaP ab525c7431 Aggiunta modifica 2022-09-21 17:55:33 +02:00
NicolaP 613b9fa725 Correzione gestione salvataggio fase 2022-09-21 17:52:51 +02:00
NicolaP e4e20b9f91 Salvataggio nell'utensile delle info di taglio 2022-09-19 20:22:22 +02:00
NicolaP ca6a468cda Merge branch 'develop' 2022-09-19 15:09:11 +02:00
NicolaP 24ddd7d245 Migliorata gestione ponticelli 2022-09-19 14:59:48 +02:00
NicolaP f9fd0f0168 Miglioramento gestione comado AddSpar/RemoveScrap 2022-09-19 12:19:40 +02:00
NicolaP eac7b0999a Merge branch 'develop' 2022-09-15 12:15:52 +02:00
NicolaP a464e0dc3b Milgiorato Reset ponticelli da movimento pezzo 2022-09-15 12:15:25 +02:00
NicolaP 401af44bb5 Merge branch 'develop' 2022-09-15 12:00:00 +02:00
NicolaP 1599515d58 Gestione eliminazione Pezzi/Ponticelli 2022-09-15 11:59:45 +02:00
NicolaP 0be1695246 Merge branch 'develop' 2022-09-15 11:20:19 +02:00
NicolaP a79725783f Migliorata selezione lati per ponticelli 2022-09-15 11:19:39 +02:00
NicolaP f13a51e8a1 Merge remote-tracking branch 'origin/master' into develop 2022-09-15 11:06:00 +02:00
NicolaP b77ed406ae Inizio gestione salvataggio parametri lavorazione 2022-09-15 11:05:37 +02:00
DarioS bb650afe9c OmagCUT :
- aggiunte altre info per Bridges.
2022-09-14 10:11:37 +02:00
NicolaP 1d87ac5c47 Merge branch 'develop' 2022-09-13 15:28:30 +02:00
NicolaP fc3053df66 Eliminazione Bridges se muovo grezzo 2022-09-13 15:28:06 +02:00
NicolaP 588ef08b17 Merge branch 'develop' 2022-09-13 12:27:27 +02:00
NicolaP ebdaeece85 Merge branch 'Features/Research_DXF' into develop 2022-09-13 12:27:10 +02:00
NicolaP 1605f81090 Merge branch 'develop' 2022-09-13 11:28:05 +02:00
NicolaP a10703fe94 Aggiorno lavorazioni dopo Ins/Del di ogni Bridge 2022-09-13 11:27:31 +02:00
NicolaP a0575cbbac Migliorata gestione dei pontocelli 2022-09-13 11:21:42 +02:00
NicolaP 8180ffaeaa Merge remote-tracking branch 'origin/HEAD' into develop 2022-09-13 10:14:08 +02:00
DarioS 848783078c Merge branch 'master' of https://gitlab.steamware.net/egaltech/OmagCUT 2022-09-13 09:01:49 +02:00
DarioS 45f0245f9f OmagCUT 2.4i2 :
- ricompilazione con cambio di versione.
2022-09-13 09:01:10 +02:00
NicolaP a81a7f8d9e Correzione gestione importazione di più pezzi DXF 2022-09-12 14:54:54 +02:00
NicolaP ca0210cf09 Aggiunta gestine notifica di lastra in letttura 2022-09-12 10:22:40 +02:00
NicolaP 622912dec3 Gestione Add/Save/Delete lastra da DB 2022-09-09 17:24:16 +02:00
NicolaP 8ed35a5c46 Merge branch 'develop' 2022-09-09 09:46:05 +02:00
NicolaP a2bbcfed95 Cambio versione 2022-09-09 09:44:42 +02:00
NicolaP 0667da3692 Merge branch 'Features/Save_TRF_Data' into develop 2022-09-09 09:42:35 +02:00
NicolaP 5ff39c9d1c Gestione personalizzata OmagPHOTO 2022-09-08 19:27:24 +02:00
NicolaP 60a666c1c1 Creazione pagina per gestione campi DB 2022-09-07 18:10:03 +02:00
NicolaP df47692e8e Salvataggio nel file *.ini del programma dati TRF 2022-09-06 12:59:11 +02:00
NicolaP 41903872b1 Definita funzione per il salvataggio TabAux (ERRORE simulazione) 2022-09-05 12:13:26 +02:00
NicolaP beb3ce841b Inizio gestione creazione grezzi per scarico (ERRORI simulazione) 2022-09-01 20:29:46 +02:00
NicolaP 5b3e73290c Salvataggio in DB dell'iimagine ritagliata 2022-08-29 20:09:46 +02:00
NicolaP 854519b706 Aggiunti riferimenti alla libreria EgtPHOTOLib 2022-08-25 19:28:07 +02:00
NicolaP d8179b47ee Inizio gestione sfridi 2022-08-24 18:58:33 +02:00
39 changed files with 2026 additions and 146 deletions
+12 -6
View File
@@ -133,10 +133,14 @@
</Button> </Button>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6" <Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/> Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3"> <Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -155,9 +159,11 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/> <ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
</Grid> <Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid> </Grid>
+284 -45
View File
@@ -11,8 +11,12 @@ Public Class MoveRawPartPage
Private m_nAuxTabId As Integer = GDB_ID.NULL Private m_nAuxTabId As Integer = GDB_ID.NULL
' Fase corrente ' Fase corrente
Private m_nCurrPhase As Integer = 0 Private m_nCurrPhase As Integer = 0
' Disposizione corrente
Private m_nCurrDisposition As Integer = GDB_ID.NULL
' Premuto Prev ' Premuto Prev
Private m_bPrev As Boolean = False Private m_bPrev As Boolean = False
' Pemuto Next
Private m_bToNext As Boolean = False
' Dati movimento ' Dati movimento
Private m_dStep As Double = 0 Private m_dStep As Double = 0
Private m_dRotation As Double = 0 Private m_dRotation As Double = 0
@@ -27,7 +31,8 @@ Public Class MoveRawPartPage
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
' Visibilità comando Scrap
Private m_ScrapsVisibility As Visibility = Visibility.Visible
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -35,12 +40,15 @@ Public Class MoveRawPartPage
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ScrapsBtn.Content = "Add Scraps"
End Sub End Sub
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_SplitPage = m_MainWindow.m_CadCutPageUC.m_SplitPage m_SplitPage = m_MainWindow.m_CadCutPageUC.m_SplitPage
m_bActive = True m_bActive = True
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Leggo tipo movimento grezzi ' Leggo tipo movimento grezzi
m_bByHand = (GetVacuumType() = 0 Or m_bByHand = (GetVacuumType() = 0 Or
Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP) Or Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP) Or
@@ -57,40 +65,47 @@ Public Class MoveRawPartPage
m_SplitPage.GetEnabledCuts(Cuts) m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente ' Fase precedente
Dim nPrevPhase As Integer = EgtGetCurrPhase() Dim nPrevPhase As Integer = EgtGetCurrPhase()
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
If Not m_SplitPage.m_bShow Then If Not m_SplitPage.m_bShow Then
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
SplitRawParts(nPrevPhase, Cuts, vNewRaws) SplitRawParts(nPrevPhase, Cuts, vNewRaws)
Else Else
EgtSetCurrPhase(nPrevPhase + 1) EgtSetCurrPhase(nPrevPhase + 1)
HideAllMachinings() HideAllMachinings()
End If End If
m_nCurrPhase = EgtGetCurrPhase() m_nCurrPhase = EgtGetCurrPhase()
'---------------------------- SCRAPS ----------------------------
' gestione visualizzazione del comando "Scraps"
Dim ScrapsVisibility As Visibility = Visibility.Collapsed
' verifico se licenza abilitat: m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SCRAPS)
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, m_MainWindow.GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, m_MainWindow.GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\OmagPHOTODb.sqlite") Then
ScrapsVisibility = Visibility.Visible
End If
End If
' verifico che siano stati generati dei nuovi grezzi
If vNewRaws.Count = 0 Then
ScrapsVisibility = Visibility.Collapsed
End If
' aggiorno la grafica
m_ScrapsVisibility = ScrapsVisibility
If m_ScrapsVisibility <> Visibility.Visible Then
Grid.SetColumnSpan(RemovePartBtn, 3)
Else
Grid.SetColumnSpan(RemovePartBtn, 2)
End If
'---------------------------- SCRAPS ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario ' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then If m_SplitPage.m_bOnAuxTab Then
m_nAuxTabId = EgtGetTableId(AUX_TAB) ' assegnazione delle info tavola ausiliaria alla dispozione corrente
' Visualizzo tavolo ausiliario SetAuxTabInCurrDisposition()
Dim bOldEnMod As Boolean = EgtGetEnableModified() ' altrimenti, aggiorno visualizzazione
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' altrimenti, aggiorno visualizzazione
Else Else
EgtDraw() EgtDraw()
End If End If
@@ -128,14 +143,14 @@ Public Class MoveRawPartPage
' Distanza iniziale ' Distanza iniziale
m_dCurrDist = 0 m_dCurrDist = 0
End If End If
' Non dovrebbe mai accadere, ma inizializzo con default ' Non dovrebbe mai accadere, ma inizializzo con default
Else Else
m_vtDir = Vector3d.Y_AX() m_vtDir = Vector3d.Y_AX()
m_ptMid = Point3d.ORIG() m_ptMid = Point3d.ORIG()
m_dOrigDist = 0 m_dOrigDist = 0
m_dCurrDist = 0 m_dCurrDist = 0
End If End If
' Altrimenti movimento con ventose ' Altrimenti movimento con ventose
Else Else
m_bRemovedRaw = False m_bRemovedRaw = False
m_bRawWithCups = False m_bRawWithCups = False
@@ -149,6 +164,9 @@ Public Class MoveRawPartPage
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList) GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
End If End If
End If End If
' aggiorno il messaggio del comando per gestire gli sfridi
VerifyIsNewScrap(m_CurrRawOnVacuum)
' Aggiorno interfaccia per taglio perpendicolare ' Aggiorno interfaccia per taglio perpendicolare
If m_bByHand Then If m_bByHand Then
UpBtn.Visibility = Windows.Visibility.Visible UpBtn.Visibility = Windows.Visibility.Visible
@@ -164,8 +182,10 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento con ventose ScrapsBtn.Visibility = m_ScrapsVisibility
' altrimenti per movimento con ventose
ElseIf Not m_SplitPage.m_bOnAuxTab Then ElseIf Not m_SplitPage.m_bOnAuxTab Then
UpBtn.Visibility = Windows.Visibility.Visible UpBtn.Visibility = Windows.Visibility.Visible
LeftBtn.Visibility = Windows.Visibility.Visible LeftBtn.Visibility = Windows.Visibility.Visible
@@ -180,8 +200,10 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden ResetBtn.Visibility = Windows.Visibility.Hidden
' altrimenti per movimento finale dei pezzi ScrapsBtn.Visibility = m_ScrapsVisibility
' altrimenti per movimento finale dei pezzi
Else Else
UpBtn.Visibility = Windows.Visibility.Hidden UpBtn.Visibility = Windows.Visibility.Hidden
LeftBtn.Visibility = Windows.Visibility.Hidden LeftBtn.Visibility = Windows.Visibility.Hidden
@@ -196,14 +218,45 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Visible TopRBtn.Visibility = Windows.Visibility.Visible
BottomLBtn.Visibility = Windows.Visibility.Visible BottomLBtn.Visibility = Windows.Visibility.Visible
BottomRBtn.Visibility = Windows.Visibility.Visible BottomRBtn.Visibility = Windows.Visibility.Visible
PauseBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible ResetBtn.Visibility = Windows.Visibility.Visible
ScrapsBtn.Visibility = Windows.Visibility.Hidden
End If End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica ' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni ' gestione abilitazione altri bottoni
EnableButtons() EnableButtons()
End Sub End Sub
Private Sub SetAuxTabInCurrDisposition()
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo ' Verifico di essere il gestore attivo
If Not m_bActive Then Return If Not m_bActive Then Return
@@ -232,17 +285,19 @@ Public Class MoveRawPartPage
If nParentId = nRawGroupId Then If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_ Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nId, nStat) EgtGetStatus(nId, nStat)
' aggiorno il messaggio del bottone "Scrap" a seconda che il grezzo sia già uno scrap
VerifyIsNewScrap(nId)
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo ' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
If nStat = GDB_ST.SEL Then If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_) EgtSetStatus(nId, GDB_ST.ON_)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola ' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
If VerifyCollisionWithOtherRawPart(nId) Then If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo ' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL) EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi") m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else Else
' Se con ventose, le nascondo ' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF) If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If End If
Else Else
@@ -271,9 +326,9 @@ Public Class MoveRawPartPage
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile()) MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
Dim AverageDensity As Double = 2700 Dim AverageDensity As Double = 2700
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile()) AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger) VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0) VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0) VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then If PutVacuumCupsOnRaw(nId, rmData) Then
' Visualizzo le ventose ' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_) EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
@@ -316,6 +371,8 @@ Public Class MoveRawPartPage
' Veririfica che il grezzo non entri in colliosione con altri pezzi ' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
If m_SplitPage.m_bOnAuxTab Then Return False
If nIdOnVacumm = GDB_ID.NULL Then Return False If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione ' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT) Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
@@ -347,6 +404,27 @@ Public Class MoveRawPartPage
Return False Return False
End Function End Function
Private Function VerifyIsNewScrap(nMyId As Integer) As Boolean
Dim nVal As Integer = 0
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
If nVal = 1 Or nVal = 2 Then
' 1 → è stato definito come nuovo grezzo oppure, 2 → è stato definito come nuovo grezzo ed è stato inserito nel DB delle lastre
ScrapsBtn.Content = "Remove Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return True
ElseIf nVal = 3 Then
' non è possibile rimuovere il grezzo in questa fase
ScrapsBtn.Content = "Defined as Scrap"
ScrapsBtn.IsEnabled = False
Return True
End If
End If
' non è un nuovo grezzo
ScrapsBtn.Content = "Add Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return False
End Function
#Region "Move Up/Down/Left/Right" #Region "Move Up/Down/Left/Right"
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
@@ -679,6 +757,29 @@ Public Class MoveRawPartPage
EgtDraw() EgtDraw()
End Sub End Sub
Private Sub ScrapsBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ScrapsBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
' verifico che il grezzo non contenga dei pezzi (altrimenti non risulta selezionabile)
Dim nPartInRaw As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPartInRaw = GDB_ID.NULL Then
If Not VerifyIsNewScrap(nRawId) Then
EgtSetInfo(nRawId, K_ISNEWSCRAPS, "1")
Else
EgtRemoveInfo(nRawId, K_ISNEWSCRAPS)
End If
' aggiorno il contenuto del bottone
VerifyIsNewScrap(nRawId)
Else
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetErrorMessage("Part inside raw!")
End If
' passo al grezzo succesivo (NON dovrebbero esserci altri grezzi selezionabili contemporaneamente!)
nRawId = EgtGetNextSelectedObj()
End While
End Sub
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
Dim dStep As Double Dim dStep As Double
If StringToLen(StepMoveTxBx.Text, dStep) Then If StringToLen(StepMoveTxBx.Text, dStep) Then
@@ -741,9 +842,12 @@ Public Class MoveRawPartPage
' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola ' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola
If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return
Dim bb3dRaw As New BBox3d
EgtGetRawPartBBox(nRawId, bb3dRaw)
Dim ForceToRotate As Boolean = bb3dRaw.DimX < bb3dRaw.DimY
' provo a verificare di poter depositare il pezzo (senza applicare delle rotazioni) ' provo a verificare di poter depositare il pezzo (senza applicare delle rotazioni)
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Or ForceToRotate Then
' se sono impostati degli step di rotazione ' se sono impostati degli step di rotazione
If AngRotList.Count > 0 Then If AngRotList.Count > 0 Then
Dim bOkRotate As Boolean = False Dim bOkRotate As Boolean = False
@@ -763,6 +867,16 @@ Public Class MoveRawPartPage
Next Next
If Not bOkRotate Then Return If Not bOkRotate Then Return
Else Else
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
Dim b3Area As New BBox3d
EgtGetTableArea(1, b3Area)
Dim b3RawTemp As New BBox3d
EgtGetRawPartBBox(nRawId, b3RawTemp)
' ricavo il riferimento dell'angolo in basso a sinstra del grezzo rispetto alla tavola
Dim ptCorner As Point3d = New Point3d(b3Area.DimX / 2, b3Area.DimY / 2, 0) - New Vector3d(b3RawTemp.DimX / 2, b3RawTemp.DimY / 2, 0)
' sposto il pezzo in questa posizione
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
' riprovo il movimento
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima ' riposiziono il pezzo come era prima
@@ -877,6 +991,64 @@ Public Class MoveRawPartPage
Return True Return True
End Function End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
Dim Index As Integer = 0
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
m_RawMoveDataList.RemoveAt(Index)
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' imposto la pausa nella disposizione corrente
SetPause(nDispId)
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
' Creo nuova fase
Dim nNewPhase As Integer = EgtAddPhase()
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
'SetPause(nCurrDisposition)
m_nCurrDisposition = nCurrDisposition
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtSetCurrPhase(nNewPhase)
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
' Recupero il primo grezzo selezionato ' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj() Dim nRawId As Integer = EgtGetFirstSelectedObj()
@@ -912,7 +1084,30 @@ Public Class MoveRawPartPage
EgtDeselectAll() EgtDeselectAll()
' Torno alla fase precedente ' Torno alla fase precedente
m_bPrev = True m_bPrev = True
' Passo alla pagina delle spezzature ' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
' verifico se la fasa precedente è di tipo scarico
If IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase - 1)
m_nCurrDisposition = nPrevDispId
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
EgtDraw()
Return
End If
'If EgtGetOperationType(EgtGetPrevOperation(m_nCurrDisposition)) = MCH_OY.DISP AndAlso m_SplitPage.m_bOnAuxTab Then
' EgtSetCurrPhase(m_nCurrPhase - 1)
' m_nCurrDisposition = EgtGetPrevOperation(m_nCurrDisposition)
' m_nCurrPhase -= 1
' m_bPrev = False
' m_SplitPage.m_bShow = True
' EgtDraw()
' Return
'End If
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me) m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage) m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage)
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split
@@ -928,6 +1123,19 @@ Public Class MoveRawPartPage
' non cambio pagina ' non cambio pagina
Return Return
End If End If
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
End If
' resetto l'inidice del pezzo da mnovimentare ' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto ' Deseleziono tutto
@@ -973,6 +1181,26 @@ Public Class MoveRawPartPage
EnableButtons() EnableButtons()
End Sub End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer) As Integer
' verifico se la fase precedente è uno scarico su tavola ausiliaria
Dim bVal As Integer = 0
EgtGetInfo(nCurrDispId, "Pat", bVal)
Return bVal
End Function
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
Dim nDispId As Integer = nCurrDisposId
While nDispId <> GDB_ID.NULL
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
Return nDispId
End If
nDispId = EgtGetNextOperation(nDispId)
End While
Return GDB_ID.NULL
End Function
Private Sub EnableButtons() Private Sub EnableButtons()
UpBtn.IsEnabled = Not m_SplitPage.m_bShow UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -987,11 +1215,22 @@ Public Class MoveRawPartPage
TopRBtn.IsEnabled = Not m_SplitPage.m_bShow TopRBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
End If
End Sub End Sub
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
' Se movimento con ventose ' Se movimento con ventose
If Not m_bByHand Then If Not m_bByHand Then
' nascondo le ventose ' nascondo le ventose
@@ -1007,11 +1246,11 @@ Public Class MoveRawPartPage
' imposto eventuale presenza rimozioni manuali ' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw) SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria ' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable( nDispId, m_SplitPage.m_bOnAuxTab) SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' Eseguo calcolo speciale dei movimenti ' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab) SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If End If
' se altrimenti movimento senza ventose perchè lama troppo grande ' se altrimenti movimento senza ventose perchè lama troppo grande
ElseIf GetVacuumType() > 0 Then ElseIf GetVacuumType() > 0 Then
' se non solo visualizzazione ' se non solo visualizzazione
If Not m_SplitPage.m_bShow Then If Not m_SplitPage.m_bShow Then
+53 -1
View File
@@ -1175,7 +1175,9 @@ Public Class NestPageUC
m_ptPrev = ptCurr m_ptPrev = ptCurr
' Terminata esecuzione di drag ' Terminata esecuzione di drag
m_bDragging = False m_bDragging = False
' se è stato eseguito il Drag allora cancello tutti i ponticelli '' elimino il ponticello associato: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
'DeleteBridgeAssociated(nMoveId)
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges() ResetAllBRidges()
End Sub End Sub
@@ -2312,6 +2314,11 @@ Public Class NestPageUC
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End Sub End Sub
' ripulisco la lista dei pezzi in parcheggio
Friend Sub ResetListOfGruopInPark()
m_ListOfGroupInPark.Clear()
End Sub
Friend Function StoreOnePart(nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean Friend Function StoreOnePart(nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean
' Se pezzo in grezzo, metto in parcheggio (sempre possibile) ' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
If bForced OrElse If bForced OrElse
@@ -2389,6 +2396,10 @@ Public Class NestPageUC
Dim dEraseArea As Double = 0 Dim dEraseArea As Double = 0
nId = EgtGetFirstSelectedObj() nId = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
'' elimino eventuali ponticelli associati al pezzo: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
'DeleteBridgeAssociated(nId)
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
' Recupero indice del successivo ' Recupero indice del successivo
Dim nNextId = EgtGetNextSelectedObj() Dim nNextId = EgtGetNextSelectedObj()
' Se abilitata cancellazione in ogni caso o pezzo non da Csv ' Se abilitata cancellazione in ogni caso o pezzo non da Csv
@@ -2434,6 +2445,47 @@ Public Class NestPageUC
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End Sub End Sub
Private Sub DeleteBridgeAssociated(nMyId As Integer)
' verifico se esistono dei ponticelli associati al pezzo indicato
' recuoero il gruppo di lavorazione corrente
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
' creo il gruppo per i ponticelli
Dim sNameGroup As String = BRIDGES
Dim nIdBridgesGroup As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
If nIdBridgesGroup <> GDB_ID.NULL Then
' carico la prima entità del gruppo BRIDGES
Dim nIdBridgeLine As Integer = GDB_ID.NULL
nIdBridgeLine = EgtGetFirstNameInGroup(nIdBridgesGroup, BRIDGELINE)
' ciclo su tutte le entità
While nIdBridgeLine <> GDB_ID.NULL
Dim nNextBridgeLine As Integer = GDB_ID.NULL
Dim nIdPart As Integer = GDB_ID.NULL
If EgtGetInfo(nIdBridgeLine, "PartStart", nIdPart) Then
If nIdPart = nMyId Then
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
' il ponticello deve essere eliminato
EgtErase(nIdBridgeLine)
nIdBridgeLine = nNextBridgeLine
' riparto dall'inizio del ciclo
Continue While
End If
End If
If EgtGetInfo(nIdBridgeLine, "PartEnd", nIdPart) Then
If nIdPart = nMyId Then
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
' il ponticello deve essere eliminato
EgtErase(nIdBridgeLine)
nIdBridgeLine = nNextBridgeLine
' riparto dall'inizio del ciclo
Continue While
End If
End If
' il BridgeLine corrente non contiene riferimeti al pezzo da eliminare
nIdBridgeLine = EgtGetNext(nIdBridgeLine)
End While
End If
End Sub
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Numero dei pezzi in tavola ' Numero dei pezzi in tavola
+7
View File
@@ -363,6 +363,13 @@ Public Module SplitAuto
vNewRaws.Add(nNewRawId) vNewRaws.Add(nNewRawId)
nNewRawId = EgtGetNextRawPart(nNewRawId) nNewRawId = EgtGetNextRawPart(nNewRawId)
End While End While
Else
' verifico che nella fase precedente è stato definito come sfrido, allora lo riassegno
Dim nVal As Integer = 0
EgtGetInfo(nRawId, K_ISNEWSCRAPS, nVal)
If nVal = 1 Or nVal = 2 Or nVal = 3 Then
EgtSetInfo(nRaw1Id, K_ISNEWSCRAPS, "3")
End If
End If End If
' Assegno ai nuovi grezzi eventuale texture del grezzo originale ' Assegno ai nuovi grezzi eventuale texture del grezzo originale
Dim nSolidId = EgtGetFirstNameInGroup(nRawId, NAME_RAW_SOLID) Dim nSolidId = EgtGetFirstNameInGroup(nRawId, NAME_RAW_SOLID)
+141 -48
View File
@@ -7,6 +7,7 @@ Public Class SplitPageUC
' Riferimento alla MainWindow ' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Flag di pagina attiva ' Flag di pagina attiva
Private m_bActive As Boolean = False Private m_bActive As Boolean = False
' Tipo movimento dei grezzi (manuale o con testa ventosa) ' Tipo movimento dei grezzi (manuale o con testa ventosa)
@@ -35,12 +36,9 @@ Public Class SplitPageUC
Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL
' Id gruppo Bridges (Nuovo da versione 30/08/2022) ' Id gruppo Bridges (Nuovo da versione 30/08/2022)
Private m_nIdBridgesGroup As Integer = GDB_ID.NULL Private m_nIdBridgesGroup As Integer = GDB_ID.NULL
Private m_nIdBridgeLineGroup As Integer = GDB_ID.NULL
Private m_nIdBridge As Integer = GDB_ID.NULL Private m_nIdBridge As Integer = GDB_ID.NULL
Private m_ptSrtBridge As New Point3d Private m_ptSrtBridge As New Point3d
Private m_ptEndBridge As New Point3d Private m_ptEndBridge As New Point3d
Public Const BRIDGES As String = "Bridges"
Public Const BRIDGELINE As String = "BridgeLine"
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem) Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
'Private m_CurrInd As Integer = -1 'Private m_CurrInd As Integer = -1
@@ -59,6 +57,8 @@ Public Class SplitPageUC
Private m_bDragging As Boolean = False Private m_bDragging As Boolean = False
' Selected cut ' Selected cut
Private m_nSelected As Integer = GDB_ID.NULL Private m_nSelected As Integer = GDB_ID.NULL
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
Private m_StartEndModifyOnIntCorner As Boolean = False
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs) Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
PrevBtn.IsEnabled = False PrevBtn.IsEnabled = False
@@ -87,6 +87,7 @@ Public Class SplitPageUC
AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto
RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart
BridgesWJBtn.ToolTip = "Bridges" BridgesWJBtn.ToolTip = "Bridges"
BridgesDeleteWJBtn.ToolTip = "Remove bridges"
End Sub End Sub
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -107,6 +108,8 @@ Public Class SplitPageUC
m_bEnableOnAuxTab = Not m_bByHand AndAlso m_bEnableOnAuxTab = Not m_bByHand AndAlso
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
' verifico se è abilitata la possibiltà di allungare i lati interni
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, m_MainWindow.GetIniFile()) <> 0)
' Nascondo eventuali pezzi in parcheggio ' Nascondo eventuali pezzi in parcheggio
HideParkedParts() HideParkedParts()
' Nascondo eventuale contorno da foto ' Nascondo eventuale contorno da foto
@@ -237,27 +240,16 @@ Public Class SplitPageUC
EgtGetName(nIdParent, sLayer) EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione ' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then If (EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE) AndAlso VerifySideIsAcceptable(nIdMy) Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
EgtDeselectObj(m_nIdSelectedSideWJ) EgtDeselectObj(m_nIdSelectedSideWJ)
End If End If
' recupero il gruppo della lavorazione associata ' recupero il gruppo della lavorazione associata
nIdParentPart = EgtGetParent(nIdParent) nIdParentPart = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
Dim ListGroup As List(Of Integer) = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuWJ(nIdParent, nIdPV)
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
Dim ListGroupSaw As List(Of Integer) = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuSaw(nIdParent, nIdPV)
' se non esiste almeno 1 Preview di tipo WaterJet ' se non esiste almeno 1 Preview di tipo WaterJet
If ListGroup.Count > 0 Then If IsWaterJetting(nIdMy) Then
' NON RECUPERO LA PREVIEW DELLA LAVORAZIONE → m_nIdSelectedWaterJet
m_nIdSelectedSideWJ = nIdMy m_nIdSelectedSideWJ = nIdMy
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
ListGroup = m_MainWindow.m_CadCutPageUC.m_NestPage.ResearchGropuWJ(nIdParent, nIdPV)
Dim nIdWJ As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.GetPVIdFromIdSide(ListGroup, nIdMy)
m_MainWindow.m_CadCutPageUC.m_NestPage.GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
' recupero il punto più vicino alla curva passata ' recupero il punto più vicino alla curva passata
If IsFirst Then If IsFirst Then
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge) EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge)
@@ -267,20 +259,23 @@ Public Class SplitPageUC
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB) EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
If VerifyInterference(m_nIdBridge) Then If VerifyInterference(m_nIdBridge) Then
m_CurrProjPage.ClearMessage() m_CurrProjPage.ClearMessage()
' salvo nel Gruppo "BridgeLine" gli dei pezzi che sono collegati EgtSetInfo(m_nIdBridge, "PartStart", m_nIdSelectedPartWJ_Srt)
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartStart", m_nIdSelectedPartWJ_Srt) EgtSetInfo(m_nIdBridge, "EntStart", m_nIdSelectedSideWJ_Srt)
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartEnd", m_nIdSelectedPartWJ_End) EgtSetInfo(m_nIdBridge, "PartEnd", m_nIdSelectedPartWJ_End)
EgtSetInfo(m_nIdBridge, "EntEnd", m_nIdSelectedSideWJ_End)
EgtSetInfo(m_nIdBridge, "Ph", EgtGetCurrPhase())
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
Else Else
' attendo la selezione di un punto valido ' attendo la selezione di un punto valido
m_nIdSelectedSideWJ = GDB_ID.NULL m_nIdSelectedSideWJ = GDB_ID.NULL
m_nIdSelectedWaterJet = GDB_ID.NULL
nIdParentPart = GDB_ID.NULL nIdParentPart = GDB_ID.NULL
m_CurrProjPage.ClearMessage() m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Bridge intersects part") m_CurrProjPage.SetWarningMessage("Bridge intersects part")
Return Return
End If End If
End If End If
m_nIdSelectedWaterJet = nIdWJ
' salvo il valore del PreView evidenziato ' salvo il valore del PreView evidenziato
EgtSetMark(nIdParentPart) EgtSetMark(nIdParentPart)
' EgtSetMark(nIdWJ) ' EgtSetMark(nIdWJ)
@@ -306,13 +301,19 @@ Public Class SplitPageUC
Dim nIdMy As Integer = EgtGetFirstObjInSelWin() Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL While nIdMy <> GDB_ID.NULL
Dim sGroupName As String = String.Empty Dim sGroupName As String = String.Empty
Dim sSelName As String = String.Empty
' gruppo di appartenenza ' gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nIdMy) Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer ' recupero il nome del gruppo di appartenenza
EgtGetName(nIdParent, sGroupName) EgtGetName(nIdParent, sGroupName)
If sGroupName.Contains(BRIDGELINE) Then ' recupero il nome dell'oggetto selezionato
EgtErase(nIdParent) EgtGetName(nIdMy, sSelName)
If sGroupName.Contains(BRIDGES) AndAlso sSelName.Contains(BRIDGELINE) Then
EgtErase(nIdMy)
EgtDraw() EgtDraw()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
Return Return
End If End If
nIdMy = EgtGetNextObjInSelWin() nIdMy = EgtGetNextObjInSelWin()
@@ -323,9 +324,9 @@ Public Class SplitPageUC
ptCurr.z = m_ptSrtBridge.z ptCurr.z = m_ptSrtBridge.z
' rappresento il egmento ' rappresento il egmento
If m_nIdBridge = GDB_ID.NULL Then If m_nIdBridge = GDB_ID.NULL Then
m_nIdBridgeLineGroup = EgtCreateGroup(m_nIdBridgesGroup) m_nIdBridge = EgtCreateLine(m_nIdBridgesGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB)
EgtSetName(m_nIdBridgeLineGroup, BRIDGELINE) ' assegno un nome alla linea
m_nIdBridge = EgtCreateLine(m_nIdBridgeLineGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB) EgtSetName(m_nIdBridge, BRIDGELINE)
End If End If
EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB) EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB)
EgtDraw() EgtDraw()
@@ -361,6 +362,75 @@ Public Class SplitPageUC
Return True Return True
End Function End Function
Private Function VerifySideIsAcceptable(nMyId As Integer) As Boolean
Dim dVal As Double = 0
' verifico che l'entità selezionata non contenga questi parametri
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE2, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
If EgtGetInfo(nMyId, INFO_ORIG_SIDE_ANGLE, dVal) Then
If dVal <> 0 Then
Return False
End If
End If
' altrimenti l'entità è accettabile
Return True
End Function
' verifico che il lato selezionato appartenga ad una lavorazione di tipo Waterjet
Private Function IsWaterJetting(nMyId As Integer) As Boolean
' verifico che sul lato indicato sia impostato un taglio di tipo WaterJet
Dim nMchId As Integer = GDB_ID.NULL
For nInd As Integer = 0 To m_MachiningList.Count() - 1
nMchId = m_MachiningList(nInd).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(m_MachiningList(nInd).m_nId)
If nMachiningType = MCH_MY.WATERJETTING Then
EgtSetCurrMachining(nMchId)
Dim nIndex As Integer = 0
Dim nIdSide As Integer = GDB_ID.NULL
Dim nSub As Integer = GDB_ID.NULL
While EgtGetMachiningGeometry(nIndex, nIdSide, nSub)
If nIdSide = nMyId Then
Return True
End If
nIndex += 1
End While
End If
Next
Return False
End Function
Private Sub RefreshMachList()
For nI As Integer = 0 To m_MachiningList.Count() - 1
' cancello tutti gli indici di lavorazione presenti nel disegno
Dim nNbrId As Integer = GDB_ID.NULL
EgtErase(m_MachiningList(nI).m_nNbrId)
EgtRemoveInfo(m_MachiningList(nI).m_nId, "NbrId")
Next
' Preparo la lista delle lavorazioni
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
' Aggiorno visualizzazione delle lavorazioni
For nI As Integer = 0 To m_MachiningList.Count() - 1
' sistemo colore
ColorMachining(m_MachiningList(nI))
' assegno nuova numerazione
NumberDirectionMachining(nI)
' conto il numero di tipi di lavorazioni
CountMachiningType(m_MachiningList(nI), m_nCountSawing, m_nCountWaterjetting, m_nCountOtherMachining)
Next
' aggiorno grafica
ShowMachiningList()
' aggiorno la visualizzazione
EgtDraw()
End Sub
Private Sub DeselectWJBridgesPart() Private Sub DeselectWJBridgesPart()
' se in fase di definzione di un ponticello lo elimino ' se in fase di definzione di un ponticello lo elimino
If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
@@ -397,6 +467,8 @@ Public Class SplitPageUC
OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt) OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
Else Else
OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End) OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
' aggiorno la visualizzazione delle lavorazioni e la lista
RefreshMachList()
End If End If
' se entrambi i pezzi sono stati definiti allora procedo alla deselezione ' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
@@ -408,6 +480,8 @@ Public Class SplitPageUC
' eliminazione dei ponticelli ' eliminazione dei ponticelli
If BridgesDeleteWJBtn.IsChecked Then If BridgesDeleteWJBtn.IsChecked Then
OnMyMouseDownSceneBridgesDelete(sender, e) OnMyMouseDownSceneBridgesDelete(sender, e)
' aggiorno la visualizzazione delle lavorazioni e la lista
RefreshMachList()
Return Return
End If End If
@@ -859,6 +933,7 @@ Public Class SplitPageUC
EnableButtons() EnableButtons()
End Sub End Sub
' ERRORE: questo evento non è eseguito!
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs) Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then If e.Key = Key.Escape Then
' se sono in fase di creazione di un ponticello interrompo ' se sono in fase di creazione di un ponticello interrompo
@@ -1304,21 +1379,24 @@ Public Class SplitPageUC
Do Do
' Se c'è limite alla lunghezza libera ' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno ' se abilitati i controlli sugli allungamenti dei lati interni
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL) If Not m_StartEndModifyOnIntCorner Then
' Recupero lunghezza baffo del taglio ' Recupero sicurezza in corner interno
Dim nPvId As Integer = GDB_ID.NULL Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId) ' Recupero lunghezza baffo del taglio
Dim dDT As Double = 0 Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT) EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety) Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
End If
End If End If
' Modifica della lavorazione ' Modifica della lavorazione
EgtSetCurrMachining(nOperId) EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0 Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen) EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica) ' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
Return Return
End If End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal) EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
@@ -1472,21 +1550,24 @@ Public Class SplitPageUC
Do Do
' Se c'è limite alla lunghezza libera ' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
' Recupero sicurezza in corner interno ' se abilitati i controlli sugli allungamenti dei lati interni
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL) If Not m_StartEndModifyOnIntCorner Then
' Recupero lunghezza baffo del taglio ' Recupero sicurezza in corner interno
Dim nPvId As Integer = GDB_ID.NULL Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId) ' Recupero lunghezza baffo del taglio
Dim dDT As Double = 0 Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT) EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety) Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
End If
End If End If
' Modifica della lavorazione ' Modifica della lavorazione
EgtSetCurrMachining(nOperId) EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0 Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen) EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
Return Return
End If End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal) EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
@@ -1658,6 +1739,16 @@ Public Class SplitPageUC
End Sub End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) Then
' verifico che l'operazione sia una disposizione, altrimenti cerco
NextDisposition = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.GetNextDisposition(NextDisposition)
m_bOnAuxTab = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.IsDispUnloadOnAuxTab(NextDisposition)
End If
End If
m_bToNext = True m_bToNext = True
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage) m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
@@ -1889,7 +1980,7 @@ Public Class SplitPageUC
m_bOnAuxTab = False m_bOnAuxTab = False
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante ' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1) NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti ' Altrimenti
Else Else
' movimento standard sulla tavola (almeno un taglio disabilitato) ' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0) Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
@@ -1900,7 +1991,7 @@ Public Class SplitPageUC
' Deve essere permesso almeno un tipo di movimento ' Deve essere permesso almeno un tipo di movimento
NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab
End If End If
' altrimenti sto solo visualizzando ' altrimenti sto solo visualizzando
Else Else
' movimento su tavola di scarico ' movimento su tavola di scarico
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP) m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
@@ -1939,6 +2030,8 @@ Public Class SplitPageUC
ModifEndBtn.IsEnabled = Not m_bShow ModifEndBtn.IsEnabled = Not m_bShow
InvertBtn.IsEnabled = Not m_bShow InvertBtn.IsEnabled = Not m_bShow
PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause
BridgesWJBtn.IsEnabled = Not m_bShow
BridgesDeleteWJBtn.IsEnabled = Not m_bShow
' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive ' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive
If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining) Then If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining) Then
+3 -3
View File
@@ -67,17 +67,17 @@ Module VacuumCups
End Function End Function
' carico i dati macchina relativi al peso massimo movimentabile ' carico i dati macchina relativi al peso massimo movimentabile
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double) Friend Sub SetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
m_RawDensity = Density m_RawDensity = Density
m_MaxWeightSinglePlugger = MaxSingle m_MaxWeightSinglePlugger = MaxSingle
m_MaxWeightDoublePlugger = MaxDouble m_MaxWeightDoublePlugger = MaxDouble
End Sub End Sub
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean) Friend Sub SetRotationForExtraStrokeY(Rotate As Boolean)
bRotateVacuumNearExtraStrokeY = Rotate bRotateVacuumNearExtraStrokeY = Rotate
End Sub End Sub
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean) Friend Sub SetRotationForExtraStrokeX(Rotate As Boolean)
bRotateVacuumNearExtraStrokeX = Rotate bRotateVacuumNearExtraStrokeX = Rotate
End Sub End Sub
Friend Function GetVacuumId() As Integer Friend Function GetVacuumId() As Integer
+8
View File
@@ -343,6 +343,11 @@ Module ConstGen
' Info in pezzo per facet di ultima superficie selezionata ' Info in pezzo per facet di ultima superficie selezionata
Public Const INFO_FRAME_FACET As String = "Facet" Public Const INFO_FRAME_FACET As String = "Facet"
' Nome del groppo dei ponticelli per lavorazioni Water
Public Const BRIDGES As String = "Bridges"
' Nome dell'entità ponticello contenuta nel gruppo BRIDGES
Public Const BRIDGELINE As String = "BridgeLine"
' utensile per le lavorazioni manuali ' utensile per le lavorazioni manuali
Public Const DUMMY_SAW As String = "DummySAW" Public Const DUMMY_SAW As String = "DummySAW"
' lavorazione manuale ' lavorazione manuale
@@ -386,6 +391,9 @@ Module ConstGen
Public Function COL_MCH_DRIPCUT() As Color3d Public Function COL_MCH_DRIPCUT() As Color3d
Return New Color3d(255, 0, 165) Return New Color3d(255, 0, 165)
End Function End Function
Public Function COL_MCH_ONENGRAVE_ANG() As Color3d
Return New Color3d(255, 255, 100)
End Function
Public Function COL_MCH_DRIPFREE() As Color3d Public Function COL_MCH_DRIPFREE() As Color3d
Return New Color3d(192, 0, 128) Return New Color3d(192, 0, 128)
End Function End Function
+20
View File
@@ -18,6 +18,7 @@ Module ConstIni
Public Const S_GENERAL As String = "General" Public Const S_GENERAL As String = "General"
Public Const K_DEBUG As String = "Debug" Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence" Public Const K_LICENCE As String = "Licence"
Public Const K_NETKEY As String = "NetKey"
Public Const K_MESSAGESDIR As String = "MessagesDir" Public Const K_MESSAGESDIR As String = "MessagesDir"
Public Const K_MESSAGES As String = "Messages" Public Const K_MESSAGES As String = "Messages"
Public Const K_SUPPORT As String = "Support" Public Const K_SUPPORT As String = "Support"
@@ -135,6 +136,7 @@ Module ConstIni
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth" Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2" Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
Public Const K_ENGRAVESHORT As String = "EngraveShort" Public Const K_ENGRAVESHORT As String = "EngraveShort"
Public Const K_ENGRAVEANGLE As String = "EngraveAngle"
Public Const K_DRIPOFFSET As String = "DripOffset" Public Const K_DRIPOFFSET As String = "DripOffset"
Public Const K_DRIPOFFSET2 As String = "DripOffset2" Public Const K_DRIPOFFSET2 As String = "DripOffset2"
Public Const K_DRIPDEPTH As String = "DripDepth" Public Const K_DRIPDEPTH As String = "DripDepth"
@@ -155,6 +157,7 @@ Module ConstIni
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize" Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime" Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAG_RETTANGLE As String = "DragRectangle" Public Const K_DRAG_RETTANGLE As String = "DragRectangle"
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
Public Const S_SPLIT As String = "Split" Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel" Public Const K_MOVE_LEV As String = "MoveLevel"
@@ -170,6 +173,14 @@ Module ConstIni
Public Const K_CSVCURRDIR As String = "CurrDir" Public Const K_CSVCURRDIR As String = "CurrDir"
Public Const K_CSVLASTFILE As String = "LastFile" Public Const K_CSVLASTFILE As String = "LastFile"
Public Const S_TRF As String = "TRF"
Public Const K_ORDCODE As String = "OrdCode"
Public Const K_ORDDESC As String = "OrdDesc"
Public Const K_PARTCODE As String = "PartCode"
Public Const K_MATCODE As String = "MatCode"
Public Const K_SURFCODE As String = "SurfCode"
Public Const K_TRFTHICKNESS As String = "TrfThickness"
Public Const S_SLABDXF As String = "SlabDxf" Public Const S_SLABDXF As String = "SlabDxf"
Public Const K_IMPORTSLABDXF As String = "ImportSlabDxf" Public Const K_IMPORTSLABDXF As String = "ImportSlabDxf"
Public Const K_SLABLAYER As String = "SlabLayer" Public Const K_SLABLAYER As String = "SlabLayer"
@@ -216,6 +227,15 @@ Module ConstIni
Public Const K_RAWROTATION As String = "Rotation" Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular" Public Const K_PERPENDICULAR As String = "Perpendicular"
Public Const S_SCRAPS As String = "Scraps"
Public Const K_ENABLESCRAPS As String = "EnableScraps"
Public Const K_PHOTODIR As String = "PhotoDir"
Public Const K_LASTBLOCK As String = "LastBlock"
Public Const K_TEMPLATE As String = "Template"
Public Const K_DAT As String = "Dat"
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
Public Const K_ENABLE_PRINTER As String = "EnablePrinter"
Public Const S_REG As String = "Reg" Public Const S_REG As String = "Reg"
Public Const K_REGSTEP As String = "Step" Public Const K_REGSTEP As String = "Step"
Public Const K_REGANGSTEP As String = "AngStep" Public Const K_REGANGSTEP As String = "AngStep"
+8
View File
@@ -46,6 +46,11 @@
Public Const K_THREADSLEEP As String = "ThreadSleep" Public Const K_THREADSLEEP As String = "ThreadSleep"
Public Const K_PHOTODELEY As String = "PhotoDeley" Public Const K_PHOTODELEY As String = "PhotoDeley"
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_DIRSCRIPT_LUA As String = "DirScript"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
Public Const K_CALLFUNCTION As String = "CallFunction"
Public Const S_NCDATA As String = "NcData" Public Const S_NCDATA As String = "NcData"
Public Const K_NEWVARIABLE As String = "NewVariable" Public Const K_NEWVARIABLE As String = "NewVariable"
Public Const K_NEWCONSOLE As String = "NewConsole" Public Const K_NEWCONSOLE As String = "NewConsole"
@@ -233,6 +238,9 @@
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY" Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX" Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const K_ISNEWSCRAPS As String = "IsNewScraps"
Public Const K_DATABASEID As String = "DatabaseID"
Public Const S_MACH_REG As String = "Reg" Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng" Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
+10 -3
View File
@@ -201,7 +201,8 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<!--<ColumnDefinition Width="1*"/>--> <!--<ColumnDefinition Width="1*"/>-->
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -240,8 +241,14 @@
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>--> <!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
</ToggleButton> </ToggleButton>
<!--Comando Manula/MDI--> <!--Parking-->
<Button Name="ManualModeBtn" Grid.Column="7" <ToggleButton Name="ParkingBtn" Grid.Column="6"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</ToggleButton>
<!--Comando Manula/MDI-->
<Button Name="ManualModeBtn" Grid.Column="8"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}"> Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/> <Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</Button> </Button>
+42
View File
@@ -257,6 +257,7 @@ Public Class DirectCutPageUC
ZCBtn.Visibility = Visibility.Collapsed ZCBtn.Visibility = Visibility.Collapsed
ZBBtn.Visibility = Visibility.Collapsed ZBBtn.Visibility = Visibility.Collapsed
RemoteBtn.Visibility = Visibility.Collapsed RemoteBtn.Visibility = Visibility.Collapsed
ParkingBtn.Visibility = Visibility.Collapsed
Dim Item As MachineButton = Nothing Dim Item As MachineButton = Nothing
For Each Item In m_ButtonJogList For Each Item In m_ButtonJogList
@@ -277,6 +278,10 @@ Public Class DirectCutPageUC
RemoteBtn.Visibility = Visibility.Visible RemoteBtn.Visibility = Visibility.Visible
RemoteBtn.Foreground = Brushes.White RemoteBtn.Foreground = Brushes.White
RemoteBtn.Content = "Remote" RemoteBtn.Content = "Remote"
Case K_PARKING
ParkingBtn.Visibility = Visibility.Visible
ParkingBtn.Foreground = Brushes.White
ParkingBtn.ToolTip = "Parking"
End Select End Select
Next Next
End Sub End Sub
@@ -513,6 +518,43 @@ Public Class DirectCutPageUC
End If End If
End Sub End Sub
Private Sub ParkingBtn_Click(sender As Object, e As RoutedEventArgs) Handles ParkingBtn.Click
Dim ParkingButton As MachineButton = Nothing
Dim ItemButton As MachineButton = Nothing
For Each ItemButton In m_ButtonJogList
If ItemButton.StateFlag = K_PARKING Then
ParkingButton = ItemButton
Exit For
End If
Next
If IsNothing(ParkingButton) Then Return
' eseguo lo script lua associato
Dim CurrentBtn As Primitives.ToggleButton = e.Source
Dim sLuaFileName As String = String.Empty
' verifico lo stato del bottone per avviare il giusto script
If CurrentBtn.IsChecked() Then
sLuaFileName = ParkingButton.TLuaScriptName
Else
sLuaFileName = ParkingButton.FLuaScriptName
End If
ParkingButton.ExecuteMDICommand(sLuaFileName)
End Sub
Friend Sub ParkingStateChanged(bParkingState As Boolean)
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
Dim ParkingButton As TwoStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonJogList
If MachineButton.StateFlag.Trim = K_PARKING Then
ParkingButton = MachineButton
Exit For
End If
Next
If Not IsNothing(ParkingButton) Then
ParkingButton.SetIsChecked(bParkingState)
ParkingButton.IsChecked = bParkingState
End If
End Sub
'------------------NUOVI BOTTONI PER GESTIONE JOYSTICK------------------------------------------------- '------------------NUOVI BOTTONI PER GESTIONE JOYSTICK-------------------------------------------------
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
If m_bShowMachine Then If m_bShowMachine Then
+24
View File
@@ -24,6 +24,7 @@ Public Class CompoTrfData
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
DialogResult = True DialogResult = True
SaveData()
Close() Close()
End Sub End Sub
@@ -32,7 +33,30 @@ Public Class CompoTrfData
Close() Close()
End Sub End Sub
Private Sub SaveData()
WritePrivateProfileString(S_TRF, K_ORDCODE, OrdCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_ORDDESC, OrdDescTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_PARTCODE, PartCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_MATCODE, MatCodeTxBx.Text, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_TRF, K_SURFCODE, SurfCodeTxBx.Text, m_MainWindow.GetIniFile())
' prima di salvare lo spessore converto in mm e poi di nuovo in stringa
Dim dVal As Double = 0
StringToLen(ThicknessTxBx.Text, dVal)
WritePrivateProfileString(S_TRF, K_TRFTHICKNESS, DoubleToString(dVal, 4), m_MainWindow.GetIniFile())
End Sub
Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sPartCode As String, sMatCode As String, sSurfCode As String, dTh As Double) Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sPartCode As String, sMatCode As String, sSurfCode As String, dTh As Double)
' se verifico che non sono stati iniziliazzti i campi allora provvedo a leggere il file ini del programma
If sOrdCode = "" And sOrdDesc = "" And sPartCode = "" And sMatCode = "" And sSurfCode = "" Then
GetPrivateProfileString(S_TRF, K_ORDCODE, sOrdCode, sOrdCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_ORDDESC, sOrdDesc, sOrdDesc, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_PARTCODE, sPartCode, sPartCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_MATCODE, sMatCode, sMatCode, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_TRF, K_SURFCODE, sSurfCode, sSurfCode, m_MainWindow.GetIniFile())
' recupero il dato dello spessore che deve essere in mm
dTh = GetPrivateProfileDouble(S_TRF, K_TRFTHICKNESS, dTh, m_MainWindow.GetIniFile())
End If
' inizializzo i campi della finestra
OrdCodeTxBx.Text = sOrdCode OrdCodeTxBx.Text = sOrdCode
OrdDescTxBx.Text = sOrdDesc OrdDescTxBx.Text = sOrdDesc
PartCodeTxBx.Text = sPartCode PartCodeTxBx.Text = sPartCode
+1 -1
View File
@@ -64,7 +64,7 @@
<ToggleButton Name="DimensionBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowToggleButton}" Visibility="Collapsed"/> <ToggleButton Name="DimensionBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowToggleButton}" Visibility="Collapsed"/>
</Grid> </Grid>
<Grid Name="VariablesGrd" Grid.Row="1" Grid.ColumnSpan="2"/> <Grid Name="VariablesGrd" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2"/>
<Grid Name="MessageGrid" Grid.Row="2" Grid.ColumnSpan="2"> <Grid Name="MessageGrid" Grid.Row="2" Grid.ColumnSpan="2">
<TextBlock Name="MessageTxBl" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/> <TextBlock Name="MessageTxBl" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
+5
View File
@@ -1173,8 +1173,10 @@ Public Class DrawPageUC
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
If m_bTrfData Then If m_bTrfData Then
Dim DlgTrfData As New CompoTrfData(m_MainWindow) Dim DlgTrfData As New CompoTrfData(m_MainWindow)
' carico i dati appena salvati nella pagina
DlgTrfData.SetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness) DlgTrfData.SetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
If DlgTrfData.ShowDialog() Then If DlgTrfData.ShowDialog() Then
' recupero i dati salvati nella pagina
DlgTrfData.GetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness) DlgTrfData.GetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfPartCode, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
End If End If
ElseIf m_bCsvData Then ElseIf m_bCsvData Then
@@ -1253,6 +1255,8 @@ Public Class DrawPageUC
Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False m_SceneButtons.MeasureBtn.IsChecked = False
If EngraveBtn.IsChecked Then If EngraveBtn.IsChecked Then
' Aumento lo spazio disponibile per inserirei i parametri (tolgo spazio ad eventuali messaggi)
Grid.SetRowSpan(VariablesGrd, 2)
' Imposto modalità ' Imposto modalità
m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE
If m_ActiveComponentPage = Pages.CompoDimension Then If m_ActiveComponentPage = Pages.CompoDimension Then
@@ -1284,6 +1288,7 @@ Public Class DrawPageUC
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF) EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF) EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
Else Else
Grid.SetRowSpan(VariablesGrd, 2)
VariablesGrd.Children.Remove(m_SideAngleUC) VariablesGrd.Children.Remove(m_SideAngleUC)
If m_PrevSideAnglePage = Pages.CompoDimension Then If m_PrevSideAnglePage = Pages.CompoDimension Then
VariablesGrd.Children.Add(m_CompoDimension) VariablesGrd.Children.Add(m_CompoDimension)
+3 -1
View File
@@ -839,7 +839,7 @@ Public Class ImportPageUC
PartId = EgtGetNextPart(PartId) PartId = EgtGetNextPart(PartId)
End While End While
' identificativo univoico del gruppo di pezzi, se più di un pezzo ' identificativo univoico del gruppo di pezzi, se più di un "Repeat"
Dim sGUICode As New List(Of String) Dim sGUICode As New List(Of String)
' Scrivo testi per nesting ' Scrivo testi per nesting
@@ -881,6 +881,7 @@ Public Class ImportPageUC
EgtInsertFile(sTmpFile) EgtInsertFile(sTmpFile)
Dim FirstOfImport As Integer = EgtGetNextPart(nFirst2Id) Dim FirstOfImport As Integer = EgtGetNextPart(nFirst2Id)
If FirstOfImport = GDB_ID.NULL Then FirstOfImport = EgtGetFirstPart()
Dim Index As Integer = 1 Dim Index As Integer = 1
While FirstOfImport <> GDB_ID.NULL And Index <= sGUICode.Count While FirstOfImport <> GDB_ID.NULL And Index <= sGUICode.Count
If Not String.IsNullOrEmpty(sGUICode(Index - 1)) Then If Not String.IsNullOrEmpty(sGUICode(Index - 1)) Then
@@ -917,6 +918,7 @@ Public Class ImportPageUC
' Passo al pezzo successivo ' Passo al pezzo successivo
nId = EgtGetNextPart(nId) nId = EgtGetNextPart(nId)
End While End While
' Ciclo sui pezzi inseriti ' Ciclo sui pezzi inseriti
nId = nFirstId nId = nFirstId
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
+18 -7
View File
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="597.1" d:DesignWidth="255.9"> d:DesignHeight="636.9" d:DesignWidth="255.9">
<!-- Definizione della Grid Laterale --> <!-- Definizione della Grid Laterale -->
<Grid Name="VariablesCompoGrid" Grid.RowSpan="2"> <Grid Name="VariablesCompoGrid" Grid.RowSpan="2">
@@ -28,7 +28,7 @@
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/> <RowDefinition Height="0.2*"/>
<RowDefinition Height="4*"/> <RowDefinition Height="5*"/>
<!--<RowDefinition Height="0.5*"/> <!--<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>--> <RowDefinition Height="0.5*"/>-->
@@ -135,7 +135,7 @@
Margin="0,0,0,-2" Margin="0,0,0,-2"
Style="{StaticResource OmagCut_CalculatorTextBox}"/> Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4"> <Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/> <ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.3*"/> <ColumnDefinition Width="0.3*"/>
@@ -143,10 +143,11 @@
<ColumnDefinition Width="0.6*"/> <ColumnDefinition Width="0.6*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="0.9*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="0.9*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="0.9*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="0.9*"/>
<RowDefinition Height="0.9*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Name="Parameter1TxBl" Grid.Row="0" Grid.ColumnSpan="2" <TextBlock Name="Parameter1TxBl" Grid.Row="0" Grid.ColumnSpan="2"
@@ -196,6 +197,16 @@
Margin="0,0,0,-2" Margin="0,0,0,-2"
Width="85" Height="30" Width="85" Height="30"
Style="{StaticResource OmagCut_CalculatorTextBox}"/> Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="Parameter5TxBl" Grid.Row="4" Grid.ColumnSpan="2"
Text="Angolo"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
<EgtWPFLib:EgtTextBox Name="Parameter5TxBx"
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4"
Margin="0,0,0,-2"
Width="85" Height="30"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid> </Grid>
<!--<TextBlock Name="Parameter1TxBl" Grid.Row="11" Text="Offset" <!--<TextBlock Name="Parameter1TxBl" Grid.Row="11" Text="Offset"
+88 -1
View File
@@ -36,6 +36,7 @@ Public Class SideAngleUC
Friend m_dDripDepth As Double = 10 Friend m_dDripDepth As Double = 10
Friend m_dEngraveDepth2 As Double = 15 Friend m_dEngraveDepth2 As Double = 15
Friend m_dDripShort As Double = 0 Friend m_dDripShort As Double = 0
Friend m_dEngraveAngle As Double = 0
Private CurrEntityDrip As DripEntity Private CurrEntityDrip As DripEntity
@@ -106,6 +107,9 @@ Public Class SideAngleUC
' Accorciamento ' Accorciamento
Parameter4TxBl.Visibility = Windows.Visibility.Hidden Parameter4TxBl.Visibility = Windows.Visibility.Hidden
Parameter4TxBx.Visibility = Windows.Visibility.Hidden Parameter4TxBx.Visibility = Windows.Visibility.Hidden
' Angolo
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
Else Else
' se aggiungo gli ENGRAVE e i DRIP ' se aggiungo gli ENGRAVE e i DRIP
@@ -117,10 +121,12 @@ Public Class SideAngleUC
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
Next Next
' Offset ' Offset
Parameter1TxBl.Visibility = Windows.Visibility.Visible Parameter1TxBl.Visibility = Windows.Visibility.Visible
Parameter1TxBx.Visibility = Windows.Visibility.Visible Parameter1TxBx.Visibility = Windows.Visibility.Visible
Parameter2TxBl.Visibility = Windows.Visibility.Visible Parameter2TxBl.Visibility = Windows.Visibility.Visible
' Offset2 ' Offset2
If m_Mode <> ModeOpt.ENGRAVE Then If m_Mode <> ModeOpt.ENGRAVE Then
Parameter2TxBx.Visibility = Windows.Visibility.Visible Parameter2TxBx.Visibility = Windows.Visibility.Visible
@@ -131,6 +137,7 @@ Public Class SideAngleUC
Parameter2aTxBx.Visibility = Windows.Visibility.Visible Parameter2aTxBx.Visibility = Windows.Visibility.Visible
Parameter2bTxBx.Visibility = Windows.Visibility.Visible Parameter2bTxBx.Visibility = Windows.Visibility.Visible
End If End If
' Affondamento ' Affondamento
Parameter3TxBl.Visibility = Windows.Visibility.Visible Parameter3TxBl.Visibility = Windows.Visibility.Visible
Parameter3TxBx.Visibility = Windows.Visibility.Visible Parameter3TxBx.Visibility = Windows.Visibility.Visible
@@ -146,6 +153,17 @@ Public Class SideAngleUC
Parameter4TxBx.Visibility = Windows.Visibility.Hidden Parameter4TxBx.Visibility = Windows.Visibility.Hidden
End If End If
' Angolo
If m_Mode = ModeOpt.ENGRAVE Then
' modifico il nome del messaggio
Parameter5TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo
Parameter5TxBl.Visibility = Windows.Visibility.Visible
Parameter5TxBx.Visibility = Windows.Visibility.Visible
Else
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
End If
End If End If
' Gestisco Checkbox e nomi in base al numero di lati inclinabili ' Gestisco Checkbox e nomi in base al numero di lati inclinabili
@@ -167,11 +185,13 @@ Public Class SideAngleUC
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile()) m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile()) m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile()) m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3) m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
Parameter2aTxBx.Text = m_nEngrNbr2.ToString() Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3) Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3) Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3) Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
Parameter5TxBx.Text = LenToString(m_dEngraveAngle, 3)
End If End If
' Aggiorno visualizzazione ' Aggiorno visualizzazione
@@ -501,6 +521,7 @@ Public Class SideAngleUC
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile()) WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile()) WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
'WritePrivateProfileString( S_SIDES, K_ENGRAVESHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile()) 'WritePrivateProfileString( S_SIDES, K_ENGRAVESHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_SIDES, K_ENGRAVEANGLE, LenToString(m_dEngraveAngle, 3), m_MainWindow.GetIniFile())
End If End If
EgtDraw() EgtDraw()
@@ -862,6 +883,8 @@ Public Class SideAngleUC
End While End While
End If End If
Dim ListEngraveSideAng As New List(Of Integer)
If m_Mode = ModeOpt.DRIP Then If m_Mode = ModeOpt.DRIP Then
' Esplodo nelle curve componenti ' Esplodo nelle curve componenti
nCrvId = EgtGetFirstInGroup(DripLayer) nCrvId = EgtGetFirstInGroup(DripLayer)
@@ -881,15 +904,70 @@ Public Class SideAngleUC
End While End While
Else Else
' Assegno colore e attributi ' Assegno colore e attributi
Dim nInd As Integer = 0
nCrvId = EgtGetFirstInGroup(DripLayer) nCrvId = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL While nCrvId <> GDB_ID.NULL
EgtSetColor(nCrvId, COL_MCH_DRIPCUT()) EgtSetColor(nCrvId, COL_MCH_DRIPCUT())
'EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth) 'EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0")) EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0"))
If nInd = 0 Then
' solo se m_dEngraveAngle > 0
If Math.Abs(m_dEngraveAngle) > EPS_ANG_SMALL Then
' salvo l'Id della curva che deve essere manipolato separatamente
ListEngraveSideAng.Add(nCrvId)
Else
EgtRemoveInfo(nCrvId, INFO_SIDE_ANGLE)
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
Else
If nInd = m_nEngrNbr2 Then
nInd = -1
End If
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
nInd = nInd + 1
If nInd > m_nEngrNbr2 Then nInd = 0
nCrvId = EgtGetNext(nCrvId) nCrvId = EgtGetNext(nCrvId)
End While End While
End If End If
SplitJointedSideEngrave(ListEngraveSideAng)
End Sub
Private Sub SplitJointedSideEngrave(ListEngraveSideAngId As List(Of Integer))
For Each nCrvId As Integer In ListEngraveSideAngId
' eventualmente separo il taglio inclinato
Dim dUs, dUe As Double
EgtCurveDomain(nCrvId, dUs, dUe)
Dim dU As Double = dUs
While dU < dUe ' + EPS_ZERO
Dim ptCurr As Point3d
EgtAtParamPoint(nCrvId, dU + 1, nCrvId, ptCurr)
' separa la curva in questo punto
Dim nNewCurvId As Integer = GDB_ID.NULL
If dUe > 1 Then
nNewCurvId = EgtSplitCurveAtPoint(nCrvId, ptCurr, GDB_RT.LOC)
Else
nNewCurvId = nCrvId
End If
EgtSetColor(nCrvId, COL_MCH_ONENGRAVE_ANG())
EgtSetInfo(nCrvId, INFO_SIDE_ANGLE, m_dEngraveAngle)
' recupero il vettore di estrusione della curva e la direzione della curva
Dim vtAux As Vector3d
EgtStartVector(nCrvId, vtAux)
Dim vtExtrusion As Vector3d
EgtCurveExtrusion(nCrvId, vtExtrusion)
' ruoto il vetottore nella nuova direzione
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
Dim ExtendFactor As Double = New Vector3d(0, 0, 1) * vtExtrusion
EgtModifyCurveThickness(nCrvId, -m_dDripDepth / ExtendFactor)
If dUe = 1 Then Exit While
nCrvId = nNewCurvId
' aggiorno i valori del dominio della curva che rimane
EgtCurveDomain(nCrvId, dUs, dUe)
End While
Next
End Sub End Sub
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
@@ -1336,6 +1414,15 @@ Public Class SideAngleUC
End If End If
End Sub End Sub
Private Sub Parameter5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter5TxBx.EgtClosed
If m_Mode = ModeOpt.ENGRAVE Then
' Recupero il valore
StringToLen(Parameter5TxBx.Text, m_dEngraveAngle)
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
End If
End Sub
Friend Sub ReLoadSideAnglePage() Friend Sub ReLoadSideAnglePage()
SideAngleUC_Loaded(Me, New RoutedEventArgs) SideAngleUC_Loaded(Me, New RoutedEventArgs)
End Sub End Sub
+158 -11
View File
@@ -1,16 +1,48 @@
<ResourceDictionary <ResourceDictionary x:Class="EgtDictionary"
x:Class="EgtDictionary" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Project="clr-namespace:OmagCUT"
xmlns:Project="clr-namespace:OmagCUT" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions"> xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions">
<!--Template che permette di andare a capo--> <EgtWPFLib5:StatusBarVM x:Key="StatusBarVM"/>
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
<EgtPHOTOLib:ProjectSlabVM x:Key="ProjectSlabVM"/>
<EgtPHOTOLib:OptionPanelSlabVM x:Key="OptionPanelSlabVM"/>
<EgtPHOTOLib:ListPageSlabVM x:Key="ListPageSlabVM"/>
<EgtPHOTOLib:DetailPageSlabVM x:Key="DetailPageSlabVM"/>
<EgtPHOTOLib:SearchPanelSlabVM x:Key="SearchPanelSlabVM"/>
<EgtPHOTOLib:MyInstrumentPanelSlabVM x:Key="MyInstrumentPanelSlabVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
<SolidColorBrush x:Key="Omag_Green" Color="LawnGreen" />
<SolidColorBrush x:Key="Omag_VeryLightGray" Color="#FFF2F2F2" />
<SolidColorBrush x:Key="Omag_LightGray" Color="LightGray" />
<SolidColorBrush x:Key="Omag_Gray" Color="#FF9E9E9E" />
<SolidColorBrush x:Key="Omag_DarkGray" Color="#FF444444" />
<SolidColorBrush x:Key="Omag_White" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="Omag_Black" Color="#FF000000" />
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF095CA8" />
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="Button_DataTemplate_Wrap"> <DataTemplate x:Key="Button_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}"/> <TextBlock TextWrapping="Wrap" Text="{Binding}"/>
</DataTemplate> </DataTemplate>
<!--ButtonBase--> <!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- Button Style -->
<Style TargetType="{x:Type Button}"> <Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle"> <Setter Property="FocusVisualStyle">
<Setter.Value> <Setter.Value>
@@ -71,7 +103,44 @@
</Setter> </Setter>
</Style> </Style>
<!-- ______________________________________________________________________________________________________________________ --> <!--Template che permette di andare a capo-->
<DataTemplate x:Key="WrapButton_DataTemplate">
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="ToolBar_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="80"/>
</Style>
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_TextWrapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="Height" Value="45"/>
</Style>
<Style x:Key="OptionPanel_NestingButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="EgtWPFLib5_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="60"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo--> <!--Template che permette di andare a capo-->
<DataTemplate x:Key="CheckBox_DataTemplate_Wrap"> <DataTemplate x:Key="CheckBox_DataTemplate_Wrap">
@@ -375,7 +444,59 @@
</Setter> </Setter>
</Style> </Style>
<!-- ______________________________________________________________________________________________________________________ --> <Style x:Key="ToolBar_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="70"/>
</Style>
<Style x:Key="OptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="CompoWindow_WrapToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFB8C3CD"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="OpacityMask" Value="#33FF0000"/>
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#FFF4F4F4"/>
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TreeViewBase--> <!--TreeViewBase-->
<!--Style e colori della freccia di espansione, necessari per modificare il ContainerItemStyle perchè contiene riferimenti ad essi--> <!--Style e colori della freccia di espansione, necessari per modificare il ContainerItemStyle perchè contiene riferimenti ad essi-->
@@ -431,6 +552,32 @@
</Setter> </Setter>
</Style> </Style>
<!-- ______________________________________________________________________________________________________________________ --> <!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtCustomWindow -->
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
<Setter Property="TitleBarHeight" Value="32"/>
<Setter Property="TitleBarBrush" Value="{StaticResource Omag_LightGray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtFloatingPanel -->
<Style x:Key="ToolBar_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<Style x:Key="Option_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="IsToolBar" Value="False"/>
<Setter Property="TitleBarOrientation" Value="Vertical"/>
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
</ResourceDictionary> </ResourceDictionary>
+11 -7
View File
@@ -801,19 +801,23 @@
<Grid Grid.Column="0" Grid.Row="8"> <Grid Grid.Column="0" Grid.Row="8">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*"/> <ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="5*"/> <ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="2*"/> <ColumnDefinition Width="4.5*"/>
<ColumnDefinition Width="1.8*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button x:Name="SawProbingBtn" <Button x:Name="SawProbingBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}"> Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource SawProbeImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/> <Image Source="{DynamicResource SawProbeImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</Button> </Button>
<Button x:Name="ExecLuaBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource PlayImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
</Button>
<TextBlock Name="UseLaserOriginTxBl" Grid.Column="2"
<TextBlock Name="UseLaserOriginTxBl" Grid.Column="1"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" /> Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="UseLaserOriginChBx" Style="{DynamicResource OmagCut_CheckBox_Single}" Grid.Column="2" <CheckBox Name="UseLaserOriginChBx" Style="{DynamicResource OmagCut_CheckBox_Single}" Grid.Column="3"
HorizontalAlignment="Right" Margin="10,0,10,0"/> HorizontalAlignment="Right" Margin="0,0,10,0"/>
</Grid> </Grid>
</Grid> </Grid>
+83
View File
@@ -45,6 +45,13 @@ Public Class AlarmsPageUC
SawProbingBtn.Visibility = Windows.Visibility.Hidden SawProbingBtn.Visibility = Windows.Visibility.Hidden
End If End If
' Se esiste un file lua valido allora mostro il pulsante per l'esecuzione dello script
If Not String.IsNullOrEmpty(GetExecLuaFile()) And
ExecLuaBtn.Visibility = Visibility.Visible Then
Else
ExecLuaBtn.Visibility = Visibility.Hidden
End If
' Imposto i messaggi letti dal file dei messaggi ' Imposto i messaggi letti dal file dei messaggi
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1) CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2) AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
@@ -578,6 +585,33 @@ Public Class AlarmsPageUC
String.Compare(sMchTool, m_CurrentMachine.sCurrSaw, True) <> 0 Then String.Compare(sMchTool, m_CurrentMachine.sCurrSaw, True) <> 0 Then
m_CurrentMachine.sCurrSawing = String.Empty m_CurrentMachine.sCurrSawing = String.Empty
End If End If
'Dim sVal As String = String.Empty
'Dim dVal As Double = 0
'If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSawing, false) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevLength(dVal)
'End If
'If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSawing, false) Then
' StringToDouble(sVal, dVal)
' m_CurrentMachine.SetFsevPerc(dVal)
'End If
Dim sVal As String = String.Empty
Dim dVal As Double = 0
If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, dVal)
m_CurrentMachine.SetFsevLength(dVal)
End If
If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, dVal)
m_CurrentMachine.SetFsevPerc(dVal)
End If
' Leggo parametri per variazione feed in tagli aggiornati in funzione della lama
CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
CfrPercTxBx.Text = DoubleToString(m_CurrentMachine.dFsevPerc, 0)
' Aggiorno utensili per lavoro in corso ' Aggiorno utensili per lavoro in corso
m_MainWindow.m_WorkInProgressPageUC.UpdateTools() m_MainWindow.m_WorkInProgressPageUC.UpdateTools()
' aggiorno la lista delle lavorazioni ' aggiorno la lista delle lavorazioni
@@ -1300,4 +1334,53 @@ Public Class AlarmsPageUC
End Sub End Sub
Private Sub ExecLuaBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExecLuaBtn.Click
Dim sExecFile As String = GetExecLuaFile()
Dim sCallFunction As String = GetCallFunction()
' Recupero file LUA
Dim bExec As Boolean = EgtLuaExecFile(sExecFile)
' Lancio l'esecuzione della funzione principale
bExec = bExec And EgtLuaCallFunction(sCallFunction)
' Leggo variabili
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMD.ERR", nErr)
' Reset lua
EgtLuaResetGlobVar("CMD")
' Verifico condizioni di errore
If nErr <> 0 And bExec Then
' Errore in tastatura lama
EgtOutLog("Error in execution file: " & sExecFile & ", calling function: " & sCallFunction & ", CMD.ERR=" & nErr, ToString)
Return
End If
End Sub
' Recupero il percorso del file lua da eseguire
Private Function GetExecLuaFile() As String
Dim sDir As String = String.Empty
Dim sFile As String = String.Empty
If GetPrivateProfileString(S_EXECLUA, K_DIRSCRIPT_LUA, "", sDir, m_MainWindow.GetMachIniFile()) <> 0 And
GetPrivateProfileString(S_EXECLUA, K_FILESCRIPT_LUA, "", sFile, m_MainWindow.GetMachIniFile()) <> 0 Then
' Formatto le stringhe lette
sDir = sDir.Trim
sFile = sFile.Trim
If sDir.EndsWith("\"c) Then
sDir = sDir.Remove(sDir.LastIndexOf("\"c))
End If
If Not sFile.EndsWith(".lua") Then
sFile = sFile & ".lua"
End If
If File.Exists(sDir & "\" & sFile) Then
Return sDir & "\" & sFile
End If
End If
Return String.Empty
End Function
' Recupera il nome della funzione che deve essere chiamata
Private Function GetCallFunction() As String
Dim sCallFunction As String = "CMD.CmdString"
GetPrivateProfileString(S_EXECLUA, K_CALLFUNCTION, sCallFunction, sCallFunction, m_MainWindow.GetMachIniFile())
Return sCallFunction
End Function
End Class End Class
+167
View File
@@ -609,6 +609,18 @@ Public Class CurrentMachine
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then
m_sCurrSawing = value m_sCurrSawing = value
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
'' aggiorno il file ini della macchina con i valori correnti della lavorazione
'Dim sVal As String = String.Empty
'Dim dVal As Double = m_dFsevLength
'If GetUserNote("FsevLength", sVal, m_sCurrSawing, False) Then
' StringToDouble(sVal, dVal)
' SetFsevLength(dVal)
'End If
'dVal = m_dFsevPerc
'If GetUserNote("FsevPerc", sVal, m_sCurrSawing, False) Then
' StringToDouble(sVal, m_dFsevPerc)
' SetFsevPerc(dVal)
'End If
End If End If
End Set End Set
End Property End Property
@@ -861,9 +873,18 @@ Public Class CurrentMachine
Set(value As Double) Set(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevLength = value m_dFsevLength = value
' salvo il dato nelle UserNote della lavorazione
'MdbSetCurrMachiningUserNote("FsevLength", m_dFsevLength.ToString, sCurrSawing, false)
' salvo il dato nelle UserNote dell'utensile
TdbSetCurrToolUserNote("FsevLength", m_dFsevLength.ToString, sCurrSaw)
End If End If
End Set End Set
End Property End Property
Friend Sub SetFsevLength(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevLength = value
End If
End Sub
Friend Property dFsevPerc As Double Friend Property dFsevPerc As Double
Get Get
@@ -872,9 +893,18 @@ Public Class CurrentMachine
Set(value As Double) Set(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevPerc = value m_dFsevPerc = value
'' salvo il dato nelle UserNote della lavorazione
'MdbSetCurrMachiningUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSawing)
' salvo il dato nelle UserNote dell'utensile
TdbSetCurrToolUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSaw)
End If End If
End Set End Set
End Property End Property
Friend Sub SetFsevPerc(value As Double)
If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then
m_dFsevPerc = value
End If
End Sub
Friend ReadOnly Property ToolChangerNbr As Integer Friend ReadOnly Property ToolChangerNbr As Integer
Get Get
@@ -1265,6 +1295,7 @@ Public Class CurrentMachine
' Leggo dati per feed ridotta all'inizio/fine dei tagli ' Leggo dati per feed ridotta all'inizio/fine dei tagli
m_bFsevEnable = (GetPrivateProfileInt(S_NEST, K_MACH_CUTFSEVENABLE, 0, sMachIniFile) <> 0) m_bFsevEnable = (GetPrivateProfileInt(S_NEST, K_MACH_CUTFSEVENABLE, 0, sMachIniFile) <> 0)
' sposto la lettura nel DB delle lavorazioni della lama corrente!
m_dFsevLength = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVLEN, 0, sMachIniFile) m_dFsevLength = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVLEN, 0, sMachIniFile)
m_dFsevPerc = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVPERC, 0, sMachIniFile) m_dFsevPerc = GetPrivateProfileDouble(S_NEST, K_MACH_CUTFSEVPERC, 0, sMachIniFile)
@@ -1386,6 +1417,142 @@ Public Class CurrentMachine
Return dMaxThick Return dMaxThick
End Function End Function
#Region "USERNOTE"
' recupero le note UserNote associate alla LAVORAZIONE Machining
Friend Function MdbGetCurrMachiningUserNote(Machining As String) As String
Dim UserNotes As String = String.Empty
' lavorazione corrente
Dim CurrMach As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, CurrMach)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Machining) AndAlso EgtMdbSetCurrMachining(Machining) Then
' leggo nel db corrente della lavorazione questa info
EgtMdbGetCurrMachiningParam(MCH_MP.USERNOTES, UserNotes)
' reimposto lavorazione corrente
EgtMdbSetCurrMachining(CurrMach)
End If
Return UserNotes
End Function
' recupero le note UserNote associate all'UTENSILE Tool
Friend Function TdbGetCurrToolUserNote(Tool As String) As String
Dim UserNotes As String = String.Empty
' lavorazione corrente
Dim CurrTool As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.NAME, CurrTool)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Tool) AndAlso EgtTdbSetCurrTool(Tool) Then
' leggo nel db corrente della lavorazione questa info
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, UserNotes)
' reimposto lavorazione corrente
EgtTdbSetCurrTool(CurrTool)
End If
Return UserNotes
End Function
' imposta il nuovo valore in UserNote della LAVORAZIONE Machining
Friend Sub MdbSetCurrMachiningUserNote(sKeyUserNote As String, sValUserNote As String, Machining As String)
' lavorazione corrente
Dim CurrMach As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.NAME, CurrMach)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Machining) AndAlso EgtMdbSetCurrMachining(Machining) Then
Dim UserNotes As String = String.Empty
' salvo nel db corrente della lavorazione questa info devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
EgtMdbSetCurrMachiningParam(MCH_MP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Machining))
EgtMdbSaveCurrMachining()
EgtMdbSave()
' reimposto lavorazione corrente
EgtMdbSetCurrMachining(CurrMach)
End If
End Sub
' imposta il nuovo valore in UserNote dell'UTENSILE Tool
Friend Sub TdbSetCurrToolUserNote(sKeyUserNote As String, sValUserNote As String, Tool As String)
' lavorazione corrente
Dim CurrTool As String = String.Empty
EgtTdbGetCurrToolParam(MCH_TP.NAME, CurrTool)
' Imposto utensile lama corrente
If Not String.IsNullOrWhiteSpace(Tool) AndAlso EgtTdbSetCurrTool(Tool) Then
Dim UserNotes As String = String.Empty
' salvo nel db corrente della lavorazione questa info devo gestire l'inserimento: sovrascrivo NON ESEGUE un APPEND delle info
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, AssembUserNote(sKeyUserNote, sValUserNote, Tool))
EgtTdbSaveCurrTool()
EgtTdbSave()
' reimposto lavorazione corrente
EgtTdbSetCurrTool(Tool)
End If
End Sub
' separa la le note UserNote della LAVORAZIONE
Private Function SplitUserNoteMachinig(Machining As String) As String()
Dim sUserNotes As String = MdbGetCurrMachiningUserNote(Machining)
If String.IsNullOrEmpty(sUserNotes) Then Return Nothing
Dim sItems As String() = sUserNotes.Split(";"c)
Return sItems
End Function
' separa la le note UserNote della LAVORAZIONE
Private Function SplitUserNoteTool(Tool As String) As String()
Dim sUserNotes As String = TdbGetCurrToolUserNote(Tool)
If String.IsNullOrEmpty(sUserNotes) Then Return Nothing
Dim sItems As String() = sUserNotes.Split(";"c)
Return sItems
End Function
' recupera il valore della associato alla chiave per la lavorazione oppure utensile (bIsToolNote)
Friend Function GetUserNote(sKeyUserNote As String, ByRef sValUserNote As String, sName As String, Optional bIsToolNote As Boolean = True) As Boolean
Dim sUserNotesList As String() = Nothing
If bIsToolNote Then
sUserNotesList = SplitUserNoteTool(sName)
Else
sUserNotesList = SplitUserNoteMachinig(sName)
End If
If IsNothing(sUserNotesList) Then Return False
For Index As Integer = 0 To sUserNotesList.Count - 1
Dim sNote As String() = sUserNotesList(Index).Split("="c)
If sNote.Count = 2 AndAlso sNote(0).Trim = sKeyUserNote Then
sValUserNote = sNote(1).Trim
End If
Next
Return True
End Function
' ricostruisce la stringa UserNote da salvare
Friend Function AssembUserNote(sKeyUserNote As String, sValUserNote As String, sName As String, Optional bIsToolNote As Boolean = True) As String
Dim sUserNotes As String = String.Empty
Dim sUserNotesList As String() = Nothing
If bIsToolNote Then
sUserNotesList = SplitUserNoteTool(sName)
Else
sUserNotesList = SplitUserNoteMachinig(sName)
End If
Dim bExists As Boolean = False
If Not IsNothing(sUserNotesList) Then
For Index As Integer = 0 To sUserNotesList.Count - 1
Dim sNote As String() = sUserNotesList(Index).Split("="c)
If sNote.Count = 2 AndAlso sNote(0).Trim = sKeyUserNote Then
sUserNotesList(Index) = sKeyUserNote & "=" & sValUserNote
bExists = True
Exit For
End If
Next
' riassemblo la stringa
For Each Item As String In sUserNotesList
If Not String.IsNullOrWhiteSpace(Item) Then
sUserNotes &= Item & ";"
End If
Next
End If
If Not bExists Then
sUserNotes &= sKeyUserNote & "=" & sValUserNote & ";"
End If
Return sUserNotes
End Function
#End Region ' USERNOTE
Friend Function IsVacuumMovePossible() As Boolean Friend Function IsVacuumMovePossible() As Boolean
' Recupero diametro lama corrente ' Recupero diametro lama corrente
EgtTdbSetCurrTool(sCurrSaw) EgtTdbSetCurrTool(sCurrSaw)
+73 -2
View File
@@ -2,6 +2,7 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
Imports EgtPHOTOLib
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Threading Imports System.Threading
Imports System.Windows.Threading Imports System.Windows.Threading
@@ -320,11 +321,13 @@ Class MainWindow
Dim sNestKey As String = "" Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile) EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey(sNestKey) EgtSetNestKey(sNestKey)
Dim bNetHwKey As Boolean = ( GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey( bNetHwKey)
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave ' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2406, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(9423, 2411, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2406, 1, m_nKeyOptions) EgtGetKeyOptions(9423, 2411, 1, m_nKeyOptions)
' Verifico abilitazione prodotto ' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE) Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
@@ -498,6 +501,64 @@ Class MainWindow
AddHandler m_ProdLineTimer.Tick, AddressOf OnProdLine AddHandler m_ProdLineTimer.Tick, AddressOf OnProdLine
' Imposto riferimento a funzione delle textbox che disattiva scene in libreria ' Imposto riferimento a funzione delle textbox che disattiva scene in libreria
EgtWPFLib.EgtTextBox.m_refScenesIsEnabled = AddressOf IsEnabledScenes EgtWPFLib.EgtTextBox.m_refScenesIsEnabled = AddressOf IsEnabledScenes
' --------------------------------- SLAB DB -------------------------------------------------------
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\" & DB_FILENAME) Then
If Not ManageDb.ConnectToDb(PhotDir.Trim & "\" & DB_FILENAME) Then
EgtOutLog("Error connecting to DB: " & PhotDir.Trim & "\" & DB_FILENAME)
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrentProjectPageUC.ClearMessage()
m_CurrentProjectPageUC.SetErrorMessage("Denied connection SlabDB")
Else
' Impostazione direttorio per backup
Dim BackUpDir As String = m_sDataRoot & "\BackUp"
Directory.CreateDirectory(BackUpDir)
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
EgtPHOTOLib.MainData.SetPhotoDir(PhotDir)
EgtPHOTOLib.MainData.SetBackUpDir(BackUpDir)
EgtPHOTOLib.MainData.SetIsOMagCUT(True)
Dim sLastBlock As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_LASTBLOCK, "", sLastBlock, GetIniFile())
If Not String.IsNullOrEmpty(sLastBlock) Then
EgtPHOTOLib.MainData.SetLastBlock(sLastBlock)
End If
If GetPrivateProfileInt(S_SCRAPS, K_ENABLE_PRINTER, 0, GetIniFile()) = 1 Then
' leggo nome file prn (per stampante zebra)
Dim m_TemplateFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_TEMPLATE, m_sDataRoot & "\Label\Default.prn", m_TemplateFilePrinter, GetIniFile())
' leggo nome del direttorio in cui scrivere il file ini (per stampante zebra) -- solo se si desidera scrivere il file in un direttorio diverso
Dim m_DatFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_DAT, m_sDataRoot & "\Temp", m_DatFilePrinter, GetIniFile())
' leggo nome file exe (per stampante zebra)
Dim m_ZebraUtilitiesExe As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_ZEBRAUTILITIES, System.AppDomain.CurrentDomain.BaseDirectory & "ZebraPrinterUtilitiesR32.exe", m_ZebraUtilitiesExe, GetIniFile())
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
EgtPHOTOLib.MainData.SetDataFilePrinter(m_DatFilePrinter)
EgtPHOTOLib.MainData.SetZebraPrinterExe(m_ZebraUtilitiesExe)
EgtPHOTOLib.MainData.SetPrinterVisibility(True)
Else
EgtPHOTOLib.MainData.SetPrinterVisibility(False)
End If
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
End Sub End Sub
Private Sub ManageSingleIstance() Private Sub ManageSingleIstance()
@@ -546,6 +607,16 @@ Class MainWindow
m_WorkInProgressPageUC.Prepare() m_WorkInProgressPageUC.Prepare()
m_WorkInProgressPageUC.UpdateTools() m_WorkInProgressPageUC.UpdateTools()
Dim sVal As String = String.Empty
If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, m_CurrentMachine.dFsevLength)
m_CurrentMachine.SetFsevLength(m_CurrentMachine.dFsevLength)
End If
If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then
StringToDouble(sVal, m_CurrentMachine.dFsevPerc)
m_CurrentMachine.SetFsevPerc(m_CurrentMachine.dFsevPerc)
End If
' Se macchina fotografica abilitata, ne inizializzo il gestore ' Se macchina fotografica abilitata, ne inizializzo il gestore
#If Not TRIAL Then #If Not TRIAL Then
If GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then If GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.7.1")> <Assembly: AssemblyVersion("2.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.7.1")> <Assembly: AssemblyFileVersion("2.4.11.1")>
+2
View File
@@ -581,6 +581,7 @@ Public Class CNCommunication
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog) m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog) m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote) m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
End If End If
Else Else
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState) m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
@@ -607,6 +608,7 @@ Public Class CNCommunication
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog) m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog) m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote) m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
End If End If
End If End If
+31
View File
@@ -115,6 +115,9 @@
<Reference Include="AxInterop.FXLib"> <Reference Include="AxInterop.FXLib">
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath> <HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
</Reference> </Reference>
<Reference Include="EgtPHOTOLib">
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.3.4.5, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="EgtUILib, Version=2.3.4.5, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath> <HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
@@ -143,6 +146,10 @@
</Reference> </Reference>
<Reference Include="PresentationFramework.Aero" /> <Reference Include="PresentationFramework.Aero" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
@@ -210,6 +217,15 @@
<Compile Include="Machine\WaterJetPageUC.xaml.vb"> <Compile Include="Machine\WaterJetPageUC.xaml.vb">
<DependentUpon>WaterJetPageUC.xaml</DependentUpon> <DependentUpon>WaterJetPageUC.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
</Compile>
<Compile Include="Project\OmagPhotoWD.xaml.vb">
<DependentUpon>OmagPhotoWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\ScrapsWD.xaml.vb">
<DependentUpon>ScrapsWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\StartLauncheWD.xaml.vb"> <Compile Include="Project\StartLauncheWD.xaml.vb">
<DependentUpon>StartLauncheWD.xaml</DependentUpon> <DependentUpon>StartLauncheWD.xaml</DependentUpon>
</Compile> </Compile>
@@ -460,6 +476,18 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Project\AddToDataBaseUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\OmagPhotoWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\ScrapsWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\StartLauncheWD.xaml"> <Page Include="Project\StartLauncheWD.xaml">
</Page> </Page>
<Page Include="Project\CicloStartWD.xaml"> <Page Include="Project\CicloStartWD.xaml">
@@ -1268,6 +1296,9 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" /> <Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Parking.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+1
View File
@@ -208,6 +208,7 @@
<BitmapImage x:Key="XYJogImg" UriSource="Resources/NewIcons/XYJog.png"></BitmapImage> <BitmapImage x:Key="XYJogImg" UriSource="Resources/NewIcons/XYJog.png"></BitmapImage>
<BitmapImage x:Key="ZCJogImg" UriSource="Resources/NewIcons/ZCJog.png"></BitmapImage> <BitmapImage x:Key="ZCJogImg" UriSource="Resources/NewIcons/ZCJog.png"></BitmapImage>
<BitmapImage x:Key="ZBJogImg" UriSource="Resources/NewIcons/ZBJog.png"></BitmapImage> <BitmapImage x:Key="ZBJogImg" UriSource="Resources/NewIcons/ZBJog.png"></BitmapImage>
<BitmapImage x:Key="ParkingImg" UriSource="Resources/NewIcons/Parking.png"></BitmapImage>
<!--Frame--> <!--Frame-->
+95
View File
@@ -0,0 +1,95 @@
<UserControl x:Class="AddToDataBaseUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<!--Nome BLOCCO-->
<TextBlock Name="BlockTxBl" Grid.Column="1" Grid.Row="1" Text="Name block"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="BlockTxBx" Grid.Column="3" Grid.Row="1"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--Numero ID-->
<TextBlock Name="NbrIdTxBl" Grid.Column="1" Grid.Row="3" Text="ID"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="NbrIdTxBx" Grid.Column="3" Grid.Row="3"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--STATE-->
<TextBlock Name="StateTxBl" Grid.Column="1" Grid.Row="5" Text="State"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<ComboBox Name="StateCmBx" Grid.Column="3" Grid.Row="5" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--PROJECT-->
<TextBlock Name="ProjectNameTxBl" Grid.Column="1" Grid.Row="7" Text="Project"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ProjectTxBx" Grid.Column="3" Grid.Row="7"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--MATERIAL-->
<TextBlock Name="MatTxBl" Grid.Column="1" Grid.Row="9" Text="Mat"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="MatTxBx" Grid.Column="3" Grid.Row="9"
Style="{DynamicResource OmagCut_KeyboardTextBox}" IsEnabled="False"/>
<!--THICKNESS-->
<TextBlock Name="ThicknessTxBl" Grid.Column="1" Grid.Row="11" Text="Thickness"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ThicknessTxBx" Grid.Column="3" Grid.Row="11"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<!--WAREHOUSE-->
<TextBlock Name="WarehouseTxBl" Grid.Column="1" Grid.Row="13" Text="Warehouse position"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WarehouseTxBx" Grid.Column="3" Grid.Row="13"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--CANCEL-->
<Button Name="CacelBtn" Grid.Column="1" Grid.Row="15" Content="Delete"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--ADD-->
<Button Name="AddBtn" Grid.Column="3" Grid.Row="15" Content="Add"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--PRINT-->
<Button Name="PrintBtn" Grid.Column="1" Grid.Row="17" Content="Print"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Border>
</UserControl>
+121
View File
@@ -0,0 +1,121 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class AddToDataBaseUC
Private m_OmagPhotoWD As OmagPhotoWD
#Region "PROPERTY"
Private Sub BlockTxBx_EgtClosed(sender As Object, e As EventArgs) Handles BlockTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock = BlockTxBx.Text
' devo riasseganre il valore dell'indice
NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
EnableButtons()
End Sub
Private Sub NbrIdTxBx_EgtClosed(sender As Object, e As EventArgs) Handles NbrIdTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID = NbrIdTxBx.Text
EnableButtons()
End Sub
Private Sub StateCmBx_Changed() Handles StateCmBx.SelectionChanged
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.State = StateCmBx.SelectedIndex
EnableButtons()
End Sub
Private Sub ProjectTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ProjectTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo = ProjectTxBx.Text
EnableButtons()
End Sub
Private Sub ThicknessTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ThicknessTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness = ThicknessTxBx.Text
EnableButtons()
End Sub
Private Sub WarehouseTxBx_EgtClosed(sender As Object, e As EventArgs) Handles WarehouseTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.WarehousePosition = WarehouseTxBl.Text
EnableButtons()
End Sub
#End Region ' Property
Sub New(LocalOmagPhotoWD As OmagPhotoWD)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_OmagPhotoWD = LocalOmagPhotoWD
End Sub
' dopo la crezione della pagina imposto lo stato dei pulsanti
Private Sub PostLoaded() Handles Me.Loaded
If EgtPHOTOLib.MainData.bEnableTextId Then
BlockTxBx.Visibility = Visibility.Collapsed
BlockTxBl.Visibility = Visibility.Collapsed
Else
NbrIdTxBx.IsEnabled = False
End If
PrintBtn.IsEnabled = EgtPHOTOLib.MainData.bEnablePrinter
EnableButtons()
End Sub
#Region "COMMAND"
Private Sub CancelBtn_Click() Handles CacelBtn.Click
' se è stata inserita nel DB allora devo rimuoverla ed esco dalla pagina
EgtPHOTOLib.refOptionPanelVM.Delete()
' notifico che il grezzo è stato rimosso
OmagPhotoWD.m_IsDeleted = True
' notifico che il grezzo non è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = False
' elimino l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = ""
' esco dalla pagina
m_OmagPhotoWD.Close()
End Sub
Private Sub AddBtn_Click() Handles AddBtn.Click
' se non sono validi i campi allora attendo
If Not EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled Then Return
' modalità di funzionamento della libreria: ProjectSlabVM.ProjectModeOpt.NEWSLAB
EgtPHOTOLib.PhotoMap.refOptionPanelVM.Save()
' notifico che il grezzo è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = True
' salvo l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
' salvo il nome del blocco che è stato utilizzato
If Not EgtPHOTOLib.MainData.bEnableTextId Then
WritePrivateProfileString(S_SCRAPS, K_LASTBLOCK, EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock, m_OmagPhotoWD.m_MainWindow.GetIniFile())
End If
' aggiorno il testo del messaggio "Add" "Save"
AddBtn.Content = "Save"
' notifico che da ora la lastra inserita è in modalità di modifica (non salvo la lastra come nuova, ma la sovrascrivo come in modifica)
EgtPHOTOLib.PhotoMap.refProjectVM.SetSelProjectMode(ProjectSlabVM.ProjectModeOpt.DETAIL)
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.SetOrigValues()
' notifico che la lastra è in modifica da questo programma
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.IsSelected = EgtPHOTOLib.MainData.nKey
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
End Sub
Private Sub PrintBtn_Click() Handles PrintBtn.Click
EgtPHOTOLib.PhotoMap.refOptionPanelVM.PrintLabel()
End Sub
#End Region ' Command
#Region "METHODS"
Private Sub EnableButtons()
AddBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
' se la stampante non è abilitata allora non permetto assolutamente di abilitare il comando
If EgtPHOTOLib.MainData.bEnablePrinter Then
PrintBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
End If
End Sub
#End Region ' Methods
End Class
+6 -7
View File
@@ -107,7 +107,8 @@ Public Class CurrentProjectPageUC
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile()) Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave ' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
If Not CurrentProjectScene.Init() Then Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
If Not CurrentProjectScene.Init() Or Not bProd Then
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!! ' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost) Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
' Flag per riavvio programma ' Flag per riavvio programma
@@ -158,6 +159,7 @@ Public Class CurrentProjectPageUC
#End If #End If
m_MainWindow.Close() m_MainWindow.Close()
If bRestart Then Process.Start(Application.ResourceAssembly.Location) If bRestart Then Process.Start(Application.ResourceAssembly.Location)
Return
End If End If
' visualizzazione avanzata dei triangoli costituenti le superfici ' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_MainWindow.GetIniFile()) <> 0) Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_MainWindow.GetIniFile()) <> 0)
@@ -168,11 +170,6 @@ Public Class CurrentProjectPageUC
' dimensione lineare max in pixel delle textures ' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile()) Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
EgtSetTextureMaxLinPixels(nTxrMaxLinPix) EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' Verifico abilitazione prodotto
If Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE) Then
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 1)
m_MainWindow.Close()
End If
' Recupero e imposto handle finestra principale ' Recupero e imposto handle finestra principale
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
EgtSetMainWindowHandle(hMainWnd) EgtSetMainWindowHandle(hMainWnd)
@@ -399,6 +396,8 @@ Public Class CurrentProjectPageUC
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
m_dRawHeight = 0 m_dRawHeight = 0
UpdateHeightTxBx() UpdateHeightTxBx()
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
' Parcheggio correttamente i pezzi precedentemente salvati ' Parcheggio correttamente i pezzi precedentemente salvati
Dim nId2 As Integer = EgtGetFirstPart() Dim nId2 As Integer = EgtGetFirstPart()
While nId2 <> GDB_ID.NULL While nId2 <> GDB_ID.NULL
@@ -410,7 +409,7 @@ Public Class CurrentProjectPageUC
nId2 = EgtGetNextPart(nId2) nId2 = EgtGetNextPart(nId2)
End While End While
' Aggiorno Aree totale e da lavorare dei pezzi ' Aggiorno Aree totale e da lavorare dei pezzi
SetTotalArea( dTotArea) SetTotalArea(dTotArea)
UpdateToProduceArea() UpdateToProduceArea()
ShowAreas() ShowAreas()
' Dichiaro progetto non modificato ' Dichiaro progetto non modificato
+40
View File
@@ -0,0 +1,40 @@
<Window x:Class="OmagPhotoWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:OmagCUT="clr-namespace:OmagCUT"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="OmagPHOTO" Height="700" Width="1250" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" >
<Border Style="{DynamicResource OmagCut_Border}">
<Grid Name="OptionSLabGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<!-- nel codice mi occupo di riempire la griglia con gli UserControl -->
<Button Name="ExitBtn" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<DockPanel Grid.Column="1" Grid.Row="1" Visibility="Hidden">
<!--StatusBar-->
<EgtWPFLib5:StatusBarV DataContext="{StaticResource StatusBarVM}" DockPanel.Dock="Bottom"/>
</DockPanel>
</Grid>
</Border>
</Window>
+171
View File
@@ -0,0 +1,171 @@
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtPHOTOLib
Imports System.IO
Public Class OmagPhotoWD
' Riferimento alla MainWindow
Friend m_MainWindow As MainWindow
Private m_AddToDataBaseUC As AddToDataBaseUC
Private m_StateList As New List(Of EgtWPFLib5.IdNameStruct)
' il contorno dell sfrido è definito a partire dai punti che rappresentano i vertici dello stesso
Private m_ContornScrap As New List(Of Point3d)
' se lo stato della lastra è "2" significa che è già stata inserita nel DB (non devo generare una nuova foto!)
Private m_nState As Integer = 1
' salvo il nome del file *.jpg
Private m_sFileImage As String = String.Empty
' definsce se il slavataggio è andato a buon fine (questa variabile deve esistere anche dopo la chiusura della finestra!)
Public Shared m_IsAdded As Boolean = False
Public Shared m_sDtBsId As String = ""
Public Shared m_bSlabIsSelected As Boolean = False
' definisce se il grezzo è stato eliminato dal DB
Public Shared m_IsDeleted As Boolean = False
Public Sub New(sImage As String, ContornScrap As List(Of Point3d), MnWindow As MainWindow, nState As Integer, DatabaseID As String)
InitializeComponent()
' salvo il riferimento della finestra principale
m_MainWindow = MnWindow
' leggo lo stato dello sfrido per decidere quale modalità di apertuta usare
m_nState = nState
'--------------- CARCICO lastra esistente ---------------
If m_nState = 2 Then
m_bSlabIsSelected = False
' ricerco l'elemento già inserito nel DB
For Each Item As Slab In EgtPHOTOLib.refProjectVM.SlabList
Dim CurrId As String = Item.GetCurrentID.Trim
If Item.GetCurrentID.Trim = DatabaseID.Trim Then
EgtPHOTOLib.refProjectVM.SelSlab = Item
m_bSlabIsSelected = True
Exit For
End If
Next
' se non trovo nessun elemento nel db allora esco
If IsNothing(EgtPHOTOLib.refProjectVM.SelSlab) Then
EgtOutLog("ID is not found in database: " & DatabaseID)
m_bSlabIsSelected = False
Return
End If
' procedo alla visualizzazione della pagina
EgtPHOTOLib.PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.DETAIL
' carico la lista degli stati letta dalla libreria
For Each Item As EgtWPFLib5.IdNameStruct In EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList
m_StateList.Add(Item)
Next
' notifico che la lastra è in modifica da questo programma
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.IsSelected = EgtPHOTOLib.MainData.nKey
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
' posiziono la finestra
Me.Top = 15
Me.Left = 15
Return
End If
'--------------- DEFINSCO nuova lastra esistente ---------------
' imposto come prima pagina sempre la lista (per inizializzare gli elementi della libreria) ACCELERARE il processo di creazione di questo oggetto!
EgtPHOTOLib.PhotoMap.refProjectVM.SelProjectMode = ProjectSlabVM.ProjectModeOpt.NEWSLAB
' imposto il percoso della foto appena generato
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ImagePath = sImage
' carico la foto come texture
EgtPHOTOLib.PhotoMap.refOptionPanelVM.PostPhoto(sImage, "")
' carico l'elenco dei materiali (non serve...)
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SetMaterialFromDB()
' definisco la lista degli stati
For Each Item As EgtWPFLib5.IdNameStruct In EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList
m_StateList.Add(Item)
Next
' imposto i dati lastra
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness = m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight
' carico la lista degli stati letta dalla libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelState = EgtPHOTOLib.PhotoMap.refOptionPanelVM.StateList(0)
' ricorco il materiale corrente nell'elenco dei materiali presenti nel DB (se non presente nell'elenco?)
For Each MaterialItem As String In EgtPHOTOLib.PhotoMap.refOptionPanelVM.MaterialList
If MaterialItem.ToLower = m_MainWindow.m_CurrentMachine.CurrMat.sName.ToLower Then
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Material = MaterialItem
Exit For
End If
Next
' salvo in locale i punti che arrivano dal progetto
m_ContornScrap = ContornScrap
' avvio la finestra di modifica
Dim m_refImagePrevieV As New EgtPHOTOLib.ImagePreviewV()
' modifico l'immagine e salvo
m_refImagePrevieV.SetContourScraps(m_ContornScrap)
m_refImagePrevieV.Show()
m_refImagePrevieV.SaveImage()
m_refImagePrevieV.Close()
m_bSlabIsSelected = True
' posiziono la finestra
Me.Top = 15
Me.Left = 15
End Sub
' posizionamento degli UserControl all'interno della griglia
Private Sub OmagPhotoWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' definisco nella pagina la posizione dello UserControl e inizializzo le liste
m_AddToDataBaseUC = New AddToDataBaseUC(Me)
m_AddToDataBaseUC.SetValue(Grid.ColumnProperty, 0)
m_AddToDataBaseUC.SetValue(Grid.RowProperty, 1)
m_AddToDataBaseUC.SetValue(Grid.RowSpanProperty, 2)
Me.OptionSLabGrid.Children.Add(m_AddToDataBaseUC)
m_AddToDataBaseUC.StateCmBx.ItemsSource = m_StateList
' recupero la scena dalla libreria e la carico nel finestra
Dim MyScene As New EgtPHOTOLib.SceneHostSlabV(EgtPHOTOLib.PhotoMap.refSceneHostVM)
MyScene.SetValue(Grid.ColumnProperty, 1)
MyScene.SetValue(Grid.ColumnSpanProperty, 2)
MyScene.SetValue(Grid.RowProperty, 1)
Me.OptionSLabGrid.Children.Add(MyScene)
End Sub
' carcio i dati della lastra
Private Sub PostLoaded() Handles Me.Loaded
If Not m_bSlabIsSelected Then
Return
End If
' carico i campi con i dati letti da database
If m_nState = 2 Then
' provo ad eseguire la separazione dei campi
m_sDtBsId = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
m_AddToDataBaseUC.BlockTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock
m_AddToDataBaseUC.NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
m_AddToDataBaseUC.StateCmBx.SelectedIndex = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.State
m_AddToDataBaseUC.MatTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Material
m_AddToDataBaseUC.ThicknessTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness
m_AddToDataBaseUC.ProjectTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo
' aggiorno il testo del messaggio "Add" "Save"
m_AddToDataBaseUC.AddBtn.Content = "Save"
Return
End If
' inizializzo i campi
'm_AddToDataBaseUC.IdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
m_AddToDataBaseUC.BlockTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock
m_AddToDataBaseUC.NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
m_AddToDataBaseUC.StateCmBx.SelectedIndex = 0
m_AddToDataBaseUC.MatTxBx.Text = m_MainWindow.m_CurrentMachine.CurrMat.sName
m_AddToDataBaseUC.ThicknessTxBx.Text = LenToString(m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight, 4)
m_AddToDataBaseUC.ProjectTxBx.Text = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
' rendo in primo piano la finestra
Me.Activate()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' se esista una lastra corrente, notifico che deve essere deselezionata
If Not IsNothing(EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab) Then
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.IsSelected = 0
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
End If
Me.Close()
End Sub
End Class
+97
View File
@@ -494,6 +494,20 @@ Public Class ProjectMgrUC
End If End If
'------------------- FINE Avvio il Ciclo-Start------------------------- '------------------- FINE Avvio il Ciclo-Start-------------------------
' ------------------ INIZIO gestione SCRAPS ---------------------------
Dim NewScrapsList As New List(Of Scrap)
' procedo all'aggiornamento della lista degli sfridi
UpDateScrapList(NewScrapsList)
' se esiste almeno uno sfrido da inserire come nuovo grezzo
If NewScrapsList.Count > 0 Then
' apro la finestra con l'elenco degli sfridi
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
MyScrapsWD.ShowDialog()
End If
' ------------------ FINE gestione SCRAPS -----------------------------
' Altrimenti linea di produzione ' Altrimenti linea di produzione
Else Else
' Verifico non sia già stato trasmesso ' Verifico non sia già stato trasmesso
@@ -665,6 +679,32 @@ Public Class ProjectMgrUC
#End If #End If
End Sub End Sub
' aggiorno la lista dei grezzi/sfridi
Public Sub UpDateScrapList(ByRef NewScrapsList As List(Of Scrap))
If IsNothing(NewScrapsList) Then
NewScrapsList = New List(Of Scrap)
Else
NewScrapsList.Clear()
End If
' procedo all'aggiornamento della lista degli sfridi
Dim CurrRawId As Integer = EgtGetFirstRawPart()
Dim IsNewScraps As Integer = 0
Dim nCountScrap As Integer = 1
While CurrRawId <> GDB_ID.NULL
If EgtGetInfo(CurrRawId, K_ISNEWSCRAPS, IsNewScraps) Then
If IsNewScraps = 1 Or IsNewScraps = 2 Then
' deve essere aggiunto nel DB delle lastre come nuovo grezzo (l'indice è utilizzato per definire il nome della lastra)
NewScrapsList.Add(New Scrap(CurrRawId, "Scrap_" & nCountScrap.ToString, IsNewScraps))
nCountScrap += 1
' è già stato aggiunto al DB delle lastre come nuovo grezzo
Else
' non è stato definito come nuovo grezzo
End If
End If
CurrRawId = EgtGetNextRawPart(CurrRawId)
End While
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------ ' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double) Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
@@ -938,3 +978,60 @@ Public Class ProjectMgrUC
End Sub End Sub
End Class End Class
Public Class Scrap
Private m_iPictureID As Integer
Private m_sName As String
Private m_IdRaw As Integer
Private m_nState As Integer
Public Property PictureID() As Integer
Get
Return m_iPictureID
End Get
Set(value As Integer)
m_iPictureID = value
End Set
End Property
Public Property Name() As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Public ReadOnly Property IdRaw() As Integer
Get
Return m_IdRaw
End Get
End Property
Public ReadOnly Property nState As Integer
Get
Return m_nState
End Get
End Property
Public ReadOnly Property PictureString() As String
Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
End Get
End Property
Sub New(IdScrap As Integer, NameScrap As String, State As Integer)
m_IdRaw = IdScrap
m_sName = NameScrap
m_nState = State
' immagine del grezzo
If m_nState = 2 Then
m_iPictureID = 5
Else
m_iPictureID = 4
End If
End Sub
End Class
+50
View File
@@ -0,0 +1,50 @@
<Window x:Class="ScrapsWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="Scraps" Height="482.6" Width="226.6" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True" Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+186
View File
@@ -0,0 +1,186 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class ScrapsWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_refProjectMgrUC As ProjectMgrUC
Private m_ScrapList As New List(Of Scrap)
Private m_CurrScrapId As Integer = GDB_ID.NULL
Private m_CurrScrapState As Integer = 2
Private m_sDatabaseId As String = ""
Private Sub Initalized()
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' inserisco il titolo della pagina aperta
TitleTxBl.Content = "Scraps List"
ScrapsListBox.ItemsSource = m_ScrapList
' definzione posizione finetra
Me.Left = 25
Me.Top = 25
End Sub
Public Sub New(Owner As Window, LocalProjectMgrUC As ProjectMgrUC, MyScrapList As List(Of Scrap))
Me.Owner = Owner
InitializeComponent()
m_ScrapList = MyScrapList
m_refProjectMgrUC = LocalProjectMgrUC
Initalized()
End Sub
' visualizzo la fase del pezzo selezionato
Private Sub ScrapListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ScrapsListBox.PreviewMouseUp
Dim vItems As Scrap = ScrapsListBox.SelectedItems(0)
' elimino l'utimo selzione
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' ricerco il grezzo associato a questo Id
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If nRawId = vItems.IdRaw Then
m_CurrScrapId = nRawId
m_CurrScrapState = vItems.nState
If m_CurrScrapState = 2 Then
EgtGetInfo(nRawId, K_DATABASEID, m_sDatabaseId)
Else
m_sDatabaseId = String.Empty
End If
Dim nCurrRawPhase As Integer = 0
' recupero la fase del grezzo corrente
EgtGetInfo(nRawId, "Ph", nCurrRawPhase)
If nCurrRawPhase <> 0 Then
' evidenzio lo sfrido selezionato all'interno della fase
EgtSetCurrPhase(nCurrRawPhase)
EgtSetMark(m_CurrScrapId)
EgtSelectObj(m_CurrScrapId)
EgtDraw()
Return
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
If m_CurrScrapId = GDB_ID.NULL Then Return
' creo una copia dell'immagine attuale (fotocamera 1)
Dim sImage As String = String.Empty
Dim sInfo As String = String.Empty
GetPrivateProfileString(S_CAMERA, K_CAM_IMAGE, "", sImage, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_CAMERA, K_CAM_INFO, "", sInfo, m_MainWindow.GetIniFile())
' recupero dalla libreria il percoso del database
Dim sPhotoDir As String = String.Empty
EgtPHOTOLib.GetPhotoDir(sPhotoDir)
' recupero l'ora corrente
Dim sDate As String = Date.Now.ToString
sDate = sDate.Replace("/", "_")
sDate = sDate.Replace(" ", "_")
sDate = sDate.Replace(":", "_")
Dim sNewPath As String = sPhotoDir & "\Scrap_" & sDate
Try
File.Copy(sImage, sNewPath & ".jpg", False)
File.Copy(sInfo, sNewPath & ".txt", False)
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
' se non esiste la classe StatusBar allora provo ad inizializzarla...
If IsNothing(EgtWPFLib5.LibMap.refStatusBarVM) Then
Dim objStatusBarVM As New EgtWPFLib5.StatusBarVM
End If
' salvo il contesto corrente del programma
Dim nCurrentContetxt As Integer = EgtGetCurrentContext()
' costruisco l'elenco ordinato dei punti che reppresentano il contorno del grezzo da salvare
Dim ContornScrapList As New List(Of Point3d)
Dim RefId As New Frame3d
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawSolid")
EgtGetTextureFrame(nRawSolidId, nRawSolidId, RefId)
Dim nCurveCompoId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawOutline")
Dim dStart As Double = 0
Dim dEnd As Double = 0
EgtCurveDomain(nCurveCompoId, dStart, dEnd)
Dim ptCurrPoint As Point3d
For dU As Integer = dStart To dEnd - 1
EgtAtParamPoint(nCurveCompoId, dU, m_CurrScrapId, ptCurrPoint)
ptCurrPoint.z = 0
ptCurrPoint.ToLoc(RefId)
ContornScrapList.Add(ptCurrPoint)
Next
MainData.SetPreviousContext(nCurrentContetxt)
'If Not IsNothing(MainData.ContextSTONELib) Or MainData.ContextSTONELib <> 0 Then
'If MainData.ContextSTONELib <> 0 Then
' EgtSetCurrentContext(MainData.ContextSTONELib)
'End If
' inizializzo PojectSlabV pechè si occupa di inizializzare le pagine Detail e Option
Dim MyProjectSlab As New EgtPHOTOLib.ProjectSlabV
' ACCELERARE il processo di creazione di questo oggetto!
MyProjectSlab.DataContext = New EgtPHOTOLib.ProjectSlabVM
' per ogni creazione della nuova pagina viene creata una nuova scena, ma non viene eliminata
Dim refProjectVMSceneContext As Integer = EgtGetCurrentContext()
' apro la finestra OmagPHOTO (passo il nome del file come copia dell'originale)
If ContornScrapList.Count > 2 Then
Dim MyOmagPhotoWD As New OmagPhotoWD(sNewPath & ".jpg", ContornScrapList, m_MainWindow, m_CurrScrapState, m_sDatabaseId)
OmagPhotoWD.m_IsAdded = False
OmagPhotoWD.m_sDtBsId = String.Empty
OmagPhotoWD.m_IsDeleted = False
MyOmagPhotoWD.ShowDialog()
Else
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Error loading contour scrap")
End If
' ripristino il contesto corrente dell'immagine
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
' se l'inserimento è andatoa buon fine allora procedo a notificarlo
If OmagPhotoWD.m_IsAdded AndAlso Not String.IsNullOrEmpty(OmagPhotoWD.m_sDtBsId) Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 2)
EgtSetInfo(m_CurrScrapId, K_DATABASEID, OmagPhotoWD.m_sDtBsId)
Else
' se è stato eliminato dal DB allora aggiorno la lista dei grezzi
If OmagPhotoWD.m_IsDeleted Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 1)
EgtRemoveInfo(m_CurrScrapId, K_DATABASEID)
End If
Try
File.Delete(sNewPath & ".jpg")
File.Delete(sNewPath & ".txt")
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
End If
'----------------INIZIO ELIMINAZIONE contesti generati da OmagPHOTOLib per la visualizzazione delle Texture
EgtDeleteContext(EgtPHOTOLib.MainData.ContextSTONELib)
EgtDeleteContext(refProjectVMSceneContext)
'---------------- FINE ELIMINAZIONE contesti
' aggiorno la lista degli scrap
m_refProjectMgrUC.UpDateScrapList(m_ScrapList)
ScrapsListBox.ItemsSource = m_ScrapList
ScrapsListBox.Items.Refresh()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' deseleziono l'oggetto corrente
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' reimposto la fase iniziale
EgtSetCurrPhase(1)
EgtDraw()
Me.Close()
End Sub
End Class
+2
View File
@@ -513,6 +513,8 @@ Public Class RawPartPageUC
End Select End Select
' Aggiorno il punto precedente ' Aggiorno il punto precedente
m_ptPrev = ptCurr m_ptPrev = ptCurr
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges()
End Sub End Sub
Private Sub ModifyRectangle(ptCurr As Point3d) Private Sub ModifyRectangle(ptCurr As Point3d)
Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

+3 -1
View File
@@ -309,7 +309,8 @@ Public Class WorkInProgressPageUC
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile()) Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave ' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
If Not WorkInProgressScene.Init() Then Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
If Not WorkInProgressScene.Init() Or Not bProd Then
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!! ' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost) Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
' Flag per riavvio programma ' Flag per riavvio programma
@@ -360,6 +361,7 @@ Public Class WorkInProgressPageUC
#End If #End If
m_MainWindow.Close() m_MainWindow.Close()
If bRestart Then Process.Start( Application.ResourceAssembly.Location) If bRestart Then Process.Start( Application.ResourceAssembly.Location)
Return True
End If End If
' dimensione lineare max in pixel delle textures ' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile()) Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())