Merge commit 'a73b45d23ec23ddf0120a92ec35d85440229ffd0'

This commit is contained in:
Nicola Pievani
2025-02-24 15:33:53 +01:00
12 changed files with 276 additions and 104 deletions
+23 -8
View File
@@ -150,6 +150,7 @@ Public Class NestPageUC
' Gestione dei comandi di parcheggio e selezione (UniformGrid2)
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
EgtOutLog("Button 'EnableDXFPark' is not enable, check in file *.ini program.")
ParkIndBtn.Visibility = Visibility.Collapsed
UG2.Columns = 2
End If
@@ -163,7 +164,9 @@ Public Class NestPageUC
Dim nCpuntParkInd As Integer = UpdateImageParkInd()
If nCpuntParkInd > 2 Then
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
EgtOutLog("ATTENZIONE: Attivare gestione parcheggio per progetti DXF e riavviare il programma")
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("There are " & (nCpuntParkInd - 1).ToString & " park in project.")
EgtOutLog("WARNONG: Enable button 'EnableDXFPark' in file *.ini program.")
End If
ParkIndBtn.IsChecked = True
End If
@@ -2997,19 +3000,30 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
' Aggiorna immagine e restituisce il numero di parcheggi (+1) disponibili (+1 perchè conto anche il comando All_Off)
Private Function UpdateImageParkInd() As Integer
Dim nCount As Integer = 0
' Carcico la lista dei parcheggi
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"
Dim ListparkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListparkInd)
If ListparkInd.Count > 1 Then
If nCount > 1 Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Busy.png"
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Empty.png"
End If
ParkIndImg.Source = ImageConverter.ConvertFromString(s)
nCount = ListparkInd.Count
Else
' Se il comando non è abilitato allora provvedo a selezionare il primo parcheggio
Dim CurrparkInd As ParkInd = SelParkIndWD.GetCurrentParkIndSelected()
If Not IsNothing(CurrparkInd) Then
SelParkIndWD.SetStatusPartInParkInd(CurrparkInd, True)
Else
If nCount > 1 Then
ListparkInd(1).Status = GDB_ST.ON_
SelParkIndWD.SetStatusPartInParkInd(ListparkInd(1), True)
End If
End If
End If
Return nCount
End Function
@@ -3134,17 +3148,18 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
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)
End If
'm_SelParkInd.Show()
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Add(m_SelParkInd)
Else
If Not IsNothing(m_SelParkInd) Then
'm_SelParkInd.Close()
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Remove(m_SelParkInd)
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
m_SelParkInd = Nothing
+63 -12
View File
@@ -6,13 +6,27 @@ Imports EgtUILib
Imports OmagCUT.NestPageUC
Public Class SelParkIndWD
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_ParkIndList As New List(Of ParkInd)
Private m_nCtx As Integer = -1
Public Const nIndAllOff As Integer = 999
Sub New(Owner As Window)
Public Shared sActualProj As String = String.Empty
Private m_ParkIndList As New List(Of ParkInd)
Public Property ParkIndList As List(Of ParkInd)
Get
Return m_ParkIndList
End Get
Set(value As List(Of ParkInd))
m_ParkIndList = value
End Set
End Property
Sub New(Owner As Window, Optional nCtx As Integer = -1)
'Me.Owner = Owner
InitializeComponent()
If nCtx > -1 Then m_nCtx = nCtx
End Sub
Public Sub Me_Laoded() Handles Me.Loaded
@@ -24,7 +38,7 @@ Public Class SelParkIndWD
Public Sub UpdateList()
' Carico lista dei pezzi
LoadParkInd(m_ParkIndList)
LoadParkInd(m_ParkIndList, m_nCtx)
ParkIndListBox.ItemsSource = m_ParkIndList
UpdateDefaultSelection()
' Forzo l'aggiornamento della grafica
@@ -82,19 +96,19 @@ Public Class SelParkIndWD
End While
' Assegno lo stato del parcheggio a tutti i pezzi i parcheggio
If bFound Then
SetStatusPartInParkInd(localParkInd)
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
Else
' Significa che i pezzi sono tutti in macchina: quindi i pezzi sono (SICURAMENTE?) accesi
Dim OppositStat As Integer = If(localParkInd.Status = GDB_ST.ON_, GDB_ST.OFF, GDB_ST.ON_)
localParkInd.Status = OppositStat
SetStatusPartInParkInd(localParkInd)
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
End If
' Se accendo un parcheggio procedo a spegnere tutto gli atri
If localParkInd.Status = GDB_ST.ON_ Then
For Each ItemParkInd As ParkInd In m_ParkIndList
If localParkInd.Ind <> ItemParkInd.Ind Then
ItemParkInd.Status = GDB_ST.OFF
SetStatusPartInParkInd(ItemParkInd)
SetStatusPartInParkInd(ItemParkInd, True, m_nCtx)
End If
Next
End If
@@ -104,11 +118,12 @@ Public Class SelParkIndWD
#Region "METODI SHARED per gestione della lista parcheggi"
' Restituisce il primo indice di parcheggio libero
Public Shared Function NewParkInd() As Integer
Public Shared Function NewParkInd(Optional nCtx As Integer = -1) As Integer
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim LastParkInd As Integer = 0
Dim nRawId As Integer = GetCurrentRaw()
@@ -144,12 +159,13 @@ Public Class SelParkIndWD
End Function
' Gestisce lo stato dei pezzi associati al parcheggio indicato
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True)
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True, Optional nCtx As Integer = -1)
If IsNothing(localParkInd) Then Return
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
@@ -182,7 +198,7 @@ Public Class SelParkIndWD
End Sub
' Restituuisce la lista dei parcheggi del progetto corrente
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd))
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd), Optional nCtx As Integer = -1)
If IsNothing(P_List) Then Return
P_List.Clear()
P_List.Add(New ParkInd(nIndAllOff, "All off", 0))
@@ -190,6 +206,7 @@ Public Class SelParkIndWD
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
@@ -210,7 +227,7 @@ Public Class SelParkIndWD
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
@@ -235,7 +252,7 @@ Public Class SelParkIndWD
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
@@ -273,9 +290,43 @@ Public Class SelParkIndWD
Public Shared Function GetPathCurrProj() As String
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sParkPath As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
If Not String.IsNullOrEmpty(sActualProj) Then
Dim sDir As String = System.IO.Path.GetDirectoryName(sActualProj)
Dim sFile As String = System.IO.Path.GetFileNameWithoutExtension(sActualProj)
sParkPath = sDir & "\" & sFile & "_ParkInd_"
End If
Return sParkPath
End Function
Public Shared Sub CopyImgSvg(sNewFileName As String, Optional nCtx As Integer = -1)
If sNewFileName.EndsWith(".nge") Then
sNewFileName = sNewFileName.Remove(sNewFileName.Length - 4, 4) & "_ParkInd_"
End If
Dim Extension As String = ".svg"
If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
Dim ListParkInd As New List(Of ParkInd)
' ricarico la lista
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
'SelParkIndWD.sActualProj = Path.GetFileNameWithoutExtension(sPath)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
Try
Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
If MainWindow.m_bShowSVGParkInd Then
WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
Else
If System.IO.File.Exists(sNewFile) Then
System.IO.File.Delete(sNewFile)
End If
System.IO.File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
End If
Catch ex As Exception
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
End Try
End If
Next
End Sub
#End Region ' Metodi Shared
End Class
@@ -338,7 +389,7 @@ Public Class ParkInd
End Set
End Property
Private m_nPartInPark As Integer = 0
Private m_nPartInPark As Integer = GDB_ST.ON_
Public Property nPartInPark As Integer
Get
Return m_nPartInPark
+1
View File
@@ -212,6 +212,7 @@ Module ConstIni
Public Const K_OFFSXY As String = "OffsXY"
Public Const K_OFFSYY As String = "OffsYY"
Public Const K_OFFSXINTERY As String = "OffsYInterY"
Public Const K_OFFSXINTERYSAWTH As String = "OffsYInterYSawTh"
Public Const K_STARTTRIM As String = "StartTrim"
Public Const K_ENDTRIM As String = "EndTrim"
Public Const K_OTHERSIDE As String = "OtherSide"
+1
View File
@@ -186,6 +186,7 @@
Public Const K_CAMERA_DIRECT_CMD As String = "CameraDirectCmd"
Public Const K_CAMERA_STATE_VAR As String = "CameraStateVar"
Public Const K_ENABELE_GOHOME_FOR_PHOTO As String = "EnableGoHomeForPhoto"
Public Const K_PENDIG_TIME_FOR_PHOTO As String = "PendigTimeForPhoto"
Public Const S_TOOLS As String = "Tools"
Public Const K_DRILLBIT As String = "Drillbit"
+13 -4
View File
@@ -123,10 +123,19 @@
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="OffsXInteryTxBl" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<CheckBox Name="UseInteraxisChBx" Grid.Row="7" Grid.Column="1" Height="30" Width="40" HorizontalAlignment="Right"
Margin="-20,0,0,0"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}" IsEnabled="{Binding ElementName=UseInteraxisChBx, Path=IsChecked}"/>
</Grid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
+33 -4
View File
@@ -54,6 +54,8 @@ Public Class FrameCutPageUC
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
Dim bOffsYInterYSawTh As Boolean = False
UseInteraxisChBx.IsChecked = (GetPrivateProfileInt(S_FRAME, K_OFFSXINTERYSAWTH, 0, m_MainWindow.GetIniFile()) <> 1)
' Imposto i messaggi letti dal file dei messaggi
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
@@ -73,6 +75,17 @@ Public Class FrameCutPageUC
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
Dim sItems As String() = sChBxToolTip.Split("£")
For Index As Integer = 0 To sItems.Count - 1
If Index = 0 Then
sChBxToolTip = sItems(Index).Trim
Else
sChBxToolTip &= vbCrLf & sItems(Index).Trim
End If
Next
UseInteraxisChBx.ToolTip = sChBxToolTip
End Sub
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -280,7 +293,7 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed, UseInteraxisChBx.Click
' Forzo aggiornamento grezzo nella pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
' Parcheggio pezzi presenti nel grezzo
@@ -312,6 +325,11 @@ Public Class FrameCutPageUC
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
End If
Dim sUseInteraxis As String = "1"
If UseInteraxisChBx.IsChecked Then
sUseInteraxis = "0"
End If
WritePrivateProfileString(S_FRAME, K_OFFSXINTERYSAWTH, sUseInteraxis, m_MainWindow.GetIniFile())
End Sub
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
@@ -963,11 +981,22 @@ Public Class FrameCutPageUC
StringToLen(OffsXInteryTxBx.Text, dOffsXIntery)
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
If dOffsXIntery <= dSawThick Then
dMinDist = dSawThick + 5 * EPS_SMALL
If UseInteraxisChBx.IsChecked Then
If dOffsXIntery < 0 Then
dMinDist = 5 * EPS_SMALL
OffsXInteryTxBx.Text = "0"
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
End If
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
dMinDist = dSawThick + 5 * EPS_SMALL
End If
'If dOffsXIntery <= dSawThick Then
' dMinDist = dSawThick + 5 * EPS_SMALL
' EgtOutLog("WARNINGS: Saw tickness is more width then interaxis")
'Else
' dMinDist = dOffsXIntery + 5 * EPS_SMALL
'End If
Else
EgtOutLog("Not found current saw for frames mindist")
dMinDist = dOffsXIntery
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.2.1")>
<Assembly: AssemblyFileVersion("2.7.2.1")>
<Assembly: AssemblyVersion("2.7.2.2")>
<Assembly: AssemblyFileVersion("2.7.2.2")>
+11
View File
@@ -777,6 +777,17 @@ Public Class CurrentProjectPageUC
' Notifico a foto il cambio di path
EgtChangePhotoPath(nPhotoId, sNewPhoto)
End If
'--------------------------------------------------------------------------------
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Gestione visulizzazione lista pezzi in parcheggio
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sPath)
SelParkIndWD.sActualProj = String.Empty
SelParkIndWD.CopyImgSvg(sNewFileName)
End If
'--------------------------------------------------------------------------------
' Se assente, inserisco contrassegno di progetto OmagCut valido
AddProjectMark()
' Eseguo
+59 -52
View File
@@ -6,33 +6,40 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded">
<!-- Definizione della OpenPage -->
<Border>
<Grid Name="OpenPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<!-- Definizione della OpenPage -->
<Border>
<Grid Name="OpenPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<Grid Grid.Row="1" Grid.RowSpan="2">
<!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<Grid Name="SceneHostGrid" Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<Grid Grid.Row="1" Grid.RowSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="6.5*"/>
<RowDefinition Height="0.65*"/>
@@ -53,39 +60,39 @@
</Grid>
</Grid>
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</Border>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
</Border>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Button>
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
</Button>
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
</Grid>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</UserControl>
+47 -3
View File
@@ -5,6 +5,7 @@ Public Class OpenPageUC
'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_SelParkInd As SelParkIndWD
'Dichiarazione dello UserControl SceneButtons
Private m_SceneButtons As SceneButtonsUC
@@ -35,11 +36,12 @@ Public Class OpenPageUC
' Assegnazione scena all'host e posizionamento nella OpenPageGrid
OpenSceneHost.Child = OpenScene
OpenSceneHost.SetValue(Grid.ColumnProperty, 1)
OpenSceneHost.SetValue(Grid.RowProperty, 2)
OpenSceneHost.SetValue(Grid.ColumnProperty, 0) '1
OpenSceneHost.SetValue(Grid.RowProperty, 0) ' 2
' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
Me.OpenPageGrid.Children.Add(OpenSceneHost)
'Me.OpenPageGrid.Children.Add(OpenSceneHost)
SceneHostGrid.Children.Add(OpenSceneHost)
' Definizione del collegamento tra ItemList e ListBox1
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
@@ -241,6 +243,14 @@ Public Class OpenPageUC
Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale
EgtNewFile()
' Elimino elenco dei parcheggi
If Not IsNothing(m_SelParkInd) Then
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' Pulisco la selezione dei dati
SelParkIndWD.sActualProj = String.Empty
' Eseguo zoom
OpenScene.ZoomAll()
' Cancello messaggio
@@ -302,6 +312,24 @@ Public Class OpenPageUC
MessageBrd.Background = Brushes.Tomato
OkBtn.IsEnabled = False
End If
' Recupero il percorso del progetto per caricare le immagini
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
m_SelParkInd = New SelParkIndWD(m_MainWindow, OpenScene.GetCtx)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
SceneHostGrid.Children.Add(m_SelParkInd)
Else
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
End If
' Eseguo zoom
OpenScene.ZoomAll()
Return bOk
@@ -475,11 +503,21 @@ Public Class OpenPageUC
' Se file dxf devo processarlo opportunamente
Dim bFileDxf As Boolean = (EgtGetFileType(m_sCurrFile) = FT.DXF)
If bFileDxf Then AdjustSlabDxf()
' Istruzioni per chiudere OpenPageUC e aprire currentproject
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
' Lancio caricamento nuovo progetto corrente
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.PostLoad(m_sCurrDir, m_sCurrFile)
'--------------------------------------------------------------------------------
' Gestione visulizzazione lista pezzi in parcheggio
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sNewFileName As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
SelParkIndWD.CopyImgSvg(sNewFileName, OpenScene.GetCtx)
SelParkIndWD.sActualProj = String.Empty
'--------------------------------------------------------------------------------
' Se file dxf
If bFileDxf Then
' Applico le lavorazioni
@@ -513,6 +551,12 @@ Public Class OpenPageUC
End Sub
Private Sub OpenPage_Unloaded(sender As Object, e As RoutedEventArgs)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' resetto il nome del progetto corrente
SelParkIndWD.sActualProj = String.Empty
End Sub
End Class
+20 -18
View File
@@ -110,24 +110,26 @@ Public Class ProjectMgrUC
' Gestione visulizzazione lista pezzi in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
Dim Extension As String = ".svg"
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
Try
Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
If MainWindow.m_bShowSVGParkInd Then
WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
Else
If File.Exists(sNewFile) Then
File.Delete(sNewFile)
End If
File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
End If
Catch ex As Exception
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
End Try
End If
Next
SelParkIndWD.CopyImgSvg(sNewFileName)
'Dim Extension As String = ".svg"
'If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
'For Each ItemParkInd As ParkInd In ListParkInd
' If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
' Try
' Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
' If MainWindow.m_bShowSVGParkInd Then
' WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
' Else
' If File.Exists(sNewFile) Then
' File.Delete(sNewFile)
' End If
' File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
' End If
' Catch ex As Exception
' EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
' End Try
' End If
'Next
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
+3 -1
View File
@@ -390,6 +390,8 @@ Public Class Camera
' Leggo nome variabile posizione home raggiunta
Dim CameraStateNameVar As String = String.Empty
GetPrivateProfileString(S_PHOTO, K_CAMERA_STATE_VAR, "", CameraStateNameVar, m_MainWindow.GetMachIniFile())
Dim nSteps As Integer = 20
nSteps = GetPrivateProfileInt(S_PHOTO, K_PENDIG_TIME_FOR_PHOTO, nSteps, m_MainWindow.GetMachIniFile())
If String.IsNullOrEmpty(CameraStateNameVar) Then
'Return False
Else
@@ -403,7 +405,7 @@ Public Class Camera
System.Threading.Thread.Sleep(300)
' Definisco flag posizionamento completato
Dim bPositionOk As Boolean = False
For I As Integer = 0 To 40
For I As Integer = 0 To nSteps
' Devo rileggere la variabile ad ogni ciclo
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(CameraStateNameVar, 3)
System.Threading.Thread.Sleep(100)