Compare commits

..

22 Commits

Author SHA1 Message Date
NicolaP 4f12bce90a Aggiunta icona per generazione CN 2022-04-27 18:47:31 +02:00
NicolaP 915d3c0408 Generazione file CadCut dalla pagina della simulazione 2022-04-14 10:59:40 +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 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 26e00416c5 Correzione apertura progetti Frame 2022-03-10 11:53:41 +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 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 75e3c023ad Merge commit 'd57075b065da56953b217733509f5871bf2ff24a' into Features/New_manage_Park 2022-02-23 19:10:46 +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
23 changed files with 852 additions and 137 deletions
+31 -14
View File
@@ -189,6 +189,7 @@ Public Class CSVPage
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
@@ -308,7 +309,7 @@ Public Class CSVPage
Dim LocalPartList As New List(Of CsvPart)
' Lettura del file
If ReadCsvPartList(sFile, m_sCsvPath, m_CsvPartList) Then
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
@@ -322,7 +323,6 @@ Public Class CSVPage
Next
End Sub
Private Sub ShowTreeView()
' Path del file Csv
Dim TempPath As New Text.StringBuilder(260)
@@ -345,6 +345,7 @@ Public Class CSVPage
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) &
@@ -492,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
@@ -502,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
@@ -627,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)
@@ -641,6 +640,11 @@ Public Class CSVPage
' 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)
@@ -760,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
@@ -772,10 +776,13 @@ 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(CurrPart.m_sRefGuid)
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
@@ -791,6 +798,16 @@ Public Class CSVPage
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
+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}">
+392 -11
View File
@@ -1,5 +1,4 @@
Imports System.Windows.Input
Imports EgtUILib
Imports EgtUILib
Imports EgtWPFLib
Public Class NestPageUC
@@ -14,10 +13,26 @@ Public Class NestPageUC
Private m_nPartPos As Integer = PART_POS.NONE_TABLE
' Flag per impostata per selezionare di una curva
Friend m_bSelectCurv As Boolean = False
' dati per DragRettangoli (estensio/accorciamento dei rettangoli trascinando un lato)
Private m_bIsVisibleDragRettangle As Boolean = False
Friend m_bIsCheckedDragRettangle As Boolean = False
' Id della curva e del taglio selezionati per eseguire il test
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
Friend m_CurrSelectedSawCurv As Integer = GDB_ID.NULL
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedCurvRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedTextTopRettangle As Integer = GDB_ID.NULL
Private m_nIdSelectedFlatSurfRettangle As Integer = GDB_ID.NULL
Private m_SideListRettangle(4) As Integer
Private m_sTextContent As String = String.Empty
Private m_dRettangleIsModified As Boolean = False
Enum PART_POS As Integer
IN_TABLE = -1
NONE_TABLE = 0
@@ -59,8 +74,8 @@ Public Class NestPageUC
' lista delle famiglie di pezzi in parcheggio
Private m_ListOfGroupInPark As New List(Of FamilyPart)
' se seleniozato il layer CounterPz
Dim m_bIsCounterLy As Boolean = False
Dim m_nCurrNubrOfParts As Integer = 0
Private m_bIsCounterLy As Boolean = False
Private m_nCurrNubrOfParts As Integer = 0
Private Sub NestPage_Initialized(sender As Object, e As EventArgs)
' Imposto i messaggi letti dal file dei messaggi
@@ -69,6 +84,14 @@ Public Class NestPageUC
RemovePartBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 3) 'Remove part - Elimina pezzo
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bIsVisibleDragRettangle Then
UG1.Columns = 1
DragRettanleBtn.Visibility = Visibility.Collapsed
End If
End Sub
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -116,6 +139,7 @@ Public Class NestPageUC
m_dRegStep = GetPrivateProfileDouble(S_REG, K_REGSTEP, 10, m_MainWindow.GetIniFile())
m_dRegAngStep = GetPrivateProfileDouble(S_REG, K_REGANGSTEP, 1, m_MainWindow.GetIniFile())
m_dMaxRegAng = GetPrivateProfileDouble(S_MACH_REG, K_MACH_MAX_ROT_ANG, 10, m_MainWindow.GetMachIniFile())
' Garantisco visibilità pezzi parcheggiati
ShowParkedParts()
' Garantisco visibilità eventuale contorno da foto
@@ -132,6 +156,7 @@ Public Class NestPageUC
End If
End Sub
' funzione utilizzata per la selezione dei tagli quando il comando TEST è attivo
Private Sub OnMyMouseDownSceneSelCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
@@ -162,7 +187,6 @@ Public Class NestPageUC
Dim ptE As Point3d
EgtEndPoint(nIdMy, ptE)
If m_CurrSelectedCurv <> GDB_ID.NULL Or m_CurrSelectedCurv = nIdMy Then
EgtDeselectObj(m_CurrSelectedSawCurv)
EgtDeselectObj(m_CurrSelectedCurv)
End If
' recupero il gruppo della lavorazione associata
@@ -170,10 +194,8 @@ Public Class NestPageUC
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
If Not EgtGetGroupObjs(nIdSaw) Then
EgtSelectObj(nIdSaw)
m_CurrSelectedSawCurv = nIdSaw
m_CurrSelectedCurv = nIdMy
EgtSelectObj(nIdSaw)
EgtSetMark(nIdSaw)
EgtSelectObj(nIdMy)
EgtDraw()
@@ -187,6 +209,308 @@ Public Class NestPageUC
Return
End Sub
#Region "DRAG RETTANGLE"
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
Private Sub OnMyMouseDownSceneSelSideRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
If e.Button <> Windows.Forms.MouseButtons.Left then
Return
End If
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
Dim nSelMy As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
While nIdMy <> GDB_ID.NULL
Dim sLayer As String = String.Empty
' layer di origine
Dim nIdParent As Integer = EgtGetParent(nIdMy)
' recupero il nome del Layer
EgtGetName(nIdParent, sLayer)
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
If sLayer = NAME_OUTLOOP Then
If EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
' -------------------------------- INIZIO VERIFICHE --------------------------------
m_nIdSelectedOutLoopRettangle = nIdParent
If Not IsRettangle(m_SideListRettangle) Then
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Non è un rettangolo (0)")
Return
End If
' recupero il gruppo della lavorazione associata
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
' se non esiste un gruppo di lavorazione associato allora esco
If nIdPV = GDB_ID.NULL Then
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (1)")
Return
End If
' se esiste ma è vuoto (pezzo scaricato da tavola)
If EgtGetFirstInGroup(nIdPV) = GDB_ID.NULL Then
m_CurrProjPage.ClearMessage()
m_CurrProjPage.SetWarningMessage("Pezzo in parcheggio (2)")
Return
End If
' Devo verificare che sia una lavorazione solo di lama?
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
' -------------------------------- FINE VERIFICHE --------------------------------
If Not EgtGetGroupObjs(nIdSaw) Then
m_nIdSelectedSawRettangle = nIdSaw
m_nIdSelectedCurvRettangle = nIdMy
m_nIdSelectedRegionRettangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
' recupero i testi cintenuti nel layer Region
If m_nIdSelectedRegionRettangle <> GDB_ID.NULL Then
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRettangle)
While nCurrId <> GDB_ID.NULL
If EgtGetType(nCurrId) = GDB_TY.EXT_TEXT Then
Dim sVal As String = String.Empty
EgtTextGetContent(nCurrId, sVal)
If sVal = "*TOP*" Then
m_nIdSelectedTextTopRettangle = nCurrId
Else
m_nIdSelectedTextRettangle = nCurrId
m_sTextContent = GetMyRettangleText(sVal)
End If
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
m_nIdSelectedFlatSurfRettangle = nCurrId
End If
nCurrId = EgtGetNext(nCurrId)
End While
End If
' seleziono ed evidenzio il lato selezionato
EgtSelectObj(nIdSaw)
EgtSetMark(nIdSaw)
EgtSelectObj(nIdMy)
EgtDraw()
Exit While
End If
End If
' se le'elemto corrente non è una linea
End If
' se le'elemto corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
nIdMy = EgtGetNextObjInSelWin()
End While
End Sub
' restituisce il valore del Text ripulito dalle dimensioni
Private Function GetMyRettangleText(sTextPz As String) As String
' da DrawPageUC.xaml.vb/MultipleInsert
Dim sText As String = String.Empty
If sTextPz.Contains("<br/>") Then
Dim nLastIndex As Integer = sTextPz.LastIndexOf(">")
sText = sTextPz.Remove(nLastIndex + 1)
Return sText
End If
If sTextPz.Contains(" ") Then
Dim sInfo() As String = sTextPz.Split(" ")
If sInfo.Count > 3 Then
Return sText = sInfo(0) & " " & sInfo(1) & " "
End If
End If
Return sText
End Function
' verifico che la figura selezionata sia realmente un rettangolo
Private Function IsRettangle(ByRef IdSideList() As Integer) As Boolean
' creo una lista con i lati del rettangolo
Dim nCounter As Integer = 0
' recupero i lati dal leyer "OutLoop"
Dim IdSideRettangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRettangle)
While IdSideRettangle <> GDB_ID.NULL And nCounter < 4
Dim sVal As String = String.Empty
Dim dPrevAng As Double = 0
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
StringToDouble(sVal, dPrevAng)
Dim dNextAng As Double = 0
EgtGetInfo(IdSideRettangle, "NextAng", sVal)
StringToDouble(sVal, dNextAng)
' se gli angoli non sono retti allora esco senza caricare il lato corrente
If Math.Abs(dPrevAng - 90) > EPS_ANG_SMALL OrElse Math.Abs(dNextAng - 90) > EPS_ANG_SMALL Then
Exit While
End If
IdSideList(nCounter) = IdSideRettangle
nCounter += 1
IdSideRettangle = EgtGetNext(IdSideRettangle)
End While
' verifico che siano solo quattro lati
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
' solo se la figura ha 4 lati ortogonali
Return True
End If
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
' la figura presenta più/meno di 4 lati
Return False
End Function
' recupero le informazioni correnti per sapere se la figura è mdificabile
Private Function GetRettangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
' determino la direzione del lato selezionato
Dim vtDirSelectedCurv As New Vector3d
EgtStartVector(m_nIdSelectedCurvRettangle, GDB_ID.ROOT, vtDirSelectedCurv)
' recupero il lato successivo a quello selezionato
Dim Index As Integer = 0
Dim Len As Double = 0
For Ind As Integer = 0 To 3
If m_SideListRettangle(Ind) = m_nIdSelectedCurvRettangle Then
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
If Ind = 0 Then
Index = 3
Else
Index = Ind - 1
End If
End If
Next
' recupero la dimensione del lato
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
' verifico che il lato selezionato sia il maggiore
If MinLen > MaxLen Then Return Nothing
' determimo il versore dal lato appena calcolato
Dim vtDir As New Vector3d
EgtStartVector(m_SideListRettangle(Index), GDB_ID.ROOT, vtDir)
vtDir.Normalize()
Dim dProjectionBaseX As Double = vtDir * Vector3d.X_AX
Dim ptFixed As New Point3d
EgtStartPoint(m_SideListRettangle(Index), GDB_ID.ROOT, ptFixed)
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
vtPerp.Rotate(Vector3d.Z_AX, 90)
' determino il Frame corrente
frFixed = New Frame3d(ptFixed, vtDir, vtPerp, Vector3d.Z_AX)
Return vtDir
End Function
' funzione chiamata da OnMyMouseMoveScene: gestisce la modifica lungo una dimensione del rettangolo selezionato
Private Sub OnMyMouseMoveSawRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
' Se drag non abilitato o già in esecuzione, esco
If Not m_bDrag Or m_bDragging Then Return
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
If m_bDragToStart Then
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return
End If
m_bDragToStart = False
End If
' riferiemento che deve rimanere fisso del rettangolo
Dim frFixed As Frame3d = Nothing
' lunghezza del lato da modificare
Dim MaxLen As Double = 0
Dim MinLen As Double = 0
' recupero info sul rettangolo selezionato
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
If vtDir.Equals(Vector3d.NULL) Then
Return
End If
' Inizio esecuzione di drag
m_bDragging = True
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr)
' Ricavo il vettore di movimento
Dim vtMove As Vector3d = ptCurr - m_ptPrev
' ricavo il valore efficace di allungamento (la proiezione)
Dim dProjection As Double = vtMove * vtDir
vtMove = vtDir * dProjection
' recupero il valore di scalatura
Dim dScalefactor = dProjection / MaxLen + 1
' Modifico dimensione figura
If Math.Abs(dScalefactor) > EPS_SMALL * EPS_SMALL Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, vtMove * 0.5, GDB_ID.ROOT)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5, GDB_ID.ROOT)
End If
' il rettangolo è stato modifica almeno una volta
m_dRettangleIsModified = True
End If
' verifico che il il lato maggiore rimanga semore il lato maggiore
Dim bRettangleCorrect As Boolean = False
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRettangleCorrect = True
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
EnableReferenceRegion(False)
' se la modifica genera un errore allora ripristino la figura prima della defomrazione
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRettangle), True) Or Not bRettangleCorrect Then
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
Dim ptCen As Point3d
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
EgtMove(m_nIdSelectedTextRettangle, -vtMove * 0.5, GDB_ID.ROOT)
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5, GDB_ID.ROOT)
End If
End If
EgtDraw()
' Aggiorno il punto precedente
m_ptPrev = ptCurr
' Terminata esecuzione di drag
m_bDragging = False
End Sub
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
Public Sub ResetDragRettangleParam()
' deseleziono l'elemento corrente
EgtDeselectObj(m_nIdSelectedSawRettangle)
EgtDeselectObj(m_nIdSelectedCurvRettangle)
EgtResetMark(m_nIdSelectedSawRettangle)
If m_dRettangleIsModified Then
' elimino eventuali riferienti con la famiglia di appartenenza
Dim nCurrPart As Integer = EgtGetParent(m_nIdSelectedRegionRettangle)
EgtRemoveInfo(nCurrPart, INFO_REFGROUP)
' elimino il Layer che contiene l'informazione del numero di pezzi
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nCurrPart, INFO_COUNTERLY)
EgtErase(nCounterLayer)
End If
m_dRettangleIsModified = False
' resetto gli indici
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
m_nIdSelectedRegionRettangle = GDB_ID.NULL
m_nIdSelectedSawRettangle = GDB_ID.NULL
m_nIdSelectedCurvRettangle = GDB_ID.NULL
m_nIdSelectedTextRettangle = GDB_ID.NULL
m_nIdSelectedTextTopRettangle = GDB_ID.NULL
m_nIdSelectedFlatSurfRettangle = GDB_ID.NULL
m_SideListRettangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
m_sTextContent = String.Empty
' disattivo il drag
m_bDrag = False
' aggiorno le lavorazioni
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
EgtDraw()
End Sub
#End Region ' Drag Rettangolo
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
@@ -195,6 +519,7 @@ Public Class NestPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
' se in modalità slezione tagli
If m_bSelectCurv Then
OnMyMouseDownSceneSelCurv(sender, e)
@@ -202,6 +527,18 @@ Public Class NestPageUC
End If
m_bIsCounterLy = False
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bIsCheckedDragRettangle Then
OnMyMouseDownSceneSelSideRettangle(sender, e)
' Dati per drag (abilito il Drag)
m_locPrev = e.Location
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
m_bDragToStart = m_bDrag
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
m_vtTotMove = Vector3d.NULL()
Return
End If
' Per default no drag
m_bDrag = False
' Verifico se selezionato indicativo di pezzo
@@ -353,6 +690,13 @@ Public Class NestPageUC
End If
m_bDragToStart = False
End If
' se devo muovere un lato del rettangolo
If m_bIsCheckedDragRettangle Then
OnMyMouseMoveSawRettangle(sender, e)
Return
End If
' Determino cosa muovere
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
' Verifico se in tavola o in parcheggio
@@ -458,6 +802,13 @@ Public Class NestPageUC
If Not m_bActive Then Return
' verifico che non sia attivo il comando Test
If m_bSelectCurv Then Return
' verifico che non sia attivo il comando di Drag dei rettangoli
If m_bIsCheckedDragRettangle Then
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
ResetDragRettangleParam()
Return
End If
' Se eseguito drag
If Not m_bDragToStart Then
' Se movimento con sola verifica finale
@@ -545,7 +896,6 @@ Public Class NestPageUC
VeinMatching.OnSelectPart(m_nIdToSel)
' Set flag posizione selezionati
m_nPartPos = If(bPartInTable, PART_POS.IN_TABLE, PART_POS.OUT_TABLE)
' Se deselezione da eseguire
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
EgtDeselectObj(m_nIdToDesel)
@@ -843,8 +1193,28 @@ Public Class NestPageUC
If Not EgtGetPartPartClusterCenterGlob(nId, ptCen) Then Return False
' Rotazione del pezzo attorno al suo centro
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
'---------------------- COUNTER PART ----------------------
' Aggiorno il Guid assegnando la nuova rotazione
Dim sRefGroup As String = String.Empty
If EgtGetInfo(nId, INFO_REFGROUP, sRefGroup) Then
Dim sCurrRefGroup As String = sRefGroup
If UppDateGuidCode(sRefGroup, CreatePreGuidCode(nId)) Then
EgtSetInfo(nId, INFO_REFGROUP, sRefGroup)
End If
' aggiorno il layer che indica il numero di pezzi in parcheggio
CountPartInFamily(sCurrRefGroup)
End If
' se esiste almento un pezzo del gruppo in parcheggio esco
If Not ParkInGroupFamily(nId) Then
PackPartInStore(nId)
End If
' ricarico l'lelenco dei pezzi in parcheggio
GetFamilyGroupInPark()
'---------------------- COUNTER PART ----------------------
' Sistemazione nel parcheggio
PackPartInStore(nId)
'PackPartInStore(nId)
End If
' Passo al successivo selezionato
nId = EgtGetNextSelectedObj()
@@ -1477,6 +1847,17 @@ Public Class NestPageUC
End Function
#End Region ' Manager Counter Part
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
If DragRettanleBtn.IsChecked Then
m_bIsCheckedDragRettangle = True
Else
m_bIsCheckedDragRettangle = False
ResetDragRettangleParam()
m_CurrProjPage.ClearMessage()
ShowParkedParts()
End If
EgtDraw()
End Sub
Private Sub StorePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StorePartBtn.Click
' creo la lista delle famiglie di pezzi presenti in parcheggio
@@ -1534,7 +1915,7 @@ Public Class NestPageUC
' Parcheggio
Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20
Const STORE_OFFS As Double = 20 + 40 + 20
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
End Function
@@ -1869,7 +2250,7 @@ Class FamilyPart
Private PtMaxStoraged As Point3d
Private m_nHText As Integer = 40
Public ReadOnly Property nHText As String
Public ReadOnly Property nHText As Double
Get
Return m_nHText
End Get
+124 -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
@@ -1854,7 +1932,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 +1994,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 +2038,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
+5
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"
@@ -148,6 +152,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"
+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
+4 -4
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
@@ -1047,8 +1047,7 @@ Public Class DrawPageUC
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
@@ -1066,7 +1065,8 @@ Public Class DrawPageUC
' assegno l'identificatico del pezzo, se esiste
If Not String.IsNullOrEmpty(sGUICode) Then
EgtSetInfo(nId2, INFO_REFGROUP, sGUICode)
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)
+39 -20
View File
@@ -810,7 +810,7 @@ Public Class ImportPageUC
End While
' identificativo univoico del gruppo di pezzi, se più di un pezzo
Dim sGUICode As String = String.Empty
Dim sGUICode As New List(Of String)
' Scrivo testi per nesting
SideAngle.WriteSideAngleForNest(ImportScene.GetCtx())
@@ -821,30 +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
' 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)
' creo il riferimento
If nRepeat > 1 Then
sGUICode = System.Guid.NewGuid.ToString
' 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()
' 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)
@@ -853,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
@@ -876,32 +899,28 @@ 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))
' 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
@@ -919,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
+19 -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, 2404, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2404, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -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.4.1")>
<Assembly: AssemblyFileVersion("2.4.4.1")>
+7
View File
@@ -1247,6 +1247,13 @@
</ItemGroup>
<ItemGroup>
<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>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
+2
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>
@@ -105,6 +106,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>
+2
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>
@@ -173,6 +174,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
+10 -11
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
@@ -466,20 +470,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: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 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 ""