EgtOmagCUT :

- correzione apertura progetto con parcheggi con gestione parcheggi disabilitata da Ini( [General] EnableDXFPark=0).
This commit is contained in:
Dario Sassi
2026-02-18 17:13:38 +01:00
parent a7d89047bd
commit 6c72457108
7 changed files with 38 additions and 38 deletions
+13 -13
View File
@@ -146,10 +146,11 @@ Public Class NestPageUC
UG0.Columns = nColumnIn_UG0
' Gestione dei comandi di parcheggio e selezione (UniformGrid2)
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
If Not m_MainWindow.EnabledDxfPark() Then
EgtOutLog("Button 'EnableDXFPark' is not enabled, check in OmagCUT.ini file.")
ParkIndBtn.Visibility = Visibility.Collapsed
UG2.Columns = 2
ParkIndBtn.IsChecked = False
End If
End Sub
@@ -160,14 +161,16 @@ Public Class NestPageUC
LoadParams()
Dim nCpuntParkInd As Integer = UpdateImageParkInd()
If nCpuntParkInd > 2 Then
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
If m_MainWindow.EnabledDxfPark() Then
ParkIndBtn.IsChecked = True
Else
ParkIndBtn.IsChecked = False
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("There are " & (nCpuntParkInd - 1).ToString & " park in project.")
EgtOutLog("WARNING: Enable button 'EnableDXFPark' in OmagCUT.ini file.")
End If
ParkIndBtn.IsChecked = True
End If
ParkIndBtn_Click()
If m_MainWindow.EnabledDxfPark() Then ParkIndBtn_Click()
EgtZoom(ZM.ALL)
End Sub
@@ -3003,15 +3006,15 @@ Public Class NestPageUC
Dim ListparkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListparkInd)
Dim nCount As Integer = ListparkInd.Count
' Se il comando è abilitato allora provvedo ad aggiornare l'immagine
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Parking.png"
' Se il Parcheggio è abilitato allora provvedo ad aggiornare l'immagine
If m_MainWindow.EnabledDxfPark() Then
Dim sPng As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Parking.png"
If nCount > 1 Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Busy.png"
sPng = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Busy.png"
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Empty.png"
sPng = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Empty.png"
End If
ParkIndImg.Source = ImageConverter.ConvertFromString(s)
ParkIndImg.Source = ImageConverter.ConvertFromString(sPng)
Else
Dim bOldEnMod As Boolean = False
If bDisableModified Then
@@ -3154,9 +3157,6 @@ Public Class NestPageUC
End Sub
Private Sub ParkIndBtn_Click() Handles ParkIndBtn.Click
If ParkIndBtn.Visibility = Visibility.Collapsed Then
Return
End If
If ParkIndBtn.IsChecked Then
If IsNothing(m_SelParkInd) Then
m_SelParkInd = New SelParkIndWD(m_MainWindow)
+6 -7
View File
@@ -470,15 +470,14 @@ Public Class ParkInd
m_Ind = Ind
m_Name = Name
m_Status = Stat
Dim MyMainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
' Costruisco il percorso immagine
If m_Ind = 0 Then
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.png"
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.svg"
m_Img = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.png"
m_Svg = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.svg"
ElseIf m_Ind = 999 Then
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.png"
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.svg"
m_Img = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.png"
m_Svg = MyMainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.svg"
Else
m_Img = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".png"
m_Svg = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".svg"
@@ -850,7 +849,7 @@ Public Module XMLReader
End While
' Libero il file dalla lettura
m_xmlr.Close()
' popolo la canvas con le Ptah che ho caricato
' popolo la canvas con le Path che ho caricato
Canv.LoadCanvas()
End Sub
+5 -12
View File
@@ -867,12 +867,11 @@ Public Class ImportPageUC
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False
' Genero l'immagine solo se è abilitata la modalità
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then Print()
If m_MainWindow.EnabledDxfPark() Then Print()
' Se import per pezzi piatti
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
' Eseguo importazione pezzi piatti
LoadFlatParts()
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello indicato
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
@@ -888,7 +887,7 @@ Public Class ImportPageUC
SelParkIndWD.SetStatusPartInParkInd(Item, False)
Next
' altrimenti import per cornici
' altrimenti import per cornici
Else
LoadFrame()
End If
@@ -903,9 +902,6 @@ Public Class ImportPageUC
' recupero la lista degli indici di parcheggio
NewParkInd = SelParkIndWD.NewParkInd()
Dim SM_Select As SM = SM.SHADING
' SM_Select = SM.HIDDENLINE
' SM_Select = SM.WIREFRAME
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sPath As String = SelParkIndWD.GetPathCurrProj() & NewParkInd.ToString & ".png"
' Recupero le dimensioni dell'area di stampa
@@ -920,13 +916,11 @@ Public Class ImportPageUC
' Recupero le dimensioni correnti della pagina di disegno
Dim nImgW As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualWidth()
Dim nImgH As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualHeight()
If Not EgtGetImage(SM_Select, colBackTopColor, colBackBottomColor, nImgW, nImgH, sPath) Then
If Not EgtGetImage(SM.SHADING, colBackTopColor, colBackBottomColor, nImgW, nImgH, sPath) Then
' Error in creating the print image
EgtOutLog(EgtMsg(50181))
EgtSetLineAttribs(1)
Return
End If
EgtSetLineAttribs(1)
'Metodo complesso di stampa che permette di rilasciare il file :
'carico la bitmap e la metto in uno stream in memoria
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
@@ -944,7 +938,6 @@ Public Class ImportPageUC
tmpImg.Source = bitImage
tmpImg.Stretch = Stretch.Uniform
tmpImg.EndInit()
' eseguo la stampa
Catch
' Error in executing print
EgtOutLog(EgtMsg(50182))
@@ -1050,7 +1043,7 @@ Public Class ImportPageUC
Dim nId As Integer = nFirstId
While nId <> GDB_ID.NULL
' Definisco l'indice di parcheggio assegnato al pezzo
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
If m_MainWindow.EnabledDxfPark() Then
EgtSetInfo(nId, INFO_PARKIND, NewParkInd.ToString)
' Imposto lo stato
EgtSetStatus(nId, GDB_ST.ON_)
@@ -1111,7 +1104,7 @@ Public Class ImportPageUC
' Imposto path di provenienza
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
' Inserisco in parcheggio
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
If m_MainWindow.EnabledDxfPark() Then
' Mantengo la posizione relativa tra i pezzi
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, DimX, DimY, BBoxMaxPt)
Else
+9
View File
@@ -129,6 +129,9 @@ Class MainWindow
' Variabile che indica il tipo di pc su cui gira il programma
Private m_bIsSiemensPc As Boolean = False
' Abilitazione parcheggio dei pezzi
Private m_bEnabledDxfPark As Boolean = False
' Variabile che indica il colore corrente di ColorToSIdeAng in OptionsPageUC
Friend m_brCurrentColor As Brush
@@ -274,6 +277,10 @@ Class MainWindow
Return m_bIsSiemensPc
End Function
Public Function EnabledDxfPark() As Boolean
Return m_bEnabledDxfPark
End Function
Public Function GetDebug() As Integer
Return m_nDebug
End Function
@@ -438,6 +445,8 @@ Class MainWindow
' Inizializzazione della libreria EgtWPFLib
EgtWPFInit()
EgtTextBox.EnableKeybCalc = (GetPrivateProfileInt(S_GENERAL, K_VIRTUALKEYBOARD, 1, m_sIniFile) <> 0)
' Abilitazione parcheggio pezzi
m_bEnabledDxfPark = ( GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, GetIniFile) <> 0)
' Inizializzo classe macchina corrente
m_CurrentMachine = New CurrentMachine
' Crezione della MachineStatusBar
+1 -1
View File
@@ -783,7 +783,7 @@ Public Class CurrentProjectPageUC
End If
'--------------------------------------------------------------------------------
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
If m_MainWindow.EnabledDxfPark() Then
' Gestione visualizzazione lista pezzi in parcheggio
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sPath)
+1 -1
View File
@@ -317,7 +317,7 @@ Public Class OpenPageUC
SelParkIndWD.sActualProj = sPath
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd, OpenScene.GetCtx)
If ListParkInd.Count > 2 And GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
If m_MainWindow.EnabledDxfPark() And ListParkInd.Count > 2 Then
m_SelParkInd = New SelParkIndWD(m_MainWindow, OpenScene.GetCtx)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
+3 -4
View File
@@ -73,14 +73,13 @@ Module Utility
Return True
End Function
' conerte il dato (in mm) in stringa nell'unità corrente
' converte il dato (in mm) in stringa nell'unità corrente
Friend Function LenToString(dVal As Double, nNumDec As Integer, Optional ByVal bForceToDecimal As Boolean = False) As String
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
' conevrto il dato corrente in decimale
Dim dCurrVal As Double = dVal
StringToDouble(sVal, dCurrVal)
' converto il dato corrente in decimale
Dim dCurrVal As Double = dVal / ONEINCH
Return DoubleToStringFraction(dCurrVal, dPrecision)
End If
Return sVal