Compare commits

..

58 Commits

Author SHA1 Message Date
NicolaP 56884c34f2 Migliorata lettura dato Sovratavola 2022-06-01 12:35:06 +02:00
NicolaP 332b17e55e Lettura/Scrittura dimensione sovratavola nel progetto 2022-06-01 11:50:03 +02:00
NicolaP 4bcbe8d290 Merge branch 'master' into develop 2022-06-01 10:18:53 +02:00
NicolaP 8484087c69 Corretto versione KeyOption 2022-05-30 15:10:58 +02:00
NicolaP 116289cac5 Merge branch 'develop' 2022-05-30 15:03:00 +02:00
NicolaP 30ee1bcf99 Merge remote-tracking branch 'origin/master' 2022-05-30 14:58:08 +02:00
NicolaP a1d7983704 Cambio versione 2022-05-30 14:52:25 +02:00
NicolaP 636d3a9eca Inseriti messaggi, costanti e immagini per comandi WJ 2022-05-30 14:32:46 +02:00
NicolaP bd70bf1ec9 Gestione StartPoint per tagli WJ InLoop 2022-05-26 17:51:22 +02:00
NicolaP d66b331478 Aggiunta visualizzazione tgli WJ separati 2022-05-26 16:36:35 +02:00
NicolaP aecb8ed442 Migliorato controllo contorno WaterJet per StartPoint 2022-05-25 18:08:08 +02:00
NicolaP 3e72b216a6 Migliorata evidenziazione PreView in SplitCurv 2022-05-25 15:28:43 +02:00
NicolaP 5baa701681 Merge branch 'Features/Statistic_4.0' into develop 2022-05-23 18:41:05 +02:00
NicolaP e3a1330889 Merge branch 'Feature/WaterJet_Punto_Inizio' into develop 2022-05-23 18:40:07 +02:00
NicolaP aa237fd744 Gestione scrittura info per definizioen StartPoint 2022-05-23 18:39:33 +02:00
NicolaP ccfc8f89e4 Gestione separazione tagli waterjet in pagina Nest 2022-05-23 15:54:01 +02:00
NicolaP a2e28fa134 Aggiunta info "ProjName" nel gruppo "OmagCut" del progetto 2022-05-18 12:22:06 +02:00
DarioS d8c16a34f0 OmagCUT 2.4e3 :
- ricompilazione per nuova versione (nelle dll corretto problema rallentamenti iniziali e finali non più eseguiti).
2022-05-17 08:49:27 +02:00
DarioS 1847154a29 OmagCUT 2.4e1 :
- ricompilazione con cambio versione.
2022-05-02 17:30:50 +02:00
NicolaP 2362c8df61 Merge branch 'Features/Manage_Interference_On_Vacuum_Move' into develop 2022-05-02 15:05:57 +02:00
NicolaP 54127e61ec Correzione veriosne 2.4d1 (non è mai stata rilasciata una versione d1) 2022-04-28 18:26:37 +02:00
NicolaP aaa39c3779 Merge branch 'master' into develop 2022-04-28 16:25:31 +02:00
NicolaP 78fc3118ab Aggrionata versione 2.4d2 2022-04-28 16:24:28 +02:00
NicolaP 4ff2ac1063 Merge branch 'master' into develop 2022-04-28 15:06:29 +02:00
NicolaP edab1024c3 Merge branch 'Features/Limit_Vacuum_On_Stroke' 2022-04-28 14:54:27 +02:00
NicolaP 5092385ea4 Merge branch 'Features/Manage_File_CadCut' 2022-04-28 14:53:53 +02:00
NicolaP 6cde63cd2e Correzione scrittura codice 2022-04-28 14:50:29 +02:00
NicolaP 4f12bce90a Aggiunta icona per generazione CN 2022-04-27 18:47:31 +02:00
NicolaP a69418c6f5 Merge branch 'Features/Manage_File_CadCut' into Features/Manage_Interference_On_Vacuum_Move 2022-04-20 11:31:11 +02:00
NicolaP c79e1b0327 Verifica collisione pezzi in fase di manipolazione 2022-04-14 18:34:37 +02:00
NicolaP 915d3c0408 Generazione file CadCut dalla pagina della simulazione 2022-04-14 10:59:40 +02:00
NicolaP f53b6e0bd5 Verifica movimentazione dei pezzi entro i limiti corse 2022-04-13 17:31:45 +02:00
NicolaP fc7b4d276c Gestione limiti corsa in fase di prelievo 2022-04-11 19:36:49 +02:00
NicolaP 95460ecbb2 Merge branch 'master' into Features/Max_Weight_On_Vacuums 2022-04-11 13:05:46 +02:00
NicolaP dc31665029 Aggiornamento versione 2022-04-11 13:02:25 +02:00
NicolaP e98e9ed416 Correzione spianatura con fresa 2022-04-11 12:56:58 +02:00
NicolaP de203b55fa Gestione dell'extra corsa anche per l'asse X 2022-04-11 10:14:45 +02:00
NicolaP 0a8dbb3557 Abilitata la lettura degli angoli preferenziali per extra corsa Y ventose 2022-04-08 15:04:21 +02:00
NicolaP 1f66a8f4ef Merge branch 'Features/Manage_Vacuum_StrokeY' into Features/Max_Weight_On_Vacuums 2022-04-08 12:58:02 +02:00
NicolaP 93b432284d Gestione rotazione ventosa vicino finecorsa Y 2022-04-07 19:25:46 +02:00
NicolaP 677c3af3b7 Correzione definizione funzione 2022-04-07 18:31:47 +02:00
NicolaP eb22771d06 Verifica del peso del grezzo prima del prelievo 2022-04-07 17:48:00 +02:00
NicolaP 2710d72a73 Migliorata gestione selezione tagli in SplitPage 2022-03-21 14:19:03 +01:00
NicolaP ccfb1a5179 Merge branch 'Features/New_manage_Park' 2022-03-10 11:59:42 +01:00
NicolaP 73ebd3ecdb Miglioramento gestione CSV 2022-03-07 20:30:59 +01:00
NicolaP 02acc77521 Correzione import nge con più parts 2022-02-28 20:37:55 +01:00
NicolaP 7f7c63bc07 Correzione definizione variabili 2022-02-28 19:28:07 +01:00
NicolaP 22560f434e Correzione assegnazione Tipo variabili 2022-02-28 18:47:01 +01:00
NicolaP d0c8e3e88b Migliorata gestione GUID (per rotazione) da CSV (Inserisci/Rimuovi), NGE, DXF 2022-02-28 15:41:44 +01:00
NicolaP 1f184a6f7f Gestione rotazione pezzi in parcheggio 2022-02-24 20:27:53 +01:00
NicolaP ea06fe1a9f Merge commit 'f66e5d6da9e7aab77016c0d1ea04bf1d9b94e8d6' into Features/New_manage_Park 2022-02-24 15:39:26 +01:00
NicolaP 5025c6a134 Migliorata gestione file CSV 2022-02-24 14:21:40 +01:00
NicolaP 75e3c023ad Merge commit 'd57075b065da56953b217733509f5871bf2ff24a' into Features/New_manage_Park 2022-02-23 19:10:46 +01:00
NicolaP d57075b065 Gestione inserimento di più CSV 2022-02-23 19:01:08 +01:00
NicolaP c3c24cd8e6 Inserimento da nge e dxf 2022-02-21 19:59:24 +01:00
NicolaP 63e708d601 Inserimento da CSV 2022-02-21 19:38:22 +01:00
NicolaP 0849514253 Selezione multipla per inserimento in tavola 2022-02-21 15:28:48 +01:00
NicolaP 703b7c0bad Inizio nuova gestione parcheggio 2022-02-18 16:25:25 +01:00
35 changed files with 2352 additions and 223 deletions
+68
View File
@@ -101,6 +101,74 @@ Friend Module CamAuto
Return True
End Function
Friend Function ResetAllSplitCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
EgtErase(IdAuxLayer)
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
Friend Function ResetAllStartCurv() As Boolean
Dim bOk As Boolean = True
Dim nIdPart As Integer = EgtGetFirstPart()
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
nIdPart = EgtGetNextPart(nIdPart)
End While
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
nIdPart = EgtGetFirstPartInRawPart(nRawId)
While nIdPart <> GDB_ID.NULL
' accedo al Layer OutLoop
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
nIdPart = EgtGetNextPartInRawPart(nIdPart)
End While
Return bOk
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
While nIdMy <> GDB_ID.NULL
Dim nValInfo As Integer = 1
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
If nValInfo = 0 Then Return False
End If
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
nIdMy = EgtGetNext(nIdMy)
End While
Return True
End Function
Friend Function RemoveFinalEmptyPhases() As Boolean
Dim nOpeId As Integer = EgtGetLastOperation()
While nOpeId <> GDB_ID.NULL
+42 -3
View File
@@ -1,5 +1,5 @@
Imports EgtUILib
Imports System.IO
Friend Module CSVFile
@@ -7,6 +7,7 @@ Friend Module CSVFile
'-----------------------------------------------------------------------------------------------
Friend Class CsvPart
Public m_sPath As String = String.Empty
Public m_sName As String = String.Empty
Public m_sOrd As String = String.Empty
Public m_sDist As String = String.Empty
@@ -29,6 +30,10 @@ Friend Module CSVFile
Public m_dHeel4 As Double = 0
Public m_nOriInd As Integer = 0
Public m_nId As Integer = GDB_ID.NULL
' definsco il riferimento al gruppo
Public m_sRefGuid As String = System.Guid.NewGuid.ToString
' definisco il colore del gruppo che sto inserendo
Public m_cColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
End Class
'-----------------------------------------------------------------------------------------------
@@ -59,6 +64,7 @@ Friend Module CSVFile
For i As Integer = 1 To nNbr
Dim OnePart As New CsvPart
Dim sN As String = i.ToString()
OnePart.m_sPath = sFile
EgtLuaGetGlobStringVar("CSV.NAME" & sN, OnePart.m_sName)
OnePart.m_bActive = True
EgtLuaGetGlobStringVar("CSV.ORD" & sN, OnePart.m_sOrd)
@@ -79,6 +85,9 @@ Friend Module CSVFile
EgtLuaGetGlobNumVar("CSV.A4_" & sN, OnePart.m_dAng4)
EgtLuaGetGlobNumVar("CSV.H4_" & sN, OnePart.m_dHeel4)
OnePart.m_nOriInd = i
If OnePart.m_nCount > 1 Then
OnePart.m_sRefGuid = System.Guid.NewGuid.ToString
End If
' inserisco in lista
CsvPartList.Add(OnePart)
Next
@@ -139,7 +148,9 @@ Friend Module CSVFile
Else
Dim sItems() As String = sLine.Split("=".ToCharArray)
If sItems.Count() >= 2 Then
If sItems(0) = "Nam" Then
If sItems(0) = "Path" Then
OnePart.m_sPath = sItems(1)
ElseIf sItems(0) = "Nam" Then
OnePart.m_sName = sItems(1)
ElseIf sItems(0) = "Ord" Then
OnePart.m_sOrd = sItems(1)
@@ -181,6 +192,8 @@ Friend Module CSVFile
StringToDouble(sItems(1), OnePart.m_dHeel4)
ElseIf sItems(0) = "OIn" Then
StringToInt(sItems(1), OnePart.m_nOriInd)
ElseIf sItems(0) = "Guid" Then
OnePart.m_sRefGuid = sItems(1).Trim
End If
End If
End If
@@ -208,6 +221,7 @@ Friend Module CSVFile
For i As Integer = 1 To CsvPartList.Count()
Dim CurrPart As CsvPart = CsvPartList(i - 1)
Writer.WriteLine("[P" & i.ToString() & "]")
Writer.WriteLine("Path=" & CurrPart.m_sPath)
Writer.WriteLine("Nam=" & CurrPart.m_sName)
Writer.WriteLine("Ord=" & CurrPart.m_sOrd)
Writer.WriteLine("Dist=" & CurrPart.m_sDist)
@@ -229,19 +243,44 @@ Friend Module CSVFile
Writer.WriteLine("A4=" & DoubleToString(CurrPart.m_dAng4, 4))
Writer.WriteLine("H4=" & DoubleToString(CurrPart.m_dHeel4, 4))
Writer.WriteLine("OIn=" & CurrPart.m_nOriInd.ToString())
Writer.WriteLine("Guid=" & CurrPart.m_sRefGuid)
Next
' Terminatore
Writer.WriteLine("[END]")
' Chiudo file
Writer.Close()
Return True
' Errore
' Errore
Catch ex As Exception
EgtOutLog("CSV List error writing " & sFile)
Return False
End Try
End Function
' dato l'elenco completo dei file salvo ogni singolo epl
Friend Function WriteCsvMergePartList(CsvPartList As List(Of CsvPart)) As Boolean
Dim bOk As Boolean = True
Dim LocalPartList As New List(Of CsvPart)
Dim Index As Integer = 0
' devo dividere la lista in tante parti quanti sono i file che lo costituiscono
While Index < CsvPartList.Count
Dim CurrFile As String = CsvPartList(Index).m_sPath
Dim sFile As String = Path.ChangeExtension(CurrFile, ".epl")
LocalPartList.Clear()
While CurrFile = CsvPartList(Index).m_sPath
LocalPartList.Add(CsvPartList(Index))
Index += 1
' se terminata la lista
If Index = CsvPartList.Count Then
Exit While
End If
End While
' salvo l'elenco corrente
bOk = WriteCsvPartList(sFile, CurrFile, LocalPartList) And bOk
End While
Return bOk
End Function
Friend Function RemoveNotToNestParts(ByRef CsvPartList As List(Of CsvPart)) As Boolean
For i As Integer = CsvPartList.Count() - 1 To 0 Step -1
If CsvPartList(i).m_nToNest = 0 Then
+235 -38
View File
@@ -11,7 +11,7 @@ Public Class CSVPage
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Flag tipologia
' Flag tipologia (False -> Cvs semplificato)
Private m_bFull As Boolean = False
' Flag inserimento diretto
Private m_bDirect As Boolean = True
@@ -28,6 +28,10 @@ Public Class CSVPage
Private m_ptRawMin As Point3d
Private m_ptRawMax As Point3d
Dim m_bIsCounterLy As Boolean = False
Dim m_nCurrNubrOfParts As Integer = 0
Dim m_nIdToSel As Integer = GDB_ID.NULL
Private Sub CSVPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Assegno la lista dei pezzi Csv come sorgente del treeview
PartsTreeView.ItemsSource = m_ItemsList
@@ -101,13 +105,36 @@ Public Class CSVPage
If EgtIsPart(nPartId) Or bPartInTable Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nPartId, nStat)
' Se già selezionato, lo deselezione
If nStat = GDB_ST.SEL Then
EgtDeselectObj(nPartId)
' Altrimenti lo seleziono
Else
EgtSelectObj(nPartId)
' verifico se l'lemento selezionato è il numero di pezzi
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
Dim NameLayer As String = String.Empty
EgtGetName(EgtGetParent(nId), NameLayer)
If NameLayer = INFO_COUNTERLY Then
Dim sText As String = String.Empty
If EgtTextGetContent(nId, sText) Then
Dim sItems() As String = sText.Split("#")
If sItems.Count > 1 Then
m_nCurrNubrOfParts = 0
If StringToInt(sItems(1), m_nCurrNubrOfParts) And m_nCurrNubrOfParts > 0 Then
m_bIsCounterLy = True
m_nIdToSel = nPartId
End If
End If
End If
End If
End If
If Not m_bIsCounterLy Then
' Se già selezionato, lo deselezione
If nStat = GDB_ST.SEL Then
EgtDeselectObj(nPartId)
' Altrimenti lo seleziono
Else
EgtSelectObj(nPartId)
End If
End If
Exit While
End If
nId = EgtGetNextObjInSelWin()
@@ -115,6 +142,28 @@ Public Class CSVPage
EgtDraw()
End Sub
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseUpScene
If m_bIsCounterLy Then
' apro una finestra di dialogo per chiedere se inserire tutti i pezzi della famiglia
Dim SelectWD As New SelectPartFromFamilyWD(m_MainWindow, m_nCurrNubrOfParts)
Dim sRefGroup As String = String.Empty
EgtGetInfo(m_nIdToSel, INFO_REFGROUP, sRefGroup)
' deseleziono il pezzo corrente
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectPartInFaimily(sRefGroup)
Select Case SelectWD.NumberOfSelection
Case 0 ' Annulla
' continuo senza eseguire niente
Case Else
' seleziono il numero di pezzi indicati
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectPartInFaimily(sRefGroup, SelectWD.NumberOfSelection)
End Select
m_bIsCounterLy = False
' disassegno il riferimento all'oggetto appena creato
SelectWD = Nothing
EgtDraw()
End If
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(Me)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_NestPage)
@@ -133,15 +182,48 @@ Public Class CSVPage
WritePrivateProfileString(S_CSV, K_CSVLASTFILE, "", m_MainWindow.GetIniFile())
End Sub
Private Function CreateListOfDeniedFiles() As List(Of String)
Dim LocalList As New List(Of String)
LocalList.Add("MERGE")
Dim Index1 As Integer = 0
Dim Index2 As Integer = 0
For Index1 = 0 To m_CsvPartList.Count - 1
Dim sFileName As String = m_CsvPartList(Index1).m_sPath
sFileName = Path.GetFileNameWithoutExtension(sFileName).ToUpper.Trim()
Dim bNewFile As Boolean = True
For Index2 = 0 To LocalList.Count - 1
If sFileName = LocalList(Index2) Then
bNewFile = False
Exit For
End If
Next
If bNewFile Then
LocalList.Add(Path.GetFileNameWithoutExtension(sFileName).ToUpper.Trim)
End If
Next
Return LocalList
End Function
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
' Salvo lista dei pezzi attuale
SaveCsvPartList()
'' Salvo lista dei pezzi attuale
'SaveCsvPartList()
' Leggo direttorio corrente dei file CSV
Dim sCurrDir As String = ""
GetPrivateProfileString(S_CSV, K_CSVCURRDIR, "C:\", sCurrDir, m_MainWindow.GetIniFile())
' Apro dialogo scelta file
Dim OpenFileWnd As New OpenFileWD(m_MainWindow, sCurrDir, ".CSV", ".EPL")
Dim OpenFileWnd As OpenFileWD
Dim sDeniedFiles As List(Of String) = CreateListOfDeniedFiles()
' imposto il filtro
If m_bFull Then
OpenFileWnd = New OpenFileWD(m_MainWindow, sCurrDir, ".CSV", ".EPL", sDeniedFiles)
Else
OpenFileWnd = New OpenFileWD(m_MainWindow, sCurrDir, ".CSV")
End If
If Not OpenFileWnd.ShowDialog() Then Return
' verifico che il file inserito non appartenga al Merge attuale
' Salvo lista dei pezzi attuale
SaveCsvPartList()
' Salvo direttorio corrente
WritePrivateProfileString(S_CSV, K_CSVCURRDIR, OpenFileWnd.GetFileDir(), m_MainWindow.GetIniFile())
' Apertura file
@@ -173,17 +255,28 @@ Public Class CSVPage
' Pulisco path e lista dei pezzi Csv
m_sFilePath = String.Empty
m_sCsvPath = String.Empty
m_CsvPartList.Clear()
' mantengo la lista attuale dei pezzi
'm_CsvPartList.Clear()
' aggiungo i pezzi su una lista temporanea
Dim LocalPartList As New List(Of CsvPart)
' Eseguo la lettura del file Csv
If Not ReadCsvFile(sCsvPath, m_bFull, m_sCsvPath, m_CsvPartList) Then
If Not ReadCsvFile(sCsvPath, m_bFull, m_sCsvPath, LocalPartList) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(91206)) 'Errore nella lettura del file CSV
Return False
End If
' Creo un nuovo file che ospitarà il merge de
Dim sNewMergeFile As String = Path.GetDirectoryName(m_sCsvPath) & "\Merge.csv"
m_sCsvPath = sNewMergeFile
m_sFilePath = m_sCsvPath
' Elimino pezzi nulli
RemoveWrongParts(m_CsvPartList)
RemoveWrongParts(LocalPartList)
' Aggiorno
If m_bFull Then
MySaveCsvPartList(LocalPartList)
' Salvo come epl
SaveCsvPartList()
' Rinomino file originale
@@ -196,9 +289,40 @@ Public Class CSVPage
' eseguo rinomina
My.Computer.FileSystem.RenameFile(sCsvPath, sBakName)
End If
' attacco i nuovi pezzi alla lista corrente
For Each Item As CsvPart In LocalPartList
m_CsvPartList.Add(Item)
Next
Return True
End Function
Private Sub LoadCsvPartList(sFile As String)
' Se Csv semplificato non va letta
If Not m_bFull Then Return
' Pulisco path e lista dei pezzi Csv
m_sCsvPath = String.Empty
' mantengo la lista attuale dei pezzi
'm_CsvPartList.Clear()
' aggiungo i pezzi su una lista temporanea
Dim LocalPartList As New List(Of CsvPart)
' Lettura del file
If ReadCsvPartList(sFile, m_sCsvPath, LocalPartList) Then
' Creo un nuovo file che ospitarà il merge de
Dim sNewMergeFile As String = Path.GetDirectoryName(m_sCsvPath) & "\Merge.csv"
m_sCsvPath = sNewMergeFile
m_sFilePath = m_sCsvPath
End If
' Elimino pezzi nulli
RemoveWrongParts(LocalPartList)
' attacco i nuovi pezzi alla lista corrente
For Each Item As CsvPart In LocalPartList
m_CsvPartList.Add(Item)
Next
End Sub
Private Sub ShowTreeView()
' Path del file Csv
Dim TempPath As New Text.StringBuilder(260)
@@ -208,6 +332,7 @@ Public Class CSVPage
m_ItemsList.Clear()
Dim sCurrMat As String = String.Empty
Dim dCurrTh As Double = 0
Dim sCurrPath As String = String.Empty
Dim nCatToNest As Integer = 0
Dim nCatCount As Integer = 0
Dim PartCathegory As New PartCathegoryItem("", 0)
@@ -218,19 +343,28 @@ Public Class CSVPage
If i = 1 Then
sCurrMat = CurrPart.m_sMaterial
dCurrTh = CurrPart.m_dTh
sCurrPath = CurrPart.m_sPath
ElseIf String.Compare(sCurrMat, CurrPart.m_sMaterial, True) <> 0 Or
String.Compare(sCurrPath, CurrPart.m_sPath, True) <> 0 Or
Math.Abs(dCurrTh - CurrPart.m_dTh) > 10 * EPS_SMALL Then
If m_bFull Then
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
" - " & LenToString(dCurrTh, 2) &
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
Else
PartCathegory.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
End If
PartCathegory.IsExpanded = True
m_ItemsList.Add(PartCathegory)
sCurrMat = CurrPart.m_sMaterial
dCurrTh = CurrPart.m_dTh
sCurrPath = CurrPart.m_sPath
PartCathegory = New PartCathegoryItem("", 0)
nCatToNest = 0
nCatCount = 0
@@ -248,8 +382,14 @@ Public Class CSVPage
PartCathegory.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
" - " & LenToString(dCurrTh, 2) &
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
Else
PartCathegory.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
PartCathegory.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
End If
PartCathegory.IsExpanded = True
m_ItemsList.Add(PartCathegory)
@@ -259,6 +399,7 @@ Public Class CSVPage
For Each CatItem As PartCathegoryItem In m_ItemsList
Dim sCurrMat As String = String.Empty
Dim dCurrTh As Double = 0
Dim sCurrPath As String = String.Empty
Dim nCatToNest As Integer = 0
Dim nCatCount As Integer = 0
For Each PrtItem As PartCustomItem In CatItem.Items
@@ -268,6 +409,7 @@ Public Class CSVPage
PrtItem.sText1 = sCount
sCurrMat = PartData.m_sMaterial
dCurrTh = PartData.m_dTh
sCurrPath = PartData.m_sPath
nCatToNest += PartData.m_nToNest
nCatCount += PartData.m_nCount
Next
@@ -275,8 +417,14 @@ Public Class CSVPage
CatItem.Name = If(String.IsNullOrWhiteSpace(sCurrMat), "***", sCurrMat) &
" - " & LenToString(dCurrTh, 2) &
" - " & nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
CatItem.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
Else
CatItem.Name = nCatToNest.ToString() & "/" & nCatCount.ToString()
If Not String.IsNullOrWhiteSpace(sCurrPath) Then
CatItem.Name &= vbCrLf & Path.GetFileNameWithoutExtension(sCurrPath)
End If
End If
Next
End Sub
@@ -345,6 +493,7 @@ Public Class CSVPage
End Function
Private Sub InsertBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertBtn.Click
'm_CurrProjPage.ClearMessage()
' Recupero lo spessore della lastra corrente
Dim dRawHeight As Double = GetRawHeight()
If dRawHeight < EPS_SMALL Then Return
@@ -355,20 +504,17 @@ Public Class CSVPage
End If
' Recupero la tolleranza sullo spessore
Dim dToler As Double = GetPrivateProfileDouble(S_CSV, K_THICKTOLERANCE, 100 * EPS_SMALL, m_MainWindow.GetIniFile())
dToler = Math.Max( dToler, 100 * EPS_SMALL)
dToler = Math.Max(dToler, 100 * EPS_SMALL)
' Creo la lista dei pezzi inseribili nella lastra corrente
Dim InsPartList As New List(Of CsvPart)
For i As Integer = 1 To m_CsvPartList.Count()
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
If CurrPart.m_bActive And
(Math.Abs(CurrPart.m_dTh - dRawHeight) < dToler Or
CurrPart.m_dTh < EPS_SMALL) And
(String.IsNullOrWhiteSpace(CurrPart.m_sMaterial) Or
String.IsNullOrWhiteSpace(sCurrMat) Or
CurrPart.m_sMaterial = "***" Or
sCurrMat = "***" Or
String.Compare(CurrPart.m_sMaterial, sCurrMat, True) = 0) Then
(Math.Abs(CurrPart.m_dTh - dRawHeight) < dToler Or CurrPart.m_dTh < EPS_SMALL) And
(String.IsNullOrWhiteSpace(CurrPart.m_sMaterial) Or String.IsNullOrWhiteSpace(sCurrMat) Or CurrPart.m_sMaterial = "***" Or sCurrMat = "***" Or String.Compare(CurrPart.m_sMaterial, sCurrMat, True) = 0) Then
InsPartList.Add(CurrPart)
'ElseIf CurrPart.m_bActive Then
' m_CurrProjPage.SetWarningMessage("Grezzo non compatibile")
End If
Next
' Lancio l'inserimento dei pezzi
@@ -480,7 +626,7 @@ Public Class CSVPage
EgtAdjustFlatPart(nId)
' Se Csv completo, aggiungo info su CSV di origine
If m_bFull Then
EgtSetInfo(nId, INFO_CSV_PATH, m_sCsvPath)
EgtSetInfo(nId, INFO_CSV_PATH, CurrPart.m_sPath)
EgtSetInfo(nId, INFO_CSV_PART, CurrPart.m_sName)
EgtSetInfo(nId, INFO_CSV_ORD, CurrPart.m_sOrd)
EgtSetInfo(nId, INFO_CSV_DIST, CurrPart.m_sDist)
@@ -490,14 +636,36 @@ Public Class CSVPage
Utility.SetTextColor( nRegId)
' Lo sposto nel gruppo speciale
EgtRelocate(nId, nIpGrp)
' assegno l'identificatico del pezzo, se esiste
If Not String.IsNullOrEmpty(CurrPart.m_sRefGuid) Then
' GuidCode dovrebbe contenere 36 caratteri, il precode 5: tot = 41
If CurrPart.m_sRefGuid.Count <= 36 Then
Dim sPreGuid As String = CreatePreGuidCode(CurrPart.m_nId)
CurrPart.m_sRefGuid = sPreGuid & CurrPart.m_sRefGuid
End If
EgtSetInfo(CurrPart.m_nId, INFO_REFGROUP, CurrPart.m_sRefGuid)
End If
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(CurrPart.m_nId, NAME_REGION)
' Imposto il colore del pezzo inserito nel progetto
EgtSetColor(nRegLayId, CurrPart.m_cColor)
Dim EntId As Integer = EgtGetFirstInGroup(nRegLayId)
While EntId <> GDB_ID.NULL
If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, CurrPart.m_cColor)
EntId = EgtGetNext(EntId)
End While
Next
EgtLuaResetGlobVar("CMP")
EgtLuaResetGlobVar("CMP_Draw")
' Provo ad inserire i pezzi
Dim dNewArea As Double = 0
For i As Integer = 1 To InsPartList.Count()
Dim CurrPart As CsvPart = InsPartList(i - 1)
While CurrPart.m_nToNest > 0
If m_bDirect Then
If NestOnePart(CurrPart.m_nId) Then
dNewArea += GeomCalc.GetPartArea(CurrPart.m_nId)
@@ -519,6 +687,7 @@ Public Class CSVPage
m_CurrProjPage.UpdateTotalArea( dNewArea)
m_CurrProjPage.UpdateToProduceArea()
m_MainWindow.m_CurrentProjectPageUC.ShowAreas()
Return True
End Function
@@ -595,11 +764,11 @@ Public Class CSVPage
Dim sName As String = String.Empty
EgtGetInfo(nId, INFO_CSV_PART, sName)
' Verifico che il pezzo appartenga a questo Csv
If String.Compare(sCsvPath, m_sCsvPath, True) = 0 Then
If SearchCurrCSV(sCsvPath) Then
' Cerco il pezzo nella lista dei pezzi
For i As Integer = 1 To m_CsvPartList.Count()
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
If String.Compare(sName, CurrPart.m_sName, True) = 0 Then
If String.Compare(sName, CurrPart.m_sName, True) = 0 And String.Compare(sCsvPath, CurrPart.m_sPath, True) = 0 Then
' Se nel grezzo
If EgtGetParent(nId) = m_nRawId Then
' Rimuovo le lavorazioni
@@ -607,19 +776,38 @@ Public Class CSVPage
' Rimuovo dal grezzo
EgtRemovePartFromRawPart(nId)
End If
' recupero il Guid del pezzo corrente (potrebbe essere stato modificato a causa di rotazioni quando il pezzo è passato in parcheggio)
Dim sCurrRefGuid As String = String.Empty
EgtGetInfo(nId, INFO_REFGROUP, sCurrRefGuid)
' Cancello il pezzo
EgtErase(nId)
' aggiorno il layer che indica il numero di pezzi in parcheggio (se sRefGroup<>"")
m_MainWindow.m_CadCutPageUC.m_NestPage.CountPartInFamily(sCurrRefGuid)
' Aggiorno il contatore
CurrPart.m_nToNest += 1
' ricreo la lista delle famiglie di pezzi presenti in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.GetFamilyGroupInPark()
' Esco
Return True
End If
Next
End If
' creo la lista delle famiglie di pezzi presenti in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.GetFamilyGroupInPark()
' Pezzo non appartenente al Csv corrente
Return False
End Function
Private Function SearchCurrCSV(ByVal sCSVFile As String) As Boolean
For i As Integer = 1 To m_CsvPartList.Count()
Dim CurrPart As CsvPart = m_CsvPartList(i - 1)
If String.Compare(sCSVFile, CurrPart.m_sPath, True) = 0 Then
Return True
End If
Next
Return False
End Function
Friend Sub SaveCsvPartList()
' Se Csv semplificato non va salvata
If Not m_bFull Then Return
@@ -630,24 +818,33 @@ Public Class CSVPage
End If
' Path del file
Dim sFile As String = Path.ChangeExtension(m_sFilePath, ".epl")
' Scrittura del file
If WriteCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
' Registro in ini path
WritePrivateProfileString(S_CSV, K_CSVLASTFILE, sFile, m_MainWindow.GetIniFile())
' Scrittura dei file
If WriteCsvMergePartList(m_CsvPartList) Then
' Scrittura dei file Merge
If WriteCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
WritePrivateProfileString(S_CSV, K_CSVLASTFILE, sFile, m_MainWindow.GetIniFile())
End If
End If
End Sub
Private Sub LoadCsvPartList(sFile As String)
' Se Csv semplificato non va letta
' salvo il sottoelenco dei pezzi
Friend Sub MySaveCsvPartList(ByVal CurrPartList As List(Of CsvPart))
' Se Csv semplificato non va salvata
If Not m_bFull Then Return
' Pulisco path e lista dei pezzi Csv
m_sCsvPath = String.Empty
m_CsvPartList.Clear()
' Lettura del file
ReadCsvPartList(sFile, m_sCsvPath, m_CsvPartList)
m_sFilePath = sFile
' Elimino pezzi nulli
RemoveWrongParts(m_CsvPartList)
Dim sCurrPath As String = String.Empty
' recupero dalla lista il nome del file corrente
For Each Item As CsvPart In CurrPartList
sCurrPath = Item.m_sPath
Next
' se non trov il nome del file assocciato all'elenco di pezzi esco
If String.IsNullOrEmpty(sCurrPath) Then
EgtOutLog("CSV Curr list missing")
Return
End If
' Path del file
Dim sFile As String = Path.ChangeExtension(sCurrPath, ".epl")
' Scrittura del file
WriteCsvPartList(sFile, sCurrPath, CurrPartList)
End Sub
Friend Sub UpdateCsvPartList()
+10
View File
@@ -108,6 +108,8 @@ Public Class CadCutPageUC
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Se macchina fotografica collegata, faccio una foto
@@ -142,6 +144,8 @@ Public Class CadCutPageUC
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
@@ -168,6 +172,8 @@ Public Class CadCutPageUC
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
@@ -176,6 +182,8 @@ Public Class CadCutPageUC
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
@@ -198,6 +206,8 @@ Public Class CadCutPageUC
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
m_MainWindow.DragRettangleOff()
m_MainWindow.SplitCurvWJOff()
m_MainWindow.StartCurvWJOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
m_ProjectMgr.TestBtn.IsChecked = False
+271 -10
View File
@@ -28,6 +28,8 @@ Public Class MoveRawPartPage
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Assegno testi
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
@@ -230,16 +232,48 @@ Public Class MoveRawPartPage
If nParentId = nRawGroupId Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nId, nStat)
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
If nStat = GDB_ST.SEL Then
EgtSetStatus(nId, GDB_ST.ON_)
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
' verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' esco dal ciclo, prima devo depositare correttamente il pezzo
Exit While
End If
' salvo l'indice del pezzo correntemente attaccato alle ventose
m_CurrRawOnVacuum = nId
' Deseleziono tutto e abilito la selezione del pezzo corrente
EgtDeselectAll()
EgtSetStatus(nId, GDB_ST.SEL)
' Se con ventose, le posiziono sul grezzo
If Not m_bByHand Then
Dim rmData As New RawMoveData
' inizializzo i dati del grezzo per il cacolo del peso
Dim MaxSinglePlugger As Double = 250
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, m_MainWindow.GetMachIniFile())
Dim MaxDoublePlugger As Double = 750
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
Dim AverageDensity As Double = 2700
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
@@ -249,10 +283,18 @@ Public Class MoveRawPartPage
' Reset eventuale messaggio
m_CurrProjPage.ClearMessage()
Else
' nascondo la visualizzazione delle ventose
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' Aggiorno i dati
m_bRawWithCups = False
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
If VacuumCups.bOverWeight Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4)) 'Pezzo troppo pesante : non si può muovere
ElseIf VacuumCups.bExtraStroke Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5)) 'Pezzo oltre le corse : non si può muovere
Else
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
End If
End If
End If
End If
@@ -261,8 +303,52 @@ Public Class MoveRawPartPage
End If
nId = EgtGetNextObjInSelWin()
End While
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
End If
End Sub
' Veririfica che il grezzo non entri in colliosione con altri pezzi
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
If nIdOnVacumm = GDB_ID.NULL Then Return False
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
EgtSetName(m_nTempId, "RawTemp")
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
Dim nCurrPhase As Integer = EgtGetCurrPhase()
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
Dim nIdRaw As Integer = EgtGetFirstRawPart()
' ciclo su tutti i grezzi per veririficare eventuali collisioni
While nIdRaw <> GDB_ID.NULL
' verifico la fase del grezzo
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
' recupero il contorno del pezzo
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
If EgtExistsObj(nIdRawFlatRegion) Then
EgtErase(m_nTempId)
' esiste una intersezione delle superfici
Return True
End If
End If
End If
nIdRaw = EgtGetNextRawPart(nIdRaw)
End While
EgtErase(m_nTempId)
Return False
End Function
#Region "Move Up/Down/Left/Right"
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
@@ -285,9 +371,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -322,9 +414,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -342,9 +440,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -361,9 +465,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(-m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -373,6 +483,77 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
#End Region 'Move Up/Down/Left/Right
' verifica che la poszione da raggiungere sia nei limiti delle corse
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
ptEndPointLift.x += vtMove.x
ptEndPointLift.y += vtMove.y
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
Case 1
' extra corsa sulla x-: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 2
' extra corsa sulla x+: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 4
' extra corsa sulla y-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
Case 8
' extra corsa sulla y+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
Return bOk
End Function
#Region "Rotate CounterClockWise/ClockWise"
Private Sub RotateCounterClockwiseBtn_Click(sender As Object, e As RoutedEventArgs) Handles RotateCounterClockwiseBtn.Click
' Solo movimento con ventose
If m_bByHand Then Return
@@ -380,14 +561,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -404,14 +595,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = -m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -421,6 +622,44 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
#End Region ' Rotate CounterClockWise/ClockWise
' verifica che la rotazione da raggiungere sia nei limiti delle corse
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
Case 16
' extra corsa sulla c-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
Case 34
' extra corsa sulla c+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
VacuumCups.dDegRotStartAng = dDegRotEndAng
Return bOk
End Function
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
@@ -658,6 +897,17 @@ Public Class MoveRawPartPage
End Sub
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' non cambio pagina
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Torno alla fase precedente
@@ -669,6 +919,17 @@ Public Class MoveRawPartPage
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
' verifico che il pezzo sia depositabile
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' mantengo la selezione del pezzo
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
EgtDraw()
' non cambio pagina
Return
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
EgtDeselectAll()
' Passo alla pagina delle spezzature
+10 -4
View File
@@ -99,23 +99,29 @@
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="StorePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="StartCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource StartWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" >
<Button Name="RemovePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="DragRettanleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Drag_RettangleImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="SplitCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource SplitWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
File diff suppressed because it is too large Load Diff
+21 -4
View File
@@ -9,6 +9,7 @@ Public Class OpenFileWD
Private m_sCurrFile As String = String.Empty
Private m_sExt As String = String.Empty
Private m_sExt2 As String = String.Empty
Private n_sDeniedFiles As New List(Of String)
Private m_OpenItemList As New ObservableCollection(Of IconListBoxItem)
@@ -27,6 +28,15 @@ Public Class OpenFileWD
InitializeComponent()
End Sub
Sub New(Owner As Window, sDir As String, sExt As String, sExt2 As String, DeniedFiles As List(Of String))
Me.Owner = Owner
m_sCurrDir = sDir
m_sExt = sExt
m_sExt2 = sExt2
n_sDeniedFiles = DeniedFiles
InitializeComponent()
End Sub
Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Posizione finestra
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
@@ -71,13 +81,20 @@ Public Class OpenFileWD
Dim FileI As FileInfo
For Each FileI In vFileI
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
If String.Compare(sExt, m_sExt, True) = 0 Or
String.Compare(sExt, m_sExt2, True) = 0 Then
Dim sFileName As String = Path.GetFileNameWithoutExtension(FileI.Name).ToUpper.Trim
Dim bDenied As Boolean = False
For Each ItemFile As String In n_sDeniedFiles
If ItemFile.ToUpper.Trim = sFileName Then
bDenied = True
Exit For
End If
Next
If (String.Compare(sExt, m_sExt, True) = 0 Or String.Compare(sExt, m_sExt2, True) = 0) And Not bDenied Then
m_OpenItemList.Add(New IconListBoxItem(FileI.Name, 3))
End If
Next
' riporto visualizzazione in cima alla lista (esiste sempre almeno un elemento)
FileListBox.ScrollIntoView(m_OpenItemList(0))
' riporto visualizzazione in cima alla lista (esiste sempre almeno un elemento)
FileListBox.ScrollIntoView(m_OpenItemList(0))
Return True
End Function
+72
View File
@@ -0,0 +1,72 @@
<Window x:Class="SelectPartFromFamilyWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="SaveNameWD" Height="200" Width="400" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}">
<Grid x:Name="SaveNameGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
</Grid.RowDefinitions>
<!--Messaggio: Seleziona il numero di pezzi-->
<TextBlock Name="TitleWDTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<UniformGrid Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" Columns="2">
<TextBlock Name="NbrOfPartsMsg"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="NbrOfParts"
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
</UniformGrid>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="5" Grid.RowSpan="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<!--ultimo progetto-->
<Button Name="ConfirmSelection" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="Confirm">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--nuovo progetto-->
<Button Name="SelectAllPart" Grid.Column="2" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="Select all" Visibility="Collapsed">
<Image Source="{DynamicResource NuovoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--apri folder progetti-->
<Button Name="CancelSelection" Grid.Column="5" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"
ToolTip="Cancel">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+66
View File
@@ -0,0 +1,66 @@
Public Class SelectPartFromFamilyWD
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_NumberOfParts As Integer = 1
Public Property NumberOfParts As Integer
Get
Return m_NumberOfParts
End Get
Set(value As Integer)
m_NumberOfParts = value
End Set
End Property
Private m_NumberOfSelection As Integer = 1
Public Property NumberOfSelection As Integer
Get
Return m_NumberOfSelection
End Get
Set(value As Integer)
m_NumberOfSelection = value
End Set
End Property
Public Sub New(Owner As Window, NbrParts As Integer)
Me.Owner = Owner
m_NumberOfParts = NbrParts
InitializeComponent()
Me.ShowDialog()
End Sub
' inizializzo la finestra
Private Sub SelectPartFromFamilyWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' posiziono la fistra in centro alla pagina
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
TitleWDTxbl.Text = "Selection parts"
NbrOfPartsMsg.Text = "Number of parts"
NbrOfParts.Text = m_NumberOfParts.ToString
End Sub
' seleziono il numero di elementi indicati
Private Sub ConfirmSelection_Click(sender As Object, e As RoutedEventArgs) Handles ConfirmSelection.Click
Dim nVal As Integer = 0
StringToInt(NbrOfParts.Text, nVal)
If nVal >= 0 Then
m_NumberOfSelection = nVal
Else
' indice non valido per la selezione
m_NumberOfSelection = 0
End If
Me.Close()
End Sub
'' seleziona tutti
'Private Sub SelectAllPart_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllPart.Click
' m_NumberOfSelection = m_NumberOfParts
' Me.Close()
'End Sub
' Deseleziomo tutto
Private Sub CancelSelection_Click(sender As Object, e As RoutedEventArgs) Handles CancelSelection.Click
m_NumberOfSelection = 0
Me.Close()
End Sub
End Class
+163 -32
View File
@@ -410,25 +410,38 @@ Public Class SplitPageUC
VerifyHomogenousMachining(ItemList)
ItemList.Sort(Function(x, y) Comparer(Of Integer).Default.Compare(m_ItemList.IndexOf(x), m_ItemList.IndexOf(y)))
' verifico che siano contigui
Dim bContigus As Boolean = False
Dim OrdIndex = 0
OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
If MachiningLsBx.SelectedItems.Count = 1 Then
bContigus = True
If VerifyContinuity(ItemList) Then
MoveUpBtn.IsEnabled = True
MoveDownBtn.IsEnabled = True
Else
For Each Item As NameIdLsBxItem In ItemList
If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
bContigus = True
End If
Next
End If
' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
If Not bContigus Then
ItemList.Remove(LastSel)
MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
MoveUpBtn.IsEnabled = False
MoveDownBtn.IsEnabled = False
End If
GetCurrSelection()
'' verifico che siano contigui
'Dim bContigus As Boolean = False
'Dim OrdIndex = 0
'OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
'' recupero l'indice dell'ultimo elemento selezionato
'Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
'If MachiningLsBx.SelectedItems.Count = 1 Then
' bContigus = True
'Else
' For Each Item As NameIdLsBxItem In ItemList
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
' bContigus = True
' End If
' Next
'End If
'' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
'If Not bContigus Then
' ItemList.Remove(LastSel)
' MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
'End If
' resetto marcatura lavorazioni
If m_CurrFirstInd > -1 Then
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
@@ -497,6 +510,9 @@ Public Class SplitPageUC
Private Sub OnOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles OnOffBtn.Click
If m_CurrFirstInd = -1 Then Return
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
@@ -557,6 +573,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Provo ad entrambi gli estremi
Dim bModif As Boolean = AdjustBothCuts(nI)
@@ -582,6 +601,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Eseguo
If AdjustEndCut(nI) Then
@@ -601,6 +623,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Eseguo
If AdjustStartCut(nI) Then
@@ -729,6 +754,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -827,6 +855,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
@@ -966,6 +997,8 @@ Public Class SplitPageUC
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
Dim bFirstInd As Boolean = True
Dim bFirstMill As Boolean = True
Dim bFirstWJ As Boolean = True
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
Dim dUsal As Double = 0
@@ -980,6 +1013,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
@@ -993,7 +1029,7 @@ Public Class SplitPageUC
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
ValWnd.SetVal(dOrigUsal)
If Not ValWnd.ShowDialog() Then Return
' carico il valore letto dal testierino virtuale
@@ -1045,16 +1081,16 @@ Public Class SplitPageUC
' leggo il valore salvato nella geometria
Dim dOrigUsal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
If bFirstInd Then
If bFirstMill Then
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
ValWnd.SetVal(dOrigUsal)
If Not ValWnd.ShowDialog() Then Return
' carico il valore letto dal testierino virtuale
dUsal = ValWnd.GetVal()
' comunico che ho letto il primo dato
bFirstInd = False
bFirstMill = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
@@ -1071,7 +1107,7 @@ Public Class SplitPageUC
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
If bFirstWJ Then
' Recupero i valori attuali della lavorazione
Dim bOriginalIsLeadIn As Boolean = True
Dim dOriginalAddLen As Double = 0
@@ -1086,7 +1122,7 @@ Public Class SplitPageUC
EgtGetMachiningParam(MCH_MP.LIPERP, nOriginalPerpDist)
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nOriginalLeadInType)
' Dialogo richiesta valori
Dim ModifStartWnd As New ModifStartEndWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 33), bOriginalIsLeadIn, nOperId) ' Inizio Modif.
Dim ModifStartWnd As New ModifStartEndWD(m_MainWindow, "WJ: " & EgtMsg(MSG_SPLITPAGEUC + 33), bOriginalIsLeadIn, nOperId) ' Inizio Modif.
ModifStartWnd.SetElongation(dOriginalAddLen)
ModifStartWnd.SetHole(bOriginalLiHole)
ModifStartWnd.SetLiTangDist(nOriginalTangDist)
@@ -1101,7 +1137,7 @@ Public Class SplitPageUC
nWJPerpDist = ModifStartWnd.GetLiPerpDist()
nWJLeadInType = ModifStartWnd.GetLeadInType().Id
' comunico che ho letto il primo dato
bFirstInd = False
bFirstWJ = False
End If
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
@@ -1132,6 +1168,8 @@ Public Class SplitPageUC
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
Dim bFirstInd As Boolean = True
Dim bFirstMill As Boolean = True
Dim bFirstWJ As Boolean = True
' elenco delle variabili : MCH_MY.SAWING/MCH_MY.MILLING
Dim dUeal As Double = 0
@@ -1145,6 +1183,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
@@ -1158,7 +1199,7 @@ Public Class SplitPageUC
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
ValWnd.SetVal(dOrigUeal)
If Not ValWnd.ShowDialog() Then Return
dUeal = ValWnd.GetVal()
@@ -1208,13 +1249,13 @@ Public Class SplitPageUC
Dim dOrigUeal As Double = 0
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
If bFirstInd Then
If bFirstMill Then
' Dialogo richiesta valore
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
ValWnd.SetVal(dOrigUeal)
If Not ValWnd.ShowDialog() Then Return
dUeal = ValWnd.GetVal()
bFirstInd = False
bFirstMill = False
End If
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
' Modifica della lavorazione
@@ -1228,7 +1269,7 @@ Public Class SplitPageUC
' se altrimenti getto d'acqua
ElseIf nMachiningType = MCH_MY.WATERJETTING Then
If bFirstInd Then
If bFirstWJ Then
' Recupero i valori attuali della lavorazione
Dim dAddLen As Double = 0
Dim LeadOutType As Integer = 0
@@ -1240,7 +1281,7 @@ Public Class SplitPageUC
EgtGetMachiningParam(MCH_MP.LOTANG, nTangDist)
EgtGetMachiningParam(MCH_MP.LOPERP, nPerpDist)
' Dialogo richiesta valore
Dim ModifStartWnd As New ModifStartEndWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 34), False, nOperId) ' Fine Modif.
Dim ModifStartWnd As New ModifStartEndWD(m_MainWindow, "WJ: " & EgtMsg(MSG_SPLITPAGEUC + 34), False, nOperId) ' Fine Modif.
ModifStartWnd.SetElongation(dAddLen)
ModifStartWnd.SetLeadOutType(LeadOutType)
ModifStartWnd.SetLoTangDist(nTangDist)
@@ -1250,7 +1291,7 @@ Public Class SplitPageUC
WJLeadOutType = ModifStartWnd.GetLeadOutType().Id
nWJTangDist = ModifStartWnd.GetLoTangDist()
nWJPerpDist = ModifStartWnd.GetLoPerpDist()
bFirstInd = False
bFirstWJ = False
End If
' Modifica della lavorazione
@@ -1278,6 +1319,9 @@ Public Class SplitPageUC
Private Sub InvertBtn_Click(sender As Object, e As RoutedEventArgs) Handles InvertBtn.Click
If m_CurrFirstInd = -1 Then Return
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
@@ -1323,6 +1367,9 @@ Public Class SplitPageUC
If m_CurrFirstInd = -1 Then Return
Dim bGenModif As Boolean = False
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
Dim nI As Integer = m_ItemList(Index).Ind
Dim nOperId As Integer = m_MachiningList(nI).m_nId
If GetPause(nOperId) Then
@@ -1645,6 +1692,37 @@ Public Class SplitPageUC
End If
End Sub
Private Function VerifyContinuity(ItemList As List(Of NameIdLsBxItem)) As Boolean
If ItemList.Count < 2 Then Return True
Dim bContigus As Boolean = False
For Index As Integer = 0 To ItemList.Count - 2
If ItemList(Index).Ind = ItemList(Index + 1).Ind + 1 Or ItemList(Index).Ind = ItemList(Index + 1).Ind - 1 Then
bContigus = True
Else
bContigus = False
Exit For
End If
Next
Return bContigus
End Function
Private Sub GetCurrSelection()
For Each Item As NameIdLsBxItem In m_ItemList
Item.IsSelected = False
Next
' recupero il numero di elementi selezionati
Dim nCount As Integer = MachiningLsBx.SelectedItems.Count
For Index As Integer = 0 To nCount - 1
Dim Local_ItemTemplate As NameIdLsBxItem = MachiningLsBx.SelectedItems(Index)
For Each Item As NameIdLsBxItem In m_ItemList
If Item.Ind = Local_ItemTemplate.Ind Then
Item.IsSelected = True
Exit For
End If
Next
Next
End Sub
Private Sub VisibilityButtonFromMachinig(ByVal Type As Integer)
If Type <> MCH_OY.SAWING Then
CutBtn.Visibility = Visibility.Hidden
@@ -1721,6 +1799,15 @@ Public Class SplitPageUC
vtXY.Normalize()
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
ptCen.z = ptMax.z + 1
' ricavo la posizione del punto (se waterjet separata)
If m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Or m_MachiningList(nI).m_nType = MCH_OY.MILLING Then
Dim ptMid As Point3d
Dim vVers As Vector3d
MidPointOfCurve(m_MachiningList(nI).m_nId, ptMid, vVers)
ptCen = ptMid ' + vVers * If(Not b2ndLav, -0.8, 0.8) * dHtxt
End If
If bNumber Then
Dim nNbrId As Integer = EgtCreateTextAdv( m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
300, False, dHtxt, dRat, 0, INS_POS.MC)
@@ -1775,6 +1862,36 @@ Public Class SplitPageUC
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
End Function
Private Function MidPointOfCurve(nOperId As Integer, ByRef ptMid As Point3d, ByRef vVers As Vector3d) As Boolean
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
' creo un layer ausiliario per creare la curva composita
Dim AuxLayer As Integer = EgtCreateGroup(nPvId)
' imposto la lavorazione corrente
EgtSetCurrMachining(nOperId)
' recupero tutte le entità della lavorazione corrente
Dim nInd As Integer = 0
Dim nIdCurr As Integer
Dim nSub As Integer
Dim CurveCompoList As New List(Of Integer)
While EgtGetMachiningGeometry(nInd, nIdCurr, nSub)
CurveCompoList.Add(nIdCurr)
nInd += 1
End While
Dim PtNearStart As Point3d
Dim nIdCutPath As Integer = EgtCreateCurveCompoByChain(AuxLayer, CurveCompoList.ToArray, PtNearStart, False)
Dim dLength As Double = 0
EgtCurveLength(nIdCutPath, dLength)
Dim dParam As Double = 0
EgtCurveParamAtLength(nIdCutPath, dLength / 2, dParam)
EgtAtParamPoint(nIdCutPath, dParam, GDB_RT.GLOB, ptMid)
EgtAtParamVector(nIdCutPath, dParam, -1, vVers)
vVers.Normalize()
vVers.Rotate(Vector3d.Z_AX, 90)
EgtErase(AuxLayer)
Return True
End Function
Private Function AddMachiningDirection( ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
Dim dArrX As Double = dLen * Math.Cos( 30 * Math.PI / 180)
Dim dArrY As Double = dLen * Math.Sin( 30 * Math.PI / 180)
@@ -1854,7 +1971,10 @@ Public Class SplitPageUC
EgtDisableModified()
' cancello evidenziazione
If m_CurrFirstInd >= 0 Then
For Index As integer = m_CurrFirstInd To m_CurrLastInd
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
If Not m_ItemList(Index).IsSelected Then
Continue For
End If
MarkMachining(m_ItemList(Index).Ind, False)
Next
m_CurrFirstInd = -1
@@ -1913,6 +2033,8 @@ Public Class SplitPageUC
Private m_bIsActive As Boolean
Private m_nType As Integer
Private m_IsSelected As Boolean
Public Property Ind As Integer
Get
Return m_nInd
@@ -1955,6 +2077,15 @@ Public Class SplitPageUC
End Set
End Property
Public Property IsSelected As Boolean
Get
Return m_IsSelected
End Get
Set(value As Boolean)
m_IsSelected = value
End Set
End Property
Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer)
Me.m_sName = Name
Me.m_nInd = Ind
+147 -4
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Text.RegularExpressions
Module VacuumCups
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
@@ -10,7 +11,22 @@ Module VacuumCups
Private m_dPreferredRot As Double = 0
Private m_dPrefVertRotXMinus As Double = 0
Private m_dPrefVertRotXPlus As Double = 0
Private m_dPrefVertRotYMinus As Double = 0
Private m_dPrefVertRotYPlus As Double = 0
Private m_dDripRefAng As Double = 0
' dati carico massimo manipolatore
Private m_RawDensity As Double = 2500
Private m_RawWeight As Double = 0
Private m_MaxWeightSinglePlugger As Double = 250
Private m_MaxWeightDoublePlugger As Double = 750
Public bOverWeight As Boolean = False
' dati per rotazione ventose vicono al fine corsa Y e X
Private bRotateVacuumNearExtraStrokeY As Boolean = False
Private bRotateVacuumNearExtraStrokeX As Boolean = False
' dati stroke
Public bExtraStroke As Boolean = False
Public ptStartPointLift As Point3d
Public dDegRotStartAng As Double
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
@@ -50,6 +66,20 @@ Module VacuumCups
Return m_nVacType
End Function
' carico i dati macchina relativi al peso massimo movimentabile
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
m_RawDensity = Density
m_MaxWeightSinglePlugger = MaxSingle
m_MaxWeightDoublePlugger = MaxDouble
End Sub
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
bRotateVacuumNearExtraStrokeY = Rotate
End Sub
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
bRotateVacuumNearExtraStrokeX = Rotate
End Sub
Friend Function GetVacuumId() As Integer
Return m_nVacId
End Function
@@ -66,6 +96,8 @@ Module VacuumCups
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -78,7 +110,9 @@ Module VacuumCups
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
@@ -165,6 +199,18 @@ Module VacuumCups
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
Dim ptKerfCen As Point3d
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
'-------------------- INIZIO CALCOLO PESO --------------------
' recupero l'area del grezzo da muovere
Dim RawArea As Double = 0
' superficie del grezzo senza considerare eventuali fori
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
@@ -187,6 +233,7 @@ Module VacuumCups
Return False
End Function
' utilizzata per gestire la movimentazione dei pezzi per eseguire i drip
Friend Function PutVacuumCupsOnPart(nPartId As Integer,
ByRef rmData As RawMoveData, ByRef b3Part As BBox3d) As Boolean
' Ripristino posizione originale ventose
@@ -266,6 +313,7 @@ Module VacuumCups
Dim sCups() As String = Nothing
Dim sCups2() As String = Nothing
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
bExtraStroke = False
' Determino validità soluzioni della configurazione
Dim vtMove As New Vector3d
Dim ptRotCen As New Point3d
@@ -294,6 +342,7 @@ Module VacuumCups
Dim frCurrRef As New Frame3d
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
' Assegno dati noti al movimento del grezzo
rmData.m_nId = nRawId
rmData.m_vtRawMove = Vector3d.NULL()
@@ -368,6 +417,23 @@ Module VacuumCups
If b3Vac.IsEmpty() Then Return INFINITO
' Se box maggiore di quello del pezzo, scarto soluzione
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
'-------------------- INIZIO VERIFICA PESO --------------------
bOverWeight = False
Select Case GetPluggerFromCameras(sCups)
Case 2
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightDoublePlugger Then
bOverWeight = True
Return INFINITO
End If
Case 1
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightSinglePlugger Then
bOverWeight = True
Return INFINITO
End If
End Select
'-------------------- FINE VERIFICA PESO --------------------
' Recupero l'area della tavola
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
@@ -383,13 +449,24 @@ Module VacuumCups
dRotAngDeg = dAngOrizzDeg
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dPreferredRot As Double = m_dPreferredRot
If Math.Abs( dRotAngDeg - 90) < 45 Or Math.Abs( dRotAngDeg - 270) < 45 Then
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
' verifico l'orientamento del pezzo
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
' se l'orientamento è verticale
If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus
else
Else
dPreferredRot = m_dPrefVertRotXPlus
End If
End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus
Else
dPreferredRot = m_dPrefVertRotYMinus
End If
End If
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
dRotAngDeg -= dAngDelta
@@ -446,11 +523,55 @@ Module VacuumCups
' Applico movimento e rotazione al punto
ptRef.Move(vtMove)
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
bExtraStroke = True
Return INFINITO
End If
' se la posizione è accettbaile allora salvo i dati
ptStartPointLift = ptRef
dDegRotStartAng = dRotAngDeg
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
' Ne calcolo la distanza dal centro della tavola
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
Return dDist
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double
Dim nStat As Integer
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
Return nStat
End Function
' dall'informazione di extra corsa recupera il valore indicato
Public Function GetExtraStrokeValue(sInfo As String) As Double
Dim dExtraStroke As Double = 0
Dim sItems As String() = sInfo.Split("="c)
If sItems.Count = 2 Then
Dim nStartIndex As Integer = 0
For Each ItemChar As Char In sItems(1)
If ItemChar = "("c Then
Exit For
End If
nStartIndex += 1
Next
If nStartIndex > 0 Then
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
StringToLen(sValue, dExtraStroke)
End If
End If
Return dExtraStroke
End Function
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
' Eseguo verifica delle ventose rispetto al grezzo
@@ -471,6 +592,28 @@ Module VacuumCups
Return bVacOk
End Function
' dato il vettore delle camere restituisco il quali attuatori sono coinvolti
Private Function GetPluggerFromCameras(sCups() As String) As Integer
Dim nCountPlunger As Integer = 1
Dim bPlugger1 As Boolean = False
Dim bPlugger2 As Boolean = False
For Each Camera As String In sCups
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
bPlugger1 = True
Else
bPlugger2 = True
End If
Next
' verifico quali sono le camere attive
If bPlugger1 And bPlugger2 Then
nCountPlunger = 2
ElseIf Not bPlugger1 And Not bPlugger2 Then
nCountPlunger = 0
End If
' restituisco il numero di Plugger in uso
Return nCountPlunger
End Function
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
' Assegno le informazioni
EgtSetInfo(nId, "Id", rmData.m_nId)
+13
View File
@@ -94,6 +94,8 @@ Module ConstGen
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
' Info in asse rotante ventosa per step discreti
@@ -147,6 +149,9 @@ Module ConstGen
Public Const INFO_RAW_BLOCK = "Block"
' Info per numero lastra nel blocco
Public Const INFO_RAW_SLABNBR = "SlabNbr"
' Info per identificazione gruppo pezzi
Public Const INFO_REFGROUP As String = "RefGroup"
Public Const INFO_COUNTERLY As String = "CounterPz"
' Contrassegno di progetto OmagCut
Public Const NAME_PROJMARK As String = "OmagCut"
@@ -182,6 +187,8 @@ Module ConstGen
Public Const INFO_TOTAREA As String = "TotArea"
' Info per area da produrre dei pezzi del progetto
Public Const INFO_TOPRODAREA As String = "ToProdArea"
' Info per nome progetti
Public Const INFO_PROJNAME As String = "ProjName"
' Nome layer delle regioni
Public Const NAME_REGION As String = "Region"
@@ -297,6 +304,12 @@ Module ConstGen
Public Const INFO_PARTOK As String = "POK"
' Info in pezzo per stato rotazione
Public Const INFO_PARTROT As String = "ROT"
' Info in entità in OutLoop per indicare se è separata WaterJet
Public Const INFO_JOINENTITY As String = "JoinEntity"
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
' Info in OutLoop per punto inzio lavorazione WaterJet
Public Const INFO_START As String = "Start"
' Nome di pezzo che è una cornice
Public Const NAME_FRAME As String = "Frame"
+4
View File
@@ -46,6 +46,10 @@ Module ConstIni
Public Const K_THEME As String = "Theme"
Public Const K_MANUAL_CUT As String = "ManualCut"
Public Const K_TEST As String = "Test"
Public Const K_SMARTMACHININGPAGE As String = "SmartMachiningPage"
Public Const K_STARTPROGRAM As String = "StartProgram"
Public Const K_GENERATECN As String = "GenerateCN"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
+5
View File
@@ -228,6 +228,10 @@
Public Const S_MACH_RAWMOVE As String = "RawMove"
Public Const K_MACH_RM_ROTATE As String = "Rotate"
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
@@ -290,5 +294,6 @@
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
End Module
+2 -1
View File
@@ -644,7 +644,8 @@ Public Class FlatteningCut
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
EgtSetName(nPartId, NAME_DIRECTCUT)
Dim nLayerId = EgtCreateGroup(nPartId)
EgtSetName(nLayerId, NAME_OUTLOOP)
' EgtSetName(nLayerId, NAME_OUTLOOP)
EgtSetName(nLayerId, NAME_ONPATH)
' Creo il taglio
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
+16 -2
View File
@@ -882,7 +882,7 @@ Public Class DrawPageUC
' permette di inserire più di un part
Private Function MakeMultipleInsert(ByVal nNbr As Integer, sName As String) As Boolean
Dim InsertColor As Color3d = CompoColor(m_MainWindow.GetIniFile())
' Imposto il contesto corrente
@@ -893,6 +893,9 @@ Public Class DrawPageUC
' Cancello layer regioni per selezione buchi
Pz = EgtGetFirstGroupInGroup(GDB_ID.ROOT)
' identificativo univoico del gruppo di pezzi, se più di un pezzo
Dim sGUICode As String = String.Empty
While Pz <> -1
' imposto il contesto corrente
EgtSetCurrentContext(DrawScene.GetCtx())
@@ -1040,6 +1043,11 @@ Public Class DrawPageUC
EgtEraseEmptyParts()
' Area dei nuovi pezzi
Dim dNewArea As Double = 0
If nNbr > 1 Then
sGUICode = System.Guid.NewGuid.ToString
End If
' Se esiste il file del pezzo
If My.Computer.FileSystem.FileExists(sTmpFile) Then
' eseguo inserimento
@@ -1054,7 +1062,13 @@ Public Class DrawPageUC
If m_bTrfData Then EgtSetInfo(nId2, "CsvPart", m_TrfOrderCode & "-" & nId2.ToString())
' Aggiorno l'area dei nuovi pezzi
dNewArea += GeomCalc.GetPartArea(nId2)
' Inserisco in parcheggio
' assegno l'identificatico del pezzo, se esiste
If Not String.IsNullOrEmpty(sGUICode) Then
Dim sPreGuid As String = CreatePreGuidCode(nId2)
EgtSetInfo(nId2, INFO_REFGROUP, sPreGuid & sGUICode)
End If
' muovo il pezzo nella prima posizione di parcheggio libera
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
+43 -12
View File
@@ -808,6 +808,10 @@ Public Class ImportPageUC
EgtErase(EgtGetFirstNameInGroup(PartId, SELECT_REGION_LAYER))
PartId = EgtGetNextPart(PartId)
End While
' identificativo univoico del gruppo di pezzi, se più di un pezzo
Dim sGUICode As New List(Of String)
' Scrivo testi per nesting
SideAngle.WriteSideAngleForNest(ImportScene.GetCtx())
' Imposto riferimento sul centro geometrico di ogni pezzo
@@ -817,26 +821,53 @@ Public Class ImportPageUC
' Salvo tutti i pezzi in un file temporaneo
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPart" & ".Nge"
If Not EgtSaveFile(sTmpFile, NGE.BIN) Then Return
' Determino numero ripetizioni
Dim nRepeat = 1
StringToInt(PartNumTxBx.Text, nRepeat)
nRepeat = Math.Min(Math.Max(1, nRepeat), 50)
' creo il riferimento
If nRepeat > 1 Then
' per ogni pezze del file DXF creo un gruppo
Dim nIdTemp As Integer = EgtGetFirstPart()
While nIdTemp <> GDB_ID.NULL
Dim sPreGuid As String = CreatePreGuidCode(nIdTemp)
sGUICode.Add(sPreGuid & System.Guid.NewGuid.ToString)
nIdTemp = EgtGetNextPart(nIdTemp)
End While
End If
' Passo al contesto principale
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Recupero flag per inserimento diretto in grezzo (altrimenti in parcheggio)
Dim bDirect As Boolean = (GetPrivateProfileInt(S_NEST, K_DIRECT, 0, m_MainWindow.GetIniFile()) <> 0)
' Elimino eventuali precedenti pezzi vuoti
EgtEraseEmptyParts()
' Determino numero ripetizioni
Dim nRepeat = 1
StringToInt(PartNumTxBx.Text, nRepeat)
nRepeat = Math.Min(Math.Max(1, nRepeat), 50)
' Inserisco i pezzi nell'ambiente principale e recupero Id primo pezzo inserito
Dim nFirstId As Integer = EgtGetLastPart()
For nInd As Integer = 1 To nRepeat
Dim nFirst2Id As Integer = EgtGetLastPart()
EgtInsertFile(sTmpFile)
Dim FirstOfImport As Integer = EgtGetNextPart(nFirst2Id)
Dim Index As Integer = 1
While FirstOfImport <> GDB_ID.NULL And Index <= sGUICode.Count
If Not String.IsNullOrEmpty(sGUICode(Index - 1)) Then
EgtSetInfo(FirstOfImport, INFO_REFGROUP, sGUICode(Index - 1))
Index += 1
Else
Exit While
End If
FirstOfImport = EgtGetNextPart(FirstOfImport)
End While
nFirst2Id = If(nFirst2Id <> GDB_ID.NULL, EgtGetNextPart(nFirst2Id), EgtGetFirstPart())
' Eventuale inserimento pezzi in VeinMatching
VeinMatching.AddParts(sTmpFile, nFirst2Id)
Next
nFirstId = If(nFirstId <> GDB_ID.NULL, EgtGetNextPart(nFirstId), EgtGetFirstPart())
' Cancello il file
If My.Computer.FileSystem.FileExists(sTmpFile) Then
My.Computer.FileSystem.DeleteFile(sTmpFile)
@@ -845,7 +876,7 @@ Public Class ImportPageUC
Dim dNewArea As Double = 0
Dim nId As Integer = nFirstId
While nId <> GDB_ID.NULL
dNewArea += GeomCalc.GetPartArea( nId)
dNewArea += GeomCalc.GetPartArea(nId)
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
@@ -868,26 +899,26 @@ Public Class ImportPageUC
If m_nFileType = FT.DXF Or m_nFileType = FT.NGE Then
' Eventuale testo per indicare il sopra
If TopBtn.IsChecked() Then
Utility.AddTopToPartRegion( nRegId)
Utility.AddTopToPartRegion(nRegId)
End If
' Se richiesti, inserisco dati Ordine, Distinta, Nome, Origine
If m_bEnableOrderList Then
' Cerco il nome del pezzo
Dim sName As String = ""
EgtGetName( nId, sName)
EgtGetName(nId, sName)
' Recupero il box del pezzo
Dim b3Reg As New BBox3d : EgtGetBBox( nRegId, GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Reg)
Dim b3Reg As New BBox3d : EgtGetBBox(nRegId, GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Reg)
' Aggiungo info equivalenti a CSV
EgtSetInfo(nId, INFO_CSV_PART, sName)
EgtSetInfo(nId, INFO_CSV_ORD, m_sOrder)
EgtSetInfo(nId, INFO_CSV_DIST, m_sList)
EgtSetInfo(nId, INFO_CSV_MAT, m_MainWindow.m_CurrentMachine.CurrMat.sName)
EgtSetInfo(nId, INFO_CSV_V1, DoubleToString( b3Reg.DimX(), 1))
EgtSetInfo(nId, INFO_CSV_V2, DoubleToString( b3Reg.DimY(), 1))
EgtSetInfo(nId, INFO_CSV_V1, DoubleToString(b3Reg.DimX(), 1))
EgtSetInfo(nId, INFO_CSV_V2, DoubleToString(b3Reg.DimY(), 1))
End If
End If
' Imposto colore testi
Utility.SetTextColor( nRegId)
Utility.SetTextColor(nRegId)
' Imposto path di provenienza
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
' Inserisco in parcheggio
@@ -907,7 +938,7 @@ Public Class ImportPageUC
' Eventuale aggiornamento VeinMatching
VeinMatching.ZoomAll()
' Aggiorno Aree totale e da lavorare dei pezzi
m_MainWindow.m_CurrentProjectPageUC.UpdateTotalArea( dNewArea)
m_MainWindow.m_CurrentProjectPageUC.UpdateTotalArea(dNewArea)
m_MainWindow.m_CurrentProjectPageUC.UpdateToProduceArea()
m_MainWindow.m_CurrentProjectPageUC.ShowAreas()
' Aggiorno ambiente principale
+18 -7
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.IO
Imports EgtUILib
Public Class InternalComponentPageUC
@@ -286,12 +287,22 @@ Public Class InternalComponentPageUC
If sCompoImage.Length <> 0 Then
Try
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
If File.Exists(sPath) Then
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
Else
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
GetLabel(index).SetValue(Grid.ColumnProperty, 0)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 2)
End If
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty
+17 -1
View File
@@ -752,6 +752,7 @@ Public Class CurrentMachine
End Select
End Get
Set(value As Double)
Dim dValue As Double = 0
Select Case GetCurrentTable()
Case 3
If Math.Abs(value - m_dTab3AdditionalTable) > EPS_SMALL And
@@ -760,14 +761,24 @@ Public Class CurrentMachine
m_dTab3AdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, value)
End If
End If
Case 2
Case 2
If Math.Abs(value - m_dTab2AdditionalTable) > EPS_SMALL And
WritePrivateProfileString(S_TABLE, K_TAB2_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
' Aggiorno il valore corrente
m_dTab2AdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, value)
End If
End If
Case Else
If Math.Abs(value - m_dAdditionalTable) > EPS_SMALL And
@@ -776,6 +787,11 @@ Public Class CurrentMachine
m_dAdditionalTable = value
' Aggiorno il progetto corrente
m_MainWindow.m_CurrentProjectPageUC.AdjustAdditionalTable()
' salvo il valore della sovratavola nel progetto
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
If Math.Abs(dValue - value) > EPS_SMALL Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, value)
End If
End If
End Select
End Set
+36 -4
View File
@@ -323,8 +323,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2402, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2402, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2405, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2405, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -571,6 +571,10 @@ Class MainWindow
TestOff()
' disabilito DragRettangle
DragRettangleOff()
' disabilito SplitCurv
SplitCurvWJOff()
' disattivo StartCurv
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = True
@@ -628,6 +632,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -682,6 +688,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -735,6 +743,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -789,6 +799,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -838,6 +850,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
SplitCurvWJOff()
StartCurvWJOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -1144,10 +1158,15 @@ Class MainWindow
Private Sub OnIdle()
' Recupero il tipo di progetto
Dim nPrjType As Integer = m_CurrentProjectPageUC.GetCurrentProjectType()
' Verifico presenza testa H1 per lama/fresa (nel contesto principale)
Dim nCurrCtx As Integer = EgtGetCurrentContext()
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
EgtSetCurrentContext(nCurrCtx)
' Aggiorno interfaccia
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso (EgtGetHeadId("H1") <> GDB_ID.NULL)
' DirectCutBtn.IsEnabled = (EgtGetHeadId("H1") <> GDB_ID.NULL)
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
' DirectCutBtn.IsEnabled = bHeadH1
End Sub
' Nomi dei file per OmagVIEW
@@ -1905,4 +1924,17 @@ Class MainWindow
End Sub
Public Sub SplitCurvWJOff()
m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.IsChecked = False
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedSplitCurveWJ = False
m_CadCutPageUC.m_NestPage.ResetSplitCurvWJParam()
End Sub
Public Sub StartCurvWJOff()
m_CadCutPageUC.m_NestPage.StartCurveWJBtn.IsChecked = False
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedStartCurveWJ = False
m_CadCutPageUC.m_NestPage.ResetStartCurvWJParam()
End Sub
End Class
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.3.1")>
<Assembly: AssemblyFileVersion("2.4.3.1")>
<Assembly: AssemblyVersion("2.4.5.4")>
<Assembly: AssemblyFileVersion("2.4.5.4")>
+19
View File
@@ -166,6 +166,9 @@
<Compile Include="AboutBox\AboutBoxWD.xaml.vb">
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
</Compile>
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
</Compile>
<Compile Include="CAM\CamPolishing.vb" />
<Compile Include="DirectCuts\Polishing.xaml.vb">
<DependentUpon>Polishing.xaml</DependentUpon>
@@ -405,6 +408,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DirectCuts\Polishing.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -1242,6 +1249,18 @@
<Resource Include="Resources\Spiral.png" />
<Resource Include="Resources\NewIcons\Drag_Rettangle.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\GenerateCN.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\GenerateCN.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\SPLIT-WJ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\START-WJ.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+3
View File
@@ -46,6 +46,7 @@
<BitmapImage x:Key="DownArrowImg" UriSource="Resources/NewIcons/DownArrow.png"></BitmapImage>
<BitmapImage x:Key="DrawImg" UriSource="Resources/NewIcons/icone-tagli-3.png"></BitmapImage>
<BitmapImage x:Key="FrameMachiningImg" UriSource="Resources/NewIcons/FrameMachining.png"></BitmapImage>
<BitmapImage x:Key="GenerateCNImg" UriSource="Resources/NewIcons/GenerateCN.png"></BitmapImage>
<BitmapImage x:Key="GenericViewImg" UriSource="Resources/NewIcons/GenericView.png"></BitmapImage>
<BitmapImage x:Key="HalfTurnRotateImg" UriSource="Resources/Negative/HalfTurnRotate.png"></BitmapImage>
<BitmapImage x:Key="ImportImg" UriSource="Resources/NewIcons/icone-tagli-6.png"></BitmapImage>
@@ -106,6 +107,8 @@
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
+3
View File
@@ -116,6 +116,7 @@
<BitmapImage x:Key="DownArrowImg" UriSource="Resources/DownArrow.png"></BitmapImage>
<BitmapImage x:Key="DrawImg" UriSource="Resources/Draw.png"></BitmapImage>
<BitmapImage x:Key="FrameMachiningImg" UriSource="Resources/FrameMachining.png"></BitmapImage>
<BitmapImage x:Key="GenerateCNImg" UriSource="Resources/GenerateCN.png"></BitmapImage>
<BitmapImage x:Key="GenericViewImg" UriSource="Resources/GenericView.png"></BitmapImage>
<BitmapImage x:Key="HalfTurnRotateImg" UriSource="Resources/HalfTurnRotate.png"></BitmapImage>
<BitmapImage x:Key="ImportImg" UriSource="Resources/Import.png"></BitmapImage>
@@ -174,6 +175,8 @@
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
+14
View File
@@ -508,6 +508,20 @@ Public Class CurrentProjectPageUC
UpdateHeightTxBx()
' aggiorno materiale
m_MainWindow.m_CurrentMachine.SetCurrMatByName(GetProjectMaterial())
' aggiorno altezza sovaratavola
If GetPrivateProfileInt(S_GENERAL, "AdditionalTableByProj", 0, m_sIniFile) = 1 Then
' leggo il valore OrigiAdditionalTable
Dim dValue As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable
Select Case GetCurrentTable()
Case 3
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, dValue)
Case 2
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB2_ADDITIONALTABLE, dValue)
Case Else
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_ADDITIONALTABLE, dValue)
End Select
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
End If
' forzo visualizzazione eventuali dati su aree
SetAreasStatus( True)
' Dichiaro progetto non modificato
+15 -8
View File
@@ -252,6 +252,10 @@ Public Class ProjectMgrUC
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
' cancello tutti i tagli di separazione (Waterjet)
ResetAllSplitCurv()
' cancello tutti i punti di inizio (Waterjet)
ResetAllStartCurv()
' Ricalcolo tutte le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
@@ -353,6 +357,14 @@ Public Class ProjectMgrUC
Return
End If
' ---------------------------- Fine modalità test --------------------------------------------
' se esiste salvo il nome del progetto
Dim sCurrProjName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrProjName, m_MainWindow.GetIniFile())
If Not String.IsNullOrEmpty(sCurrProjName) Then
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME, sCurrProjName)
Else
EgtRemoveInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME)
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
@@ -470,20 +482,15 @@ Public Class ProjectMgrUC
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.SIMPLESTATISTICS) And nPhaseRestart = 0 Then
m_MainWindow.ExecSentProgScript(False)
''-------------------Avvio il Ciclo-Start-------------------------
'Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
'MyCicloStartWD.ShowDialog()
''-------------------Avvio il Ciclo-Start-------------------------
End If
End If
'-------------------Avvio il Ciclo-Start-------------------------
If GetPrivateProfileInt(S_GENERAL, "StartProgram", 0, m_MainWindow.GetIniFile()) <> 0 Then
'------------------- INIZIO Avvio il Ciclo-Start-------------------------
If GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 Then
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
MyCicloStartWD.ShowDialog()
End If
'-------------------Avvio il Ciclo-Start-------------------------
'------------------- FINE Avvio il Ciclo-Start-------------------------
' Altrimenti linea di produzione
Else
+1 -1
View File
@@ -142,7 +142,7 @@ Public Class RawPartPageUC
GetPrivateProfileInt(S_RAWPART, K_SLABID, 0, m_MainWindow.GetIniFile()) <> 0)
SlabIdBtn.Visibility = If(m_bSlabId, Windows.Visibility.Visible, Windows.Visibility.Collapsed)
m_SmartMachiningPage = GetPrivateProfileInt(S_GENERAL, "SmartMachiningPage", 0, m_MainWindow.GetIniFile()) <> 0
m_SmartMachiningPage = GetPrivateProfileInt(S_GENERAL, K_SMARTMACHININGPAGE, 0, m_MainWindow.GetIniFile()) <> 0
' Imposto i messaggi letti dal file dei messaggi
OutlineBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 33) 'Rectangle - Rettangolo
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+3
View File
@@ -240,6 +240,9 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateXPIUC_Click">
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtnUC_Click">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
+112
View File
@@ -1,5 +1,6 @@
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Public Class SimulationPageUC
' Riferimenti a pagine
@@ -76,6 +77,12 @@ Public Class SimulationPageUC
End If
' Pulsante Play
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
' abilito la visualizzazione del pulsante per la sola generazione del codice CN
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
GenerateCN_Btn.Visibility = Visibility.Visible
Else
GenerateCN_Btn.Visibility = Visibility.Hidden
End If
End Sub
Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -559,6 +566,111 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
EgtEraseCurrSetup()
' Verifico l'attrezzaggio degli utensili utilizzati
Dim sMissingTools As String = String.Empty
If Not VerifySetup(sMissingTools) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
Return
End If
' Costringo ad aggiornare UI
UpdateUI()
' Aggiorno flag per lavaggio
m_CurrProjPage.UpdateWashingFlag()
' Aggiorno flag per tastatura per tagli con angolo di fianco
m_CurrProjPage.UpdateSideAngCutProbeFlag()
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
Not bDirectCut And
Not m_CurrProjPage.GetOrderMachiningFlag() Then
ResetAllMachinings()
bOk = SortAllMachinings()
If bOk Then
m_CurrProjPage.SetOrderMachiningFlag()
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
Else
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
End If
EgtDraw()
End If
End If
' Costringo ad aggiornare UI
UpdateUI()
' Disabilito impostazione modificato
EgtDisableModified()
' Aggiorno le lavorazioni
bOk = UpdateAllMachiningsToolpaths() And bOk
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
bOk = UpdateVacuumsForDrip() And bOk
' Costringo ad aggiornare UI
UpdateUI()
' Inserisco indice di progetto
m_CurrProjPage.SetProjectIndexFlag()
' Inserisco il materiale
m_CurrProjPage.SetProjectMaterial()
' Salvo il progetto con le lavorazioni
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\MachProj.nge"
m_CurrProjPage.SaveFile(sMchPath)
' Costringo ad aggiornare UI
UpdateUI()
' Se modalità Ufficio, copio il progetto ed esco
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
' Chiedo il nome del file esportato
Dim MySaveNameWD As New SaveNameWD(m_MainWindow, SaveNameWD.SAVE_TYPE.PRJ_COPY)
MySaveNameWD.ShowDialog()
Return
End If
' Se presente ripartenza, ne chiedo conferma
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
If nPhaseRestart <> 0 Then
' Confermi ripartenza dalla fase NNN ?
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
Select Case AskNcRestart.m_nPressedBtn
Case 1 ' YES
Case 2 ' NO
EgtEnableModified()
m_CurrProjPage.ResetProjectNcRestart()
nPhaseRestart = 0
EgtDisableModified()
Case Else ' CANCEL
Return
End Select
End If
' Se abilitate, eseguo le stime
If GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0 Then
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
End If
' Genero file CNC (lancio anche se errore in precedenza) -> recupero la tavola corrente! CamAuto.GetCurrentTable()
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
Dim sIndexTab As String = String.Empty
If nIndexTab > 0 Then
sIndexTab = nIndexTab.ToString
End If
Dim sFileName As String = "CadCut" & sIndexTab
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOk Then
m_CurrProjPage.SetInfoMessage("Genarato file " & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
End Sub
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
' Visualizzo assi
ShowCncData()
+63
View File
@@ -60,6 +60,69 @@ Module Utility
End If
End Function
#Region "PreGuidCode"
' recupero i primi 5 caratteri della stringa
Friend Function GetPreGuidCode(sGuidCode As String) As String
If sGuidCode.Count > 5 Then
Return sGuidCode(0) & sGuidCode(1) & sGuidCode(2) & sGuidCode(3) & sGuidCode(4)
End If
Return String.Empty
End Function
' sostituisce i primi 5 caratteri della stringa con qualle passata
Friend Function UppDateGuidCode(ByRef sGuidCode As String, sPreGuidCode As String) As Boolean
If sPreGuidCode.Count = 5 Then
sGuidCode = sGuidCode.Remove(0, 5)
sGuidCode = sPreGuidCode & sGuidCode
Return True
End If
Return False
End Function
' restituisce 5 caratteri
Friend Function CreatePreGuidCode(nId As Integer) As String
' recupero il frame dell'oggetto
Dim frGlobFrame As New Frame3d
If Not EgtGetGroupGlobFrame(nId, frGlobFrame) Then
Return String.Empty
End If
' recupero il suo versore
Dim vtX As Vector3d = frGlobFrame.VersX
Dim Len As Double
Dim AngV As Double
Dim AngH As Double
vtX.ToSpherical(Len, AngV, AngH)
' costruisco il codice (6 caratteri!) che identifica la posizione del pezzo in parcheggio
Dim sPreGuid As String = GetDirectionCode(AngH)
Return sPreGuid
End Function
Friend Function GetDirectionCode(dVal As Double) As String
Dim bIsNegative As Boolean = False
If dVal < 0 Then
dVal = dVal + (-1)
bIsNegative = True
End If
Dim sVal As String = DoubleToString(dVal * 1000, 0)
Dim nCount As Integer = sVal.Count
For Index As Integer = 1 To 4 - nCount
sVal = "0" & sVal
Next
Dim vVal As Char() = {"+", "1", "0", "0", "0"}
If bIsNegative Then
vVal = {"-"c, sVal(0), sVal(1), sVal(2), sVal(3)}
Else
vVal = {"+"c, sVal(0), sVal(1), sVal(2), sVal(3)}
End If
' ricostruisco la stringa dotata di segno
sVal = vVal(0) & vVal(1) & vVal(2) & vVal(3) & vVal(4)
Return sVal
End Function
#End Region ' PreGiudCode
Friend Function UIExprToExpr(sUIExpr As String) As String
If String.IsNullOrWhiteSpace(sUIExpr) Then
Return ""