Compare commits

...

39 Commits

Author SHA1 Message Date
NicolaP 7ccb7fb96f Correzione Import/Export per utensili e lavorazioni 2021-12-23 12:13:16 +01:00
NicolaP 9a751d0524 Costruzione finestra Import/Export per Machining 2021-12-22 11:11:50 +01:00
NicolaP 58c00878a8 Merge branch 'Features/Comandi_Siemens' 2021-12-15 19:02:10 +01:00
NicolaP 992686a5a2 Correzione funzionamento per macchina Siemens 2021-12-15 19:01:23 +01:00
NicolaP 5b2b39789d Commento esecuzione comando lettura ActiveMode 2021-12-15 12:58:13 +01:00
NicolaP ad74579ee6 Merge branch 'release/AlzatineFrontalini' 2021-12-02 15:50:45 +01:00
NicolaP f3f9db7bb7 Correzione SingleDrill per cambio utensile automatico 2021-12-02 15:46:25 +01:00
NicolaP 2900aa98f8 Merge remote-tracking branch 'origin/develop' into release/AlzatineFrontalini 2021-11-29 15:11:19 +01:00
SaraP 153374cd5d correzione gestione texture alzatine e frontalini 2021-11-29 15:08:55 +01:00
NicolaP 1076abd8de Merge branch 'master' into release/AlzatineFrontalini 2021-11-25 14:33:03 +01:00
NicolaP 0e260a570e Correzione configurazione linea di produzione. 2021-11-24 18:11:38 +01:00
NicolaP 59176a1269 Modifica versione 2.3k5 2021-11-22 19:12:51 +01:00
NicolaP 2e2de2ade4 Correzione aggiuna Incisioni 2021-11-22 19:11:45 +01:00
NicolaP b6f19b04cb GHestione Kerf negativo 2021-11-22 19:11:06 +01:00
NicolaP 7289e84d7b Scrittura dei messaggi nel file dei messaggi 2021-11-18 18:08:35 +01:00
NicolaP c5757cb3c7 Merge commit '311f6fca992ee31e37e2e2771bb2d8a5d64a9c26' into release/AlzatineFrontalini 2021-11-17 10:29:14 +01:00
DarioS 311f6fca99 OmagCUT 2.3k4 :
- cambiata effettivamente la versione del programma.
2021-11-16 13:49:58 +01:00
Emmanuele Sassi 0efe5b51e4 - Gestione casi che davano eccezione su macchina 2021-11-16 13:34:35 +01:00
NicolaP 38bf52893b Merge commit '09e8c0f6b4b124387e0f60f3a8ff67f18b36965e' into release/AlzatineFrontalini 2021-11-11 17:53:47 +01:00
NicolaP d4b49699c8 Migliorato gestione dei lati per alette 2021-11-11 17:53:03 +01:00
SaraP 09e8c0f6b4 - aggiunto disegno 3D piani cucina
- correzione errori nella gestione texture per disegno 3D
- migliorie disegno 3D alette.
2021-11-11 15:07:18 +01:00
NicolaP 03fdc33be0 Merge branch 'master' into develop 2021-11-10 18:59:37 +01:00
NicolaP 50c3eac8fe Merge remote-tracking branch 'origin/master' 2021-11-10 18:51:53 +01:00
NicolaP 004258a469 Gestione delle alzatine come per i tagli inclinati 2021-11-10 18:51:03 +01:00
NicolaP ce83d8ee49 Correzione scrittura variabili per NUM 2021-11-10 18:50:06 +01:00
DarioS 9db1f5085c OmagCUT 2.3j4 :
- aggiunta possibilità di spostare su seconda tavola con rotazione di 180deg (da Ini Macchina [Table] ChangeTabWD=2)
- aggiunto livello di movimento per split automatico da 1 a 5 fino a 3 passo completo poi metà e un quarto (da Ini [Split] MoveLevel=1...5)
2021-10-26 09:56:18 +02:00
DarioS 49435ba828 OmagCUT 2.3j3 :
- modifiche per assegnare il colore delle regioni anche ai relativi layer
- il colore si assegna alle regioni e non ai testi
- migliorato colore standard pezzo se non trovato nel file ini
- sistemazioni costanti per lettura da file ini.
2021-10-19 17:53:58 +02:00
SaraP 6e963ad6a2 Correzione gestione texture per alette in 3D VeinMatch 2021-10-19 12:00:02 +02:00
NicolaP 4d12d4a129 Correzione CN Siemens 2021-10-18 20:38:18 +02:00
NicolaP c46b7d1aa0 Correzzione/modifica comunicazione Siemens (Ampere,Mode) 2021-10-14 18:45:12 +02:00
NicolaP 08d71ecec2 Correzione visualizzazione dato di Amperaggio 2021-10-14 18:39:37 +02:00
NicolaP 9f4448220e Miogliorata gestione spostamenti grezzi e cambio versione 2021-10-14 10:50:52 +02:00
NicolaP 6117963ac1 Valore di spostamento pezzi pari alla dimensione baffo di taglio 2021-10-13 19:40:41 +02:00
NicolaP 941fa96d03 Correzione sfondo Machining 2021-10-11 14:11:01 +02:00
NicolaP 9f995079e2 Aggiunte icone in interfaccia chiara 2021-10-11 13:03:06 +02:00
SaraP 604f0f744c Aggiunto controllo sulla necessità di eseguire comando 3D nel VeinMatch 2021-10-11 12:57:36 +02:00
SaraP 185cfffe71 Correzione errori disegno 3D alette 2021-10-11 11:19:49 +02:00
DarioS 289c58f867 OmagCUT 2.3 j1 :
- promozione modifiche per fiera
- sistemazione VeinMatching con top cucina da componenti
- gestione anima per lame.
2021-10-10 20:08:04 +02:00
DarioS 5d75e658fb OmagCUT 2.3i4 :
- ricompilazione con cambio versione.
2021-09-24 11:50:42 +02:00
48 changed files with 2494 additions and 1362 deletions
+3 -1
View File
@@ -94,7 +94,9 @@ Public Class MoveRawPartPage
End If End If
' Carico i parametri di movimento ' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile()) m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
StepMoveTxBx.Text = LenToString(m_dStep, 3) ' Ricavo la lunghezza del baffo di taglio
m_dStep = SplitAuto.MaxCuttingMustache(m_dStep)
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+1"
m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile()) m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile())
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3) RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
' Se movimento manuale perpendicolare ' Se movimento manuale perpendicolare
+67 -8
View File
@@ -214,9 +214,9 @@ Public Class NestPageUC
Else Else
' verifico se l'elemento selezionato è il nome della tavola ' verifico se l'elemento selezionato è il nome della tavola
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
Dim nTab As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable() Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
' se non è stata eseguita nessuna scelta esco dal ciclo ' se non è stata eseguita nessuna scelta esco dal ciclo
If nTab = 0 Then Exit While If nRes = 0 Then Exit While
' imposto l'altra tavola ' imposto l'altra tavola
Dim sOtherTab = If( sNamePartId = MAIN_TAB, SECOND_TAB, MAIN_TAB) Dim sOtherTab = If( sNamePartId = MAIN_TAB, SECOND_TAB, MAIN_TAB)
EgtChangeTable( sOtherTab, True) EgtChangeTable( sOtherTab, True)
@@ -241,6 +241,49 @@ Public Class NestPageUC
PackPartInStore(nPPId) PackPartInStore(nPPId)
nPPId = EgtGetNextPart( nPPId) nPPId = EgtGetNextPart( nPPId)
End While End While
' se prevista rotazione
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 2 Then
' Dati tavola
Dim b3Tab As New BBox3d
EgtGetTableArea( 1, b3Tab)
' Box lastra
Dim b3OrigRaw As New BBox3d
GetRawBox( b3OrigRaw)
' Allargo i limiti della tavola in tutte le fasi
Const TAB_OFFS As Double = 3000
For nI As Integer = 1 To EgtGetPhaseCount()
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset( TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
Next
EgtSetCurrPhase(1)
' Rotazione
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
if Not RotateAllRawParts(dAngRot, False) Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
End If
' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diveta TR e viceversa
Dim b3Raw As New BBox3d
GetRawBox( b3Raw)
Dim vtMove As Vector3d
If sOtherTab = SECOND_TAB Then
Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
vtMove = vtDiffFin - vtDiffIni
Else
Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
vtMove = -( vtDiffFin - vtDiffIni)
End If
vtMove.z = 0
MoveAllRawParts(vtMove)
' Ripristino i limiti della tavola in tutte le fasi
For nI As Integer = 1 To EgtGetPhaseCount()
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset( 0, 0, 0, 0)
Next
EgtSetCurrPhase(1)
HideAllMachinings()
End If
' visualizzazione ' visualizzazione
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
Exit While Exit While
@@ -669,7 +712,7 @@ Public Class NestPageUC
nId = EgtGetNextSelectedObj() nId = EgtGetNextSelectedObj()
End While End While
Else Else
RotateAllRawParts(m_dRegAngStep) UserRotateAllRawParts(m_dRegAngStep)
EgtDraw() EgtDraw()
End If End If
End Sub End Sub
@@ -687,7 +730,7 @@ Public Class NestPageUC
nId = EgtGetNextSelectedObj() nId = EgtGetNextSelectedObj()
End While End While
Else Else
RotateAllRawParts(-m_dRegAngStep) UserRotateAllRawParts(-m_dRegAngStep)
EgtDraw() EgtDraw()
End If End If
End Sub End Sub
@@ -739,7 +782,7 @@ Public Class NestPageUC
End If End If
End Function End Function
Private Sub RotateAllRawParts(dAngDeg As Double) Private Sub UserRotateAllRawParts(dAngDeg As Double)
' Recupero rotazione totale ' Recupero rotazione totale
Dim dRegRot As Double = GetRegistrationRotation() Dim dRegRot As Double = GetRegistrationRotation()
' Verifico se nuova rotazione totale ammissibile ' Verifico se nuova rotazione totale ammissibile
@@ -748,6 +791,13 @@ Public Class NestPageUC
m_CurrProjPage.SetWarningMessage(EgtMsg(90338)) 'Angolo di registrazione oltre i limiti m_CurrProjPage.SetWarningMessage(EgtMsg(90338)) 'Angolo di registrazione oltre i limiti
Return Return
End If End If
Dim bMoveOk As Boolean = RotateAllRawParts( dAngDeg)
If Not bMoveOk Then m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
End Sub
Friend Function RotateAllRawParts(dAngDeg As Double, Optional bIsReg As Boolean = True) As Boolean
' Recupero rotazione totale
Dim dRegRot As Double = GetRegistrationRotation()
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione ' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
Dim ptCen As New Point3d Dim ptCen As New Point3d
GetRawCenter(ptCen) GetRawCenter(ptCen)
@@ -782,7 +832,6 @@ Public Class NestPageUC
End While End While
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati ' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
If Not bMoveOk Then If Not bMoveOk Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
Dim nRevPhase As Integer = 1 Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= nPhase While nRevPhase <= nPhase
@@ -865,15 +914,25 @@ Public Class NestPageUC
End If End If
nOpeId = EgtGetNextActiveOperation(nOpeId) nOpeId = EgtGetNextActiveOperation(nOpeId)
End While End While
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
'If Not bIsReg Then
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
'End If
' Aggiorno rotazione totale ' Aggiorno rotazione totale
SetRegistrationRotation(dRegRot + dAngDeg) If bIsReg Then
SetRegistrationRotation(dRegRot + dAngDeg)
Else
SetRegistrationRotation(0)
End If
' Dichiaro grezzo per punti ' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1) EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If End If
' Ripristino lo stato iniziale ' Ripristino lo stato iniziale
EgtSetCurrPhase(1) EgtSetCurrPhase(1)
HideAllMachinings() HideAllMachinings()
End Sub Return bMoveOk
End Function
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
' Se inserimento automatico ' Se inserimento automatico
+63 -12
View File
@@ -5,6 +5,11 @@ Public Module SplitAuto
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_dLastDT As Double = 0 Private m_dLastDT As Double = 0
Public ReadOnly Property dLastDT As Double
Get
Return m_dLastDT
End Get
End Property
'----------------------------------------------------------------------------------------------- '-----------------------------------------------------------------------------------------------
Friend Class SplitMach Friend Class SplitMach
@@ -737,35 +742,55 @@ Public Module SplitAuto
End Function End Function
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
' Spostamento originale
Dim vtOriMove As New Vector3d( vtMove)
' Livello di movimento
Dim nMoveLevel As Integer = GetPrivateProfileInt( S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
Dim nMove As Integer = 1
' Se esce dalla tavola, movimento già annullato ed esco con errore ' Se esce dalla tavola, movimento già annullato ed esco con errore
If Not EgtMoveRawPart(nRawId, vtMove) Then Return False If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
' Se interferisce con altri grezzi, annullo movimento ed esco con errore ' Se interferisce con altri grezzi, annullo movimento ed esco con errore
If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then If Not VerifyRawWithOtherRaws(nRawId, dMindist) Then
EgtMoveRawPart(nRawId, -vtMove) EgtMoveRawPart(nRawId, -vtOriMove)
Return False Return False
End If End If
If nMoveLevel < 2 Then Return True
' Provo ad aggiungere un altro movimento ' Provo ad aggiungere un altro movimento
If EgtMoveRawPart(nRawId, vtMove) Then If EgtMoveRawPart(nRawId, vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += vtMove vtMove += vtOriMove
nMove += 1
If nMoveLevel = nMove Then Return True
Else Else
EgtMoveRawPart(nRawId, -vtMove) EgtMoveRawPart(nRawId, -vtOriMove)
End If
End If
' Provo ad aggiungere un altro movimento
If EgtMoveRawPart(nRawId, vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += vtOriMove
nMove += 1
If nMoveLevel = nMove Then Return True
Else
EgtMoveRawPart(nRawId, -vtOriMove)
End If End If
End If End If
' Provo ad aggiungere un movimento dimezzato ' Provo ad aggiungere un movimento dimezzato
If EgtMoveRawPart(nRawId, 0.5 * vtMove) Then If EgtMoveRawPart(nRawId, 0.5 * vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += 0.5 * vtMove vtMove += 0.5 * vtOriMove
nMove += 1
If nMoveLevel = nMove Then return True
Else Else
EgtMoveRawPart(nRawId, -0.5 * vtMove) EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
End If End If
End If End If
' Provo ad aggiunger un movimento 1/4 ' Provo ad aggiungere un movimento 1/4
If EgtMoveRawPart(nRawId, 0.25 * vtMove) Then If EgtMoveRawPart(nRawId, 0.25 * vtOriMove) Then
If VerifyRawWithOtherRaws(nRawId, dMindist) Then If VerifyRawWithOtherRaws(nRawId, dMindist) Then
vtMove += 0.25 * vtMove vtMove += 0.25 * vtOriMove
Else Else
EgtMoveRawPart(nRawId, -0.25 * vtMove) EgtMoveRawPart(nRawId, -0.25 * vtOriMove)
End If End If
End If End If
Return True Return True
@@ -817,4 +842,30 @@ Public Module SplitAuto
Return (Not bInterf) Return (Not bInterf)
End Function End Function
Public Function MaxCuttingMustache(dMustache As Double) As Double
Dim MachSplitList As New List(Of SplitMach)
' Recupero l'indice della fase corrente
Dim nCurrPhase As Integer = EgtGetCurrPhase()
' se non è stata creata nessuna lista allora restituisco il valore di Default
If Not CalculateSplitMachList(nCurrPhase, MachSplitList) Then Return dMustache
Dim NewMustache As Double = 0
Dim ItemMachSplit As SplitMach
For Each ItemMachSplit In MachSplitList
' Recupero lunghezza baffo secondo taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(ItemMachSplit.m_nId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double
If EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT) Then
If NewMustache < dDT Then NewMustache = dDT
End If
Next
Dim dExtraL As Double = 0
EgtMdbGetGeneralParam(MCH_GP.EXTRALONCUTREG, dExtraL)
' se esiste il valore di un baffo allora sovrascrivo il valore di default
If NewMustache > 0 Then
dMustache = Math.Ceiling(NewMustache)
End If
Return dMustache + dExtraL
End Function
End Module End Module
+5
View File
@@ -334,6 +334,8 @@ Module ConstGen
' Nome di pezzo temporaneo che serve per copia dime ' Nome di pezzo temporaneo che serve per copia dime
Public Const NAME_COPYTEMPLATE As String = "CopyTemplate" Public Const NAME_COPYTEMPLATE As String = "CopyTemplate"
' Nome layer solidi per VM
Public Const NAME_VM_SOLID As String = "Solid"
' Chiave per Id originale del pezzo per VeinMatch ' Chiave per Id originale del pezzo per VeinMatch
Public Const KEY_ORI_ID As String = "OriId" Public Const KEY_ORI_ID As String = "OriId"
@@ -343,6 +345,9 @@ Module ConstGen
' Lunghezza libera infinita ' Lunghezza libera infinita
Public Const FREELEN_INF = 9999 Public Const FREELEN_INF = 9999
' Costante per lunghezza gambo di lama
Public Const STEM = 131072
' Colori per lavorazioni ' Colori per lavorazioni
Public Function COL_MCH_CUT() As Color3d Public Function COL_MCH_CUT() As Color3d
Return New Color3d(0, 255, 0) Return New Color3d(0, 255, 0)
+12
View File
@@ -105,6 +105,15 @@ Module ConstIni
Public Const K_TRFDATA As String = "TrfData" Public Const K_TRFDATA As String = "TrfData"
Public Const K_CSVDATA As String = "CsvData" Public Const K_CSVDATA As String = "CsvData"
Public Const K_COMPODIR As String = "CompoDir" Public Const K_COMPODIR As String = "CompoDir"
Public Const K_CMP_COUNT As String = "Count"
Public Const K_LASTCOLOR As String = "LastColor"
Public Const K_COLOR As String = "Color"
Public Const S_EXTCOMPO As String = "Compo"
Public Const S_INTCOMPO As String = "InternalCompo"
Public Const K_INT_COMPODIR As String = "CompoDir"
Public Const K_INT_COUNT As String = "Count"
Public Const S_FLATPARTS As String = "FlatParts" Public Const S_FLATPARTS As String = "FlatParts"
Public Const K_FLPCURRDIR As String = "CurrDir" Public Const K_FLPCURRDIR As String = "CurrDir"
@@ -140,6 +149,9 @@ Module ConstIni
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize" Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime" Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
Public Const S_CSV As String = "Csv" Public Const S_CSV As String = "Csv"
Public Const K_FULL As String = "Full" Public Const K_FULL As String = "Full"
Public Const K_MAXDIMONX As String = "MaxDimOnX" Public Const K_MAXDIMONX As String = "MaxDimOnX"
+3
View File
@@ -37,7 +37,9 @@
Public Const K_PATH_HMI As String = "PathHmi" Public Const K_PATH_HMI As String = "PathHmi"
Public Const K_USENEWMDI As String = "UseNewMDI" Public Const K_USENEWMDI As String = "UseNewMDI"
Public Const K_ISSIEMENSONE As String = "IsSiemensOne" Public Const K_ISSIEMENSONE As String = "IsSiemensOne"
Public Const K_ISACTIVEMODESUBSCR As String = "IsActiveModeSubscr"
Public Const K_DBVARPATH As String = "DBVarPath" Public Const K_DBVARPATH As String = "DBVarPath"
Public Const K_NEWWRITECNCMODE As String = "NewWriteCNCMode"
Public Const S_NCNUM As String = "NcNUM" Public Const S_NCNUM As String = "NcNUM"
Public Const K_RESETSENDDELAY As String = "ResetSendDelay" Public Const K_RESETSENDDELAY As String = "ResetSendDelay"
@@ -46,6 +48,7 @@
Public Const S_NCDATA As String = "NcData" Public Const S_NCDATA As String = "NcData"
Public Const K_NEWVARIABLE As String = "NewVariable" Public Const K_NEWVARIABLE As String = "NewVariable"
Public Const K_NEWCONSOLE As String = "NewConsole" Public Const K_NEWCONSOLE As String = "NewConsole"
Public Const K_WRITECNCMODEVAR As String = "WriteCNCModeVar"
Public Const K_COMM As String = "Comm" Public Const K_COMM As String = "Comm"
Public Const K_REFRESH As String = "Refresh" Public Const K_REFRESH As String = "Refresh"
Public Const K_MODE As String = "Mode" Public Const K_MODE As String = "Mode"
+1 -1
View File
@@ -475,7 +475,7 @@ Public MustInherit Class MachineButton
If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then If m_CN.m_NewVariable And m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
' solo per Flexium ' solo per Flexium
m_CN.DPlcVariables_WriteVariables(ENumber, EValue) m_CN.DPlcVariables_WriteVariables(ENumber, EValue)
If Not IsNothing(ENumber2) And Not IsNothing(EValue2) Then If Not String.IsNullOrEmpty(ENumber2) And Not String.IsNullOrEmpty(EValue2) Then
m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2) m_CN.DPlcVariables_WriteVariables(ENumber2, EValue2)
End If End If
' altrimenti scrittura delle variabili E ' altrimenti scrittura delle variabili E
-120
View File
@@ -567,124 +567,4 @@ Public Class DirectCutPageUC
End Sub End Sub
'' ------------------------ GESTIONE SECONDA PAGINA ------------------------
'Private Sub ClearButton(nCount As Integer)
' Dim nEndIndex As Integer
' If m_bIsFirstPage Then
' nEndIndex = If(nCount < 8, nCount, 8)
' Else
' nEndIndex = If(nCount < 16, nCount - 8, 8)
' End If
' For index As Integer = 1 To nEndIndex
' GetLabel(index).Text = String.Empty
' GetImage(index).Source = Nothing
' GetButton(index).Visibility = Windows.Visibility.Visible
' Next
' For index As Integer = nEndIndex + 1 To 8
' GetLabel(index).Text = String.Empty
' GetImage(index).Source = Nothing
' GetButton(index).Visibility = Windows.Visibility.Hidden
' Next
'End Sub
'Private Sub LoadPage()
' Dim nDeltaSecondPage As Integer = 8
' ' Leggo numero di componenti presenti
' Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "Count", 0, m_MainWindow.GetIniFile())
' ' Calcolo indici a seconda della pagina in cui sono
' If m_bIsFirstPage Then
' ClearButton(nCompoNumber)
' nDeltaSecondPage = 0
' Else
' ClearButton(nCompoNumber)
' nDeltaSecondPage = 8
' End If
' ' Creazione converter da String a ImageSource
' Dim ImageConverter As New ImageSourceConverter
' Dim ThicknessConverter As New ThicknessConverter
' 'Assegnazione immagine e testo ai Button
' For index As Integer = 1 To 8
' Dim CustomThickness As New Thickness(0)
' Dim nCompoName As Integer = GetPrivateProfileInt("Compo" & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
' Dim sCompoImage As String = ""
' Dim sCompoImageSource As ImageSource
' 'verifico presenza immagine e la aggiungo
' If GetPrivateProfileString("Compo" & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
' Try
' sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
' GetImage(index).Height = 65
' GetImage(index).Width = 65
' GetImage(index).Source = sCompoImageSource
' Catch ex As Exception
' EgtOutLog("Error loading image " & sCompoImage)
' sCompoImage = String.Empty
' GetImage(index).Height = 0
' GetImage(index).Width = 0
' CustomThickness.Right = 0
' GetImage(index).Margin = CustomThickness
' End Try
' Else
' 'Se non c'è l'immagine azzero la distanza tra testo e immagine
' CustomThickness.Right = 0
' GetImage(index).Margin = CustomThickness
' End If
' 'verifico presenza testo
' If nCompoName > 0 Then
' Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
' 'verifico presenza immagine
' If sCompoImage.Length > 0 Then
' 'se la lunghezza del testo è maggiore di 15 lo taglio
' If sCompoName.Length > 15 Then
' sCompoName = sCompoName.Substring(0, 15)
' End If
' GetLabel(index).Text = sCompoName
' 'Se ci sono sia testo che immagine imposto un margine di 10
' CustomThickness.Right = 10
' GetImage(index).Margin = CustomThickness
' Else
' 'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
' If sCompoName.Length > 20 Then
' sCompoName = sCompoName.Substring(0, 20)
' End If
' GetLabel(index).Text = sCompoName
' End If
' Else
' 'Se non c'è testo azzero la distanza tra testo e immagine
' CustomThickness.Right = 0
' GetImage(index).Margin = CustomThickness
' End If
' Next
'End Sub
'' Gestione bottone altri componenti
'Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
' If m_bIsFirstPage Then
' m_bIsFirstPage = False
' LoadPage()
' 'Compo9.SetValue(Grid.ColumnProperty, 1)
' 'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
' 'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
' 'ImageCompo9.Visibility = Windows.Visibility.Visible
' 'LabelCompo9.Visibility = Windows.Visibility.Hidden
' Compo9.SetValue(Grid.ColumnProperty, 0)
' Compo9.SetValue(Grid.ColumnSpanProperty, 2)
' ImageCompo9.Visibility = Windows.Visibility.Hidden
' LabelCompo9.Visibility = Windows.Visibility.Visible
' Else
' m_bIsFirstPage = True
' LoadPage()
' Compo9.SetValue(Grid.ColumnProperty, 0)
' Compo9.SetValue(Grid.ColumnSpanProperty, 2)
' ImageCompo9.Visibility = Windows.Visibility.Hidden
' LabelCompo9.Visibility = Windows.Visibility.Visible
' End If
'End Sub
End Class End Class
-2
View File
@@ -671,8 +671,6 @@ Public Class FlatteningCut
End If End If
UpdateSimulOkBtn() UpdateSimulOkBtn()
Return m_bCutOk Return m_bCutOk
End Function End Function
+7 -3
View File
@@ -550,7 +550,11 @@ Public Class MachineButtonsUC
End Sub End Sub
Friend Sub DoorStateChanged(DoorState As Integer) Friend Sub DoorStateChanged(DoorState As Integer)
' recupero le asscociazioni con i bottoni If IsNothing(DoorState) Then
EgtOutLog("Error: door state null!")
Return
End If
' recupero le associazioni con i bottoni
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_OPENED) Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_DOOR_OPENED)
If nIndex = -1 Then Return If nIndex = -1 Then Return
' bottone di apertura porte ' bottone di apertura porte
@@ -560,7 +564,7 @@ Public Class MachineButtonsUC
' bottone di chiusura porte ' bottone di chiusura porte
Dim DoorClosedButton As Primitives.ToggleButton = GetToggleButton(nIndex + 1) Dim DoorClosedButton As Primitives.ToggleButton = GetToggleButton(nIndex + 1)
' modifico il colore dei bottoni ' modifico il colore dei bottoni
If Not IsNothing(DoorState) Then If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorClosedButton) Then
Select Case DoorState Select Case DoorState
Case 0 Case 0
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red") DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
@@ -568,7 +572,7 @@ Public Class MachineButtonsUC
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray") DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
End Select End Select
End If End If
If Not IsNothing(DoorState) Then If Not IsNothing(DoorState) AndAlso Not IsNothing(DoorOpenedButton) Then
Select Case DoorState Select Case DoorState
Case 0 Case 0
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray") DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
+50 -7
View File
@@ -1,4 +1,5 @@
Imports EgtUILib Imports EgtUILib
Imports System.Collections.ObjectModel
Public Class SingleDrillUC Public Class SingleDrillUC
' Riferimenti a pagine ' Riferimenti a pagine
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
@@ -37,6 +38,8 @@ Public Class SingleDrillUC
Private m_dDiameter As Double = 0 Private m_dDiameter As Double = 0
Private m_sCurrDrill As String = String.Empty
' Costanti ' Costanti
Private Const MAX_TAB_DEPTH As Double = 10.0 Private Const MAX_TAB_DEPTH As Double = 10.0
Private Const MIN_CUT_LEN As Double = 10.0 Private Const MIN_CUT_LEN As Double = 10.0
@@ -67,8 +70,11 @@ Public Class SingleDrillUC
End Sub End Sub
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
m_sCurrDrill = m_CurrentMachine.sCurrDrill
GetDrillFromDrilling(m_sCurrDrill)
' recupero informazioni del foretto usato ' recupero informazioni del foretto usato
EgtTdbSetCurrTool(m_CurrentMachine.sCurrDrill) EgtTdbSetCurrTool(m_sCurrDrill)
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter) EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
' Attivo la pagina ' Attivo la pagina
@@ -215,7 +221,7 @@ Public Class SingleDrillUC
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
' Ricavo dati Foretto corrente ' Ricavo dati Foretto corrente
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill Dim sDrill As String = m_sCurrDrill
' Se punto da laser ' Se punto da laser
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
' Imposto come testa corrente il laser (senza utensile ovviamente) ' Imposto come testa corrente il laser (senza utensile ovviamente)
@@ -245,9 +251,9 @@ Public Class SingleDrillUC
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri)) m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
m_bPointP1Ok = True m_bPointP1Ok = True
' Ricavo dati lama corrente ' Ricavo dati lama corrente
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrDrill Dim sDrill As String = m_sCurrDrill
' Imposto la lama corrente ' Imposto la lama corrente
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
End If End If
' Disegno il taglio ' Disegno il taglio
@@ -261,6 +267,42 @@ Public Class SingleDrillUC
Point1Btn.IsChecked = True Point1Btn.IsChecked = True
End Sub End Sub
Private Sub GetDrillFromDrilling(ByRef sCurrDrill As String)
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
' creo l'elenco degli utensili di foratura
Dim sToolName As String = String.Empty
Dim nType As Integer = MCH_TY.NONE
Dim DrillToolList As New ObservableCollection(Of String)
DrillToolList.Clear()
If EgtTdbGetFirstTool(MCH_TF.DRILLBIT, sToolName, nType) Then
DrillToolList.Add(sToolName)
While EgtTdbGetNextTool(MCH_TF.DRILLBIT, sToolName, nType)
DrillToolList.Add(sToolName)
End While
End If
' recupero l'utensile associato alla lavorazione
Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
Dim ToolString As String = String.Empty
EgtMdbSetCurrMachining(sCurrDrilling)
' Recupero nome utensile tramite TUUID
Dim sTuuid As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
EgtTdbGetToolFromUUID(sTuuid, ToolString)
Dim bToolExist As Boolean = False
For Each CurrTool As IEnumerable In DrillToolList
If CurrTool.ToString() = ToolString Then
bToolExist = True
Exit For
End If
Next
If bToolExist Then
sCurrDrill = ToolString
Else
sCurrDrill = String.Empty
End If
End If
End Sub
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
' Recupero il valore della coordinata (in 0 Tab) ' Recupero il valore della coordinata (in 0 Tab)
Dim dXcoord As Double = 0 Dim dXcoord As Double = 0
@@ -354,10 +396,11 @@ Public Class SingleDrillUC
' Spessore grezzo ' Spessore grezzo
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
' Recupero spessore lama corrente ' Recupero spessore lama corrente
Dim sDrill As String = m_MainWindow.m_CurrentMachine.sCurrDrill Dim sDrill As String = m_sCurrDrill
GetDrillFromDrilling(sDrill)
EgtTdbSetCurrTool(sDrill) EgtTdbSetCurrTool(sDrill)
Dim dThick As Double = 0 Dim dDiam As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick) EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
' Rimuovo eventuale vecchio pezzo per taglio diretto ' Rimuovo eventuale vecchio pezzo per taglio diretto
EraseDirectCutPart() EraseDirectCutPart()
' Disattivo eventuali lavorazioni presenti ' Disattivo eventuali lavorazioni presenti
+73 -31
View File
@@ -20,6 +20,7 @@ Public Class AlzFrontUC
' nome della info riferita alle alzatine e ai frontalini (1=Alz, 2=Front, 0=niente) ' nome della info riferita alle alzatine e ai frontalini (1=Alz, 2=Front, 0=niente)
Private Const INFO_ALZFRONT As String = "AF" Private Const INFO_ALZFRONT As String = "AF"
Private Const INFO_ENABLE As String = "EnableAF"
' Properties ' Properties
Private m_sCompoDir As String = String.Empty Private m_sCompoDir As String = String.Empty
@@ -140,38 +141,41 @@ Public Class AlzFrontUC
' inserisco il lato nella lista ' inserisco il lato nella lista
While CurrLine <> GDB_ID.NULL While CurrLine <> GDB_ID.NULL
' escludo tutte le forme che non sono delle linee Dim NextId As Integer = EgtGetNext(CurrLine)
If EgtGetType(CurrLine) = GDB_TY.CRV_LINE Then If NextId = GDB_ID.NULL Then NextId = EgtGetFirstInGroup(LoopId)
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino If VerifySideAnglePossible(PrevLine, CurrLine, NextId, bOutLoop) Then
Dim sNameCurrLine As String = String.Empty
Dim nInfo As Integer = 0
Dim dSideAng As Integer = 0
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
EgtGetName(CurrLine, sNameCurrLine)
' inserisco la numerazione dei lati della figura
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
' recupero l'informazione
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
If nInfo = 1 Then
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
ElseIf nInfo = 2 Then
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
Else
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
End If
' inserisco riferimento univoco al lato (solo se non esiste)
Dim sInfoRef As String = String.Empty
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
If String.IsNullOrEmpty(sInfoRef) Then
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
End If
nEntityIndex += 1
Else
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
nOtherIndex = nOtherIndex + 1
End If
If ApprovedSideToAlzFront(CurrLine) Then
' Aggiungo il lato alla lista di quelli su cui è possibile mettere una alzatina o un frontalino
Dim sNameCurrLine As String = String.Empty
Dim nInfo As Integer = 0
Dim dSideAng As Integer = 0
EgtSetName(CurrLine, "A" & nEntityIndex.ToString)
EgtGetName(CurrLine, sNameCurrLine)
' inserisco la numerazione dei lati della figura
AddTextToLine(sNameCurrLine, LabelId, CurrLine, 20, m_dBBoxRad, True)
' recupero l'informazione
EgtGetInfo(CurrLine, INFO_ALZFRONT, nInfo)
If nInfo = 1 Then
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.ALZATINA))
ElseIf nInfo = 2 Then
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine, AlzFrontEntity.AlzFront.FRONTALINO))
Else
AlzFrontEntityList.Add(New AlzFrontEntity(sNameCurrLine, CurrLine))
End If
' inserisco riferimento univoco al lato (solo se non esiste)
Dim sInfoRef As String = String.Empty
EgtGetInfo(CurrLine, "RefAF", sInfoRef)
If String.IsNullOrEmpty(sInfoRef) Then
Dim sRefGUID As String = System.Guid.NewGuid().ToString()
EgtSetInfo(CurrLine, "RefAF", sRefGUID)
End If
nEntityIndex += 1
Else
EgtSetName(CurrLine, "B" & nOtherIndex.ToString)
nOtherIndex = nOtherIndex + 1
End If
End If
PrevLine = CurrLine PrevLine = CurrLine
CurrLine = EgtGetNext(CurrLine) CurrLine = EgtGetNext(CurrLine)
End While End While
@@ -275,6 +279,44 @@ Public Class AlzFrontUC
bInternalSelection = False bInternalSelection = False
End Sub End Sub
' restituisce vero se il lato possiede delle info legate al sideangle
Private Function VerifyIsThereSideAngle(nCurrLine As Integer) As Boolean
Dim sInfoSideAngle As String = String.Empty
EgtGetInfo(nCurrLine, INFO_SIDE_ANGLE, sInfoSideAngle)
If Not String.IsNullOrWhiteSpace(sInfoSideAngle) Or Not String.IsNullOrEmpty(sInfoSideAngle) Then
' verifico che il dato salvato sia un double
Try
Dim dSideAngle As Double = 0
StringToDouble(sInfoSideAngle, dSideAngle)
If dSideAngle <> 0 Then
Return True
End If
Catch ex As Exception
End Try
End If
Return False
End Function
' restituisce vero se il lato possiede delle info legate alle alette
Private Function VerifyIsThereAlzFront(nCurrLine As Integer) As Boolean
Dim sInfoAlzFront As String = String.Empty
EgtGetInfo(nCurrLine, INFO_ALZFRONT, sInfoAlzFront)
If Not String.IsNullOrWhiteSpace(sInfoAlzFront) Or Not String.IsNullOrEmpty(sInfoAlzFront) Then
If sInfoAlzFront.Trim <> "0" Then
Return True
End If
End If
Return False
End Function
' approvo la costruzione dell'aletta sul lato indicato
Private Function ApprovedSideToAlzFront(nCurrLine As Integer) As Boolean
If VerifyIsThereSideAngle(nCurrLine) And Not VerifyIsThereAlzFront(nCurrLine) Then
' se esiste SideAngle e un'aletta allora NON approvo
Return False
End If
Return True
End Function
' Permette di aggiugere accanto alla linea passata ' Permette di aggiugere accanto alla linea passata
Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double, Friend Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double,
+12 -7
View File
@@ -105,6 +105,9 @@ Public Class DrawPageUC
Return m_nSelectedLayer Return m_nSelectedLayer
End Get End Get
End Property End Property
Public Sub SetCurrLayer(ByVal nCurrLayer As Integer)
m_nSelectedLayer = nCurrLayer
End Sub
Enum Pages Enum Pages
MainComponent MainComponent
@@ -879,8 +882,8 @@ Public Class DrawPageUC
' permette di inserire più di un part ' permette di inserire più di un part
Private Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean Private Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean
Dim InsertColor As Color3d = New Color3d(89, 210, 210)
CompoColor(InsertColor, m_MainWindow.GetIniFile()) Dim InsertColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
' Imposto il contesto corrente ' Imposto il contesto corrente
EgtSetCurrentContext(DrawScene.GetCtx()) EgtSetCurrentContext(DrawScene.GetCtx())
@@ -893,8 +896,6 @@ Public Class DrawPageUC
While Pz <> -1 While Pz <> -1
' imposto il contesto corrente ' imposto il contesto corrente
EgtSetCurrentContext(DrawScene.GetCtx()) EgtSetCurrentContext(DrawScene.GetCtx())
' salvo il file temporaneo per studio delle alzatine
EgtSaveFile("c:\EgtData\OmagCUT\Temp\TempAlzatine.nge", NGE.CMPTEXT)
' cerco un altro pezzo nell'elenco ' cerco un altro pezzo nell'elenco
NxtPz = EgtGetNextPart(Pz) NxtPz = EgtGetNextPart(Pz)
@@ -1018,8 +1019,12 @@ Public Class DrawPageUC
' Imposto colore testi ' Imposto colore testi
Utility.SetTextColor(nRegLayId) Utility.SetTextColor(nRegLayId)
' Imposto il colore del pezzo inserito nel progetto ' Imposto il colore del pezzo inserito nel progetto
Dim nPartInRegion As Integer = EgtGetFirstInGroup(nRegLayId) EgtSetColor(nRegLayId, InsertColor)
EgtSetColor(nPartInRegion, InsertColor) Dim EntId As Integer = EgtGetFirstInGroup(nRegLayId)
While EntId <> GDB_ID.NULL
If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
EntId = EgtGetNext(EntId)
End While
' Esporto il pezzo in un file temporaneo ' Esporto il pezzo in un file temporaneo
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPartCompo.Nge" Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPartCompo.Nge"
@@ -1059,7 +1064,7 @@ Public Class DrawPageUC
If sCMP.StartsWith("PCucina") Or sCMP.StartsWith("PBagno") Or sCMP.StartsWith("AlzFront") Then If sCMP.StartsWith("PCucina") Or sCMP.StartsWith("PBagno") Or sCMP.StartsWith("AlzFront") Then
' Aggiungo riferimento e lo inserisco in VeinMatching ' Aggiungo riferimento e lo inserisco in VeinMatching
VeinMatching.SetRefOnPart(nId2) VeinMatching.SetRefOnPart(nId2)
VeinMatching.AddPartFromDraw(nId2, True) VeinMatching.AddPartFromDraw(nId2)
' Se richiesto posizionamento diretto, lo eseguo ' Se richiesto posizionamento diretto, lo eseguo
If bDirect Then If bDirect Then
If m_MainWindow.m_CadCutPageUC.m_NestPage.InsertOnePart(nId2) Then If m_MainWindow.m_CadCutPageUC.m_NestPage.InsertOnePart(nId2) Then
+5 -5
View File
@@ -578,23 +578,23 @@ Public Class ImportPageUC
' metodo utilizzato per definire il colore dei pezzi DXF importati ' metodo utilizzato per definire il colore dei pezzi DXF importati
Private Sub ColorRegion(nCtx As Integer) Private Sub ColorRegion(nCtx As Integer)
' Leggo dati corrispondenza colore ' Leggo dati corrispondenza colore
Dim InsertColor As Color3d = New Color3d(89, 210, 210) Dim InsertColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
CompoColor(InsertColor, m_MainWindow.GetIniFile())
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext(nCtx) EgtSetCurrentContext(nCtx)
' Ciclo sui pezzi ' Ciclo sui pezzi
Dim PartId As Integer = EgtGetFirstPart() Dim PartId As Integer = EgtGetFirstPart()
While PartId <> GDB_ID.NULL While PartId <> GDB_ID.NULL
' Ciclo sui layer di contorno ' Ciclo sui layer delle regioni
Dim bOutLoop As Boolean = True
Dim RegionId As Integer = EgtGetFirstNameInGroup(PartId, NAME_REGION) Dim RegionId As Integer = EgtGetFirstNameInGroup(PartId, NAME_REGION)
While RegionId <> GDB_ID.NULL While RegionId <> GDB_ID.NULL
EgtSetColor(RegionId, InsertColor)
' Ciclo sulle regioni ' Ciclo sulle regioni
Dim EntId As Integer = EgtGetFirstInGroup(RegionId) Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
While EntId <> GDB_ID.NULL While EntId <> GDB_ID.NULL
EgtSetColor(EntId, InsertColor) If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
EntId = EgtGetNext(EntId) EntId = EgtGetNext(EntId)
End While End While
RegionId = EgtGetNextName(PartId, NAME_REGION) RegionId = EgtGetNextName(PartId, NAME_REGION)
+4 -4
View File
@@ -24,7 +24,7 @@ Public Class InternalComponentPageUC
ImageCompo9.Visibility = Windows.Visibility.Hidden ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible LabelCompo9.Visibility = Windows.Visibility.Visible
' Se i componenti interni sono più di 8 viene visualizzato il bottone "Altri" altrimenti no ' Se i componenti interni sono più di 8 viene visualizzato il bottone "Altri" altrimenti no
Dim nCount As Integer = GetPrivateProfileInt("InternalCompo", "Count", 0, m_MainWindow.GetIniFile()) Dim nCount As Integer = GetPrivateProfileInt(S_INTCOMPO, K_INT_COUNT, 0, m_MainWindow.GetIniFile())
If nCount > 8 Then If nCount > 8 Then
Compo9.Visibility = Windows.Visibility.Visible Compo9.Visibility = Windows.Visibility.Visible
Else Else
@@ -163,10 +163,10 @@ Public Class InternalComponentPageUC
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
CurrentBtn = e.Source CurrentBtn = e.Source
Dim CompoName As String = "InternalCompo" & GetIndexFromButton(CurrentBtn).ToString Dim CompoName As String = S_INTCOMPO & GetIndexFromButton(CurrentBtn).ToString
m_sCurrCompoFam = CompoName m_sCurrCompoFam = CompoName
' m_SecondaryComponentPage.m_sCurrCompo = String.Empty ' m_SecondaryComponentPage.m_sCurrCompo = String.Empty
Dim nCount As Integer = GetPrivateProfileInt(CompoName, "Count", 0, m_MainWindow.GetIniFile()) Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
If nCount > 1 Then If nCount > 1 Then
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me) m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent
@@ -252,7 +252,7 @@ Public Class InternalComponentPageUC
Private Sub LoadPage() Private Sub LoadPage()
Dim nDeltaSecondPage As Integer = 8 Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti ' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt("InternalCompo", "Count", 0, m_MainWindow.GetIniFile()) Dim nCompoNumber As Integer = GetPrivateProfileInt(S_INTCOMPO, K_INT_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono ' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then If m_bIsFirstPage Then
ClearButton(nCompoNumber) ClearButton(nCompoNumber)
+3 -3
View File
@@ -167,10 +167,10 @@ Public Class MainComponentPageUC
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
CurrentBtn = DirectCast(e.Source, Button) CurrentBtn = DirectCast(e.Source, Button)
Dim CompoName As String = "Compo" & GetIndexFromButton(CurrentBtn).ToString Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
m_sCurrCompoFam = CompoName m_sCurrCompoFam = CompoName
m_SecondaryComponentPage.m_sCurrCompo = String.Empty m_SecondaryComponentPage.m_sCurrCompo = String.Empty
Dim nCount As Integer = GetPrivateProfileInt(CompoName, "Count", 0, m_MainWindow.GetIniFile()) Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
If nCount > 1 Then If nCount > 1 Then
m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me) m_MainWindow.m_DrawPageUC.LeftButtonGrd.Children.Remove(Me)
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SecondaryComponent
@@ -253,7 +253,7 @@ Public Class MainComponentPageUC
Private Sub LoadPage() Private Sub LoadPage()
Dim nDeltaSecondPage As Integer = 8 Dim nDeltaSecondPage As Integer = 8
' Leggo numero di componenti presenti ' Leggo numero di componenti presenti
Dim nCompoNumber As Integer = GetPrivateProfileInt("Compo", "Count", 0, m_MainWindow.GetIniFile()) Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
' Calcolo indici a seconda della pagina in cui sono ' Calcolo indici a seconda della pagina in cui sono
If m_bIsFirstPage Then If m_bIsFirstPage Then
ClearButton(nCompoNumber) ClearButton(nCompoNumber)
+4 -4
View File
@@ -26,17 +26,17 @@ Public Class SecondaryComponentPageUC
Dim ImageConverter As New ImageSourceConverter Dim ImageConverter As New ImageSourceConverter
Dim ThicknessConverter As New ThicknessConverter Dim ThicknessConverter As New ThicknessConverter
m_sMainCompoName = m_MainComponentPage.m_sCurrCompoFam '"Compo" & m_MainComponentPage.GetIndexFromButton(CurrentMainBtn) m_sMainCompoName = m_MainComponentPage.m_sCurrCompoFam
'Assegnazione immagine e testo ai Button 'Assegnazione immagine e testo ai Button
Dim nCount As Integer = GetPrivateProfileInt(m_sMainCompoName, "Count", 0, m_MainWindow.GetIniFile()) Dim nCount As Integer = GetPrivateProfileInt(m_sMainCompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
ClearButton(nCount) ClearButton(nCount)
For index As Integer = 1 To nCount For index As Integer = 1 To nCount
Dim CustomThickness As Thickness = ThicknessConverter.ConvertFromString("0") Dim CustomThickness As Thickness = ThicknessConverter.ConvertFromString("0")
Dim nCompoName As Integer = GetPrivateProfileInt(m_sMainCompoName, "Compo" & index, 0, m_MainWindow.GetIniFile()) Dim nCompoName As Integer = GetPrivateProfileInt(m_sMainCompoName, S_EXTCOMPO & index, 0, m_MainWindow.GetIniFile())
Dim sCompo As String = "" Dim sCompo As String = ""
Dim sCompoImage As String = "" Dim sCompoImage As String = ""
m_MainComponentPage.GetPrivateProfileCompo(m_sMainCompoName, "Compo" & index, nCompoName, sCompo, sCompoImage, m_MainWindow.GetIniFile()) m_MainComponentPage.GetPrivateProfileCompo(m_sMainCompoName, S_EXTCOMPO & index, nCompoName, sCompo, sCompoImage, m_MainWindow.GetIniFile())
Dim sCompoImageSource As ImageSource Dim sCompoImageSource As ImageSource
'verifico presenza immagine e la aggiungo 'verifico presenza immagine e la aggiungo
+25 -8
View File
@@ -75,10 +75,12 @@ Public Class SideAngleUC
' Inizializzo lati per angoli e per gocciolatoi (ne compilo la lista e aggiungo la scritta nel disegno) ' Inizializzo lati per angoli e per gocciolatoi (ne compilo la lista e aggiungo la scritta nel disegno)
InitSides() InitSides()
' Aggiorno testi nel disegno e creo i gocciolatoi '' Aggiorno testi nel disegno e creo i gocciolatoi
RefreshSideAngleText() 'RefreshSideAngleText()
' Aggiorno check e valori ' Aggiorno check e valori
RefreshCheckAndValue() RefreshCheckAndValue()
' Aggiorno testi nel disegno e creo i gocciolatoi
RefreshSideAngleText()
' Gestisco visualizzazione di tutti i parametri ' Gestisco visualizzazione di tutti i parametri
If m_Mode = ModeOpt.SIDEANGLE Then If m_Mode = ModeOpt.SIDEANGLE Then
@@ -179,6 +181,10 @@ Public Class SideAngleUC
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
' Ricavo nome primo pezzo e lo sistemo ' Ricavo nome primo pezzo e lo sistemo
If m_Mode = ModeOpt.ENGRAVE And m_MainWindow.m_DrawPageUC.SelectedLayer = GDB_ID.NULL Then
PartId = EgtGetFirstPart()
m_MainWindow.m_DrawPageUC.SetCurrLayer(EgtGetFirstNameInGroup(PartId, NAME_OUTLOOP))
End If
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL) PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
@@ -275,8 +281,8 @@ Public Class SideAngleUC
' Attualmente il vaore m_nCount è inizializzato ad "1".. ' Attualmente il vaore m_nCount è inizializzato ad "1"..
' Bottoni Prev Next ' Bottoni Prev Next
If m_nCount <= MAX_LINES Then If m_nCount <= MAX_LINES Then
PrevBtn.Visibility = Windows.Visibility.Hidden PrevBtn.Visibility= Windows.Visibility.Hidden
NextBtn.Visibility = Windows.Visibility.Hidden NextBtn.Visibility= Windows.Visibility.Hidden
Else Else
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow) Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
PrevBtn.Visibility = Windows.Visibility.Visible PrevBtn.Visibility = Windows.Visibility.Visible
@@ -497,11 +503,10 @@ Public Class SideAngleUC
If m_CallingPage = MainWindow.Pages.Draw Then If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
' Ricavo nome primo pezzo
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL) PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo ' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
ElseIf m_CallingPage = MainWindow.Pages.Import Then ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente ' Imposto contesto corrente
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
' Recupero nome pezzo ' Recupero nome pezzo
@@ -568,8 +573,20 @@ Public Class SideAngleUC
' verifico se l'entità ha un gocciolatoio ' verifico se l'entità ha un gocciolatoio
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
' aggiorno i valore delle caselle di testo per le entità caricate (Start/End) ' aggiorno i valore delle caselle di testo per le entità caricate (Start/End)
GetAngleTxBxFromIndex(nChIndex).Text = DoubleToString(Entity.dShortStart, 1) If m_Mode = ModeOpt.ENGRAVE Then
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1) Dim dVal As Double = 0
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_Start", 0, m_MainWindow.GetIniFile()), dVal) Then
Entity.dShortStart = dVal
End If
If StringToLen(GetPrivateProfileDouble(S_SIDES, K_ENGRAVESHORT & "A" & nIndex.ToString & "_End", 0, m_MainWindow.GetIniFile()), dVal) Then
Entity.dShortEnd = dVal
End If
Else
'GetAngleTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_Start", 0, m_MainWindow.GetIniFile())
'GetHeelTxBxFromIndex(Index).Text = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT & "A" & nI.ToString & "_End", 0, m_MainWindow.GetIniFile())
End If
GetAngleTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortStart, 1)
GetHeelTxBxFromIndex(nChIndex).Text = LenToString(Entity.dShortEnd, 1)
Next Next
End If End If
End Sub End Sub
+8
View File
@@ -1026,6 +1026,14 @@ Public Class AlarmsPageUC
End Sub End Sub
Private Sub SawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles SawProbingBtn.Click Private Sub SawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles SawProbingBtn.Click
' imposto modo automatico
Select Case m_MainWindow.m_CNCommunication.m_nNCType
Case 1, 2
' in attesa di verifica
Case 3
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
End Select
' Recupero file LUA ' Recupero file LUA
EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua") EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
' Recupero utensile da tastare ' Recupero utensile da tastare
+139
View File
@@ -0,0 +1,139 @@
<Window x:Class="ImportExportMachiningWindowWD"
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"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="SaveNameWD" Height="350" Width="426.5" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0" Margin="20">
<TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningFamily}" ItemsSource="{Binding MachiningList}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
</Grid>
<!-- multibinding quando sono attivi.-->
<HierarchicalDataTemplate.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}" >
<Setter Property="Foreground" Value="{DynamicResource OmagCut_TreeViewTextColor}" />
<Setter Property="IsSelected" Value="{Binding IsSelected}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="19" Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
<Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" VerticalAlignment="Top" Fill="{DynamicResource OmagCut_TreeViewDelimiterColor}" Height="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="false">
<Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBackground}" />
<Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBorder}"/>
<Setter Property="BorderThickness" TargetName="Bd" Value="1"/>
<!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
</Trigger>
<!--<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
</MultiTrigger>-->
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</HierarchicalDataTemplate.ItemContainerStyle>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
<CheckBox Name="ActiveTxBx" Grid.Column="0" Height="15" Width="15"
Margin="-15,0,5,0" VerticalContentAlignment="Center"
IsChecked="{Binding Active}"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1" Text="{Binding Name}"
Style="{StaticResource OmagCut_ListBoxTextBlock}" />
</Grid>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</ScrollViewer>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Row="0" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
Margin="5,-10,5,15"
Command="{Binding OkCommand}">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="ExitBtn" Grid.Row="0" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}"
Margin="5,-10,5,15"
IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
@@ -0,0 +1,33 @@
Imports EgtWPFLib5
Public Class ImportExportMachiningWindowWD
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_ImportExportMachiningWindowVM As ImportExportMachiningWindowVM
Private m_OkResult As Boolean = False
Public ReadOnly Property OkResult As Boolean
Get
Return m_OkResult
End Get
End Property
Sub New(Owner As Window, ImportExportToolWindowVM As ImportExportMachiningWindowVM)
Me.Owner = Owner
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportExportToolWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportExportMachiningWindowVM = ImportExportToolWindowVM
End Sub
Private Sub OkCloseDialogWD() Handles OkBtn.Click
m_OkResult = True
Me.Close()
End Sub
Private Sub CancelCloseDialogWD() Handles ExitBtn.Click
m_OkResult = False
Me.Close()
End Sub
End Class
+2 -2
View File
@@ -18,7 +18,7 @@
<ScrollViewer Grid.Row="0" Margin="20"> <ScrollViewer Grid.Row="0" Margin="20">
<TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}"> <TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
<TreeView.Resources> <TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpFamily}" ItemsSource="{Binding ToolList}"> <HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolFamily}" ItemsSource="{Binding ToolList}">
<Grid Height="20"> <Grid Height="20">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -88,7 +88,7 @@
</HierarchicalDataTemplate.ItemContainerStyle> </HierarchicalDataTemplate.ItemContainerStyle>
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpItem}"> <DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolItem}">
<Grid Height="20"> <Grid Height="20">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
+18
View File
@@ -5,6 +5,13 @@ Public Class ImportExportToolWD
Private WithEvents m_ImportExportToolWindowVM As ImportExportToolWindowVM Private WithEvents m_ImportExportToolWindowVM As ImportExportToolWindowVM
Private m_OkResult As Boolean = False
Public ReadOnly Property OkResult As Boolean
Get
Return m_OkResult
End Get
End Property
Sub New(Owner As Window, ImportExportToolWindowVM As ImportExportToolWindowVM) Sub New(Owner As Window, ImportExportToolWindowVM As ImportExportToolWindowVM)
Me.Owner = Owner Me.Owner = Owner
' This call is required by the designer. ' This call is required by the designer.
@@ -17,4 +24,15 @@ Public Class ImportExportToolWD
'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportToolWindowVM.m_CloseWindow 'Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ImportExportToolWindowVM.m_CloseWindow
' Me.DialogResult = bDialogResult ' Me.DialogResult = bDialogResult
'End Sub 'End Sub
Private Sub OkCloseDialogWD() Handles OkBtn.Click
m_OkResult = True
Me.Close()
End Sub
Private Sub CancelCloseDialogWD() Handles ExitBtn.Click
m_OkResult = False
Me.Close()
End Sub
End Class End Class
+2 -2
View File
@@ -423,8 +423,8 @@
<TextBlock Grid.Column="0" Name="ConsumptionNameTxBx" Text="A" <TextBlock Grid.Column="0" Name="ConsumptionNameTxBx" Text="A"
Style="{StaticResource OmagCut_LowerBarTitleTextBlock}"/> Style="{StaticResource OmagCut_LowerBarTitleTextBlock}"/>
<TextBlock Grid.Column="1" Name="ConsumptionTxBx" Text="25" <TextBlock Grid.Column="1" Name="ConsumptionTxBx" Text="25.00"
Style="{StaticResource OmagCut_LowerBarValueTextBlock}"/> Style="{StaticResource OmagCut_LowerBarValueTextBlock}" FontSize="22"/>
</Grid> </Grid>
+4 -2
View File
@@ -931,14 +931,16 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="11*"/> <ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/> <Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
<Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/> <Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
<Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/> <Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
<Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
<Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
</Grid> </Grid>
</Grid> </Grid>
+190
View File
@@ -3,6 +3,7 @@ Imports System.ComponentModel
Imports OmagCUT.TreeViewItem Imports OmagCUT.TreeViewItem
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
Imports EgtWPFLib5
Public Class MachiningDbPageUC Public Class MachiningDbPageUC
@@ -78,6 +79,8 @@ Public Class MachiningDbPageUC
NewBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 16) NewBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 16)
SaveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 17) SaveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 17)
RemoveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18) RemoveBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 18)
ExportBtn.Content = "Export"
ImportBtn.Content = "Import"
NameTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 1) NameTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 1)
DepthTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 2) DepthTxBl.Text = EgtMsg(MSG_MACHININGSDBPAGEUC + 2)
@@ -321,6 +324,193 @@ Public Class MachiningDbPageUC
End If End If
End Sub End Sub
Private Sub ExportBtn_Click(Sender As Object, e As RoutedEventArgs) Handles ExportBtn.Click
' contesto corrente
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' creo lista lavorazioni per esportazione
Dim MachiningToExportList As New ObservableCollection(Of ImpExpMachiningFamily)
Dim Family As CathegoryItem
Dim Machining As CustomItem
For Each Family In MachiningsList
Dim ImpExpMachiningFamily As New ImpExpMachiningFamily(Family.Name, Family.nTType)
For Each Machining In Family.Items
ImpExpMachiningFamily.MachiningList.Add(New ImpExpMachiningItem(Machining.Name, False))
Next
MachiningToExportList.Add(ImpExpMachiningFamily)
Next
Dim ExportWndVM As New ImportExportMachiningWindowVM(MachiningToExportList)
Dim ExportWnd As New ImportExportMachiningWindowWD(Application.Current.MainWindow, ExportWndVM)
ExportWnd.ShowDialog()
End Sub
Private Sub ImoportBtn_Click() Handles ImportBtn.Click
' contesto corrente
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' apro dialogo di scelta file
Dim ImportFileDlg As New Microsoft.Win32.OpenFileDialog() With {
.Title = EgtMsg(31161) & " " & EgtMsg(31163),
.DefaultExt = ".data",
.Filter = "Machinings (.data)|*.data",
.CheckFileExists = True,
.ValidateNames = True
}
If ImportFileDlg.ShowDialog() <> True Then Return
Dim ImportFilePath As String = ImportFileDlg.FileName
' recupero liste utensili da importare
Dim ImportFileMachiningNameList As String() = Nothing
Dim ImportFileMachiningFamilyList As Integer() = Nothing
If Not EgtMdbToBeImported(ImportFilePath, ImportFileMachiningNameList, ImportFileMachiningFamilyList) Then Return
' li inserisco in lista per finestra di scelta
Dim MachinigToImportList As New ObservableCollection(Of ImpExpMachiningFamily)
' creo famiglie di utensili in base a quelle trovate in lista importata
For MachiningIndex As Integer = 0 To ImportFileMachiningNameList.Count - 1
Dim MachiningName As String = ImportFileMachiningNameList(MachiningIndex)
Dim MachiningFamily As Integer = ImportFileMachiningFamilyList(MachiningIndex)
MachiningFamily = MachiningFamily And
(MCH_MY.DRILLING Or
MCH_MY.SAWING Or
MCH_MY.MILLING Or
MCH_MY.POCKETING Or
MCH_MY.MORTISING Or
MCH_MY.SAWROUGHING Or
MCH_MY.SAWFINISHING Or
MCH_MY.GENMACHINING Or
MCH_MY.CHISELING Or
MCH_MY.SURFROUGHING Or
MCH_MY.SURFFINISHING Or
MCH_MY.WATERJETTING)
Dim bFounded As Boolean = False
Dim MachinigToImportFamily As ImpExpMachiningFamily
For Each MachinigToImportFamily In MachinigToImportList
If (MachiningFamily = MachinigToImportFamily.FamilyType) Then
MachinigToImportFamily.MachiningList.Add(New ImpExpMachiningItem(MachiningName, AlreadyExist(MachiningName)))
bFounded = True
Exit For
End If
Next
If Not bFounded Then
Dim NewFamily As New ImpExpMachiningFamily(GetMachiningFamilyName(MachiningFamily), MachiningFamily)
NewFamily.MachiningList.Add(New ImpExpMachiningItem(MachiningName, AlreadyExist(MachiningName)))
MachinigToImportList.Add(NewFamily)
End If
Next
Dim ImportWndVM As New ImportExportMachiningWindowVM(MachinigToImportList, ImportFilePath, ImportFileMachiningNameList)
Dim ImportWnd As New ImportExportMachiningWindowWD(Application.Current.MainWindow, ImportWndVM)
ImportWnd.ShowDialog()
' Aggiungo all'albero visualizzato gli utensili appena importati
If ImportWnd.OkResult Then
LoadImportedMachineMachinings(ImportWndVM.vsImported)
End If
End Sub
Private Function AlreadyExist(MachiningName As String) As Boolean
Dim MachiningFamily As CathegoryItem
For Each MachiningFamily In MachiningsList
Dim MachiningItem As CustomItem
For Each MachiningItem In MachiningFamily.Items
If MachiningName = MachiningItem.Name Then
Return True
End If
Next
Next
Return False
End Function
Private Function GetMachiningFamilyName(NewMachinigFamily As Integer) As String
Dim MachiningFamily As CathegoryItem
For Each MachiningFamily In MachiningsList
If NewMachinigFamily = MachiningFamily.nTType Then
Return MachiningFamily.Name
End If
Next
Return ""
End Function
Private Sub LoadImportedMachineMachinings(vsImportedMachinings As String())
' Leggo tutte le lavorazioni presenti nella Macchina (quindi anche quelli appena importati).
Dim ActiveMachiningsFamilies() As MachiningsType = MyReadMachiningFamilies(m_MainWindow.m_CurrentMachine.sMachIniFile)
Dim MachiningsFamilyIndex As Integer = 0
Dim MachiningsFamilyItem As MachiningsType
For Each MachiningsFamilyItem In ActiveMachiningsFamilies
Dim FamilyTreeView As New CathegoryItem(MachiningsFamilyItem.Name, MachiningsFamilyItem.Id)
Dim MachiningFamilyItem = MachiningsList.FirstOrDefault(Function(MachiningFamily) MachiningsFamilyItem.Id = MachiningFamily.nTType)
If IsNothing(MachiningFamilyItem) Then
MachiningsList.Insert(MachiningsFamilyIndex, FamilyTreeView)
End If
Dim nType As Integer = 0
Dim MachiningName As String = String.Empty
Dim MachiningIndex As Integer = 0
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningsFamilyItem.Id, MachiningName)
While bFound
Dim MachiningItem = MachiningsList(MachiningsFamilyIndex).Items.FirstOrDefault(Function(Machining) Machining.Name = MachiningName)
Dim bInList As Boolean = vsImportedMachinings.Contains(MachiningName)
If bInList Then
' Se una lavorazione è presente nella MachiningsList visualizzata ma nel contempo è nell'array vsImported
' vuol dire che è stata sovrascritta perciò la rimuovo
MachiningsList(MachiningsFamilyIndex).Items.Remove(MachiningsList(MachiningsFamilyIndex).Items.FirstOrDefault(Function(Machining) Machining.Name = MachiningName))
End If
If bInList OrElse IsNothing(MachiningItem) Then
' recupero tuuid
EgtMdbSetCurrMachining(MachiningName)
Dim sCurrMachTUUID As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sCurrMachTUUID)
' aggiungo la lavorazione importata
MachiningsList(MachiningsFamilyIndex).Items.Insert(MachiningIndex, New CustomItem(MachiningName, MachiningsFamilyItem.Id, ToolDbUtility.IsToolInDb(sCurrMachTUUID)))
' eventualmente evidezio l'ultimo elemento inserito (ERRORE: non espando l'albero)
'MachiningsList(MachiningsFamilyIndex).Items(MachiningIndex).IsSelected = True
End If
MachiningIndex += 1
bFound = EgtMdbGetNextMachining(MachiningsFamilyItem.Id, MachiningName)
End While
MachiningsFamilyIndex += 1
Next
End Sub
Public Function MyReadMachiningFamilies(sMachineIniPath As String) As MachiningsType()
Dim ActiveMachiningsFamiliesList As New List(Of MachiningsType)
' Se il materiale lavorato è Marmo l'ordine di lettura e inserimento di Foratura e Taglio di lama nelle famiglie di lavorazioni attive è invertito
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWING, .Name = EgtMsg(31200 + 2)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.DRILLING, .Name = EgtMsg(31200 + 1)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.MILLING, .Name = EgtMsg(31200 + 3)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_POCKETING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.POCKETING, .Name = EgtMsg(31200 + 4)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_MORTISING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.MORTISING, .Name = EgtMsg(31200 + 5)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWROUGHING, .Name = EgtMsg(31200 + 6)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SAWFINISHING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SAWFINISHING, .Name = EgtMsg(31200 + 7)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_GENMACHINING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.GENMACHINING, .Name = EgtMsg(31200 + 8)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_CHISELING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.CHISELING, .Name = EgtMsg(31200 + 9)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_SURFFINISHING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.SURFFINISHING, .Name = EgtMsg(31211)})
End If
If EgtUILib.GetPrivateProfileInt(S_MACHININGS, K_WATERJETTING, 0, sMachineIniPath) <> 0 Then
ActiveMachiningsFamiliesList.Add(New MachiningsType With {.Id = MCH_MY.WATERJETTING, .Name = EgtMsg(31210)})
End If
Return ActiveMachiningsFamiliesList.ToArray
End Function
Private Sub InitializeMachiningFamily(bEnabled As Boolean, nFType As Integer, sFName As String) Private Sub InitializeMachiningFamily(bEnabled As Boolean, nFType As Integer, sFName As String)
If Not bEnabled Then Return If Not bEnabled Then Return
' Inserisco categoria ed eventuali elementi ' Inserisco categoria ed eventuali elementi
+3 -4
View File
@@ -434,17 +434,16 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="9*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/> <Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
<Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/> <Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
<Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/> <Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
<Button Name="ExportBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/> <Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
<Button Name="ImportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/> <Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
</Grid> </Grid>
+131 -23
View File
@@ -17,6 +17,8 @@ Public Class ToolsDbPageUC
Dim ToolsList As New ObservableCollection(Of CathegoryItem) Dim ToolsList As New ObservableCollection(Of CathegoryItem)
' Proprietà ' Proprietà
Private m_bFirst As Boolean = True Private m_bFirst As Boolean = True
' Flag nuova gestione parametri lama in disegno
Private m_bNewSawbladeMaker As Boolean = False
' Stringa identificativa variabile geometrica in modifica ' Stringa identificativa variabile geometrica in modifica
Private m_sCurrVar As String = String.Empty Private m_sCurrVar As String = String.Empty
' Parametri dell'utensile corrente ' Parametri dell'utensile corrente
@@ -173,6 +175,10 @@ Public Class ToolsDbPageUC
If Not m_CurrMachine.bShowHeadExit Then If Not m_CurrMachine.bShowHeadExit Then
MoveParam() MoveParam()
End If End If
' Verifico se macchina con nuovo SawbladeMaker
Dim sSawBladeMaker As String = ""
GetPrivateProfileString(S_TOOLS, K_SAWBLADEMAKER, "", sSawBladeMaker, m_MainWindow.GetIniFile())
m_bNewSawbladeMaker = String.Compare(sSawBladeMaker, "MakeStoneSawBlade.lua", True)
m_bFirst = False m_bFirst = False
Else Else
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
@@ -487,17 +493,17 @@ Public Class ToolsDbPageUC
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' creo lista utensili per esportazione ' creo lista utensili per esportazione
Dim ToolToExportList = New ObservableCollection(Of ImpExpFamily) Dim ToolToExportList = New ObservableCollection(Of ImpExpToolFamily)
Dim Family As CathegoryItem Dim Family As CathegoryItem
Dim Tool As CustomItem Dim Tool As CustomItem
For Each Family In ToolsList For Each Family In ToolsList
Dim ImpExpFamily As New ImpExpFamily(Family.Name, Family.nTType) Dim ImpExpToolFamily As New ImpExpToolFamily(Family.Name, Family.nTType)
ImpExpFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png" ImpExpToolFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png"
For Each Tool In Family.Items For Each Tool In Family.Items
Dim CurrTool = New ImpExpItem(Tool.Name, False) Dim CurrTool = New ImpExpToolItem(Tool.Name, False)
ImpExpFamily.ToolList.Add(CurrTool) ImpExpToolFamily.ToolList.Add(CurrTool)
Next Next
ToolToExportList.Add(ImpExpFamily) ToolToExportList.Add(ImpExpToolFamily)
Next Next
Dim ExportWndVM As New ImportExportToolWindowVM(ToolToExportList) Dim ExportWndVM As New ImportExportToolWindowVM(ToolToExportList)
@@ -522,9 +528,9 @@ Public Class ToolsDbPageUC
' recupero liste utensili da importare ' recupero liste utensili da importare
Dim ImportFileToolNameList As String() = Nothing Dim ImportFileToolNameList As String() = Nothing
Dim ImportFileToolFamilyList As Integer() = Nothing Dim ImportFileToolFamilyList As Integer() = Nothing
EgtTdbToBeImported(ImportFilePath, ImportFileToolNameList, ImportFileToolFamilyList) If Not EgtTdbToBeImported(ImportFilePath, ImportFileToolNameList, ImportFileToolFamilyList) Then Return
' li inserisco in lista per finestra di scelta ' li inserisco in lista per finestra di scelta
Dim ToolToImportList As New ObservableCollection(Of ImpExpFamily) Dim ToolToImportList As New ObservableCollection(Of ImpExpToolFamily)
' creo famiglie di utensili in base a quelle trovate in lista importata ' creo famiglie di utensili in base a quelle trovate in lista importata
For ToolIndex As Integer = 0 To ImportFileToolNameList.Count - 1 For ToolIndex As Integer = 0 To ImportFileToolNameList.Count - 1
Dim ToolName As String = ImportFileToolNameList(ToolIndex) Dim ToolName As String = ImportFileToolNameList(ToolIndex)
@@ -538,25 +544,26 @@ Public Class ToolsDbPageUC
MCH_TF.WATERJET Or MCH_TF.WATERJET Or
MCH_TF.COMPO) MCH_TF.COMPO)
Dim bFounded As Boolean = False Dim bFounded As Boolean = False
Dim ToolToImportFamily As ImpExpFamily Dim ToolToImportFamily As ImpExpToolFamily
For Each ToolToImportFamily In ToolToImportList For Each ToolToImportFamily In ToolToImportList
If (ToolFamily = ToolToImportFamily.FamilyType) Then If (ToolFamily = ToolToImportFamily.FamilyType) Then
ToolToImportFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName))) ToolToImportFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
bFounded = True bFounded = True
Exit For Exit For
End If End If
Next Next
If Not bFounded Then If Not bFounded Then
Dim NewFamily As New ImpExpFamily(GetToolFamilyName(ToolFamily), ToolFamily) Dim NewFamily As New ImpExpToolFamily(GetToolFamilyName(ToolFamily), ToolFamily)
NewFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName))) NewFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
ToolToImportList.Add(NewFamily) ToolToImportList.Add(NewFamily)
End If End If
Next Next
Dim ImportWndVM As New ImportExportToolWindowVM(ToolToImportList, ImportFilePath, ImportFileToolNameList) Dim ImportWndVM As New ImportExportToolWindowVM(ToolToImportList, ImportFilePath, ImportFileToolNameList)
Dim ImportWnd As New ImportExportToolWD(Application.Current.MainWindow, ImportWndVM) Dim ImportWnd As New ImportExportToolWD(Application.Current.MainWindow, ImportWndVM)
If ImportWnd.ShowDialog() Then ImportWnd.ShowDialog()
' Aggiungo all'albero visualizzato gli utensili appena importati ' Aggiungo all'albero visualizzato gli utensili appena importati
If ImportWnd.OkResult Then
LoadImportedMachineTools(ImportWndVM.vsImported) LoadImportedMachineTools(ImportWndVM.vsImported)
End If End If
End Sub End Sub
@@ -586,31 +593,38 @@ Public Class ToolsDbPageUC
Private Sub LoadImportedMachineTools(vsImportedTools As String()) Private Sub LoadImportedMachineTools(vsImportedTools As String())
' Leggo tutti gli utensili presenti nella Macchina (quindi anche quelli appena importati). ' Leggo tutti gli utensili presenti nella Macchina (quindi anche quelli appena importati).
Dim ActiveToolsFamilies() As ToolsFamily = MachineUtility.ReadToolFamilies(m_CurrMachine.sMachIniFile) Dim ActiveToolsFamilies() As ToolsFamily = MyReadToolFamilies(m_CurrMachine.sMachIniFile)
Dim ToolsFamilyIndex As Integer = 0 Dim ToolsFamilyIndex As Integer = 0
Dim ToolsFamilyItem As ToolsFamily Dim ToolsFamilyItem As ToolsFamily
For Each ToolsFamilyItem In ActiveToolsFamilies For Each ToolsFamilyItem In ActiveToolsFamilies
' dalla lista che ho ricavato dalla libreria recupero gli utensili associati
Dim FamilyTreeView As New CathegoryItem(ToolsFamilyItem.Name, ToolsFamilyItem.Id) Dim FamilyTreeView As New CathegoryItem(ToolsFamilyItem.Name, ToolsFamilyItem.Id)
Dim ToolFamilyItem = ToolsList.FirstOrDefault(Function(ToolFamily) ToolsFamilyItem.Id = FamilyTreeView.nTType) Dim ToolFamilyItem = ToolsList.FirstOrDefault(Function(ToolFamily) ToolFamily.nTType = ToolsFamilyItem.Id)
If IsNothing(ToolFamilyItem) Then If IsNothing(ToolFamilyItem) Then
ToolsList.Insert(ToolsFamilyIndex, FamilyTreeView) ToolsList.Insert(ToolsFamilyIndex, FamilyTreeView)
Else
' ricerco l'indice nella lista Tools
End If End If
Dim nType As Integer = 0 Dim nType As Integer = 0
Dim ToolName As String = String.Empty Dim ToolName As String = String.Empty
Dim ToolIndex As Integer = 0 Dim ToolIndex As Integer = 0
EgtSetCurrentContext(ToolScene.GetCtx()) 'EgtSetCurrentContext(ToolScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
If EgtTdbGetFirstTool(ToolsFamilyItem.Id, ToolName, nType) Then If EgtTdbGetFirstTool(ToolsFamilyItem.Id, ToolName, nType) Then
Dim ToolItem = ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName) Dim ToolItem = ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName)
If IsNothing(ToolItem) Then If IsNothing(ToolItem) Then
' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa. ' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa.
Dim NewToolName As New CustomItem(ToolName, nType) Dim NewToolName As New CustomItem(ToolName, nType)
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName) ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
'NewToolName.IsSelected = True
ElseIf vsImportedTools.Contains(ToolName) Then ElseIf vsImportedTools.Contains(ToolName) Then
' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported ' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported
' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList. ' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList.
ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName)) ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName))
Dim NewToolName As New CustomItem(ToolName, nType) Dim NewToolName As New CustomItem(ToolName, nType)
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName) ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
'NewToolName.IsSelected = True
End If End If
ToolIndex += 1 ToolIndex += 1
While EgtTdbGetNextTool(ToolsFamilyItem.Id, ToolName, nType) While EgtTdbGetNextTool(ToolsFamilyItem.Id, ToolName, nType)
@@ -619,20 +633,60 @@ Public Class ToolsDbPageUC
' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa. ' Se leggo un utensile non presente nella ToolsList visualizzata lo aggiungo ad essa.
Dim NewToolName As New CustomItem(ToolName, nType) Dim NewToolName As New CustomItem(ToolName, nType)
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName) ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
'NewToolName.IsSelected = True
ElseIf vsImportedTools.Contains(ToolName) Then ElseIf vsImportedTools.Contains(ToolName) Then
' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported ' Se un utensile è presente nella ToolsList visualizzata ma nel contempo è nell'array vsImported
' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList. ' vuol dire che è stato sovrascritto perciò lo rimuovo e lo riaggiungo alla ToolsList.
ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName)) ToolsList(ToolsFamilyIndex).Items.Remove(ToolsList(ToolsFamilyIndex).Items.FirstOrDefault(Function(Tool) Tool.Name = ToolName))
Dim NewToolName As New CustomItem(ToolName, nType) Dim NewToolName As New CustomItem(ToolName, nType)
ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName) ToolsList(ToolsFamilyIndex).Items.Insert(ToolIndex, NewToolName)
'NewToolName.IsSelected = True
End If End If
ToolIndex += 1 ToolIndex += 1
End While End While
End If End If
ToolsFamilyIndex += 1 ToolsFamilyIndex += 1
Next Next
End Sub End Sub
Public Function MyReadToolFamilies(sMachineIniPath As String) As ToolsFamily()
Dim ActiveToolsFamiliesList As New List(Of ToolsFamily)
' Se il materiale lavorato è Marmo l'ordine di lettura e inserimento di Punta e Lama nelle famiglie di utensili attivi è invertito
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_SAWBLADE, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.SAWBLADE, EgtMsg(31000 + 2)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.DRILLBIT, EgtMsg(31000 + 1)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_MILL, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(31000 + 3)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, "CupWheel", 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(90754)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, "PolishingWheel", 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MILL, EgtMsg(90756)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_MORTISE, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.MORTISE, EgtMsg(31000 + 4)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_CHISEL, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.CHISEL, EgtMsg(31000 + 9)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_COMPO, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.COMPO, EgtMsg(31000 + 5)))
End If
If EgtUILib.GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachineIniPath) <> 0 Then
ActiveToolsFamiliesList.Add(New ToolsFamily(MCH_TF.WATERJET, EgtMsg(31010)))
End If
Return ActiveToolsFamiliesList.ToArray
End Function
Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String) Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String)
If Not bEnabled Then Return If Not bEnabled Then Return
' Inserisco categoria ed eventuali elementi ' Inserisco categoria ed eventuali elementi
@@ -915,8 +969,8 @@ Public Class ToolsDbPageUC
nMsg = MSG_TOOLSDBPAGEUC + 24 ' Tagliente nMsg = MSG_TOOLSDBPAGEUC + 24 ' Tagliente
Case MCH_TP.CORE Case MCH_TP.CORE
nMsg = 90720 ' Anima nMsg = 90720 ' Anima
'Case MCH_TP.STEM Case STEM
'nMsg = "Portautensile" ' Portautensile nMsg = 90719 ' Lunghezza portautensile
End Select End Select
' Predispongo calcolatrice (converto sempre in UIUnits perchè tutte lunghezze) ' Predispongo calcolatrice (converto sempre in UIUnits perchè tutte lunghezze)
Dim EgtCalculator As New EgtCalculatorWD(m_MainWindow, EgtToUiUnits(dVal), 300, WidthType.PIXEL, 0, 0, EgtMsg(nMsg)) Dim EgtCalculator As New EgtCalculatorWD(m_MainWindow, EgtToUiUnits(dVal), 300, WidthType.PIXEL, 0, 0, EgtMsg(nMsg))
@@ -947,7 +1001,20 @@ Public Class ToolsDbPageUC
Private Function GetVariableValue(ByRef dVal As Double) As Boolean Private Function GetVariableValue(ByRef dVal As Double) As Boolean
' Recupero valore variabile ' Recupero valore variabile
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
Return EgtTdbGetCurrToolParam(GetVariableType(), dVal) Dim nVarType As Integer = GetVariableType()
If m_nToolType <> MCH_TY.SAW_STD OrElse nVarType <> STEM Then
Return EgtTdbGetCurrToolParam(nVarType, dVal)
Else
Dim dL, dCore, dTh As Double
If EgtTdbGetCurrToolParam(MCH_TP.LEN, dL) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.CORE, dCore) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dTh) Then
dVal = Math.Max(dL - (dCore + dTh) / 2, 0.0)
Return True
Else
Return False
End If
End If
End Function End Function
Private Function SetVariableValue(ByVal dVal As Double) As Boolean Private Function SetVariableValue(ByVal dVal As Double) As Boolean
@@ -961,8 +1028,30 @@ Public Class ToolsDbPageUC
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dVal + 1) EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dVal + 1)
Case MCH_TP.DIAM Case MCH_TP.DIAM
EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dVal) EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dVal)
Case MCH_TP.THICK
If m_bNewSawbladeMaker Then
Dim dTh, dLen As Double
If EgtTdbGetCurrToolParam(MCH_TP.THICK, dTh) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.LEN, dLen) Then
Dim dNewLen As Double = dLen + ((dVal - dTh) / 2)
EgtTdbSetCurrToolParam(MCH_TP.LEN, dNewLen)
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dNewLen + 1)
Else
Return False
End If
End If
Case MCH_TP.CORE Case MCH_TP.CORE
EgtTdbSetCurrToolParam(MCH_TP.CORE, dVal) If m_bNewSawbladeMaker Then
Dim dCore, dLen As Double
If EgtTdbGetCurrToolParam(MCH_TP.CORE, dCore) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.LEN, dLen) Then
Dim dNewLen As Double = dLen + ((dVal - dCore) / 2)
EgtTdbSetCurrToolParam(MCH_TP.LEN, dNewLen)
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dNewLen + 1)
Else
Return False
End If
End If
End Select End Select
ElseIf m_nToolType = MCH_TY.DRILL_STD Then ElseIf m_nToolType = MCH_TY.DRILL_STD Then
Select Case nType Select Case nType
@@ -988,7 +1077,19 @@ Public Class ToolsDbPageUC
EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dVal) EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dVal)
End Select End Select
End If End If
Return EgtTdbSetCurrToolParam(nType, dVal) If m_nToolType <> MCH_TY.SAW_STD OrElse nType <> STEM Then
Return EgtTdbSetCurrToolParam(nType, dVal)
Else
Dim dCore, dTh As Double
If EgtTdbGetCurrToolParam(MCH_TP.CORE, dCore) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dTh) Then
Dim dL As Double = Math.Max(dVal, 0.0) + ((dCore + dTh) / 2)
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dL + 1)
Return EgtTdbSetCurrToolParam(MCH_TP.LEN, dL)
Else
Return False
End If
End If
End Function End Function
Private Function GetVariableType() As Integer Private Function GetVariableType() As Integer
@@ -1004,7 +1105,7 @@ Public Class ToolsDbPageUC
ElseIf m_sCurrVar = "CORE" Then ElseIf m_sCurrVar = "CORE" Then
nType = MCH_TP.CORE nType = MCH_TP.CORE
ElseIf m_sCurrVar = "STEM" Then ElseIf m_sCurrVar = "STEM" Then
'nType = MCH_TP.STEM nType = STEM
End If End If
Return nType Return nType
End Function End Function
@@ -1066,6 +1167,13 @@ Public Class ToolsDbPageUC
EgtTdbSetCurrToolParam(MCH_TP.THICK, dToolThick) EgtTdbSetCurrToolParam(MCH_TP.THICK, dToolThick)
EgtOutLog("ToolThick too small ->" & DoubleToString(dToolThick, 1)) EgtOutLog("ToolThick too small ->" & DoubleToString(dToolThick, 1))
End If End If
Dim dToolCore As Double
EgtTdbGetCurrToolParam(MCH_TP.CORE, dToolCore)
If dToolCore < EPS_SMALL Then
dToolCore = If(dToolLen >= dToolThick, dToolThick - 1, 2 * dToolLen - dToolThick)
EgtTdbSetCurrToolParam(MCH_TP.CORE, dToolCore)
EgtOutLog("ToolCore too small ->" & DoubleToString(dToolCore, 1))
End If
Dim dToolMaxMat As Double Dim dToolMaxMat As Double
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, dToolMaxMat) EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, dToolMaxMat)
If dToolMaxMat < EPS_SMALL Then If dToolMaxMat < EPS_SMALL Then
+2 -2
View File
@@ -323,8 +323,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave ' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2309, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(9423, 2312, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2309, 1, m_nKeyOptions) EgtGetKeyOptions(9423, 2312, 1, m_nKeyOptions)
' Verifico abilitazione prodotto ' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE) Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.3.9.5")> <Assembly: AssemblyVersion("2.3.12.1")>
<Assembly: AssemblyFileVersion("2.3.9.5")> <Assembly: AssemblyFileVersion("2.3.12.1")>
+23 -10
View File
@@ -11,6 +11,8 @@ Public Class CNCommunication
Private m_AlarmsPage As AlarmsPageUC = m_MainWindow.m_MachinePageUC.m_AlarmsPageUC Private m_AlarmsPage As AlarmsPageUC = m_MainWindow.m_MachinePageUC.m_AlarmsPageUC
Private m_CurrProjPage As CurrentProjectPageUC = m_MainWindow.m_CurrentProjectPageUC Private m_CurrProjPage As CurrentProjectPageUC = m_MainWindow.m_CurrentProjectPageUC
Friend m_nCountRefresh As Integer = 0
' Variabile per tipologia CN ' Variabile per tipologia CN
Friend m_nNCType As Integer Friend m_nNCType As Integer
@@ -225,8 +227,11 @@ Public Class CNCommunication
' definisco il tipo di varibili che devono essere scritte nl plc ' definisco il tipo di varibili che devono essere scritte nl plc
Dim sVal As String = String.Empty Dim sVal As String = String.Empty
GetPrivateProfileString(S_NCDATA, K_NEWVARIABLE, "0", sVal, m_MainWindow.GetMachIniFile()) Dim nVal As Integer = 0
m_CN.m_NewVariable = sVal <> 0 'GetPrivateProfileString(S_NCDATA, K_NEWVARIABLE, "0", sVal, m_MainWindow.GetMachIniFile())
nVal = GetPrivateProfileInt(S_NCDATA, K_NEWVARIABLE, nVal, m_MainWindow.GetMachIniFile())
'm_CN.m_NewVariable = sVal <> "0"
m_CN.m_NewVariable = (nVal <> 0)
EgtOutLog("NewVariable=" & If(m_CN.m_NewVariable, "1", "0")) EgtOutLog("NewVariable=" & If(m_CN.m_NewVariable, "1", "0"))
' Recupero e imposto le variabili per i dati del CN (feed, speed,...) ' Recupero e imposto le variabili per i dati del CN (feed, speed,...)
@@ -326,8 +331,8 @@ Public Class CNCommunication
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal) m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
' nuove variabili: stato dei nuovi pulsanti ' nuove variabili: stato dei nuovi pulsanti
GetPrivateProfileString(S_NCDATA, K_NEWCONSOLE, "", sVal, m_MainWindow.GetMachIniFile()) nVal = GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile())
m_IsNewConsole = (sVal = 1) m_IsNewConsole = (nVal = 1)
If m_IsNewConsole Then If m_IsNewConsole Then
GetPrivateProfileString(S_NCDATA, K_XYJOG, "", sVal, m_MainWindow.GetMachIniFile()) GetPrivateProfileString(S_NCDATA, K_XYJOG, "", sVal, m_MainWindow.GetMachIniFile())
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.XYJog, sVal) If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.XYJog, sVal)
@@ -376,6 +381,7 @@ Public Class CNCommunication
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg) EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
Process.Start(m_sCNSiemensHMIPath, sArg) Process.Start(m_sCNSiemensHMIPath, sArg)
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0 m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
If m_CN.m_IsSiemensOne Then If m_CN.m_IsSiemensOne Then
' stati bottoni parte 1 ' stati bottoni parte 1
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0) m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
@@ -392,6 +398,8 @@ Public Class CNCommunication
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1) m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile) GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
ElseIf m_CN.m_IsActiveModeSubscription Then
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
End If End If
Catch ex As Exception Catch ex As Exception
EgtOutLog("Error starting Process -> NcLink=True type=0") EgtOutLog("Error starting Process -> NcLink=True type=0")
@@ -695,12 +703,17 @@ Public Class CNCommunication
m_MachineStatus.DisplayVar() m_MachineStatus.DisplayVar()
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode) 'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
Dim TempCurrMode As Short = m_CN.read_active_mode() If m_nCountRefresh > 10 Then
'EgtOutLog("Machine status: " & TempCurrMode) Dim TempCurrMode As Short = m_CN.read_active_mode()
If TempCurrMode <> m_nCurrMode Then 'EgtOutLog("Machine status: " & TempCurrMode)
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode) If TempCurrMode <> m_nCurrMode Then
m_nCurrMode = CInt(TempCurrMode) 'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
m_MachineStatus.DisplayActiveMode(m_nCurrMode) m_nCurrMode = CInt(TempCurrMode)
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
End If
m_nCountRefresh = 0
Else
m_nCountRefresh = m_nCountRefresh + 1
End If End If
If m_CN.b_NC_error Then If m_CN.b_NC_error Then
+5 -3
View File
@@ -131,8 +131,7 @@ Public Class CN_Siemens
Public Overrides Function read_active_mode() As Short Public Overrides Function read_active_mode() As Short
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2) 'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
'Return M_MMFiles.read_active_mode() If m_IsSiemensOne Or m_IsActiveModeSubscription Then
If m_IsSiemensOne Then
Select Case n_data(3) Select Case n_data(3)
Case 1 Case 1
Return 0 Return 0
@@ -144,7 +143,10 @@ Public Class CN_Siemens
Return 0 Return 0
End Select End Select
Else Else
Return CShort(M_MMFiles.SiemensRet.n_param2) ' per verificare che la comunicazione funzioni correttamente
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
Return M_MMFiles.read_active_mode()
'Return CShort(M_MMFiles.SiemensRet.n_param2)
End If End If
End Function End Function
+2
View File
@@ -88,6 +88,8 @@ Public MustInherit Class CN_generico
#Region " Interface" #Region " Interface"
Friend m_IsSiemensOne As Boolean = False Friend m_IsSiemensOne As Boolean = False
Friend m_IsActiveModeSubscription As Boolean = False
Friend m_DbVarPath As String = "" Friend m_DbVarPath As String = ""
Public IsFlexiumPlus As Boolean = False Public IsFlexiumPlus As Boolean = False
+51 -28
View File
@@ -398,13 +398,35 @@ Module M_MMFiles
End Function End Function
Function WriteCncMode(ByVal nmode As Short) As Short Function WriteCncMode(ByVal nmode As Short) As Short
'EgtOutLog("WriteCncMode start dell'm_mmFiles") Dim nNewWriteCNCMode As Integer = 0
SiemensSend.n_Command = CMD.CMD_WriteCncMode If GetPrivateProfileInt(S_NCSIEMENS, K_NEWWRITECNCMODE, nNewWriteCNCMode, m_MainWindow.GetMachIniFile()) <> 0 Then
SiemensSend.n_param1 = nmode Dim s_var As String = String.Empty
GetPrivateProfileString(S_NCDATA, K_WRITECNCMODEVAR, "db11.dbx0", s_var, m_MainWindow.GetMachIniFile())
execute_command() Select Case nmode
'EgtOutLog("WriteCncMode end dell'm_mmFiles") Case 0
Return SiemensRet.n_result ' Auto
s_var &= ".0"
Case 2
' MDI
s_var &= ".1"
Case 7
' manuale
s_var &= ".2"
Case Else
' manuale
s_var &= ".2"
End Select
EgtOutLog("Nuova scrittura modo: case(" & nmode.ToString & ") -> " & s_var)
Return Write_var(s_var, CShort(1), CInt(1), 0, 0, "")
Else
'EgtOutLog("WriteCncMode start dell'm_mmFiles")
SiemensSend.n_Command = CMD.CMD_WriteCncMode
SiemensSend.n_param1 = nmode
EgtOutLog("Attivata modalità: " & SiemensSend.n_param1.ToString)
execute_command()
'EgtOutLog("WriteCncMode end dell'm_mmFiles")
Return SiemensRet.n_result
End If
End Function End Function
@@ -454,6 +476,7 @@ Module M_MMFiles
SiemensSend.n_param1 = nChannel SiemensSend.n_param1 = nChannel
execute_command() execute_command()
'EgtOutLog("MDI_command end dell'm_mmFiles") 'EgtOutLog("MDI_command end dell'm_mmFiles")
Return SiemensRet.n_result Return SiemensRet.n_result
@@ -592,7 +615,6 @@ Module M_MMFiles
'---------------------------------------------------------------------------------------------------------- '----------------------------------------------------------------------------------------------------------
' '
Sub execute_command() Sub execute_command()
Try Try
' Attesa eventuale busy iniziale ' Attesa eventuale busy iniziale
Dim nCount As Integer = 0 Dim nCount As Integer = 0
@@ -619,25 +641,25 @@ Module M_MMFiles
bEnd = False bEnd = False
While Not bEnd While Not bEnd
Select Case nState Select Case nState
Case State.Command_on ' alzato il comando attendo il busy Case State.Command_on ' alzato il comando attendo il busy
If SiemensRet.b_busy Then If SiemensRet.b_busy Then
nState = State.Busy_On nState = State.Busy_On
Else Else
System.Threading.Thread.Sleep(50) System.Threading.Thread.Sleep(50)
End If End If
Case State.Busy_On ' trovato il busy abbasso il comando Case State.Busy_On ' trovato il busy abbasso il comando
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
' scrivo !!!!! ' scrivo !!!!!
Marshal.StructureToPtr(SiemensSend, pView, False) Marshal.StructureToPtr(SiemensSend, pView, False)
nState = State.Command_off nState = State.Command_off
Case State.Command_off ' abbassato il comando attendo il busy basso Case State.Command_off ' abbassato il comando attendo il busy basso
If SiemensRet.b_busy Then If SiemensRet.b_busy Then
System.Threading.Thread.Sleep(50) System.Threading.Thread.Sleep(50)
Else Else
nState = State.Busy_Off nState = State.Busy_Off
End If End If
Case State.Busy_Off Case State.Busy_Off
bEnd = True bEnd = True
End Select End Select
' controllo massimo numero di cicli ' controllo massimo numero di cicli
nCount += 1 nCount += 1
@@ -723,7 +745,8 @@ Module M_MMFiles
CurrCN.d_Dvariable_values(n) = SiemensRet.d_interf_variable_values(n) CurrCN.d_Dvariable_values(n) = SiemensRet.d_interf_variable_values(n)
Next Next
' copy spindle current ' copy spindle current: per debuggare errore di comunicazione
'EgtOutLog("Spindle -d_interf_spindle_power-: " & SiemensRet.d_interf_spindle_power.ToString)
CurrCN.d_spindle_power = SiemensRet.d_interf_spindle_power CurrCN.d_spindle_power = SiemensRet.d_interf_spindle_power
CurrCN.n_spindle_override(0) = SiemensRet.n_interf_spindle_override CurrCN.n_spindle_override(0) = SiemensRet.n_interf_spindle_override
+10 -1
View File
@@ -1578,7 +1578,16 @@ Namespace Num
End Sub End Sub
Public Overrides Sub DPlcVariables_WriteVariables(sz_var_names As String, sz_values As String) Public Overrides Sub DPlcVariables_WriteVariables(sz_var_names As String, sz_values As String)
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, CShort(sz_values)) Dim value As Short = 0
If Not Short.TryParse(sz_values, value) Then
If Not IsNothing( sz_values) then
EgtOutLog("Write variable: " & sz_var_names & ", value:" & sz_values & " failed!")
Else
EgtOutLog("Write variable: " & sz_var_names & ", value:nothing failed!")
End If
Return
End If
Dim _ret As Short = objDPlcVariables.WriteVariables(sz_var_names, value)
If _ret <> 0 Then If _ret <> 0 Then
EgtOutLog("Scrittura " & sz_var_names & " fallita") EgtOutLog("Scrittura " & sz_var_names & " fallita")
Else Else
+7
View File
@@ -196,6 +196,9 @@
<DependentUpon>CadCutPageUC.xaml</DependentUpon> <DependentUpon>CadCutPageUC.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="CAM\CamAuto.vb" /> <Compile Include="CAM\CamAuto.vb" />
<Compile Include="Machine\ImportExportMachiningWindowWD.xaml.vb">
<DependentUpon>ImportExportMachiningWindowWD.xaml</DependentUpon>
</Compile>
<Compile Include="Machine\ImportExportToolWD.xaml.vb"> <Compile Include="Machine\ImportExportToolWD.xaml.vb">
<DependentUpon>ImportExportToolWD.xaml</DependentUpon> <DependentUpon>ImportExportToolWD.xaml</DependentUpon>
</Compile> </Compile>
@@ -434,6 +437,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Machine\ImportExportMachiningWindowWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Machine\ImportExportToolWD.xaml"> <Page Include="Machine\ImportExportToolWD.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
+1
View File
@@ -118,6 +118,7 @@
<BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage> <BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage>
<BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage> <BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage>
<BitmapImage x:Key="Taglio-singoloImg" UriSource="Resources/NewIcons/Taglio-singolo.png"></BitmapImage> <BitmapImage x:Key="Taglio-singoloImg" UriSource="Resources/NewIcons/Taglio-singolo.png"></BitmapImage>
<BitmapImage x:Key="Foro-singoloImg" UriSource="Resources/NewIcons/Foro-singolo.png"></BitmapImage>
<BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage> <BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage>
<BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage> <BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage>
<BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage> <BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage>
+61 -2
View File
@@ -156,18 +156,32 @@
<BitmapImage x:Key="VacuumImg" UriSource="Resources/Vacuum.png"></BitmapImage> <BitmapImage x:Key="VacuumImg" UriSource="Resources/Vacuum.png"></BitmapImage>
<!--sono le stesse immagini usate per l'interfaccia Dark--> <!--sono le stesse immagini usate per l'interfaccia Dark-->
<!--General-->
<BitmapImage x:Key="EseguiImg" UriSource="Resources/NewIcons/Esegui.png"></BitmapImage>
<BitmapImage x:Key="SimulaImg" UriSource="Resources/NewIcons/Simula.png"></BitmapImage>
<!--ProjectManager--> <!--ProjectManager-->
<BitmapImage x:Key="NuovoImg" UriSource="Resources/NewIcons/Nuovo.png"></BitmapImage> <BitmapImage x:Key="NuovoImg" UriSource="Resources/NewIcons/Nuovo.png"></BitmapImage>
<BitmapImage x:Key="CaricaImg" UriSource="Resources/NewIcons/Carica.png"></BitmapImage> <BitmapImage x:Key="CaricaImg" UriSource="Resources/NewIcons/Carica.png"></BitmapImage>
<BitmapImage x:Key="SalvaImg" UriSource="Resources/NewIcons/Salva.png"></BitmapImage> <BitmapImage x:Key="SalvaImg" UriSource="Resources/NewIcons/Salva.png"></BitmapImage>
<BitmapImage x:Key="Salva-con-nomeImg" UriSource="Resources/NewIcons/Salva-con-nome.png"></BitmapImage> <BitmapImage x:Key="Salva-con-nomeImg" UriSource="Resources/NewIcons/Salva-con-nome.png"></BitmapImage>
<BitmapImage x:Key="CSVImg" UriSource="Resources/NewIcons/CSV.png"></BitmapImage> <BitmapImage x:Key="CSVImg" UriSource="Resources/NewIcons/File-CSV.png"></BitmapImage>
<BitmapImage x:Key="Vein-matchImg" UriSource="Resources/NewIcons/Vein-match.png"></BitmapImage> <BitmapImage x:Key="Vein-matchImg" UriSource="Resources/NewIcons/Vein-match.png"></BitmapImage>
<BitmapImage x:Key="Test-lamaImg" UriSource="Resources/NewIcons/Test-lama.png"></BitmapImage>
<BitmapImage x:Key="Parcheggia-pezzoImg" UriSource="Resources/NewIcons/Parcheggia-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Inserisci-pezzoImg" UriSource="Resources/NewIcons/Inserisci-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<!--Machine--> <!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage> <BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
<BitmapImage x:Key="DB-lavorazioniImg" UriSource="Resources/NewIcons/DB-lavorazioni.png"></BitmapImage> <BitmapImage x:Key="DB-lavorazioniImg" UriSource="Resources/NewIcons/DB-lavorazioni.png"></BitmapImage>
<BitmapImage x:Key="DB-utensiliImg" UriSource="Resources/NewIcons/DB-utensili.png"></BitmapImage> <BitmapImage x:Key="DB-utensiliImg" UriSource="Resources/NewIcons/DB-utensili.png"></BitmapImage>
<BitmapImage x:Key="MacchinaImg" UriSource="Resources/NewIcons/Macchina.png"></BitmapImage> <BitmapImage x:Key="MacchinaImg" UriSource="Resources/NewIcons/Macchina.png"></BitmapImage>
<BitmapImage x:Key="LucidaturaImg" UriSource="Resources/NewIcons/Lucidatura.png"></BitmapImage>
<!--Direct cuts--> <!--Direct cuts-->
<BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage> <BitmapImage x:Key="Taglio-grigliaImg" UriSource="Resources/NewIcons/Taglio-griglia.png"></BitmapImage>
<BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage> <BitmapImage x:Key="Taglio-multiploImg" UriSource="Resources/NewIcons/Taglio-multiplo.png"></BitmapImage>
@@ -176,9 +190,46 @@
<BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage> <BitmapImage x:Key="SpianaturaImg" UriSource="Resources/NewIcons/Spianatura.png"></BitmapImage>
<BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage> <BitmapImage x:Key="Movimento-manualeImg" UriSource="Resources/NewIcons/Movimento-manuale.png"></BitmapImage>
<BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage> <BitmapImage x:Key="Copia-dimaImg" UriSource="Resources/NewIcons/Copia-dima.png"></BitmapImage>
<BitmapImage x:Key="Acquisisci-P1_P2Img" UriSource="Resources/NewIcons/Acquisisci-P1_P2.png"></BitmapImage>
<BitmapImage x:Key="Acquisisci-P1Img" UriSource="Resources/NewIcons/Acquisisci-P1.png"></BitmapImage>
<BitmapImage x:Key="Acquisisci-P2Img" UriSource="Resources/NewIcons/Acquisisci-P2.png"></BitmapImage>
<BitmapImage x:Key="Acquisisci-PImg" UriSource="Resources/NewIcons/Acquisisci-P.png"></BitmapImage>
<BitmapImage x:Key="ArcoImg" UriSource="Resources/NewIcons/Arco.png"></BitmapImage>
<BitmapImage x:Key="LineaImg" UriSource="Resources/NewIcons/Linea.png"></BitmapImage>
<BitmapImage x:Key="Rimuovi-segmentoImg" UriSource="Resources/NewIcons/Rimuovi-segmento.png"></BitmapImage>
<BitmapImage x:Key="ChiudiImg" UriSource="Resources/NewIcons/Chiudi.png"></BitmapImage>
<BitmapImage x:Key="Salva-taglioImg" UriSource="Resources/NewIcons/Salva-taglio.png"></BitmapImage>
<BitmapImage x:Key="Take-pointImg" UriSource="Resources/NewIcons/Take-point.png"></BitmapImage>
<BitmapImage x:Key="XYJogImg" UriSource="Resources/NewIcons/XYJog.png"></BitmapImage>
<BitmapImage x:Key="ZCJogImg" UriSource="Resources/NewIcons/ZCJog.png"></BitmapImage>
<BitmapImage x:Key="ZBJogImg" UriSource="Resources/NewIcons/ZBJog.png"></BitmapImage>
<!--Frame--> <!--Frame-->
<BitmapImage x:Key="Sezione-corniceImg" UriSource="Resources/NewIcons/Sezione-cornice.png"></BitmapImage> <BitmapImage x:Key="Sezione-corniceImg" UriSource="Resources/NewIcons/Sezione-cornice.png"></BitmapImage>
<BitmapImage x:Key="SpecchiaImg" UriSource="Resources/NewIcons/Specchia.png"></BitmapImage>
<BitmapImage x:Key="Rimuovi_eliminaImg" UriSource="Resources/NewIcons/Rimuovi_elimina.png"></BitmapImage>
<!--Machinig-->
<BitmapImage x:Key="Allunga-AccorciaImg" UriSource="Resources/NewIcons/Allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
<BitmapImage x:Key="Tutti-OFFImg" UriSource="Resources/NewIcons/Tutti-OFF.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Centro-FuoriImg" UriSource="Resources/NewIcons/Inizio-centro-fuori.png"></BitmapImage>
<BitmapImage x:Key="Fine-Centro-FuoriImg" UriSource="Resources/NewIcons/Fine-centro-fuori.png"></BitmapImage>
<BitmapImage x:Key="Modifica-InizioImg" UriSource="Resources/NewIcons/Modifica-inizio.png"></BitmapImage>
<BitmapImage x:Key="Modifica-FineImg" UriSource="Resources/NewIcons/Modifica-fine.png"></BitmapImage>
<BitmapImage x:Key="InvertiImg" UriSource="Resources/NewIcons/Inverti.png"></BitmapImage>
<BitmapImage x:Key="Pausa-ON_OFFImg" UriSource="Resources/NewIcons/Pausa-ON_OFF.png"></BitmapImage>
<BitmapImage x:Key="Inizio-tutti-fuoriImg" UriSource="Resources/NewIcons/Inizio-tutti-fuori.png"></BitmapImage>
<BitmapImage x:Key="Inizio-tutti-centroImg" UriSource="Resources/NewIcons/Inizio-tutti-centro.png"></BitmapImage>
<BitmapImage x:Key="Fine-tutti-fuoriImg" UriSource="Resources/NewIcons/Fine-tutti-fuori.png"></BitmapImage>
<BitmapImage x:Key="Fine-tutti-centroImg" UriSource="Resources/NewIcons/Fine-tutti-centro.png"></BitmapImage>
<BitmapImage x:Key="Tutti-allungaImg" UriSource="Resources/NewIcons/Tutti-allunga.png"></BitmapImage>
<BitmapImage x:Key="Tutti-accorciaImg" UriSource="Resources/NewIcons/Tutti-accorcia.png"></BitmapImage>
<BitmapImage x:Key="LastProjImg" UriSource="Resources/NewIcons/PlayStep.png"></BitmapImage> <BitmapImage x:Key="LastProjImg" UriSource="Resources/NewIcons/PlayStep.png"></BitmapImage>
<FontFamily x:Key="OmagCut_Font">./Resources/Fonts/#Century Gothic</FontFamily> <FontFamily x:Key="OmagCut_Font">./Resources/Fonts/#Century Gothic</FontFamily>
@@ -199,7 +250,14 @@
<Setter Property="Margin" Value="1" /> <Setter Property="Margin" Value="1" />
</Style> </Style>
<!--Border--> <Style x:Key="OmagCut_MachiningBorder" TargetType="{x:Type Border}" BasedOn="{StaticResource OmagCut_EmptyBorder}">
<!--<Setter Property="Background" Value="#636974" #3C3F48/>
<Setter Property="BorderBrush" Value="#636974" #3C3F48/>-->
<Setter Property="Background" Value="{StaticResource OmagCut_Yellow}"/>
<Setter Property="BorderBrush" Value="#3C3F48"/>
</Style>
<!--Border-->
<Style x:Key="OmagCut_Border" TargetType="{x:Type Border}" BasedOn="{StaticResource OmagCut_EmptyBorder}"> <Style x:Key="OmagCut_Border" TargetType="{x:Type Border}" BasedOn="{StaticResource OmagCut_EmptyBorder}">
<Setter Property="Background" Value="{StaticResource OmagCut_LightGray}"/> <Setter Property="Background" Value="{StaticResource OmagCut_LightGray}"/>
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Blue}"/> <Setter Property="BorderBrush" Value="{StaticResource OmagCut_Blue}"/>
@@ -1174,6 +1232,7 @@
<Style x:Key="OmagCut_FixedTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}"> <Style x:Key="OmagCut_FixedTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}">
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Gray}"/> <Setter Property="BorderBrush" Value="{StaticResource OmagCut_Gray}"/>
<Setter Property="Background" Value="White"/>
<Setter Property="IsReadOnly" Value="True"/> <Setter Property="IsReadOnly" Value="True"/>
<Setter Property="IsEnabled" Value="False"/> <Setter Property="IsEnabled" Value="False"/>
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" /> <Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
+24 -2
View File
@@ -50,6 +50,7 @@ Namespace TreeViewItem
Private m_sPictureString As String Private m_sPictureString As String
Private m_nTType As Integer Private m_nTType As Integer
Private m_Items As ObservableCollection(Of CustomItem) Private m_Items As ObservableCollection(Of CustomItem)
Friend m_IsValidTool As Boolean
Public ReadOnly Property PictureString As String Public ReadOnly Property PictureString As String
Get Get
@@ -86,12 +87,13 @@ Namespace TreeViewItem
'Private m_sTitle As String 'Private m_sTitle As String
Private m_nType As Integer Private m_nType As Integer
'Private m_sName As String
'Public Property Name As String 'Public Property Name As String
' Get ' Get
' Return m_sTitle ' Return m_sName
' End Get ' End Get
' Set(value As String) ' Set(value As String)
' m_sTitle = value ' m_sName = value
' End Set ' End Set
'End Property 'End Property
@@ -101,11 +103,31 @@ Namespace TreeViewItem
End Get End Get
End Property End Property
Friend m_IsValidTool As Boolean = True
Public Property IsValidTool As Boolean
Get
Return m_IsValidTool
End Get
Set(value As Boolean)
If value <> m_IsValidTool Then
m_IsValidTool = value
NotifyPropertyChanged("ToolColor")
End If
End Set
End Property
Sub New(Title As String, nType As Integer) Sub New(Title As String, nType As Integer)
Me.Name = Title Me.Name = Title
m_nType = nType m_nType = nType
End Sub End Sub
Sub New(sName As String, nType As Integer, bIsValidTool As Boolean)
MyBase.Name = sName
m_nType = nType
m_IsValidTool = bIsValidTool
End Sub
End Class End Class
Public Class PartCathegoryItem Public Class PartCathegoryItem
+3 -2
View File
@@ -9,7 +9,8 @@ Public Class OptionsPageUC
Private UnitsList() As String = {"inch", "mm"} Private UnitsList() As String = {"inch", "mm"}
Private ThemesList() As String = {"Classic", "Dark"} Private ThemesList() As String = {"Classic", "Dark"}
Private StartLauncherList() As String = {"Last Project", "New Project", "Open Folder", "Show Window"} ' "Last Project", "New Project", "Open Folder", "Show Window"
Private StartLauncherList() As String = {EgtMsg(91013), EgtMsg(91014), EgtMsg(91015), EgtMsg(91016)}
Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized Private Sub OptionsPageUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -109,7 +110,7 @@ Public Class OptionsPageUC
ToleranceEMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 21) ToleranceEMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 21)
AffondamentoMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27) AffondamentoMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 27)
LarghezzaMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 28) LarghezzaMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 28)
StartLauncherGpBx.Header = "Avvio Programma" StartLauncherGpBx.Header = EgtMsg(91009)
End Sub End Sub
Private Sub UpdateSlabDxf() Private Sub UpdateSlabDxf()
+8 -23
View File
@@ -276,7 +276,7 @@ Public Class CurrentProjectPageUC
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_OpenPage) m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_OpenPage)
m_MainWindow.m_ActivePage = MainWindow.Pages.Open m_MainWindow.m_ActivePage = MainWindow.Pages.Open
' seleziono il file dalla lista della finestra (= 4) ' seleziono il file dalla lista della finestra (= 4)
ElseIf MyStartLancherWD.CurrSelection = MODE_LAUNCHER.SelectedProject Then ElseIf MyStartLancherWD.CurrSelection = MODE_LAUNCHER.SelectedProject Then
NewProject() NewProject()
Dim sCurrDir As String = Path.GetDirectoryName(MyStartLancherWD.SelPath) Dim sCurrDir As String = Path.GetDirectoryName(MyStartLancherWD.SelPath)
@@ -303,29 +303,8 @@ Public Class CurrentProjectPageUC
End If End If
m_MruFiles.Add(sCurrDir & "\" & sCurrFile) m_MruFiles.Add(sCurrDir & "\" & sCurrFile)
End If End If
'If Not LoadProject(MyStartLancherWD.SelPath, False) Then
' ' altrimenti apro un nuovo progetto
' NewProject()
'Else
' ' salvo il nome del file caricato
' m_MruFiles.Add(MyStartLancherWD.SelPath)
'End If
'EgtResetModified()
End If End If
'' Nascondo progress per fotografia
'PhotoProgress.Visibility = Windows.Visibility.Hidden
'' Carico sottopagina opportuna
'If GetProjectType() <> PRJ_TYPE.FRAMES Then
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
' m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
' m_MainWindow.CadCutBtn.IsChecked = True
'Else
' CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
' m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
' m_MainWindow.FrameCutBtn.IsChecked = True
'End If
End Sub End Sub
' questo metodo è direttamente richiamato in caso di selezione della regione sinistra della pagina ' questo metodo è direttamente richiamato in caso di selezione della regione sinistra della pagina
@@ -478,6 +457,12 @@ Public Class CurrentProjectPageUC
UpdateContour() UpdateContour()
If EgtGetRawPartCount() > 0 Then If EgtGetRawPartCount() > 0 Then
ShowPhoto(False) ShowPhoto(False)
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
While nRawGrpId <> GDB_ID.NULL
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup( nRawGrpId, NAME_RAW_SOLID)
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName( nRawSolidId, PHOTO_NAME)
nRawGrpId = EgtGetNextRawPart( nRawGrpId)
End While
End If End If
End If End If
End If End If
@@ -568,7 +553,7 @@ Public Class CurrentProjectPageUC
End If End If
' Se la macchina del file è quella impostata ' Se la macchina del file è quella impostata
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
AdjustAdditionalTable() AdjustAdditionalTable( True)
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo ' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
Else Else
' Emetto messaggio ' Emetto messaggio
+6 -11
View File
@@ -128,25 +128,20 @@ Public Class ProjectMgrUC
End Function End Function
Friend Function ChangeTable() As Integer Friend Function ChangeTable() As Integer
Dim nTabInd As Integer = 0 Dim nRes As Integer = 0
' se non abilitato esco dalla pagina ' se non abilitato esco dalla pagina
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 0 Then If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 0 Then
Return nTabInd Return nRes
End If End If
Select Case GetTableCount() Select Case GetTableCount()
Case 2 Case 2
' Tavolo da usare ? ' Vuoi cambiare tavola?
Dim TableToUse As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90968)), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL) Dim TableToUse As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90968)), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL)
Select Case TableToUse.m_nPressedBtn nRes = TableToUse.m_nPressedBtn
Case 1 ' 1
nTabInd = 1
Case 0 ' 2
nTabInd = 2
End Select
Case Else Case Else
' negli altri casi (3 tavole o una tavola non fare nulla) ' negli altri casi (3 tavole o una tavola non fare nulla)
End Select End Select
Return nTabInd Return nRes
End Function End Function
Private Sub LoadBtn_Click(sender As Object, e As RoutedEventArgs) Handles LoadBtn.Click Private Sub LoadBtn_Click(sender As Object, e As RoutedEventArgs) Handles LoadBtn.Click
@@ -462,7 +457,7 @@ Public Class ProjectMgrUC
' Costringo ad aggiornare UI ' Costringo ad aggiornare UI
UpdateUI() UpdateUI()
' Se macchina normale ' Se macchina normale
If Not m_CurrMachine.bProdLine Or Not m_CurrMachine.bDemo Then If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
' Download programma (eventuali errori sono segnalati dalla funzione) ' Download programma (eventuali errori sono segnalati dalla funzione)
If m_CurrNcComm.SendProgram(sCncPath, 900) Then If m_CurrNcComm.SendProgram(sCncPath, 900) Then
' copio il progetto corrente come progetto in lavorazione ' copio il progetto corrente come progetto in lavorazione
+6 -3
View File
@@ -111,9 +111,12 @@ Public Class StartLauncherWD
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2 Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
' imopposto il messaggio di avvio ' imopposto il messaggio di avvio
SlectLauncherTxbl.Text = "Seleziona modalità di avvio" SlectLauncherTxbl.Text = EgtMsg(91010) ' Seleziona modalità di avvio
FileName.Text = "Progetti recenti" FileName.Text = EgtMsg(91011) ' Progetti recenti
DataFile.Text = "Ultima apertura" DataFile.Text = EgtMsg(91012) ' Ultima apertura
LastProject.ToolTip = EgtMsg(91013)
NewProject.ToolTip = EgtMsg(91014)
OpenFolder.ToolTip = EgtMsg(91015)
End Sub End Sub
' lancio l'apertura della pagina dei progetti ' lancio l'apertura della pagina dei progetti
+112 -12
View File
@@ -41,6 +41,7 @@ Public Class RawPartPageUC
Private m_RawOffsX As Double = 0 Private m_RawOffsX As Double = 0
Private m_RawOffsY As Double = 0 Private m_RawOffsY As Double = 0
Private m_RawKerf As Double = 0 Private m_RawKerf As Double = 0
Private m_PrecKerf As Double = 0
' Layer per crocette temporanee ' Layer per crocette temporanee
Private m_nTempLay As Integer = GDB_ID.NULL Private m_nTempLay As Integer = GDB_ID.NULL
' Definizione lista modalità di definizione grezzo per ComboBox ' Definizione lista modalità di definizione grezzo per ComboBox
@@ -234,6 +235,7 @@ Public Class RawPartPageUC
m_RawOffsX = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSX, 100, m_MainWindow.GetIniFile()) m_RawOffsX = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSX, 100, m_MainWindow.GetIniFile())
m_RawOffsY = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSY, 100, m_MainWindow.GetIniFile()) m_RawOffsY = GetPrivateProfileDouble(S_RAWPART, K_RAWOFFSY, 100, m_MainWindow.GetIniFile())
m_RawKerf = GetPrivateProfileDouble(S_RAWPART, K_RAWKERF, 50, m_MainWindow.GetIniFile()) m_RawKerf = GetPrivateProfileDouble(S_RAWPART, K_RAWKERF, 50, m_MainWindow.GetIniFile())
m_PrecKerf = m_RawKerf
' Richiedo ricalcolo quota eventuale foto ' Richiedo ricalcolo quota eventuale foto
UpdateRawPart(True) UpdateRawPart(True)
' Eventuale gestione dati lastra ' Eventuale gestione dati lastra
@@ -270,7 +272,14 @@ Public Class RawPartPageUC
m_ActiveRawMode = RAWMODE.RECTANGLE m_ActiveRawMode = RAWMODE.RECTANGLE
RawModeCmBx.SelectedIndex = RAWMODE.RECTANGLE RawModeCmBx.SelectedIndex = RAWMODE.RECTANGLE
PointsGpBx.Visibility = Windows.Visibility.Hidden PointsGpBx.Visibility = Windows.Visibility.Hidden
AdjustRawPartPosition() If dInvertKerf < 1 Then
AdjustRawPartPositionNegativeKerf()
' assegno il giosto colore al kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
EgtSetColor(nKerfId, m_KerfCol)
Else
AdjustRawPartPosition()
End If
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End If End If
' Imposto il materiale corrente nella combobox ' Imposto il materiale corrente nella combobox
@@ -1171,6 +1180,8 @@ Public Class RawPartPageUC
' box grezzo ' box grezzo
Dim ptMin, ptMax As Point3d Dim ptMin, ptMax As Point3d
GetRawBox(ptMin, ptMax) GetRawBox(ptMin, ptMax)
Dim Lenght As Double = ptMax.x - ptMin.x
Dim Width As Double = ptMax.y - ptMin.y
ptMin.x += m_RawKerf ptMin.x += m_RawKerf
ptMin.y += m_RawKerf ptMin.y += m_RawKerf
ptMin.z = ptMax.z ptMin.z = ptMax.z
@@ -1185,6 +1196,41 @@ Public Class RawPartPageUC
Return True Return True
End Function End Function
#Region "Negative Kerf"
Private Function AdjustRawPartNegativeKerf(Optional NegativeOffset As Boolean = True) As Boolean
' Se non c'è il grezzo, esco
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then Return False
' Cancello eventuale vecchio contorno di kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
Dim nInvert As Double = 1
If Not NegativeOffset Then
nInvert = -1
End If
EgtOffsetCurve(nKerfId, (-m_RawKerf - m_PrecKerf) * nInvert, OFF_TYPE.EXTEND)
EgtSetColor(nKerfId, m_KerfCol)
' Salvo il valore del kerf (sempre in mm)
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_KERF, m_RawKerf)
Return True
End Function
Private Function AdjustRawPartPositionNegativeKerf() As Boolean
' Sistemo la posizione
Dim ptRef As New Point3d(m_RawOffsX, m_RawOffsY, m_CurrentMachine.dAdditionalTable)
If EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL) Then
OkBtn.IsEnabled = True
m_CurrProjPage.ClearMessage()
Else
OkBtn.IsEnabled = False
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 47)) ' Errore nella posizione o dimensione del grezzo
End If
' Aggiorno visualizzazione
EgtZoom(ZM.ALL)
Return True
End Function
#End Region ' Negative Kerf
Private Sub UpdateRawPartHeight() Private Sub UpdateRawPartHeight()
' Se da creare ' Se da creare
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then
@@ -1514,8 +1560,10 @@ Public Class RawPartPageUC
End If End If
Dim dMinOffsetX = m_RawKerf Dim dMinOffsetX = m_RawKerf
If dKerf < 0 And dOffsetX >= 0 Then If dKerf < 0 And dOffsetX >= 0 Then
m_RawOffsX = dOffsetX + m_RawKerf 'm_RawOffsX = dOffsetX + m_RawKerf
UpdateRawPart() 'UpdateRawPart()
m_RawOffsX = dOffsetX
AdjustRawPartPositionNegativeKerf()
ElseIf dKerf >= 0 And dOffsetX >= dMinOffsetX Then ElseIf dKerf >= 0 And dOffsetX >= dMinOffsetX Then
m_RawOffsX = dOffsetX m_RawOffsX = dOffsetX
UpdateRawPart() UpdateRawPart()
@@ -1534,8 +1582,10 @@ Public Class RawPartPageUC
End If End If
Dim dMinOffsetY = m_RawKerf Dim dMinOffsetY = m_RawKerf
If dKerf < 0 And dOffsetY >= 0 Then If dKerf < 0 And dOffsetY >= 0 Then
m_RawOffsY = dOffsetY + m_RawKerf 'm_RawOffsY = dOffsetY + m_RawKerf
UpdateRawPart() 'UpdateRawPart()
m_RawOffsY = dOffsetY
AdjustRawPartPositionNegativeKerf()
ElseIf dKerf >= 0 And dOffsetY >= dMinOffsetY Then ElseIf dKerf >= 0 And dOffsetY >= dMinOffsetY Then
m_RawOffsY = dOffsetY m_RawOffsY = dOffsetY
UpdateRawPart() UpdateRawPart()
@@ -1554,9 +1604,23 @@ Public Class RawPartPageUC
Dim dMaxKerf = Math.Min(Math.Min(m_RawOffsX, m_RawOffsY), Dim dMaxKerf = Math.Min(Math.Min(m_RawOffsX, m_RawOffsY),
Math.Min(m_dTableLength - m_RawLength - m_RawOffsX, m_dTableWidth - m_RawWidth - m_RawOffsY)) Math.Min(m_dTableLength - m_RawLength - m_RawOffsX, m_dTableWidth - m_RawWidth - m_RawOffsY))
Dim dMinKerf = -Math.Min(m_RawLength, m_RawWidth) / 2 Dim dMinKerf = -Math.Min(m_RawLength, m_RawWidth) / 2
' recuper il segno del valore del Kerf precedente
Dim dInvertKerf As Double = 1
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
m_PrecKerf = Math.Abs(m_RawKerf)
m_PrecKerf = m_PrecKerf * dInvertKerf
' Sostituisco: dKerf >= dMinKerf And dKerf <= dMaxKerf ' Sostituisco: dKerf >= dMinKerf And dKerf <= dMaxKerf
If dKerf >= 0 And dKerf <= dMaxKerf Then If dKerf >= 0 And dKerf <= dMaxKerf Then
m_RawKerf = dKerf m_RawKerf = dKerf
If m_PrecKerf < 0 Then
' definsco la dimensione del grezzo pari a quella del kerf
m_RawKerf = 0
AdjustRawPartNegativeKerf()
UpdateCircles()
UpdateRawPartKerf()
m_RawKerf = dKerf
m_PrecKerf = 0
End If
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
StringToLen(LengthTxBx.Text, m_RawLength) StringToLen(LengthTxBx.Text, m_RawLength)
StringToLen(WidthTxBx.Text, m_RawWidth) StringToLen(WidthTxBx.Text, m_RawWidth)
@@ -1576,20 +1640,56 @@ Public Class RawPartPageUC
' Ridisegno ' Ridisegno
EgtDraw() EgtDraw()
ElseIf dKerf >= dMinKerf And dKerf < 0 Then ElseIf dKerf >= dMinKerf And dKerf < 0 Then
' aggiorno il valore del Kerf corrente
m_RawKerf = dKerf m_RawKerf = dKerf
If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then If m_ActiveRawMode <> RAWMODE.FROM_PHOTO Then
' aggiorno dati grezzo ' recupero dati grezzo
StringToLen(LengthTxBx.Text, m_RawLength) StringToLen(LengthTxBx.Text, m_RawLength)
m_RawLength = m_RawLength + 2 * m_RawKerf
StringToLen(WidthTxBx.Text, m_RawWidth) StringToLen(WidthTxBx.Text, m_RawWidth)
m_RawWidth = m_RawWidth + 2 * m_RawKerf
StringToLen(OffsetXTxBx.Text, m_RawOffsX) StringToLen(OffsetXTxBx.Text, m_RawOffsX)
m_RawOffsX = m_RawOffsX - m_RawKerf
StringToLen(OffsetYTxBx.Text, m_RawOffsY) StringToLen(OffsetYTxBx.Text, m_RawOffsY)
m_RawOffsY = m_RawOffsY - m_RawKerf
' UpdateRawPart() If m_PrecKerf >= 0 Then
m_RawLength = m_RawLength + 2 * m_RawKerf
m_RawWidth = m_RawWidth + 2 * m_RawKerf
m_RawOffsX = m_RawOffsX - m_RawKerf
m_RawOffsY = m_RawOffsY - m_RawKerf
End If
m_RawKerf = -m_RawKerf m_RawKerf = -m_RawKerf
UpdateRawPartKerf() ' esegue l'aggiornamento della dimensione del grezzo solo quando passo dal kerf positivo a quello negativo
If m_PrecKerf >= 0 Then
' definsco la dimensione del grezzo pari a quella del kerf
m_RawKerf = 0
AdjustRawPartNegativeKerf(False)
UpdateCircles()
UpdateRawPartKerf()
m_RawKerf = -dKerf
m_PrecKerf = 0
End If
AdjustRawPartNegativeKerf()
UpdateCircles()
'If m_PrecKerf > 0 And m_RawKerf < 0 Then
' m_RawLength = m_RawLength + 2 * m_RawKerf
' m_RawWidth = m_RawWidth + 2 * m_RawKerf
' m_RawOffsX = m_RawOffsX - m_RawKerf - m_PrecKerf
' m_RawOffsY = m_RawOffsY - m_RawKerf - m_PrecKerf
' m_RawKerf = -m_RawKerf
' UpdateRawPartKerf()
'If m_PrecKerf >=0 And m_RawKerf < 0 Then
' m_RawOffsX = m_RawOffsX - m_PrecKerf
' m_RawOffsY = m_RawOffsY - m_PrecKerf
' UpdateNegativeRawPart()
'Else
' UpdateNegativeRawPart()
'End If
'UpdateRawPart()
'UpdateNegativeRawPart()
'm_RawKerf = -m_RawKerf
'UpdateRawPartKerf()
' Recupero id contorno kerf ' Recupero id contorno kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF) Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
' Modifico il colore ' Modifico il colore
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+14 -13
View File
@@ -2,15 +2,16 @@
Imports EgtUILib Imports EgtUILib
Module Utility Module Utility
Friend Sub CompoColor(ByRef InsertColor As Color3d, sIniFile As String) Friend Function CompoColor(sIniFile As String) As Color3d
InsertColor = New Color3d(89, 210, 210) Dim InsertColor As New Color3d(89, 210, 210, 25)
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, "LastColor", "1", sIniFile) Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
If Not GetPrivateProfileColor(S_COMPO, "Color" & IndexColor.ToString, InsertColor, sIniFile) Then If Not GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile) Then
IndexColor = 1 IndexColor = 1
GetPrivateProfileColor(S_COMPO, "Color" & IndexColor.ToString, InsertColor, sIniFile) GetPrivateProfileColor(S_COMPO, K_COLOR & IndexColor.ToString, InsertColor, sIniFile)
End If End If
WritePrivateProfileString(S_COMPO, "LastColor", (IndexColor + 1).ToString, sIniFile) WritePrivateProfileString(S_COMPO, K_LASTCOLOR, (IndexColor + 1).ToString, sIniFile)
End Sub Return InsertColor
End Function
'-------------------------------------------------------------------------------------------------- '--------------------------------------------------------------------------------------------------
@@ -22,7 +23,7 @@ Module Utility
End Sub End Sub
'-------------------------------------------------------------------------------------------------- '--------------------------------------------------------------------------------------------------
Friend Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String Friend Function DoubleToString(dVal As Double, nNumDec As Integer) As String
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString() Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture) Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
If nNumDec > 0 Then If nNumDec > 0 Then
@@ -32,7 +33,7 @@ Module Utility
End If End If
End Function End Function
Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean Friend Function StringToDouble(sVal As String, ByRef dVal As Double) As Boolean
If String.IsNullOrEmpty(sVal) Then Return False If String.IsNullOrEmpty(sVal) Then Return False
Return EgtLuaEvalNumExpr(sVal, dVal) Return EgtLuaEvalNumExpr(sVal, dVal)
End Function End Function
@@ -44,11 +45,11 @@ Module Utility
Return True Return True
End Function End Function
Friend Function LenToString(ByVal dVal As Double, ByVal nNumDec As Integer) As String Friend Function LenToString(dVal As Double, nNumDec As Integer) As String
Return DoubleToString(EgtToUiUnits(dVal), nNumDec) Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
End Function End Function
Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean Friend Function StringToLen(sVal As String, ByRef dVal As Double) As Boolean
If String.IsNullOrEmpty(sVal) Then Return False If String.IsNullOrEmpty(sVal) Then Return False
If EgtLuaEvalNumExpr(sVal, dVal) Then If EgtLuaEvalNumExpr(sVal, dVal) Then
dVal = EgtFromUiUnits(dVal) dVal = EgtFromUiUnits(dVal)
@@ -58,14 +59,14 @@ Module Utility
End If End If
End Function End Function
Friend Function UIExprToExpr(ByVal sUIExpr As String) As String Friend Function UIExprToExpr(sUIExpr As String) As String
If String.IsNullOrWhiteSpace(sUIExpr) Then If String.IsNullOrWhiteSpace(sUIExpr) Then
Return "" Return ""
End If End If
Return sUIExpr.Replace("""", "*GEO.ONE_INCH") Return sUIExpr.Replace("""", "*GEO.ONE_INCH")
End Function End Function
Friend Function ExprToUIExpr(ByVal sExpr As String) As String Friend Function ExprToUIExpr(sExpr As String) As String
If String.IsNullOrWhiteSpace(sExpr) Then If String.IsNullOrWhiteSpace(sExpr) Then
Return "" Return ""
End If End If
File diff suppressed because it is too large Load Diff