Compare commits

..

7 Commits

Author SHA1 Message Date
NicolaP 26e00416c5 Correzione apertura progetti Frame 2022-03-10 11:53:41 +01:00
NicolaP f66e5d6da9 Correzione posizionamento text in fase di DragRectangle 2022-02-24 12:42:37 +01:00
NicolaP ed6c36bff4 Cambio versione 2022-02-23 19:27:30 +01:00
NicolaP 50889df91e Merge commit '4ac0507050fb2a7e9880ad4f1c45b481fe988f3c' 2022-02-23 19:23:06 +01:00
NicolaP 4ac0507050 Migliorata la scrittura del codice 2022-02-03 11:37:33 +01:00
NicolaP a6a4f29bba Gestione delle interferenze in fase di Drag 2022-02-02 18:12:24 +01:00
NicolaP 0c9b37742a Inizio Drag rettangoli (ogni lato selezionato senza limiti) manca la gestione dell'uscita dal comando 2022-01-31 20:54:08 +01:00
20 changed files with 540 additions and 888 deletions
+3 -42
View File
@@ -1,5 +1,5 @@
Imports EgtUILib
Imports System.IO
Friend Module CSVFile
@@ -7,7 +7,6 @@ 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
@@ -30,10 +29,6 @@ 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
'-----------------------------------------------------------------------------------------------
@@ -64,7 +59,6 @@ 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)
@@ -85,9 +79,6 @@ 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
@@ -148,9 +139,7 @@ Friend Module CSVFile
Else
Dim sItems() As String = sLine.Split("=".ToCharArray)
If sItems.Count() >= 2 Then
If sItems(0) = "Path" Then
OnePart.m_sPath = sItems(1)
ElseIf sItems(0) = "Nam" Then
If sItems(0) = "Nam" Then
OnePart.m_sName = sItems(1)
ElseIf sItems(0) = "Ord" Then
OnePart.m_sOrd = sItems(1)
@@ -192,8 +181,6 @@ 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
@@ -221,7 +208,6 @@ 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)
@@ -243,44 +229,19 @@ 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
+27 -207
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 (False -> Cvs semplificato)
' Flag tipologia
Private m_bFull As Boolean = False
' Flag inserimento diretto
Private m_bDirect As Boolean = True
@@ -28,10 +28,6 @@ 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
@@ -105,36 +101,13 @@ Public Class CSVPage
If EgtIsPart(nPartId) Or bPartInTable Then
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nPartId, nStat)
' 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
' Se già selezionato, lo deselezione
If nStat = GDB_ST.SEL Then
EgtDeselectObj(nPartId)
' Altrimenti lo seleziono
Else
EgtSelectObj(nPartId)
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()
@@ -142,28 +115,6 @@ 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)
@@ -182,47 +133,15 @@ 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
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 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
Dim OpenFileWnd As New OpenFileWD(m_MainWindow, sCurrDir, ".CSV", ".EPL")
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
@@ -254,28 +173,17 @@ Public Class CSVPage
' Pulisco path e lista dei pezzi Csv
m_sFilePath = String.Empty
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)
m_CsvPartList.Clear()
' Eseguo la lettura del file Csv
If Not ReadCsvFile(sCsvPath, m_bFull, m_sCsvPath, LocalPartList) Then
If Not ReadCsvFile(sCsvPath, m_bFull, m_sCsvPath, m_CsvPartList) 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(LocalPartList)
RemoveWrongParts(m_CsvPartList)
' Aggiorno
If m_bFull Then
MySaveCsvPartList(LocalPartList)
' Salvo come epl
SaveCsvPartList()
' Rinomino file originale
@@ -288,41 +196,9 @@ 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, m_CsvPartList) 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)
@@ -332,7 +208,6 @@ 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)
@@ -343,27 +218,19 @@ 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
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
@@ -381,14 +248,8 @@ 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)
@@ -398,7 +259,6 @@ 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
@@ -408,7 +268,6 @@ 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
@@ -416,14 +275,8 @@ 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
@@ -637,31 +490,14 @@ 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
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)
@@ -683,7 +519,6 @@ Public Class CSVPage
m_CurrProjPage.UpdateTotalArea( dNewArea)
m_CurrProjPage.UpdateToProduceArea()
m_MainWindow.m_CurrentProjectPageUC.ShowAreas()
Return True
End Function
@@ -774,19 +609,13 @@ Public Class CSVPage
End If
' 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(CurrPart.m_sRefGuid)
' 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
@@ -801,33 +630,24 @@ Public Class CSVPage
End If
' Path del file
Dim sFile As String = Path.ChangeExtension(m_sFilePath, ".epl")
' 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
' Scrittura del file
If WriteCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
' Registro in ini path
WritePrivateProfileString(S_CSV, K_CSVLASTFILE, sFile, m_MainWindow.GetIniFile())
End If
End Sub
' salvo il sottoelenco dei pezzi
Friend Sub MySaveCsvPartList(ByVal CurrPartList As List(Of CsvPart))
' Se Csv semplificato non va salvata
Private Sub LoadCsvPartList(sFile As String)
' Se Csv semplificato non va letta
If Not m_bFull Then Return
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)
' 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)
End Sub
Friend Sub UpdateCsvPartList()
+8 -3
View File
@@ -107,6 +107,7 @@ Public Class CadCutPageUC
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Se macchina fotografica collegata, faccio una foto
@@ -140,6 +141,7 @@ Public Class CadCutPageUC
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
@@ -165,6 +167,7 @@ Public Class CadCutPageUC
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
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
@@ -172,6 +175,7 @@ Public Class CadCutPageUC
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
m_MainWindow.TestOff()
m_MainWindow.DragRettangleOff()
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
@@ -193,6 +197,7 @@ Public Class CadCutPageUC
End Sub
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
m_MainWindow.DragRettangleOff()
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
m_ProjectMgr.TestBtn.IsChecked = False
@@ -206,9 +211,9 @@ Public Class CadCutPageUC
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Nest.png", UriKind.Relative))
End If
If m_CadCutMode = CadCutModes.Nest Then
CadCutPageGrid.Children.Remove(m_NestPage)
Else
CadCutPageGrid.Children.Remove(m_FastGridSlabManager)
CadCutPageGrid.Children.Remove(m_NestPage)
Else
CadCutPageGrid.Children.Remove(m_FastGridSlabManager)
End If
CadCutPageGrid.Children.Add(m_SplitPage)
m_CadCutMode = CadCutModes.Split
+8 -3
View File
@@ -109,9 +109,14 @@
</Button>
</UniformGrid>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<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>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
+441 -399
View File
File diff suppressed because it is too large Load Diff
+4 -21
View File
@@ -9,7 +9,6 @@ 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)
@@ -28,15 +27,6 @@ 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
@@ -81,20 +71,13 @@ Public Class OpenFileWD
Dim FileI As FileInfo
For Each FileI In vFileI
Dim sExt As String = Path.GetExtension(FileI.Name).ToUpper()
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
If String.Compare(sExt, m_sExt, True) = 0 Or
String.Compare(sExt, m_sExt2, True) = 0 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
@@ -1,72 +0,0 @@
<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
@@ -1,66 +0,0 @@
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
-3
View File
@@ -147,9 +147,6 @@ 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"
+1
View File
@@ -148,6 +148,7 @@ Module ConstIni
Public Const K_TEXTCOLOR As String = "TextColor"
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAG_RETTANGLE As String = "DragRectangle"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
+1 -15
View File
@@ -893,9 +893,6 @@ 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())
@@ -1043,12 +1040,6 @@ Public Class DrawPageUC
EgtEraseEmptyParts()
' Area dei nuovi pezzi
Dim dNewArea As Double = 0
If nNbr > 1 Then
sGUICode = System.Guid.NewGuid.ToString
End If
' dimensione caratteri per numero di pezzi
Dim nHText As Integer = 40
' Se esiste il file del pezzo
If My.Computer.FileSystem.FileExists(sTmpFile) Then
' eseguo inserimento
@@ -1063,12 +1054,7 @@ Public Class DrawPageUC
If m_bTrfData Then EgtSetInfo(nId2, "CsvPart", m_TrfOrderCode & "-" & nId2.ToString())
' Aggiorno l'area dei nuovi pezzi
dNewArea += GeomCalc.GetPartArea(nId2)
' assegno l'identificatico del pezzo, se esiste
If Not String.IsNullOrEmpty(sGUICode) Then
EgtSetInfo(nId2, INFO_REFGROUP, sGUICode)
End If
' muovo il pezzo nella prima posizione di parcheggio libera
' Inserisco in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
' ------------------------ AGGIUNGO PEZZO NEL VEINMATCH ----------------------------------
-12
View File
@@ -808,10 +808,6 @@ 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 String = String.Empty
' Scrivo testi per nesting
SideAngle.WriteSideAngleForNest(ImportScene.GetCtx())
' Imposto riferimento sul centro geometrico di ogni pezzo
@@ -831,10 +827,6 @@ Public Class ImportPageUC
Dim nRepeat = 1
StringToInt(PartNumTxBx.Text, nRepeat)
nRepeat = Math.Min(Math.Max(1, nRepeat), 50)
' creo il riferimento
If nRepeat > 1 Then
sGUICode = System.Guid.NewGuid.ToString
End If
' Inserisco i pezzi nell'ambiente principale e recupero Id primo pezzo inserito
Dim nFirstId As Integer = EgtGetLastPart()
For nInd As Integer = 1 To nRepeat
@@ -898,10 +890,6 @@ Public Class ImportPageUC
Utility.SetTextColor( nRegId)
' Imposto path di provenienza
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
' assegno l'identificatico del pezzo, se esiste
If Not String.IsNullOrEmpty(sGUICode) Then
EgtSetInfo(nId, INFO_REFGROUP, sGUICode)
End If
' Inserisco in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
' Recupero Id di pezzo successivo
+17 -2
View File
@@ -569,6 +569,8 @@ Class MainWindow
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
' disbilito Test
TestOff()
' disabilito DragRettangle
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = True
@@ -625,6 +627,7 @@ Class MainWindow
EgtMdbGetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -678,6 +681,7 @@ Class MainWindow
Private Sub CadCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CadCutBtn.Click
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -730,6 +734,7 @@ Class MainWindow
Private Sub FrameCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles FrameCutBtn.Click
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -753,8 +758,8 @@ Class MainWindow
m_ActivePage = Pages.FrameCut
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.CSV
' Pages.Simulation: quando sono nella simulazione devo uscire dalla pagina
CadCutBtn.IsChecked = True
FrameCutBtn.IsChecked = False
CadCutBtn.IsChecked = False
FrameCutBtn.IsChecked = True
Case Pages.FrameCut
FrameCutBtn.IsChecked = True
Case Pages.Machine
@@ -783,6 +788,7 @@ Class MainWindow
Private Sub MachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachineBtn.Click
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -831,6 +837,7 @@ Class MainWindow
Private Sub OptionsBtn_Click(sender As Object, e As RoutedEventArgs) Handles OptionsBtn.Click
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
TestOff()
DragRettangleOff()
Select Case m_ActivePage
Case Pages.WorkInProgress
WorkInProgressBtn.IsChecked = False
@@ -1890,4 +1897,12 @@ Class MainWindow
Me.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
End Sub
' spegne il comando per la mofica dei rettangoli
Public Sub DragRettangleOff()
m_CadCutPageUC.m_NestPage.DragRettanleBtn.IsChecked = False
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedDragRettangle = False
ShowParkedParts()
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.2.2")>
<Assembly: AssemblyFileVersion("2.4.2.2")>
<Assembly: AssemblyVersion("2.4.3.1")>
<Assembly: AssemblyFileVersion("2.4.3.1")>
+1 -7
View File
@@ -166,9 +166,6 @@
<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>
@@ -408,10 +405,6 @@
<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>
@@ -1247,6 +1240,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Spiral.png" />
<Resource Include="Resources\NewIcons\Drag_Rettangle.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
+1
View File
@@ -105,6 +105,7 @@
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
+1
View File
@@ -173,6 +173,7 @@
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
<!--Machine-->
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
+18 -31
View File
@@ -180,42 +180,12 @@ Public Class CurrentProjectPageUC
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
m_bFirst = False
' ------------------ SELEZIONE AVVIO -----------------------------
' apro la finstra di selezione di avvio del programma
'StartProgram()
' ------------------ SELEZIONE AVVIO -----------------------------
'' Se richiesto, carico ultimo progetto
'Dim bAutoLoadLast As Boolean = GetPrivateProfileInt(S_GENERAL, K_AUTOLOADLASTPROJ, 0, m_MainWindow.GetIniFile()) <> 0
'If bAutoLoadLast Then
' m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
' Dim sPath As String = m_MainWindow.GetSaveDir() & "\" & m_nCurrProj.ToString("D4") & ".nge"
' If Not LoadProject(sPath, False) Then
' NewProject()
' End If
' EgtResetModified()
' 'Altrimenti ne imposto uno nuovo
'Else
' m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
' NewProject()
'End If
' creo nuovo progetto
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
'NewProject()
' Nascondo progress per fotografia
PhotoProgress.Visibility = Windows.Visibility.Hidden
' Carico sottopagina opportuna
If GetProjectType() <> PRJ_TYPE.FRAMES Then
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.CadCutBtn.IsChecked = True
Else
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
m_MainWindow.FrameCutBtn.IsChecked = True
End If
Else
EgtSetCurrentContext(CurrentProjectScene.GetCtx())
@@ -274,8 +244,10 @@ Public Class CurrentProjectPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_OpenPage)
m_MainWindow.m_ActivePage = MainWindow.Pages.Open
' inizializzo gli oggetti della pagina (non passo dalla funzione Load!)
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.SetReference()
' seleziono il file dalla lista della finestra (= 4)
' seleziono il file dalla lista della finestra (= 4)
ElseIf MyStartLancherWD.CurrSelection = MODE_LAUNCHER.SelectedProject Then
NewProject()
Dim sCurrDir As String = Path.GetDirectoryName(MyStartLancherWD.SelPath)
@@ -304,6 +276,21 @@ Public Class CurrentProjectPageUC
End If
End If
' se apro la finestra "OpenFolder" l'assegnazione dei Children è fatta direttamente nella classe ProjectMgrUC
If MyStartLancherWD.CurrSelection <> MODE_LAUNCHER.OpenFolder Then
' Carico sottopagina opportuna
If GetProjectType() <> PRJ_TYPE.FRAMES Then
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
m_MainWindow.CadCutBtn.IsChecked = True
Else
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut
m_MainWindow.FrameCutBtn.IsChecked = True
End If
End If
End Sub
' questo metodo è direttamente richiamato in caso di selezione della regione sinistra della pagina
+7 -3
View File
@@ -34,9 +34,7 @@ Public Class ProjectMgrUC
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
' Impostazioni
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_CurrMachine = m_MainWindow.m_CurrentMachine
m_CurrNcComm = m_MainWindow.m_CNCommunication
SetReference()
' Se richiesto carico finestra per VeinMatching e ultimo intarsio
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) And
@@ -55,6 +53,12 @@ Public Class ProjectMgrUC
End If
End Sub
Public Sub SetReference()
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_CurrMachine = m_MainWindow.m_CurrentMachine
m_CurrNcComm = m_MainWindow.m_CNCommunication
End Sub
Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB