Compare commits

..

11 Commits

Author SHA1 Message Date
NicolaP 17229ab9bc Migliorata gestione scene e eliminazione Slab 2022-09-28 11:59:11 +02:00
NicolaP 2e0f2eab1b Gestione riconoscimento sfridi da progetto 2022-09-22 17:33:17 +02:00
NicolaP 58c62ebd5c Carico coordinate punti del grezzo (Da verificare) 2022-09-21 18:23:05 +02:00
NicolaP f9fd0f0168 Miglioramento gestione comado AddSpar/RemoveScrap 2022-09-19 12:19:40 +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 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 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
24 changed files with 1158 additions and 541 deletions
+1 -9
View File
@@ -93,7 +93,7 @@ Friend Module CamAuto
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS Then
' Reinserisco tutte le lavorazioni piane
AddMachinings(GDB_ID.NULL, nWarn)
' Se altrimenti progetto con cornici
' Se altrimenti progetto con cornici
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
' Reinserisco tutte le lavorazioni delle cornici
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
@@ -155,14 +155,6 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function ResetAllBRidges() As Boolean
Dim bOk As Boolean = True
Dim nMachGroup As Integer = EgtGetCurrMachGroup()
Dim nBridgesGroup As Integer = EgtGetFirstNameInGroup(nMachGroup, "Bridges")
bOk = EgtErase(nBridgesGroup)
Return bOk
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
+10 -8
View File
@@ -133,10 +133,14 @@
</Button>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
@@ -155,11 +159,9 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Grid>
+114 -194
View File
@@ -11,12 +11,8 @@ Public Class MoveRawPartPage
Private m_nAuxTabId As Integer = GDB_ID.NULL
' Fase corrente
Private m_nCurrPhase As Integer = 0
' Disposizione corrente
Private m_nCurrDisposition As Integer = GDB_ID.NULL
' Premuto Prev
Private m_bPrev As Boolean = False
' Pemuto Next
Private m_bToNext As Boolean = False
' Dati movimento
Private m_dStep As Double = 0
Private m_dRotation As Double = 0
@@ -39,14 +35,13 @@ Public Class MoveRawPartPage
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ScrapsBtn.Content = "Add Scraps"
End Sub
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_SplitPage = m_MainWindow.m_CadCutPageUC.m_SplitPage
m_bActive = True
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Leggo tipo movimento grezzi
m_bByHand = (GetVacuumType() = 0 Or
Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP) Or
@@ -63,20 +58,62 @@ Public Class MoveRawPartPage
m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente
Dim nPrevPhase As Integer = EgtGetCurrPhase()
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
If Not m_SplitPage.m_bShow Then
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
Else
EgtSetCurrPhase(nPrevPhase + 1)
HideAllMachinings()
End If
m_nCurrPhase = EgtGetCurrPhase()
'---------------------------- SCRAPS ----------------------------
' gestione visualizzazione del comando "Scraps"
Dim ScrapsVisibility As Visibility = Visibility.Collapsed
' verifico se licenza abilitat: m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SCRAPS)
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, m_MainWindow.GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, m_MainWindow.GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\OmagPHOTODb.sqlite") Then
ScrapsVisibility = Visibility.Visible
End If
End If
' verifico che siano stati generati dei nuovi grezzi
If vNewRaws.Count = 0 Then
ScrapsVisibility = Visibility.Collapsed
End If
' aggiorno la grafica
ScrapsBtn.Visibility = ScrapsVisibility
'---------------------------- SCRAPS ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
' altrimenti, aggiorno visualizzazione
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' altrimenti, aggiorno visualizzazione
Else
EgtDraw()
End If
@@ -114,14 +151,14 @@ Public Class MoveRawPartPage
' Distanza iniziale
m_dCurrDist = 0
End If
' Non dovrebbe mai accadere, ma inizializzo con default
' Non dovrebbe mai accadere, ma inizializzo con default
Else
m_vtDir = Vector3d.Y_AX()
m_ptMid = Point3d.ORIG()
m_dOrigDist = 0
m_dCurrDist = 0
End If
' Altrimenti movimento con ventose
' Altrimenti movimento con ventose
Else
m_bRemovedRaw = False
m_bRawWithCups = False
@@ -135,6 +172,9 @@ Public Class MoveRawPartPage
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
End If
End If
' aggiorno il messaggio del comando per gestire gli sfridi
VerifyIsNewScrap(m_CurrRawOnVacuum)
' Aggiorno interfaccia per taglio perpendicolare
If m_bByHand Then
UpBtn.Visibility = Windows.Visibility.Visible
@@ -150,8 +190,8 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
ScrapsBtn.Visibility = Windows.Visibility.Visible
' altrimenti per movimento con ventose
ElseIf Not m_SplitPage.m_bOnAuxTab Then
UpBtn.Visibility = Windows.Visibility.Visible
@@ -167,8 +207,8 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Hidden
BottomLBtn.Visibility = Windows.Visibility.Hidden
BottomRBtn.Visibility = Windows.Visibility.Hidden
PauseBtn.Visibility = Windows.Visibility.Hidden
ResetBtn.Visibility = Windows.Visibility.Hidden
ScrapsBtn.Visibility = Windows.Visibility.Visible
' altrimenti per movimento finale dei pezzi
Else
UpBtn.Visibility = Windows.Visibility.Hidden
@@ -184,47 +224,15 @@ Public Class MoveRawPartPage
TopRBtn.Visibility = Windows.Visibility.Visible
BottomLBtn.Visibility = Windows.Visibility.Visible
BottomRBtn.Visibility = Windows.Visibility.Visible
PauseBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible
ScrapsBtn.Visibility = Windows.Visibility.Hidden
End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
Private Sub SetAuxTabInCurrDisposition()
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Se definizione movimenti
If Not m_SplitPage.m_bShow Then
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
End If
EgtZoom(ZM.ALL)
' verifico che siano state salvate correttamente le info della tavola di scarico
EgtSaveFile("c:\EgtData\OmagCUT\Temp\AuxTab.nge", NGE.BIN)
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -253,17 +261,19 @@ Public Class MoveRawPartPage
If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nId, nStat)
' aggiorno il messaggio del bottone "Scrap" a seconda che il grezzo sia già uno scrap
VerifyIsNewScrap(nId)
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
@@ -337,8 +347,6 @@ Public Class MoveRawPartPage
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
If m_SplitPage.m_bOnAuxTab Then Return False
If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
@@ -370,6 +378,27 @@ Public Class MoveRawPartPage
Return False
End Function
Private Function VerifyIsNewScrap(nMyId As Integer) As Boolean
Dim nVal As Integer = 0
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
If nVal = 1 Or nVal = 2 Then
' 1 → è stato definito come nuovo grezzo oppure, 2 → è stato definito come nuovo grezzo ed è stato inserito nel DB delle lastre
ScrapsBtn.Content = "Remove Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return True
ElseIf nVal = 3 Then
' non è possibile rimuovere il grezzo in questa fase
ScrapsBtn.Content = "Defined as Scrap"
ScrapsBtn.IsEnabled = False
Return True
End If
End If
' non è un nuovo grezzo
ScrapsBtn.Content = "Add Scrap"
ScrapsBtn.IsEnabled = True And Not m_SplitPage.m_bShow
Return False
End Function
#Region "Move Up/Down/Left/Right"
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
@@ -702,6 +731,29 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
Private Sub ScrapsBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ScrapsBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
' verifico che il grezzo non contenga dei pezzi (altrimenti non risulta selezionabile)
Dim nPartInRaw As Integer = EgtGetFirstPartInRawPart(nRawId)
If nPartInRaw = GDB_ID.NULL Then
If Not VerifyIsNewScrap(nRawId) Then
EgtSetInfo(nRawId, K_ISNEWSCRAPS, "1")
Else
EgtRemoveInfo(nRawId, K_ISNEWSCRAPS)
End If
' aggiorno il contenuto del bottone
VerifyIsNewScrap(nRawId)
Else
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetErrorMessage("Part inside raw!")
End If
' passo al grezzo succesivo (NON dovrebbero esserci altri grezzi selezionabili contemporaneamente!)
nRawId = EgtGetNextSelectedObj()
End While
End Sub
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
Dim dStep As Double
If StringToLen(StepMoveTxBx.Text, dStep) Then
@@ -786,16 +838,6 @@ Public Class MoveRawPartPage
Next
If Not bOkRotate Then Return
Else
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
Dim b3Area As New BBox3d
EgtGetTableArea(1, b3Area)
Dim b3RawTemp As New BBox3d
EgtGetRawPartBBox(nRawId, b3RawTemp)
' ricavo il riferimento dell'angolo in basso a sinstra del grezzo rispetto alla tavola
Dim ptCorner As Point3d = New Point3d(b3Area.DimX / 2, b3Area.DimY / 2, 0) - New Vector3d(b3RawTemp.DimX / 2, b3RawTemp.DimY / 2, 0)
' sposto il pezzo in questa posizione
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
' riprovo il movimento
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima
@@ -910,62 +952,6 @@ Public Class MoveRawPartPage
Return True
End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
Dim Index As Integer = 0
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
m_RawMoveDataList.RemoveAt(Index)
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
' Creo nuova fase
Dim nNewPhase As Integer = EgtAddPhase()
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
SetPause(nCurrDisposition)
m_nCurrDisposition = nCurrDisposition
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtSetCurrPhase(nNewPhase)
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj()
@@ -1001,30 +987,7 @@ Public Class MoveRawPartPage
EgtDeselectAll()
' Torno alla fase precedente
m_bPrev = True
' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
' verifico se la fasa precedente è di tipo scarico
If IsDispUnloadOnAuxTab(nPrevDispId) Then
EgtSetCurrPhase(m_nCurrPhase - 1)
m_nCurrDisposition = nPrevDispId
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
EgtDraw()
Return
End If
'If EgtGetOperationType(EgtGetPrevOperation(m_nCurrDisposition)) = MCH_OY.DISP AndAlso m_SplitPage.m_bOnAuxTab Then
' EgtSetCurrPhase(m_nCurrPhase - 1)
' m_nCurrDisposition = EgtGetPrevOperation(m_nCurrDisposition)
' m_nCurrPhase -= 1
' m_bPrev = False
' m_SplitPage.m_bShow = True
' EgtDraw()
' Return
'End If
' Passo alla pagina delle spezzature
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage)
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split
@@ -1040,19 +1003,6 @@ Public Class MoveRawPartPage
' non cambio pagina
Return
End If
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -1098,26 +1048,6 @@ Public Class MoveRawPartPage
EnableButtons()
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer)
' verifico se la fase precedente è uno scarico su tavola ausiliaria
Dim bVal As Integer = 0
EgtGetInfo(nCurrDispId, "Pat", bVal)
Return bVal
End Function
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
Public Function GetNextDisposition(nCurrDisposId As Integer)
Dim nDispId As Integer = nCurrDisposId
While nDispId <> GDB_ID.NULL
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
Return nDispId
End If
nDispId = EgtGetNextOperation(nDispId)
End While
Return GDB_ID.NULL
End Function
Private Sub EnableButtons()
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -1132,22 +1062,12 @@ Public Class MoveRawPartPage
TopRBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
End If
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
ScrapsBtn.IsEnabled = Not m_SplitPage.m_bShow
End Sub
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
' Se movimento con ventose
If Not m_bByHand Then
' nascondo le ventose
@@ -1163,11 +1083,11 @@ Public Class MoveRawPartPage
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable( nDispId, m_SplitPage.m_bOnAuxTab)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
' se altrimenti movimento senza ventose perchè lama troppo grande
' se altrimenti movimento senza ventose perchè lama troppo grande
ElseIf GetVacuumType() > 0 Then
' se non solo visualizzazione
If Not m_SplitPage.m_bShow Then
-2
View File
@@ -1175,8 +1175,6 @@ Public Class NestPageUC
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
' se è stato eseguito il Drag allora cancello tutti i ponticelli
ResetAllBRidges()
End Sub
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseUpScene
+7
View File
@@ -363,6 +363,13 @@ Public Module SplitAuto
vNewRaws.Add(nNewRawId)
nNewRawId = EgtGetNextRawPart(nNewRawId)
End While
Else
' verifico che nella fase precedente è stato definito come sfrido, allora lo riassegno
Dim nVal As Integer = 0
EgtGetInfo(nRawId, K_ISNEWSCRAPS, nVal)
If nVal = 1 Or nVal = 2 Or nVal = 3 Then
EgtSetInfo(nRaw1Id, K_ISNEWSCRAPS, "3")
End If
End If
' Assegno ai nuovi grezzi eventuale texture del grezzo originale
Dim nSolidId = EgtGetFirstNameInGroup(nRawId, NAME_RAW_SOLID)
+2 -13
View File
@@ -48,8 +48,8 @@
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="AutoBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
<Button Name="RestartBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}" Visibility="Hidden"/>
</Grid>
</Grid>
<!--Left Button Grid-->
@@ -125,17 +125,6 @@
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesWJBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<!-- solo per macchine con lavorazioni Waterjet -->
<ToggleButton Name="BridgesDeleteWJBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource PonticelliDeleteWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<Button Name="CutEndBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Fine-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
+5 -298
View File
@@ -7,7 +7,6 @@ Public Class SplitPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Tipo movimento dei grezzi (manuale o con testa ventosa)
@@ -27,22 +26,6 @@ Public Class SplitPageUC
' verifico che le lavorazioni selezionate siano omogenee (con lo stesso utensile)
Private m_bAreHomogeneous As Boolean = False
' Id tagli WJ per generazione ponticelli tra due percorsi
Private m_nIdSelectedPartWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_Srt As Integer = GDB_ID.NULL
Private m_nIdSelectedPartWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedSideWJ_End As Integer = GDB_ID.NULL
Private m_nIdSelectedWaterJet_End As Integer = GDB_ID.NULL
' Id gruppo Bridges (Nuovo da versione 30/08/2022)
Private m_nIdBridgesGroup As Integer = GDB_ID.NULL
Private m_nIdBridgeLineGroup As Integer = GDB_ID.NULL
Private m_nIdBridge As Integer = GDB_ID.NULL
Private m_ptSrtBridge As New Point3d
Private m_ptEndBridge As New Point3d
Public Const BRIDGES As String = "Bridges"
Public Const BRIDGELINE As String = "BridgeLine"
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
'Private m_CurrInd As Integer = -1
'Private m_CurrItems As New List(Of NameIdLsBxItem)
@@ -87,7 +70,6 @@ Public Class SplitPageUC
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) ' Modifica
AutoBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 18) ' Auto
RestartBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 19) ' Restart
BridgesWJBtn.ToolTip = "Bridges"
End Sub
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -213,176 +195,6 @@ Public Class SplitPageUC
Next
End Sub
#Region "BRIDGE"
Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs,
ByVal IsFirst As Boolean,
ByRef m_nIdSelectedSideWJ As Integer,
ByRef m_nIdSelectedWaterJet As Integer,
ByRef nIdParentPart As Integer)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
EgtDeselectObj(m_nIdSelectedSideWJ)
End If
' recupero il gruppo della lavorazione associata
nIdParentPart = EgtGetParent(nIdParent)
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
If ListGroup.Count > 0 Then
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
If IsFirst Then
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptSrtBridge)
Else
' prima di confermare verifico che non ci siano interferenze
EgtNearPoint(nIdMy, CurrPoint, GDB_RT.GLOB, m_ptEndBridge)
EgtModifyCurveEndPoint(m_nIdBridge, m_ptEndBridge, GDB_RT.GLOB)
If VerifyInterference(m_nIdBridge) Then
m_CurrProjPage.ClearMessage()
' salvo nel Gruppo "BridgeLine" gli dei pezzi che sono collegati
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartStart", m_nIdSelectedPartWJ_Srt)
EgtSetInfo(EgtGetParent(m_nIdBridge), "PartEnd", m_nIdSelectedPartWJ_End)
Else
' attendo la selezione di un punto valido
m_nIdSelectedSideWJ = GDB_ID.NULL
m_nIdSelectedWaterJet = GDB_ID.NULL
nIdParentPart = GDB_ID.NULL
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Bridge intersects part")
Return
End If
End If
m_nIdSelectedWaterJet = nIdWJ
' salvo il valore del PreView evidenziato
EgtSetMark(nIdParentPart)
' EgtSetMark(nIdWJ)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseDownSceneBridgesDelete(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Acquisisco punto da disegno
Dim CurrPoint As New Point3d
EgtUnProjectPoint(e.Location, CurrPoint)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sGroupName As String = String.Empty
' gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sGroupName)
If sGroupName.Contains(BRIDGELINE) Then
EgtErase(nIdParent)
EgtDraw()
Return
End If
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
Private Sub OnMyMouseMoveSceneBridges(ptCurr As Point3d)
ptCurr.z = m_ptSrtBridge.z
' rappresento il egmento
If m_nIdBridge = GDB_ID.NULL Then
m_nIdBridgeLineGroup = EgtCreateGroup(m_nIdBridgesGroup)
EgtSetName(m_nIdBridgeLineGroup, BRIDGELINE)
m_nIdBridge = EgtCreateLine(m_nIdBridgeLineGroup, m_ptSrtBridge, ptCurr, GDB_RT.GLOB)
End If
EgtModifyCurveEndPoint(m_nIdBridge, ptCurr, GDB_RT.GLOB)
EgtDraw()
End Sub
Private Function VerifyInterference(nIdBridge As Integer) As Boolean
' prima di procedere alla verifica accorco il segmento (solo per sicurezza) 10 * EPS_SMALL
Dim dLen As Double
EgtCurveLength(nIdBridge, dLen)
If dLen > 21 AndAlso Not EgtCurveIsClosed(nIdBridge) Then
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
End If
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
Dim nIdPart As Integer = GDB_ID.NULL
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
While nIdPart <> GDB_ID.NULL
Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nIdPart, "Region")
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
While nIdSurf <> GDB_ID.NULL
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
' se la linea bridge interseca la superficie allora restitusco false
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
Return False
End If
Exit While
End If
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return True
End Function
Private Sub DeselectWJBridgesPart()
' se in fase di definzione di un ponticello lo elimino
If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
EgtErase(EgtGetParent(m_nIdBridge))
End If
m_nIdBridge = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_Srt)
m_nIdSelectedPartWJ_Srt = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_Srt)
m_nIdSelectedSideWJ_Srt = GDB_ID.NULL
m_nIdSelectedWaterJet_Srt = GDB_ID.NULL
EgtResetMark(m_nIdSelectedPartWJ_End)
m_nIdSelectedPartWJ_End = GDB_ID.NULL
EgtDeselectObj(m_nIdSelectedSideWJ_End)
m_nIdSelectedSideWJ_End = GDB_ID.NULL
m_nIdSelectedWaterJet_End = GDB_ID.NULL
EgtDraw()
End Sub
#End Region ' Bridge
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
@@ -391,27 +203,6 @@ Public Class SplitPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt = GDB_ID.NULL Then
OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
Else
OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
End If
' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
DeselectWJBridgesPart()
End If
Return
End If
' eliminazione dei ponticelli
If BridgesDeleteWJBtn.IsChecked Then
OnMyMouseDownSceneBridgesDelete(sender, e)
Return
End If
' Reset drag
m_nDragInd = -1
m_nDragType = 0
@@ -496,23 +287,13 @@ Public Class SplitPageUC
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
If Not m_bActive OrElse m_bShow Then Return
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' definizione dei ponticelli
If BridgesWJBtn.IsChecked Then
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL Then
OnMyMouseMoveSceneBridges(ptCurr)
End If
Return
End If
' Se drag non abilitato o in corso
If m_nDragInd = -1L Or m_bDragging Then Return
m_bDragging = True
Dim nOperId As Integer = m_MachiningList(m_nDragInd).m_nId
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento e la variazione di lunghezza
Dim vtMove As Vector3d = ptCurr - m_ptDragPrev
Dim dDelta = vtMove * m_MachiningList(m_nDragInd).m_vtDir
@@ -860,50 +641,6 @@ Public Class SplitPageUC
EnableButtons()
End Sub
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
If e.Key = Key.Escape Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
End If
End Sub
Private Sub BridgeBtn_Click(sender As Object, e As RoutedEventArgs) Handles BridgesWJBtn.Click
' eventualmente spengo il comando per eliminare i ponticelli
If BridgesDeleteWJBtn.IsChecked Then
BridgesDeleteWJBtn.IsChecked = False
End If
' se deseleziono resetto tutte le variabili
If Not BridgesWJBtn.IsChecked Then
' se sono in fase di creazione di un ponticello interrompo
DeselectWJBridgesPart()
Return
End If
' recuoero il gruppo di lavorazione corrente
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
' creo il gruppo per i ponticelli
Dim sNameGroup As String = BRIDGES
Dim nId As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
If nId <> GDB_ID.NULL Then
m_nIdBridgesGroup = nId
End If
' se non lo trovo allora lo creo
If nId = GDB_ID.NULL Then
m_nIdBridgesGroup = EgtCreateGroup(nIdCurrMachGroup)
EgtSetName(m_nIdBridgesGroup, BRIDGES)
End If
End Sub
Private Sub BridgeDeleteBtn_Click(Sender As Object, e As RoutedEventArgs) Handles BridgesDeleteWJBtn.Click
' eventualmente spengo il comando per inserire i ponticelli
If BridgesWJBtn.IsChecked Then
BridgesWJBtn.IsChecked = False
End If
If Not BridgesDeleteWJBtn.IsChecked Then
DeselectWJBridgesPart()
End If
End Sub
Private Function AdjustBothCuts(nI As Integer,
Optional bAllForced As Boolean = False,
Optional bAccForced As Boolean = False) As Boolean
@@ -1659,16 +1396,6 @@ Public Class SplitPageUC
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) Then
' verifico che l'operazione sia una disposizione, altrimenti cerco
NextDisposition = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.GetNextDisposition(NextDisposition)
m_bOnAuxTab = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.IsDispUnloadOnAuxTab(NextDisposition)
End If
End If
m_bToNext = True
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
@@ -1785,10 +1512,6 @@ Public Class SplitPageUC
End Sub
Friend Sub ExitSplit(Optional bTrueExit As Boolean = True)
DeselectWJBridgesPart()
BridgesWJBtn.IsChecked = False
BridgesDeleteWJBtn.IsChecked = False
' Rimuovo evidenziazione e numeri
RemoveMarkAndNumbers()
' Ripristino colori lavorazioni
@@ -1900,7 +1623,7 @@ Public Class SplitPageUC
m_bOnAuxTab = False
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
@@ -1911,7 +1634,7 @@ Public Class SplitPageUC
' Deve essere permesso almeno un tipo di movimento
NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab
End If
' altrimenti sto solo visualizzando
' altrimenti sto solo visualizzando
Else
' movimento su tavola di scarico
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
@@ -2031,7 +1754,6 @@ Public Class SplitPageUC
Private Sub VisibilityButtonFromMachinig(ByVal Type As Integer)
If Type <> MCH_OY.SAWING Then
CutBtn.Visibility = Visibility.Hidden
CutStartBtn.Visibility = Visibility.Hidden
CutEndBtn.Visibility = Visibility.Hidden
@@ -2062,21 +1784,6 @@ Public Class SplitPageUC
AllExtendBtn.Visibility = Visibility.Visible
AllReduceBtn.Visibility = Visibility.Visible
End If
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
BridgesDeleteWJBtn.Visibility = Visibility.Visible
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
Else
BridgesWJBtn.Visibility = Visibility.Hidden
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
End If
End Sub
Private Function ModifyOtherLeadIn(nI As Integer, nLiOthType As Integer) As Boolean
+9
View File
@@ -216,6 +216,15 @@ Module ConstIni
Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular"
Public Const S_SCRAPS As String = "Scraps"
Public Const K_ENABLESCRAPS As String = "EnableScraps"
Public Const K_PHOTODIR As String = "PhotoDir"
Public Const K_LASTBLOCK As String = "LastBlock"
Public Const K_TEMPLATE As String = "Template"
Public Const K_DAT As String = "Dat"
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
Public Const K_ENABLE_PRINTER As String = "EnablePrinter"
Public Const S_REG As String = "Reg"
Public Const K_REGSTEP As String = "Step"
Public Const K_REGANGSTEP As String = "AngStep"
+3
View File
@@ -233,6 +233,9 @@
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const K_ISNEWSCRAPS As String = "IsNewScraps"
Public Const K_DATABASEID As String = "DatabaseID"
Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
+158 -11
View File
@@ -1,16 +1,48 @@
<ResourceDictionary
x:Class="EgtDictionary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Project="clr-namespace:OmagCUT"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions">
<ResourceDictionary x:Class="EgtDictionary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Project="clr-namespace:OmagCUT"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtPHOTOLib="clr-namespace:EgtPHOTOLib;assembly=EgtPHOTOLib"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:ControlExtensions="clr-namespace:OmagCUT.ControlExtensions">
<!--Template che permette di andare a capo-->
<EgtWPFLib5:StatusBarVM x:Key="StatusBarVM"/>
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
<EgtPHOTOLib:ProjectSlabVM x:Key="ProjectSlabVM"/>
<EgtPHOTOLib:OptionPanelSlabVM x:Key="OptionPanelSlabVM"/>
<EgtPHOTOLib:ListPageSlabVM x:Key="ListPageSlabVM"/>
<EgtPHOTOLib:DetailPageSlabVM x:Key="DetailPageSlabVM"/>
<EgtPHOTOLib:SearchPanelSlabVM x:Key="SearchPanelSlabVM"/>
<EgtPHOTOLib:MyInstrumentPanelSlabVM x:Key="MyInstrumentPanelSlabVM"/>
<!--Colori predefiniti-->
<SolidColorBrush x:Key="Omag_Blue" Color="#FF095CA8" />
<SolidColorBrush x:Key="Omag_Yellow" Color="#FFFFCE5B" />
<SolidColorBrush x:Key="Omag_Red" Color="Red" />
<SolidColorBrush x:Key="Omag_Green" Color="LawnGreen" />
<SolidColorBrush x:Key="Omag_VeryLightGray" Color="#FFF2F2F2" />
<SolidColorBrush x:Key="Omag_LightGray" Color="LightGray" />
<SolidColorBrush x:Key="Omag_Gray" Color="#FF9E9E9E" />
<SolidColorBrush x:Key="Omag_DarkGray" Color="#FF444444" />
<SolidColorBrush x:Key="Omag_White" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="Omag_Black" Color="#FF000000" />
<SolidColorBrush x:Key="EgaltechBlue1" Color="#FF095CA8" />
<SolidColorBrush x:Key="EgaltechWhite" Color="#FFFFFFFF" />
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="Button_DataTemplate_Wrap">
<TextBlock TextWrapping="Wrap" Text="{Binding}"/>
</DataTemplate>
<!--ButtonBase-->
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- Button Style -->
<Style TargetType="{x:Type Button}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
@@ -71,7 +103,44 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="WrapButton_DataTemplate">
<TextBlock TextWrapping="WrapWithOverflow" Text="{Binding}"/>
</DataTemplate>
<Style x:Key="ToolBar_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="80"/>
</Style>
<Style x:Key="OptionPanel_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="OptionPanel_TextButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_TextWrapButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="Height" Value="45"/>
</Style>
<Style x:Key="OptionPanel_NestingButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="EgtWPFLib5_InputButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="60"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--Template che permette di andare a capo-->
<DataTemplate x:Key="CheckBox_DataTemplate_Wrap">
@@ -375,7 +444,59 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<Style x:Key="ToolBar_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="ToolBar_TextToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="70"/>
</Style>
<Style x:Key="OptionPanel_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
</Style>
<Style x:Key="OptionPanel_NestingToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="60"/>
<Setter Property="Width" Value="60"/>
</Style>
<Style x:Key="CompoWindow_ToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="CompoWindow_WrapToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="ContentTemplate" Value="{StaticResource WrapButton_DataTemplate}" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="Height" Value="40"/>
</Style>
<Style x:Key="Option_ColorButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Padding" Value="5"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFB8C3CD"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="OpacityMask" Value="#33FF0000"/>
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#FFF4F4F4"/>
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!--TreeViewBase-->
<!--Style e colori della freccia di espansione, necessari per modificare il ContainerItemStyle perchè contiene riferimenti ad essi-->
@@ -431,6 +552,32 @@
</Setter>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtCustomWindow -->
<Style TargetType="{x:Type EgtWPFLib5:EgtCustomWindow}" BasedOn="{StaticResource {x:Type EgtWPFLib5:EgtCustomWindow}}">
<Setter Property="TitleBarHeight" Value="32"/>
<Setter Property="TitleBarBrush" Value="{StaticResource Omag_LightGray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- EgtFloatingPanel -->
<Style x:Key="ToolBar_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<Style x:Key="Option_EgtFloatingPanel" TargetType="{x:Type EgtFloating:EgtFloatingPanel}" BasedOn="{StaticResource {x:Type EgtFloating:EgtFloatingPanel}}">
<Setter Property="IsToolBar" Value="False"/>
<Setter Property="TitleBarOrientation" Value="Vertical"/>
<Setter Property="Background" Value="{StaticResource Omag_Gray}"/>
<Setter Property="BorderBrush" Value="{StaticResource Omag_Gray}"/>
</Style>
<!-- ______________________________________________________________________________________________________________________ -->
</ResourceDictionary>
+59
View File
@@ -2,6 +2,7 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib
Imports EgtPHOTOLib
Imports System.ComponentModel
Imports System.Threading
Imports System.Windows.Threading
@@ -498,6 +499,64 @@ Class MainWindow
AddHandler m_ProdLineTimer.Tick, AddressOf OnProdLine
' Imposto riferimento a funzione delle textbox che disattiva scene in libreria
EgtWPFLib.EgtTextBox.m_refScenesIsEnabled = AddressOf IsEnabledScenes
' --------------------------------- SLAB DB -------------------------------------------------------
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, GetIniFile()) <> 0 Then
' leggo il direttorio in cui cercare il database delle lastre
Dim PhotDir As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, GetIniFile())
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
If System.IO.File.Exists(PhotDir.Trim & "\" & DB_FILENAME) Then
If Not ManageDb.ConnectToDb(PhotDir.Trim & "\" & DB_FILENAME) Then
EgtOutLog("Error connecting to DB: " & PhotDir.Trim & "\" & DB_FILENAME)
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
m_CurrentProjectPageUC.ClearMessage()
m_CurrentProjectPageUC.SetErrorMessage("Denied connection SlabDB")
Else
' Impostazione direttorio per backup
Dim BackUpDir As String = m_sDataRoot & "\BackUp"
Directory.CreateDirectory(BackUpDir)
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
EgtPHOTOLib.MainData.SetPhotoDir(PhotDir)
EgtPHOTOLib.MainData.SetBackUpDir(BackUpDir)
EgtPHOTOLib.MainData.SetIsOMagCUT(True)
Dim sLastBlock As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_LASTBLOCK, "", sLastBlock, GetIniFile())
If Not String.IsNullOrEmpty(sLastBlock) Then
EgtPHOTOLib.MainData.SetLastBlock(sLastBlock)
End If
If GetPrivateProfileInt(S_SCRAPS, K_ENABLE_PRINTER, 0, GetIniFile()) = 1 Then
' leggo nome file prn (per stampante zebra)
Dim m_TemplateFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_TEMPLATE, m_sDataRoot & "\Label\Default.prn", m_TemplateFilePrinter, GetIniFile())
' leggo nome del direttorio in cui scrivere il file ini (per stampante zebra) -- solo se si desidera scrivere il file in un direttorio diverso
Dim m_DatFilePrinter As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_DAT, m_sDataRoot & "\Temp", m_DatFilePrinter, GetIniFile())
' leggo nome file exe (per stampante zebra)
Dim m_ZebraUtilitiesExe As String = String.Empty
GetPrivateProfileString(S_SCRAPS, K_ZEBRAUTILITIES, System.AppDomain.CurrentDomain.BaseDirectory & "ZebraPrinterUtilitiesR32.exe", m_ZebraUtilitiesExe, GetIniFile())
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
EgtPHOTOLib.MainData.SetDataFilePrinter(m_DatFilePrinter)
EgtPHOTOLib.MainData.SetZebraPrinterExe(m_ZebraUtilitiesExe)
EgtPHOTOLib.MainData.SetPrinterVisibility(True)
Else
EgtPHOTOLib.MainData.SetPrinterVisibility(False)
End If
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
End Sub
Private Sub ManageSingleIstance()
+30 -2
View File
@@ -115,6 +115,9 @@
<Reference Include="AxInterop.FXLib">
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
</Reference>
<Reference Include="EgtPHOTOLib">
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.3.4.5, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
@@ -143,6 +146,10 @@
</Reference>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EgtProg\Dll32\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
@@ -210,6 +217,15 @@
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
</Compile>
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
</Compile>
<Compile Include="Project\OmagPhotoWD.xaml.vb">
<DependentUpon>OmagPhotoWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\ScrapsWD.xaml.vb">
<DependentUpon>ScrapsWD.xaml</DependentUpon>
</Compile>
<Compile Include="Project\StartLauncheWD.xaml.vb">
<DependentUpon>StartLauncheWD.xaml</DependentUpon>
</Compile>
@@ -460,6 +476,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\AddToDataBaseUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\OmagPhotoWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\ScrapsWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Project\StartLauncheWD.xaml">
</Page>
<Page Include="Project\CicloStartWD.xaml">
@@ -1263,10 +1291,10 @@
<Resource Include="Resources\NewIcons\START-WJ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli.png" />
<Resource Include="Resources\ImportPageListBoxImages\4.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
<Resource Include="Resources\ImportPageListBoxImages\5.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
-2
View File
@@ -218,8 +218,6 @@
<!--Machinig-->
<BitmapImage x:Key="Allunga-AccorciaImg" UriSource="Resources/NewIcons/Allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="PonticelliWJImg" UriSource="Resources/NewIcons/Ponticelli.png"></BitmapImage>
<BitmapImage x:Key="PonticelliDeleteWJImg" UriSource="Resources/NewIcons/Ponticelli_delete.png"></BitmapImage>
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
+95
View File
@@ -0,0 +1,95 @@
<UserControl x:Class="AddToDataBaseUC"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<!--Nome BLOCCO-->
<TextBlock Name="BlockTxBl" Grid.Column="1" Grid.Row="1" Text="Name block"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="BlockTxBx" Grid.Column="3" Grid.Row="1"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--Numero ID-->
<TextBlock Name="NbrIdTxBl" Grid.Column="1" Grid.Row="3" Text="ID"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="NbrIdTxBx" Grid.Column="3" Grid.Row="3"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--STATE-->
<TextBlock Name="StateTxBl" Grid.Column="1" Grid.Row="5" Text="State"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<ComboBox Name="StateCmBx" Grid.Column="3" Grid.Row="5" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--PROJECT-->
<TextBlock Name="ProjectNameTxBl" Grid.Column="1" Grid.Row="7" Text="Project"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ProjectTxBx" Grid.Column="3" Grid.Row="7"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--MATERIAL-->
<TextBlock Name="MatTxBl" Grid.Column="1" Grid.Row="9" Text="Mat"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="MatTxBx" Grid.Column="3" Grid.Row="9"
Style="{DynamicResource OmagCut_KeyboardTextBox}" IsEnabled="False"/>
<!--THICKNESS-->
<TextBlock Name="ThicknessTxBl" Grid.Column="1" Grid.Row="11" Text="Thickness"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ThicknessTxBx" Grid.Column="3" Grid.Row="11"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<!--WAREHOUSE-->
<TextBlock Name="WarehouseTxBl" Grid.Column="1" Grid.Row="13" Text="Warehouse position"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="WarehouseTxBx" Grid.Column="3" Grid.Row="13"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
<!--CANCEL-->
<Button Name="CacelBtn" Grid.Column="1" Grid.Row="15" Content="Delete"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--ADD-->
<Button Name="AddBtn" Grid.Column="3" Grid.Row="15" Content="Add"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--PRINT-->
<Button Name="PrintBtn" Grid.Column="1" Grid.Row="17" Content="Print"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Border>
</UserControl>
+121
View File
@@ -0,0 +1,121 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class AddToDataBaseUC
Private m_OmagPhotoWD As OmagPhotoWD
#Region "PROPERTY"
Private Sub BlockTxBx_EgtClosed(sender As Object, e As EventArgs) Handles BlockTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock = BlockTxBx.Text
' devo riasseganre il valore dell'indice
NbrIdTxBx.Text = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID
EnableButtons()
End Sub
Private Sub NbrIdTxBx_EgtClosed(sender As Object, e As EventArgs) Handles NbrIdTxBx.EgtClosed
' assegno il dato alla classe inizializzata nella libreria
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNbrID = NbrIdTxBx.Text
EnableButtons()
End Sub
Private Sub StateCmBx_Changed() Handles StateCmBx.SelectionChanged
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.State = StateCmBx.SelectedIndex
EnableButtons()
End Sub
Private Sub ProjectTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ProjectTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.ProjectAssignedTo = ProjectTxBx.Text
EnableButtons()
End Sub
Private Sub ThicknessTxBx_EgtClosed(sender As Object, e As EventArgs) Handles ThicknessTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Thickness = ThicknessTxBx.Text
EnableButtons()
End Sub
Private Sub WarehouseTxBx_EgtClosed(sender As Object, e As EventArgs) Handles WarehouseTxBx.EgtClosed
EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.WarehousePosition = WarehouseTxBl.Text
EnableButtons()
End Sub
#End Region ' Property
Sub New(LocalOmagPhotoWD As OmagPhotoWD)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_OmagPhotoWD = LocalOmagPhotoWD
End Sub
' dopo la crezione della pagina imposto lo stato dei pulsanti
Private Sub PostLoaded() Handles Me.Loaded
If EgtPHOTOLib.MainData.bEnableTextId Then
BlockTxBx.Visibility = Visibility.Collapsed
BlockTxBl.Visibility = Visibility.Collapsed
Else
NbrIdTxBx.IsEnabled = False
End If
PrintBtn.IsEnabled = EgtPHOTOLib.MainData.bEnablePrinter
EnableButtons()
End Sub
#Region "COMMAND"
Private Sub CancelBtn_Click() Handles CacelBtn.Click
' se è stata inserita nel DB allora devo rimuoverla ed esco dalla pagina
EgtPHOTOLib.refOptionPanelVM.Delete()
' notifico che il grezzo è stato rimosso
OmagPhotoWD.m_IsDeleted = True
' notifico che il grezzo non è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = False
' elimino l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = ""
' esco dalla pagina
m_OmagPhotoWD.Close()
End Sub
Private Sub AddBtn_Click() Handles AddBtn.Click
' se non sono validi i campi allora attendo
If Not EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled Then Return
' modalità di funzionamento della libreria: ProjectSlabVM.ProjectModeOpt.NEWSLAB
EgtPHOTOLib.PhotoMap.refOptionPanelVM.Save()
' notifico che il grezzo è stato aggiunto al DB delle lastre
OmagPhotoWD.m_IsAdded = True
' salvo l'identificativo usato nel database del grezzo appena inserito
OmagPhotoWD.m_sDtBsId = EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.Id
' salvo il nome del blocco che è stato utilizzato
If Not EgtPHOTOLib.MainData.bEnableTextId Then
WritePrivateProfileString(S_SCRAPS, K_LASTBLOCK, EgtPHOTOLib.PhotoMap.refOptionPanelVM.SelSlab.sNameBlock, m_OmagPhotoWD.m_MainWindow.GetIniFile())
End If
' aggiorno il testo del messaggio "Add" "Save"
AddBtn.Content = "Save"
' notifico che da ora la lastra inserita è in modalità di modifica (non salvo la lastra come nuova, ma la sovrascrivo come in modifica)
EgtPHOTOLib.PhotoMap.refProjectVM.SetSelProjectMode(ProjectSlabVM.ProjectModeOpt.DETAIL)
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.SetOrigValues()
' notifico che la lastra è in modifica da questo programma
EgtPHOTOLib.PhotoMap.refProjectVM.SelSlab.IsSelected = EgtPHOTOLib.MainData.nKey
EgtPHOTOLib.PhotoMap.refOptionPanelVM.IsSelected()
End Sub
Private Sub PrintBtn_Click() Handles PrintBtn.Click
EgtPHOTOLib.PhotoMap.refOptionPanelVM.PrintLabel()
End Sub
#End Region ' Command
#Region "METHODS"
Private Sub EnableButtons()
AddBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
' se la stampante non è abilitata allora non permetto assolutamente di abilitare il comando
If EgtPHOTOLib.MainData.bEnablePrinter Then
PrintBtn.IsEnabled = EgtPHOTOLib.PhotoMap.refOptionPanelVM.Ok_IsEnabled
End If
End Sub
#End Region ' Methods
End Class
+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 -2
View File
@@ -256,8 +256,6 @@ Public Class ProjectMgrUC
ResetAllSplitCurv()
' cancello tutti i punti di inizio (Waterjet)
ResetAllStartCurv()
' cancello tutti i ponticelli disegnati
ResetAllBRidges()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
@@ -494,6 +492,20 @@ Public Class ProjectMgrUC
End If
'------------------- 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
Else
' Verifico non sia già stato trasmesso
@@ -665,6 +677,32 @@ Public Class ProjectMgrUC
#End If
End Sub
' aggiorno la lista dei grezzi/sfridi
Public Sub UpDateScrapList(ByRef NewScrapsList As List(Of Scrap))
If IsNothing(NewScrapsList) Then
NewScrapsList = New List(Of Scrap)
Else
NewScrapsList.Clear()
End If
' procedo all'aggiornamento della lista degli sfridi
Dim CurrRawId As Integer = EgtGetFirstRawPart()
Dim IsNewScraps As Integer = 0
Dim nCountScrap As Integer = 1
While CurrRawId <> GDB_ID.NULL
If EgtGetInfo(CurrRawId, K_ISNEWSCRAPS, IsNewScraps) Then
If IsNewScraps = 1 Or IsNewScraps = 2 Then
' deve essere aggiunto nel DB delle lastre come nuovo grezzo (l'indice è utilizzato per definire il nome della lastra)
NewScrapsList.Add(New Scrap(CurrRawId, "Scrap_" & nCountScrap.ToString, IsNewScraps))
nCountScrap += 1
' è già stato aggiunto al DB delle lastre come nuovo grezzo
Else
' non è stato definito come nuovo grezzo
End If
End If
CurrRawId = EgtGetNextRawPart(CurrRawId)
End While
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
@@ -938,3 +976,60 @@ Public Class ProjectMgrUC
End Sub
End Class
Public Class Scrap
Private m_iPictureID As Integer
Private m_sName As String
Private m_IdRaw As Integer
Private m_nState As Integer
Public Property PictureID() As Integer
Get
Return m_iPictureID
End Get
Set(value As Integer)
m_iPictureID = value
End Set
End Property
Public Property Name() As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Public ReadOnly Property IdRaw() As Integer
Get
Return m_IdRaw
End Get
End Property
Public ReadOnly Property nState As Integer
Get
Return m_nState
End Get
End Property
Public ReadOnly Property PictureString() As String
Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
End Get
End Property
Sub New(IdScrap As Integer, NameScrap As String, State As Integer)
m_IdRaw = IdScrap
m_sName = NameScrap
m_nState = State
' immagine del grezzo
If m_nState = 2 Then
m_iPictureID = 5
Else
m_iPictureID = 4
End If
End Sub
End Class
+50
View File
@@ -0,0 +1,50 @@
<Window x:Class="ScrapsWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="Scraps" Height="482.6" Width="226.6" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True" Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+186
View File
@@ -0,0 +1,186 @@
Imports EgtUILib
Imports EgtPHOTOLib
Imports System.IO
Public Class ScrapsWD
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_refProjectMgrUC As ProjectMgrUC
Private m_ScrapList As New List(Of Scrap)
Private m_CurrScrapId As Integer = GDB_ID.NULL
Private m_CurrScrapState As Integer = 2
Private m_sDatabaseId As String = ""
Private Sub Initalized()
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' inserisco il titolo della pagina aperta
TitleTxBl.Content = "Scraps List"
ScrapsListBox.ItemsSource = m_ScrapList
' definzione posizione finetra
Me.Left = 25
Me.Top = 25
End Sub
Public Sub New(Owner As Window, LocalProjectMgrUC As ProjectMgrUC, MyScrapList As List(Of Scrap))
Me.Owner = Owner
InitializeComponent()
m_ScrapList = MyScrapList
m_refProjectMgrUC = LocalProjectMgrUC
Initalized()
End Sub
' visualizzo la fase del pezzo selezionato
Private Sub ScrapListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ScrapsListBox.PreviewMouseUp
Dim vItems As Scrap = ScrapsListBox.SelectedItems(0)
' elimino l'utimo selzione
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' ricerco il grezzo associato a questo Id
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If nRawId = vItems.IdRaw Then
m_CurrScrapId = nRawId
m_CurrScrapState = vItems.nState
If m_CurrScrapState = 2 Then
EgtGetInfo(nRawId, K_DATABASEID, m_sDatabaseId)
Else
m_sDatabaseId = String.Empty
End If
Dim nCurrRawPhase As Integer = 0
' recupero la fase del grezzo corrente
EgtGetInfo(nRawId, "Ph", nCurrRawPhase)
If nCurrRawPhase <> 0 Then
' evidenzio lo sfrido selezionato all'interno della fase
EgtSetCurrPhase(nCurrRawPhase)
EgtSetMark(m_CurrScrapId)
EgtSelectObj(m_CurrScrapId)
EgtDraw()
Return
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click
If m_CurrScrapId = GDB_ID.NULL Then Return
' creo una copia dell'immagine attuale (fotocamera 1)
Dim sImage As String = String.Empty
Dim sInfo As String = String.Empty
GetPrivateProfileString(S_CAMERA, K_CAM_IMAGE, "", sImage, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_CAMERA, K_CAM_INFO, "", sInfo, m_MainWindow.GetIniFile())
' recupero dalla libreria il percoso del database
Dim sPhotoDir As String = String.Empty
EgtPHOTOLib.GetPhotoDir(sPhotoDir)
' recupero l'ora corrente
Dim sDate As String = Date.Now.ToString
sDate = sDate.Replace("/", "_")
sDate = sDate.Replace(" ", "_")
sDate = sDate.Replace(":", "_")
Dim sNewPath As String = sPhotoDir & "\Scrap_" & sDate
Try
File.Copy(sImage, sNewPath & ".jpg", False)
File.Copy(sInfo, sNewPath & ".txt", False)
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
' se non esiste la classe StatusBar allora provo ad inizializzarla...
If IsNothing(EgtWPFLib5.LibMap.refStatusBarVM) Then
Dim objStatusBarVM As New EgtWPFLib5.StatusBarVM
End If
' salvo il contesto corrente del programma
Dim nCurrentContetxt As Integer = EgtGetCurrentContext()
' costruisco l'elenco ordinato dei punti che reppresentano il contorno del grezzo da salvare
Dim ContornScrapList As New List(Of Point3d)
Dim RefId As New Frame3d
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawSolid")
EgtGetTextureFrame(nRawSolidId, nRawSolidId, RefId)
Dim nCurveCompoId As Integer = EgtGetFirstNameInGroup(m_CurrScrapId, "RawOutline")
Dim dStart As Double = 0
Dim dEnd As Double = 0
EgtCurveDomain(nCurveCompoId, dStart, dEnd)
Dim ptCurrPoint As Point3d
For dU As Integer = dStart To dEnd - 1
EgtAtParamPoint(nCurveCompoId, dU, m_CurrScrapId, ptCurrPoint)
ptCurrPoint.z = 0
ptCurrPoint.ToLoc(RefId)
ContornScrapList.Add(ptCurrPoint)
Next
MainData.SetPreviousContext(nCurrentContetxt)
'If Not IsNothing(MainData.ContextSTONELib) Or MainData.ContextSTONELib <> 0 Then
'If MainData.ContextSTONELib <> 0 Then
' EgtSetCurrentContext(MainData.ContextSTONELib)
'End If
' inizializzo PojectSlabV pechè si occupa di inizializzare le pagine Detail e Option
Dim MyProjectSlab As New EgtPHOTOLib.ProjectSlabV
' ACCELERARE il processo di creazione di questo oggetto!
MyProjectSlab.DataContext = New EgtPHOTOLib.ProjectSlabVM
' per ogni creazione della nuova pagina viene creata una nuova scena, ma non viene eliminata
Dim refProjectVMSceneContext As Integer = EgtGetCurrentContext()
' apro la finestra OmagPHOTO (passo il nome del file come copia dell'originale)
If ContornScrapList.Count > 2 Then
Dim MyOmagPhotoWD As New OmagPhotoWD(sNewPath & ".jpg", ContornScrapList, m_MainWindow, m_CurrScrapState, m_sDatabaseId)
OmagPhotoWD.m_IsAdded = False
OmagPhotoWD.m_sDtBsId = String.Empty
OmagPhotoWD.m_IsDeleted = False
MyOmagPhotoWD.ShowDialog()
Else
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Error loading contour scrap")
End If
' ripristino il contesto corrente dell'immagine
EgtSetCurrentContext(EgtPHOTOLib.MainData.PreviousContext)
' se l'inserimento è andatoa buon fine allora procedo a notificarlo
If OmagPhotoWD.m_IsAdded AndAlso Not String.IsNullOrEmpty(OmagPhotoWD.m_sDtBsId) Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 2)
EgtSetInfo(m_CurrScrapId, K_DATABASEID, OmagPhotoWD.m_sDtBsId)
Else
' se è stato eliminato dal DB allora aggiorno la lista dei grezzi
If OmagPhotoWD.m_IsDeleted Then
EgtSetInfo(m_CurrScrapId, K_ISNEWSCRAPS, 1)
EgtRemoveInfo(m_CurrScrapId, K_DATABASEID)
End If
Try
File.Delete(sNewPath & ".jpg")
File.Delete(sNewPath & ".txt")
Catch ex As Exception
EgtOutLog(ex.Message.ToString)
End Try
End If
'----------------INIZIO ELIMINAZIONE contesti generati da OmagPHOTOLib per la visualizzazione delle Texture
EgtDeleteContext(EgtPHOTOLib.MainData.ContextSTONELib)
EgtDeleteContext(refProjectVMSceneContext)
'---------------- FINE ELIMINAZIONE contesti
' aggiorno la lista degli scrap
m_refProjectMgrUC.UpDateScrapList(m_ScrapList)
ScrapsListBox.ItemsSource = m_ScrapList
ScrapsListBox.Items.Refresh()
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click
' resetto eventuali errori mostrati nella pagina
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
' deseleziono l'oggetto corrente
EgtResetMark(m_CurrScrapId)
EgtDeselectObj(m_CurrScrapId)
' reimposto la fase iniziale
EgtSetCurrPhase(1)
EgtDraw()
Me.Close()
End Sub
End Class
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.

Before

Width:  |  Height:  |  Size: 742 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB