Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 02a8e3a274 | |||
| 00bbe3ad70 | |||
| 4ca3b4ee47 | |||
| 6b6031379b | |||
| 7e96fb2385 | |||
| 7ee4a2e552 | |||
| 105a12c497 | |||
| e0f380ed1d | |||
| a568c614fb | |||
| 6dc5fe5a12 | |||
| a1db5945df | |||
| fba8b377f9 | |||
| 401b171c4e | |||
| 3285d72817 | |||
| 17229ab9bc | |||
| c3abca3cee | |||
| 2e0f2eab1b | |||
| 9c60ef020f | |||
| 58c62ebd5c | |||
| ab525c7431 | |||
| 613b9fa725 | |||
| ca6a468cda | |||
| 24ddd7d245 | |||
| f9fd0f0168 | |||
| eac7b0999a | |||
| a464e0dc3b | |||
| 401af44bb5 | |||
| 1599515d58 | |||
| 0be1695246 | |||
| a79725783f | |||
| f13a51e8a1 | |||
| bb650afe9c | |||
| 1d87ac5c47 | |||
| fc3053df66 | |||
| 588ef08b17 | |||
| 1605f81090 | |||
| ca0210cf09 | |||
| 622912dec3 | |||
| 5ff39c9d1c | |||
| 60a666c1c1 | |||
| 41903872b1 | |||
| beb3ce841b | |||
| 5b3e73290c | |||
| 854519b706 | |||
| d8179b47ee |
@@ -133,10 +133,14 @@
|
||||
</Button>
|
||||
|
||||
|
||||
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
||||
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -155,9 +159,11 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
</Grid>
|
||||
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
|
||||
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+271
-40
@@ -11,8 +11,12 @@ Public Class MoveRawPartPage
|
||||
Private m_nAuxTabId As Integer = GDB_ID.NULL
|
||||
' Fase corrente
|
||||
Private m_nCurrPhase As Integer = 0
|
||||
' Disposizione corrente
|
||||
Private m_nCurrDisposition As Integer = GDB_ID.NULL
|
||||
' Premuto Prev
|
||||
Private m_bPrev As Boolean = False
|
||||
' Pemuto Next
|
||||
Private m_bToNext As Boolean = False
|
||||
' Dati movimento
|
||||
Private m_dStep As Double = 0
|
||||
Private m_dRotation As Double = 0
|
||||
@@ -35,12 +39,15 @@ 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
|
||||
@@ -57,40 +64,42 @@ Public Class MoveRawPartPage
|
||||
m_SplitPage.GetEnabledCuts(Cuts)
|
||||
' Fase precedente
|
||||
Dim nPrevPhase As Integer = EgtGetCurrPhase()
|
||||
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
|
||||
Dim vNewRaws As New List(Of Integer)
|
||||
If Not m_SplitPage.m_bShow Then
|
||||
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
|
||||
Dim vNewRaws As New List(Of Integer)
|
||||
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
|
||||
Else
|
||||
EgtSetCurrPhase(nPrevPhase + 1)
|
||||
HideAllMachinings()
|
||||
End If
|
||||
m_nCurrPhase = EgtGetCurrPhase()
|
||||
|
||||
'---------------------------- SCRAPS ----------------------------
|
||||
' gestione visualizzazione del comando "Scraps"
|
||||
Dim ScrapsVisibility As Visibility = Visibility.Collapsed
|
||||
' verifico se licenza abilitat: m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SCRAPS)
|
||||
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
' leggo il direttorio in cui cercare il database delle lastre
|
||||
Dim PhotDir As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, m_MainWindow.GetIniFile())
|
||||
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
|
||||
If System.IO.File.Exists(PhotDir.Trim & "\OmagPHOTODb.sqlite") Then
|
||||
ScrapsVisibility = Visibility.Visible
|
||||
End If
|
||||
End If
|
||||
' verifico che siano stati generati dei nuovi grezzi
|
||||
If vNewRaws.Count = 0 Then
|
||||
ScrapsVisibility = Visibility.Collapsed
|
||||
End If
|
||||
' aggiorno la grafica
|
||||
ScrapsBtn.Visibility = ScrapsVisibility
|
||||
'---------------------------- SCRAPS ----------------------------
|
||||
|
||||
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
||||
If m_SplitPage.m_bOnAuxTab Then
|
||||
m_nAuxTabId = EgtGetTableId(AUX_TAB)
|
||||
' Visualizzo tavolo ausiliario
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If bOldEnMod Then EgtDisableModified()
|
||||
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
' Se definizione movimenti
|
||||
If Not m_SplitPage.m_bShow Then
|
||||
' Area tavolo ausiliario
|
||||
Dim b3AuxTab As New BBox3d
|
||||
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
|
||||
' Area tavolo principale
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea(1, b3Tab)
|
||||
' Imposto offset su tavolo principale per includere anche il secondario
|
||||
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
|
||||
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
|
||||
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
|
||||
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
|
||||
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
' altrimenti, aggiorno visualizzazione
|
||||
' assegnazione delle info tavola ausiliaria alla dispozione corrente
|
||||
SetAuxTabInCurrDisposition()
|
||||
' altrimenti, aggiorno visualizzazione
|
||||
Else
|
||||
EgtDraw()
|
||||
End If
|
||||
@@ -128,14 +137,14 @@ Public Class MoveRawPartPage
|
||||
' Distanza iniziale
|
||||
m_dCurrDist = 0
|
||||
End If
|
||||
' Non dovrebbe mai accadere, ma inizializzo con default
|
||||
' Non dovrebbe mai accadere, ma inizializzo con default
|
||||
Else
|
||||
m_vtDir = Vector3d.Y_AX()
|
||||
m_ptMid = Point3d.ORIG()
|
||||
m_dOrigDist = 0
|
||||
m_dCurrDist = 0
|
||||
End If
|
||||
' Altrimenti movimento con ventose
|
||||
' Altrimenti movimento con ventose
|
||||
Else
|
||||
m_bRemovedRaw = False
|
||||
m_bRawWithCups = False
|
||||
@@ -149,6 +158,9 @@ Public Class MoveRawPartPage
|
||||
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||
End If
|
||||
End If
|
||||
|
||||
' aggiorno il messaggio del comando per gestire gli sfridi
|
||||
VerifyIsNewScrap(m_CurrRawOnVacuum)
|
||||
' Aggiorno interfaccia per taglio perpendicolare
|
||||
If m_bByHand Then
|
||||
UpBtn.Visibility = Windows.Visibility.Visible
|
||||
@@ -164,8 +176,10 @@ Public Class MoveRawPartPage
|
||||
TopRBtn.Visibility = Windows.Visibility.Hidden
|
||||
BottomLBtn.Visibility = Windows.Visibility.Hidden
|
||||
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
||||
PauseBtn.Visibility = Windows.Visibility.Hidden
|
||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||
' altrimenti per movimento con ventose
|
||||
ScrapsBtn.Visibility = Windows.Visibility.Visible
|
||||
' altrimenti per movimento con ventose
|
||||
ElseIf Not m_SplitPage.m_bOnAuxTab Then
|
||||
UpBtn.Visibility = Windows.Visibility.Visible
|
||||
LeftBtn.Visibility = Windows.Visibility.Visible
|
||||
@@ -180,8 +194,10 @@ Public Class MoveRawPartPage
|
||||
TopRBtn.Visibility = Windows.Visibility.Hidden
|
||||
BottomLBtn.Visibility = Windows.Visibility.Hidden
|
||||
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
||||
PauseBtn.Visibility = Windows.Visibility.Hidden
|
||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||
' altrimenti per movimento finale dei pezzi
|
||||
ScrapsBtn.Visibility = Windows.Visibility.Visible
|
||||
' altrimenti per movimento finale dei pezzi
|
||||
Else
|
||||
UpBtn.Visibility = Windows.Visibility.Hidden
|
||||
LeftBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -196,14 +212,48 @@ Public Class MoveRawPartPage
|
||||
TopRBtn.Visibility = Windows.Visibility.Visible
|
||||
BottomLBtn.Visibility = Windows.Visibility.Visible
|
||||
BottomRBtn.Visibility = Windows.Visibility.Visible
|
||||
PauseBtn.Visibility = Windows.Visibility.Visible
|
||||
ResetBtn.Visibility = Windows.Visibility.Visible
|
||||
ScrapsBtn.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
' salvo l'idice della fase corrente
|
||||
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
' Abilitazione bottone modifica
|
||||
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
|
||||
' gestione abilitazione altri bottoni
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
Private Sub SetAuxTabInCurrDisposition()
|
||||
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
||||
m_nAuxTabId = EgtGetTableId(AUX_TAB)
|
||||
' Visualizzo tavolo ausiliario
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If bOldEnMod Then EgtDisableModified()
|
||||
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
' Se definizione movimenti
|
||||
If Not m_SplitPage.m_bShow Then
|
||||
' Area tavolo ausiliario
|
||||
Dim b3AuxTab As New BBox3d
|
||||
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
|
||||
' Area tavolo principale
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea(1, b3Tab)
|
||||
' Imposto offset su tavolo principale per includere anche il secondario
|
||||
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
|
||||
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
|
||||
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
|
||||
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
|
||||
EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
|
||||
' verifico che siano state salvate correttamente le info della tavola di scarico
|
||||
EgtSaveFile("c:\EgtData\OmagCUT\Temp\AuxTab.nge", NGE.BIN)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||
' Verifico di essere il gestore attivo
|
||||
If Not m_bActive Then Return
|
||||
@@ -232,17 +282,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
|
||||
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
|
||||
If VerifyCollisionWithOtherRawPart(nId) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(nId, GDB_ST.SEL)
|
||||
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||
Else
|
||||
' Se con ventose, le nascondo
|
||||
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
' 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
|
||||
|
||||
@@ -316,6 +368,8 @@ 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)
|
||||
@@ -347,6 +401,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
|
||||
@@ -679,6 +754,29 @@ Public Class MoveRawPartPage
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub ScrapsBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ScrapsBtn.Click
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
' verifico che il grezzo non contenga dei pezzi (altrimenti non risulta selezionabile)
|
||||
Dim nPartInRaw As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||
If nPartInRaw = GDB_ID.NULL Then
|
||||
If Not VerifyIsNewScrap(nRawId) Then
|
||||
EgtSetInfo(nRawId, K_ISNEWSCRAPS, "1")
|
||||
Else
|
||||
EgtRemoveInfo(nRawId, K_ISNEWSCRAPS)
|
||||
End If
|
||||
' aggiorno il contenuto del bottone
|
||||
VerifyIsNewScrap(nRawId)
|
||||
Else
|
||||
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
|
||||
m_CurrProjPage.ClearMessage()
|
||||
m_CurrProjPage.SetErrorMessage("Part inside raw!")
|
||||
End If
|
||||
' passo al grezzo succesivo (NON dovrebbero esserci altri grezzi selezionabili contemporaneamente!)
|
||||
nRawId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||
Dim dStep As Double
|
||||
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
||||
@@ -763,6 +861,16 @@ Public Class MoveRawPartPage
|
||||
Next
|
||||
If Not bOkRotate Then Return
|
||||
Else
|
||||
' sposto il pezzo in centro tavola → perchè tutti i movimenti sono fatti ruotando il pezzo in centro tavola!
|
||||
Dim b3Area As New BBox3d
|
||||
EgtGetTableArea(1, b3Area)
|
||||
Dim b3RawTemp As New BBox3d
|
||||
EgtGetRawPartBBox(nRawId, b3RawTemp)
|
||||
' ricavo il riferimento dell'angolo in basso a sinstra del grezzo rispetto alla tavola
|
||||
Dim ptCorner As Point3d = New Point3d(b3Area.DimX / 2, b3Area.DimY / 2, 0) - New Vector3d(b3RawTemp.DimX / 2, b3RawTemp.DimY / 2, 0)
|
||||
' sposto il pezzo in questa posizione
|
||||
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
|
||||
' riprovo il movimento
|
||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
|
||||
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
|
||||
' riposiziono il pezzo come era prima
|
||||
@@ -877,6 +985,62 @@ Public Class MoveRawPartPage
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
||||
If m_RawMoveDataList.Count = 0 Then Return
|
||||
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
|
||||
Dim Index As Integer = 0
|
||||
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
|
||||
If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
|
||||
m_RawMoveDataList.RemoveAt(Index)
|
||||
End If
|
||||
Next
|
||||
' verifico che la lista non sia vuota
|
||||
If m_RawMoveDataList.Count = 0 Then Return
|
||||
|
||||
' recupero disposizione fase corrente
|
||||
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
|
||||
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||
|
||||
' Creo nuova fase
|
||||
Dim nNewPhase As Integer = EgtAddPhase()
|
||||
|
||||
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
|
||||
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
|
||||
Dim bKeepRawPart As Boolean = True
|
||||
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
|
||||
If nRawId = RawOnAuxTabData.m_nId Then
|
||||
bKeepRawPart = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
|
||||
End If
|
||||
' passo al successivo grezzo
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
|
||||
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
||||
SetPause(nCurrDisposition)
|
||||
m_nCurrDisposition = nCurrDisposition
|
||||
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
|
||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
EgtSetCurrPhase(nNewPhase)
|
||||
SetAuxTabInCurrDisposition()
|
||||
' ripulisco la lista degli spostamenti
|
||||
m_RawMoveDataList.Clear()
|
||||
' aggiorno la fase corrente
|
||||
m_nCurrPhase = EgtGetCurrPhase()
|
||||
End Sub
|
||||
|
||||
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
|
||||
' Recupero il primo grezzo selezionato
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
@@ -912,7 +1076,30 @@ Public Class MoveRawPartPage
|
||||
EgtDeselectAll()
|
||||
' Torno alla fase precedente
|
||||
m_bPrev = True
|
||||
' Passo alla pagina delle spezzature
|
||||
' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
|
||||
|
||||
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
|
||||
' verifico se la fasa precedente è di tipo scarico
|
||||
If IsDispUnloadOnAuxTab(nPrevDispId) Then
|
||||
EgtSetCurrPhase(m_nCurrPhase - 1)
|
||||
m_nCurrDisposition = nPrevDispId
|
||||
m_nCurrPhase -= 1
|
||||
m_bPrev = False
|
||||
m_SplitPage.m_bShow = True
|
||||
EgtDraw()
|
||||
Return
|
||||
End If
|
||||
|
||||
'If EgtGetOperationType(EgtGetPrevOperation(m_nCurrDisposition)) = MCH_OY.DISP AndAlso m_SplitPage.m_bOnAuxTab Then
|
||||
' EgtSetCurrPhase(m_nCurrPhase - 1)
|
||||
' m_nCurrDisposition = EgtGetPrevOperation(m_nCurrDisposition)
|
||||
' m_nCurrPhase -= 1
|
||||
' m_bPrev = False
|
||||
' m_SplitPage.m_bShow = True
|
||||
' EgtDraw()
|
||||
' Return
|
||||
'End If
|
||||
|
||||
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
|
||||
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_SplitPage)
|
||||
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Split
|
||||
@@ -928,6 +1115,19 @@ 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
|
||||
@@ -973,6 +1173,26 @@ Public Class MoveRawPartPage
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
||||
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer)
|
||||
' verifico se la fase precedente è uno scarico su tavola ausiliaria
|
||||
Dim bVal As Integer = 0
|
||||
EgtGetInfo(nCurrDispId, "Pat", bVal)
|
||||
Return bVal
|
||||
End Function
|
||||
|
||||
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
||||
Public Function GetNextDisposition(nCurrDisposId As Integer)
|
||||
Dim nDispId As Integer = nCurrDisposId
|
||||
While nDispId <> GDB_ID.NULL
|
||||
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
|
||||
Return nDispId
|
||||
End If
|
||||
nDispId = EgtGetNextOperation(nDispId)
|
||||
End While
|
||||
Return GDB_ID.NULL
|
||||
End Function
|
||||
|
||||
Private Sub EnableButtons()
|
||||
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
@@ -987,11 +1207,22 @@ Public Class MoveRawPartPage
|
||||
TopRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
BottomLBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
||||
If m_SplitPage.m_bShow Then
|
||||
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
||||
Else
|
||||
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||
' verifico che la fase corrente non sia vuota
|
||||
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
||||
EgtErase(nLastDispId)
|
||||
End If
|
||||
|
||||
' Se movimento con ventose
|
||||
If Not m_bByHand Then
|
||||
' nascondo le ventose
|
||||
@@ -1007,11 +1238,11 @@ Public Class MoveRawPartPage
|
||||
' imposto eventuale presenza rimozioni manuali
|
||||
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
|
||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
||||
SaveMovePartsOnAuxTable( nDispId, m_SplitPage.m_bOnAuxTab)
|
||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||
' Eseguo calcolo speciale dei movimenti
|
||||
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||
End If
|
||||
' se altrimenti movimento senza ventose perchè lama troppo grande
|
||||
' se altrimenti movimento senza ventose perchè lama troppo grande
|
||||
ElseIf GetVacuumType() > 0 Then
|
||||
' se non solo visualizzazione
|
||||
If Not m_SplitPage.m_bShow Then
|
||||
|
||||
@@ -1175,7 +1175,9 @@ Public Class NestPageUC
|
||||
m_ptPrev = ptCurr
|
||||
' Terminata esecuzione di drag
|
||||
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()
|
||||
End Sub
|
||||
|
||||
@@ -2389,6 +2391,10 @@ Public Class NestPageUC
|
||||
Dim dEraseArea As Double = 0
|
||||
nId = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
'' elimino eventuali ponticelli associati al pezzo: nella vilualizzazione il percorso di lavorazioni non si muove! in attesa di gestione
|
||||
'DeleteBridgeAssociated(nId)
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
' Recupero indice del successivo
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se abilitata cancellazione in ogni caso o pezzo non da Csv
|
||||
@@ -2434,6 +2440,47 @@ Public Class NestPageUC
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteBridgeAssociated(nMyId As Integer)
|
||||
' verifico se esistono dei ponticelli associati al pezzo indicato
|
||||
' recuoero il gruppo di lavorazione corrente
|
||||
Dim nIdCurrMachGroup As Integer = EgtGetCurrMachGroup()
|
||||
' creo il gruppo per i ponticelli
|
||||
Dim sNameGroup As String = BRIDGES
|
||||
Dim nIdBridgesGroup As Integer = EgtGetFirstNameInGroup(nIdCurrMachGroup, sNameGroup)
|
||||
If nIdBridgesGroup <> GDB_ID.NULL Then
|
||||
' carico la prima entità del gruppo BRIDGES
|
||||
Dim nIdBridgeLine As Integer = GDB_ID.NULL
|
||||
nIdBridgeLine = EgtGetFirstNameInGroup(nIdBridgesGroup, BRIDGELINE)
|
||||
' ciclo su tutte le entità
|
||||
While nIdBridgeLine <> GDB_ID.NULL
|
||||
Dim nNextBridgeLine As Integer = GDB_ID.NULL
|
||||
Dim nIdPart As Integer = GDB_ID.NULL
|
||||
If EgtGetInfo(nIdBridgeLine, "PartStart", nIdPart) Then
|
||||
If nIdPart = nMyId Then
|
||||
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
' il ponticello deve essere eliminato
|
||||
EgtErase(nIdBridgeLine)
|
||||
nIdBridgeLine = nNextBridgeLine
|
||||
' riparto dall'inizio del ciclo
|
||||
Continue While
|
||||
End If
|
||||
End If
|
||||
If EgtGetInfo(nIdBridgeLine, "PartEnd", nIdPart) Then
|
||||
If nIdPart = nMyId Then
|
||||
nNextBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
' il ponticello deve essere eliminato
|
||||
EgtErase(nIdBridgeLine)
|
||||
nIdBridgeLine = nNextBridgeLine
|
||||
' riparto dall'inizio del ciclo
|
||||
Continue While
|
||||
End If
|
||||
End If
|
||||
' il BridgeLine corrente non contiene riferimeti al pezzo da eliminare
|
||||
nIdBridgeLine = EgtGetNext(nIdBridgeLine)
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Numero dei pezzi in tavola
|
||||
|
||||
@@ -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)
|
||||
|
||||
+120
-35
@@ -7,6 +7,7 @@ Public Class SplitPageUC
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
||||
@@ -38,8 +39,6 @@ Public Class SplitPageUC
|
||||
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
|
||||
@@ -58,6 +57,8 @@ Public Class SplitPageUC
|
||||
Private m_bDragging As Boolean = False
|
||||
' Selected cut
|
||||
Private m_nSelected As Integer = GDB_ID.NULL
|
||||
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
|
||||
Private m_StartEndModifyOnIntCorner As Boolean = False
|
||||
|
||||
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
|
||||
PrevBtn.IsEnabled = False
|
||||
@@ -107,6 +108,8 @@ Public Class SplitPageUC
|
||||
m_bEnableOnAuxTab = Not m_bByHand AndAlso
|
||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso
|
||||
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
|
||||
' verifico se è abilitata la possibiltà di allungare i lati interni
|
||||
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
' Nascondo eventuali pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Nascondo eventuale contorno da foto
|
||||
@@ -237,24 +240,16 @@ Public Class SplitPageUC
|
||||
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 (EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE) AndAlso VerifySideIsAcceptable(nIdMy) Then
|
||||
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
|
||||
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||
End If
|
||||
' recupero il gruppo della lavorazione associata
|
||||
nIdParentPart = EgtGetParent(nIdParent)
|
||||
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
|
||||
If IsWaterJetting(nIdMy) Then
|
||||
' NON RECUPERO LA PREVIEW DELLA LAVORAZIONE → m_nIdSelectedWaterJet
|
||||
m_nIdSelectedSideWJ = nIdMy
|
||||
' 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)
|
||||
@@ -265,7 +260,9 @@ Public Class SplitPageUC
|
||||
If VerifyInterference(m_nIdBridge) Then
|
||||
m_CurrProjPage.ClearMessage()
|
||||
EgtSetInfo(m_nIdBridge, "PartStart", m_nIdSelectedPartWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, "EntStart", m_nIdSelectedSideWJ_Srt)
|
||||
EgtSetInfo(m_nIdBridge, "PartEnd", m_nIdSelectedPartWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, "EntEnd", m_nIdSelectedSideWJ_End)
|
||||
EgtSetInfo(m_nIdBridge, "Ph", EgtGetCurrPhase())
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
@@ -273,14 +270,12 @@ Public Class SplitPageUC
|
||||
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)
|
||||
@@ -367,6 +362,75 @@ Public Class SplitPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function VerifySideIsAcceptable(nMyId As Integer) As Boolean
|
||||
Dim dVal As Double = 0
|
||||
' verifico che l'entità selezionata non contenga questi parametri
|
||||
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE2, dVal) Then
|
||||
If dVal <> 0 Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
If EgtGetInfo(nMyId, INFO_SIDE_ANGLE, dVal) Then
|
||||
If dVal <> 0 Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
If EgtGetInfo(nMyId, INFO_ORIG_SIDE_ANGLE, dVal) Then
|
||||
If dVal <> 0 Then
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
' altrimenti l'entità è accettabile
|
||||
Return True
|
||||
End Function
|
||||
|
||||
' verifico che il lato selezionato appartenga ad una lavorazione di tipo Waterjet
|
||||
Private Function IsWaterJetting(nMyId As Integer) As Boolean
|
||||
' verifico che sul lato indicato sia impostato un taglio di tipo WaterJet
|
||||
Dim nMchId As Integer = GDB_ID.NULL
|
||||
For nInd As Integer = 0 To m_MachiningList.Count() - 1
|
||||
nMchId = m_MachiningList(nInd).m_nId
|
||||
Dim nMachiningType As Integer = EgtGetOperationType(m_MachiningList(nInd).m_nId)
|
||||
If nMachiningType = MCH_MY.WATERJETTING Then
|
||||
EgtSetCurrMachining(nMchId)
|
||||
Dim nIndex As Integer = 0
|
||||
Dim nIdSide As Integer = GDB_ID.NULL
|
||||
Dim nSub As Integer = GDB_ID.NULL
|
||||
While EgtGetMachiningGeometry(nIndex, nIdSide, nSub)
|
||||
If nIdSide = nMyId Then
|
||||
Return True
|
||||
End If
|
||||
nIndex += 1
|
||||
End While
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub RefreshMachList()
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
' cancello tutti gli indici di lavorazione presenti nel disegno
|
||||
Dim nNbrId As Integer = GDB_ID.NULL
|
||||
EgtErase(m_MachiningList(nI).m_nNbrId)
|
||||
EgtRemoveInfo(m_MachiningList(nI).m_nId, "NbrId")
|
||||
Next
|
||||
' Preparo la lista delle lavorazioni
|
||||
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
|
||||
' Aggiorno visualizzazione delle lavorazioni
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
' sistemo colore
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
' assegno nuova numerazione
|
||||
NumberDirectionMachining(nI)
|
||||
' conto il numero di tipi di lavorazioni
|
||||
CountMachiningType(m_MachiningList(nI), m_nCountSawing, m_nCountWaterjetting, m_nCountOtherMachining)
|
||||
Next
|
||||
' aggiorno grafica
|
||||
ShowMachiningList()
|
||||
' aggiorno la visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub DeselectWJBridgesPart()
|
||||
' se in fase di definzione di un ponticello lo elimino
|
||||
If m_nIdSelectedSideWJ_Srt <> GDB_ID.NULL And m_nIdSelectedSideWJ_End = GDB_ID.NULL And m_nIdBridge <> GDB_ID.NULL Then
|
||||
@@ -403,6 +467,8 @@ Public Class SplitPageUC
|
||||
OnMyMouseDownSceneBridges(sender, e, True, m_nIdSelectedSideWJ_Srt, m_nIdSelectedWaterJet_Srt, m_nIdSelectedPartWJ_Srt)
|
||||
Else
|
||||
OnMyMouseDownSceneBridges(sender, e, False, m_nIdSelectedSideWJ_End, m_nIdSelectedWaterJet_End, m_nIdSelectedPartWJ_End)
|
||||
' aggiorno la visualizzazione delle lavorazioni e la lista
|
||||
RefreshMachList()
|
||||
End If
|
||||
' se entrambi i pezzi sono stati definiti allora procedo alla deselezione
|
||||
If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then
|
||||
@@ -414,6 +480,8 @@ Public Class SplitPageUC
|
||||
' eliminazione dei ponticelli
|
||||
If BridgesDeleteWJBtn.IsChecked Then
|
||||
OnMyMouseDownSceneBridgesDelete(sender, e)
|
||||
' aggiorno la visualizzazione delle lavorazioni e la lista
|
||||
RefreshMachList()
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -865,6 +933,7 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' ERRORE: questo evento non è eseguito!
|
||||
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.Escape Then
|
||||
' se sono in fase di creazione di un ponticello interrompo
|
||||
@@ -1310,21 +1379,24 @@ Public Class SplitPageUC
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
|
||||
End If
|
||||
End If
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
|
||||
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
@@ -1478,21 +1550,24 @@ Public Class SplitPageUC
|
||||
Do
|
||||
' Se c'è limite alla lunghezza libera
|
||||
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
|
||||
' se abilitati i controlli sugli allungamenti dei lati interni
|
||||
If Not m_StartEndModifyOnIntCorner Then
|
||||
' Recupero sicurezza in corner interno
|
||||
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, m_MainWindow.GetMachIniFile()), 10 * EPS_SMALL)
|
||||
' Recupero lunghezza baffo del taglio
|
||||
Dim nPvId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||
Dim dDT As Double = 0
|
||||
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
|
||||
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
|
||||
End If
|
||||
End If
|
||||
|
||||
' Modifica della lavorazione
|
||||
EgtSetCurrMachining(nOperId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
|
||||
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
@@ -1664,6 +1739,16 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||
If m_bShow Then
|
||||
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
' recupero l'operazione successiva
|
||||
Dim NextDisposition As Integer = EgtGetNextOperation(CurrDisposition)
|
||||
If Not IsNothing(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage) Then
|
||||
' verifico che l'operazione sia una disposizione, altrimenti cerco
|
||||
NextDisposition = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.GetNextDisposition(NextDisposition)
|
||||
m_bOnAuxTab = m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage.IsDispUnloadOnAuxTab(NextDisposition)
|
||||
End If
|
||||
End If
|
||||
m_bToNext = True
|
||||
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
|
||||
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
|
||||
@@ -1895,7 +1980,7 @@ Public Class SplitPageUC
|
||||
m_bOnAuxTab = False
|
||||
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
|
||||
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
|
||||
' Altrimenti
|
||||
' Altrimenti
|
||||
Else
|
||||
' movimento standard sulla tavola (almeno un taglio disabilitato)
|
||||
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
|
||||
@@ -1906,7 +1991,7 @@ Public Class SplitPageUC
|
||||
' Deve essere permesso almeno un tipo di movimento
|
||||
NextBtn.IsEnabled = bStdTab Or m_bOnAuxTab Or bFinalMoveTab
|
||||
End If
|
||||
' altrimenti sto solo visualizzando
|
||||
' altrimenti sto solo visualizzando
|
||||
Else
|
||||
' movimento su tavola di scarico
|
||||
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And m_bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
|
||||
|
||||
@@ -343,6 +343,11 @@ Module ConstGen
|
||||
' Info in pezzo per facet di ultima superficie selezionata
|
||||
Public Const INFO_FRAME_FACET As String = "Facet"
|
||||
|
||||
' Nome del groppo dei ponticelli per lavorazioni Water
|
||||
Public Const BRIDGES As String = "Bridges"
|
||||
' Nome dell'entità ponticello contenuta nel gruppo BRIDGES
|
||||
Public Const BRIDGELINE As String = "BridgeLine"
|
||||
|
||||
' utensile per le lavorazioni manuali
|
||||
Public Const DUMMY_SAW As String = "DummySAW"
|
||||
' lavorazione manuale
|
||||
@@ -386,6 +391,9 @@ Module ConstGen
|
||||
Public Function COL_MCH_DRIPCUT() As Color3d
|
||||
Return New Color3d(255, 0, 165)
|
||||
End Function
|
||||
Public Function COL_MCH_ONENGRAVE_ANG() As Color3d
|
||||
Return New Color3d(255, 255, 100)
|
||||
End Function
|
||||
Public Function COL_MCH_DRIPFREE() As Color3d
|
||||
Return New Color3d(192, 0, 128)
|
||||
End Function
|
||||
|
||||
@@ -135,6 +135,7 @@ Module ConstIni
|
||||
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
|
||||
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
|
||||
Public Const K_ENGRAVESHORT As String = "EngraveShort"
|
||||
Public Const K_ENGRAVEANGLE As String = "EngraveAngle"
|
||||
Public Const K_DRIPOFFSET As String = "DripOffset"
|
||||
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
|
||||
Public Const K_DRIPDEPTH As String = "DripDepth"
|
||||
@@ -155,6 +156,7 @@ Module ConstIni
|
||||
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
|
||||
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
|
||||
Public Const K_DRAG_RETTANGLE As String = "DragRectangle"
|
||||
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
|
||||
|
||||
Public Const S_SPLIT As String = "Split"
|
||||
Public Const K_MOVE_LEV As String = "MoveLevel"
|
||||
@@ -224,6 +226,15 @@ Module ConstIni
|
||||
Public Const K_RAWROTATION As String = "Rotation"
|
||||
Public Const K_PERPENDICULAR As String = "Perpendicular"
|
||||
|
||||
Public Const S_SCRAPS As String = "Scraps"
|
||||
Public Const K_ENABLESCRAPS As String = "EnableScraps"
|
||||
Public Const K_PHOTODIR As String = "PhotoDir"
|
||||
Public Const K_LASTBLOCK As String = "LastBlock"
|
||||
Public Const K_TEMPLATE As String = "Template"
|
||||
Public Const K_DAT As String = "Dat"
|
||||
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
|
||||
Public Const K_ENABLE_PRINTER As String = "EnablePrinter"
|
||||
|
||||
Public Const S_REG As String = "Reg"
|
||||
Public Const K_REGSTEP As String = "Step"
|
||||
Public Const K_REGANGSTEP As String = "AngStep"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<ToggleButton Name="DimensionBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowToggleButton}" Visibility="Collapsed"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Name="VariablesGrd" Grid.Row="1" Grid.ColumnSpan="2"/>
|
||||
<Grid Name="VariablesGrd" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2"/>
|
||||
|
||||
<Grid Name="MessageGrid" Grid.Row="2" Grid.ColumnSpan="2">
|
||||
<TextBlock Name="MessageTxBl" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
@@ -1255,6 +1255,8 @@ Public Class DrawPageUC
|
||||
Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
If EngraveBtn.IsChecked Then
|
||||
' Aumento lo spazio disponibile per inserirei i parametri (tolgo spazio ad eventuali messaggi)
|
||||
Grid.SetRowSpan(VariablesGrd, 2)
|
||||
' Imposto modalità
|
||||
m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE
|
||||
If m_ActiveComponentPage = Pages.CompoDimension Then
|
||||
@@ -1286,6 +1288,7 @@ Public Class DrawPageUC
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(PartId, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
|
||||
Else
|
||||
Grid.SetRowSpan(VariablesGrd, 2)
|
||||
VariablesGrd.Children.Remove(m_SideAngleUC)
|
||||
If m_PrevSideAnglePage = Pages.CompoDimension Then
|
||||
VariablesGrd.Children.Add(m_CompoDimension)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.1" d:DesignWidth="255.9">
|
||||
d:DesignHeight="636.9" d:DesignWidth="255.9">
|
||||
|
||||
<!-- Definizione della Grid Laterale -->
|
||||
<Grid Name="VariablesCompoGrid" Grid.RowSpan="2">
|
||||
@@ -28,7 +28,7 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="5*"/>
|
||||
<!--<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>-->
|
||||
@@ -135,7 +135,7 @@
|
||||
Margin="0,0,0,-2"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4">
|
||||
<Grid Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="0.3*"/>
|
||||
@@ -143,10 +143,11 @@
|
||||
<ColumnDefinition Width="0.6*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.9*"/>
|
||||
<RowDefinition Height="0.9*"/>
|
||||
<RowDefinition Height="0.9*"/>
|
||||
<RowDefinition Height="0.9*"/>
|
||||
<RowDefinition Height="0.9*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="Parameter1TxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||
@@ -196,6 +197,16 @@
|
||||
Margin="0,0,0,-2"
|
||||
Width="85" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<TextBlock Name="Parameter5TxBl" Grid.Row="4" Grid.ColumnSpan="2"
|
||||
Text="Angolo"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
FontSize="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="Parameter5TxBx"
|
||||
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4"
|
||||
Margin="0,0,0,-2"
|
||||
Width="85" Height="30"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--<TextBlock Name="Parameter1TxBl" Grid.Row="11" Text="Offset"
|
||||
|
||||
@@ -36,6 +36,7 @@ Public Class SideAngleUC
|
||||
Friend m_dDripDepth As Double = 10
|
||||
Friend m_dEngraveDepth2 As Double = 15
|
||||
Friend m_dDripShort As Double = 0
|
||||
Friend m_dEngraveAngle As Double = 0
|
||||
|
||||
Private CurrEntityDrip As DripEntity
|
||||
|
||||
@@ -106,6 +107,9 @@ Public Class SideAngleUC
|
||||
' Accorciamento
|
||||
Parameter4TxBl.Visibility = Windows.Visibility.Hidden
|
||||
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
|
||||
' Angolo
|
||||
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
|
||||
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
|
||||
Else
|
||||
' se aggiungo gli ENGRAVE e i DRIP
|
||||
|
||||
@@ -117,10 +121,12 @@ Public Class SideAngleUC
|
||||
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
Next
|
||||
|
||||
' Offset
|
||||
Parameter1TxBl.Visibility = Windows.Visibility.Visible
|
||||
Parameter1TxBx.Visibility = Windows.Visibility.Visible
|
||||
Parameter2TxBl.Visibility = Windows.Visibility.Visible
|
||||
|
||||
' Offset2
|
||||
If m_Mode <> ModeOpt.ENGRAVE Then
|
||||
Parameter2TxBx.Visibility = Windows.Visibility.Visible
|
||||
@@ -131,6 +137,7 @@ Public Class SideAngleUC
|
||||
Parameter2aTxBx.Visibility = Windows.Visibility.Visible
|
||||
Parameter2bTxBx.Visibility = Windows.Visibility.Visible
|
||||
End If
|
||||
|
||||
' Affondamento
|
||||
Parameter3TxBl.Visibility = Windows.Visibility.Visible
|
||||
Parameter3TxBx.Visibility = Windows.Visibility.Visible
|
||||
@@ -146,6 +153,17 @@ Public Class SideAngleUC
|
||||
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
|
||||
' Angolo
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
' modifico il nome del messaggio
|
||||
Parameter5TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 9) ' Angolo
|
||||
Parameter5TxBl.Visibility = Windows.Visibility.Visible
|
||||
Parameter5TxBx.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
Parameter5TxBl.Visibility = Windows.Visibility.Hidden
|
||||
Parameter5TxBx.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
|
||||
@@ -167,11 +185,13 @@ Public Class SideAngleUC
|
||||
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, 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())
|
||||
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()
|
||||
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
|
||||
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
|
||||
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
|
||||
Parameter5TxBx.Text = LenToString(m_dEngraveAngle, 3)
|
||||
End If
|
||||
|
||||
' 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_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
|
||||
'WritePrivateProfileString( S_SIDES, K_ENGRAVESHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_SIDES, K_ENGRAVEANGLE, LenToString(m_dEngraveAngle, 3), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
|
||||
EgtDraw()
|
||||
@@ -862,6 +883,8 @@ Public Class SideAngleUC
|
||||
End While
|
||||
End If
|
||||
|
||||
Dim ListEngraveSideAng As New List(Of Integer)
|
||||
|
||||
If m_Mode = ModeOpt.DRIP Then
|
||||
' Esplodo nelle curve componenti
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
@@ -881,15 +904,70 @@ Public Class SideAngleUC
|
||||
End While
|
||||
Else
|
||||
' Assegno colore e attributi
|
||||
Dim nInd As Integer = 0
|
||||
nCrvId = EgtGetFirstInGroup(DripLayer)
|
||||
While nCrvId <> GDB_ID.NULL
|
||||
EgtSetColor(nCrvId, COL_MCH_DRIPCUT())
|
||||
'EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
||||
EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0"))
|
||||
If nInd = 0 Then
|
||||
' solo se m_dEngraveAngle > 0
|
||||
If Math.Abs(m_dEngraveAngle) > EPS_ANG_SMALL Then
|
||||
' salvo l'Id della curva che deve essere manipolato separatamente
|
||||
ListEngraveSideAng.Add(nCrvId)
|
||||
Else
|
||||
EgtRemoveInfo(nCrvId, INFO_SIDE_ANGLE)
|
||||
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
|
||||
End If
|
||||
Else
|
||||
If nInd = m_nEngrNbr2 Then
|
||||
nInd = -1
|
||||
End If
|
||||
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
|
||||
End If
|
||||
nInd = nInd + 1
|
||||
If nInd > m_nEngrNbr2 Then nInd = 0
|
||||
nCrvId = EgtGetNext(nCrvId)
|
||||
End While
|
||||
End If
|
||||
SplitJointedSideEngrave(ListEngraveSideAng)
|
||||
End Sub
|
||||
|
||||
Private Sub SplitJointedSideEngrave(ListEngraveSideAngId As List(Of Integer))
|
||||
For Each nCrvId As Integer In ListEngraveSideAngId
|
||||
' eventualmente separo il taglio inclinato
|
||||
Dim dUs, dUe As Double
|
||||
EgtCurveDomain(nCrvId, dUs, dUe)
|
||||
Dim dU As Double = dUs
|
||||
While dU < dUe ' + EPS_ZERO
|
||||
Dim ptCurr As Point3d
|
||||
EgtAtParamPoint(nCrvId, dU + 1, nCrvId, ptCurr)
|
||||
' separa la curva in questo punto
|
||||
Dim nNewCurvId As Integer = GDB_ID.NULL
|
||||
If dUe > 1 Then
|
||||
nNewCurvId = EgtSplitCurveAtPoint(nCrvId, ptCurr, GDB_RT.LOC)
|
||||
Else
|
||||
nNewCurvId = nCrvId
|
||||
End If
|
||||
EgtSetColor(nCrvId, COL_MCH_ONENGRAVE_ANG())
|
||||
EgtSetInfo(nCrvId, INFO_SIDE_ANGLE, m_dEngraveAngle)
|
||||
' recupero il vettore di estrusione della curva e la direzione della curva
|
||||
Dim vtAux As Vector3d
|
||||
EgtStartVector(nCrvId, vtAux)
|
||||
Dim vtExtrusion As Vector3d
|
||||
EgtCurveExtrusion(nCrvId, vtExtrusion)
|
||||
' ruoto il vetottore nella nuova direzione
|
||||
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
|
||||
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
|
||||
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
|
||||
Dim ExtendFactor As Double = New Vector3d(0, 0, 1) * vtExtrusion
|
||||
EgtModifyCurveThickness(nCrvId, -m_dDripDepth / ExtendFactor)
|
||||
If dUe = 1 Then Exit While
|
||||
nCrvId = nNewCurvId
|
||||
' aggiorno i valori del dominio della curva che rimane
|
||||
EgtCurveDomain(nCrvId, dUs, dUe)
|
||||
End While
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||
@@ -1336,6 +1414,15 @@ Public Class SideAngleUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Parameter5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter5TxBx.EgtClosed
|
||||
If m_Mode = ModeOpt.ENGRAVE Then
|
||||
' Recupero il valore
|
||||
StringToLen(Parameter5TxBx.Text, m_dEngraveAngle)
|
||||
' Creo le geometrie dei gocciolatoi
|
||||
RefreshSideAngleText()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ReLoadSideAnglePage()
|
||||
SideAngleUC_Loaded(Me, New RoutedEventArgs)
|
||||
End Sub
|
||||
|
||||
+158
-11
@@ -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>
|
||||
|
||||
+61
-2
@@ -2,6 +2,7 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
Imports EgtPHOTOLib
|
||||
Imports System.ComponentModel
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Threading
|
||||
@@ -323,8 +324,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2406, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2406, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2409, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2409, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
@@ -498,6 +499,64 @@ Class MainWindow
|
||||
AddHandler m_ProdLineTimer.Tick, AddressOf OnProdLine
|
||||
' Imposto riferimento a funzione delle textbox che disattiva scene in libreria
|
||||
EgtWPFLib.EgtTextBox.m_refScenesIsEnabled = AddressOf IsEnabledScenes
|
||||
|
||||
' --------------------------------- SLAB DB -------------------------------------------------------
|
||||
If GetPrivateProfileInt(S_SCRAPS, K_ENABLESCRAPS, 0, GetIniFile()) <> 0 Then
|
||||
' leggo il direttorio in cui cercare il database delle lastre
|
||||
Dim PhotDir As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_PHOTODIR, "", PhotDir, GetIniFile())
|
||||
' verifico che esista il file "OmagPHOTOVb.sqlite" nel direttorio inidicato
|
||||
If System.IO.File.Exists(PhotDir.Trim & "\" & DB_FILENAME) Then
|
||||
|
||||
If Not ManageDb.ConnectToDb(PhotDir.Trim & "\" & DB_FILENAME) Then
|
||||
EgtOutLog("Error connecting to DB: " & PhotDir.Trim & "\" & DB_FILENAME)
|
||||
' coumico che il grezzo contiene un pezzo e quindi non può essere definito come grezzo
|
||||
m_CurrentProjectPageUC.ClearMessage()
|
||||
m_CurrentProjectPageUC.SetErrorMessage("Denied connection SlabDB")
|
||||
Else
|
||||
' Impostazione direttorio per backup
|
||||
Dim BackUpDir As String = m_sDataRoot & "\BackUp"
|
||||
Directory.CreateDirectory(BackUpDir)
|
||||
EgtPHOTOLib.MainData.SetConfigDir(m_sConfigDir)
|
||||
EgtPHOTOLib.MainData.SetKeyLevel(m_nKeyLevel)
|
||||
EgtPHOTOLib.MainData.SetKeyOptions(CInt(m_nKeyOptions))
|
||||
EgtPHOTOLib.MainData.SetPhotoDir(PhotDir)
|
||||
EgtPHOTOLib.MainData.SetBackUpDir(BackUpDir)
|
||||
EgtPHOTOLib.MainData.SetIsOMagCUT(True)
|
||||
Dim sLastBlock As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_LASTBLOCK, "", sLastBlock, GetIniFile())
|
||||
If Not String.IsNullOrEmpty(sLastBlock) Then
|
||||
EgtPHOTOLib.MainData.SetLastBlock(sLastBlock)
|
||||
End If
|
||||
|
||||
If GetPrivateProfileInt(S_SCRAPS, K_ENABLE_PRINTER, 0, GetIniFile()) = 1 Then
|
||||
' leggo nome file prn (per stampante zebra)
|
||||
Dim m_TemplateFilePrinter As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_TEMPLATE, m_sDataRoot & "\Label\Default.prn", m_TemplateFilePrinter, GetIniFile())
|
||||
' leggo nome del direttorio in cui scrivere il file ini (per stampante zebra) -- solo se si desidera scrivere il file in un direttorio diverso
|
||||
Dim m_DatFilePrinter As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_DAT, m_sDataRoot & "\Temp", m_DatFilePrinter, GetIniFile())
|
||||
' leggo nome file exe (per stampante zebra)
|
||||
Dim m_ZebraUtilitiesExe As String = String.Empty
|
||||
GetPrivateProfileString(S_SCRAPS, K_ZEBRAUTILITIES, System.AppDomain.CurrentDomain.BaseDirectory & "ZebraPrinterUtilitiesR32.exe", m_ZebraUtilitiesExe, GetIniFile())
|
||||
EgtPHOTOLib.MainData.SetTemplateFilePrinter(m_TemplateFilePrinter)
|
||||
EgtPHOTOLib.MainData.SetDataFilePrinter(m_DatFilePrinter)
|
||||
EgtPHOTOLib.MainData.SetZebraPrinterExe(m_ZebraUtilitiesExe)
|
||||
EgtPHOTOLib.MainData.SetPrinterVisibility(True)
|
||||
Else
|
||||
EgtPHOTOLib.MainData.SetPrinterVisibility(False)
|
||||
End If
|
||||
|
||||
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
|
||||
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
|
||||
Dim sIdKey As String = String.Empty
|
||||
EgtGetKeyInfo(sIdKey)
|
||||
EgtPHOTOLib.MainData.SetKey(sIdKey)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' --------------------------------- SLAB DB -------------------------------------------------------
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ManageSingleIstance()
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.9.2")>
|
||||
<Assembly: AssemblyFileVersion("2.4.9.2")>
|
||||
<Assembly: AssemblyVersion("2.4.9.4")>
|
||||
<Assembly: AssemblyFileVersion("2.4.9.4")>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -494,6 +494,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 +679,32 @@ Public Class ProjectMgrUC
|
||||
#End If
|
||||
End Sub
|
||||
|
||||
' aggiorno la lista dei grezzi/sfridi
|
||||
Public Sub UpDateScrapList(ByRef NewScrapsList As List(Of Scrap))
|
||||
If IsNothing(NewScrapsList) Then
|
||||
NewScrapsList = New List(Of Scrap)
|
||||
Else
|
||||
NewScrapsList.Clear()
|
||||
End If
|
||||
' procedo all'aggiornamento della lista degli sfridi
|
||||
Dim CurrRawId As Integer = EgtGetFirstRawPart()
|
||||
Dim IsNewScraps As Integer = 0
|
||||
Dim nCountScrap As Integer = 1
|
||||
While CurrRawId <> GDB_ID.NULL
|
||||
If EgtGetInfo(CurrRawId, K_ISNEWSCRAPS, IsNewScraps) Then
|
||||
If IsNewScraps = 1 Or IsNewScraps = 2 Then
|
||||
' deve essere aggiunto nel DB delle lastre come nuovo grezzo (l'indice è utilizzato per definire il nome della lastra)
|
||||
NewScrapsList.Add(New Scrap(CurrRawId, "Scrap_" & nCountScrap.ToString, IsNewScraps))
|
||||
nCountScrap += 1
|
||||
' è già stato aggiunto al DB delle lastre come nuovo grezzo
|
||||
Else
|
||||
' non è stato definito come nuovo grezzo
|
||||
End If
|
||||
End If
|
||||
CurrRawId = EgtGetNextRawPart(CurrRawId)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
||||
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
|
||||
|
||||
@@ -938,3 +978,60 @@ Public Class ProjectMgrUC
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Scrap
|
||||
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
Private m_IdRaw As Integer
|
||||
Private m_nState As Integer
|
||||
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IdRaw() As Integer
|
||||
Get
|
||||
Return m_IdRaw
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nState As Integer
|
||||
Get
|
||||
Return m_nState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(IdScrap As Integer, NameScrap As String, State As Integer)
|
||||
m_IdRaw = IdScrap
|
||||
m_sName = NameScrap
|
||||
m_nState = State
|
||||
' immagine del grezzo
|
||||
If m_nState = 2 Then
|
||||
m_iPictureID = 5
|
||||
Else
|
||||
m_iPictureID = 4
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
@@ -513,6 +513,8 @@ Public Class RawPartPageUC
|
||||
End Select
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptCurr
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
End Sub
|
||||
|
||||
Private Sub ModifyRectangle(ptCurr As Point3d)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 534 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user