Compare commits
68 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5cfc72be27 | |||
| 45d3f5c7d8 | |||
| ac67a14fea | |||
| 1df823cdec | |||
| be29ea050d | |||
| cd4d2b1ccb | |||
| c730513f27 | |||
| 9f3920a2b2 | |||
| f388dc0c50 | |||
| 6613b3d551 | |||
| 615d6d2652 | |||
| 3ea8335357 | |||
| bbdac91894 | |||
| c424ff6661 | |||
| 4d64328b1b | |||
| 10c4c7ecc1 | |||
| 03def4b530 | |||
| a3b56444f6 | |||
| 837380226a | |||
| f15935ecbc | |||
| 00360013e3 | |||
| 0010deb7fc | |||
| 9c267aacf7 | |||
| 311cf40a8e | |||
| 4c34b62e65 | |||
| 87037b6c6a | |||
| 74c479d17d | |||
| ee6c0ad146 | |||
| ead6bcec6d | |||
| a1ad658f27 | |||
| 4ab7811b50 | |||
| 1899c9a735 | |||
| 3f769c49da | |||
| da4ddb2a7f | |||
| 3667ecb3b7 | |||
| 206af48539 | |||
| 253e92b111 | |||
| 123d6118e9 | |||
| a2104eaa03 | |||
| 65b9bfdcdb | |||
| 004591896c | |||
| 02af01052b | |||
| 2bc386807f | |||
| 82af1baae3 | |||
| 68b4dfed80 | |||
| ffc7536177 | |||
| 70368b73be | |||
| 05b4e2e95a | |||
| 1d7cdf8fa0 | |||
| 5190a41470 | |||
| 3afe6bb35b | |||
| c546df45ca | |||
| 554ae16e48 | |||
| 1b4d239202 | |||
| 3b2d15703a | |||
| 8e5a4d4ac5 | |||
| ef621a340a | |||
| f2ce55ff27 | |||
| ae3b16b715 | |||
| 8ff4b74725 | |||
| e7e1946230 | |||
| 8dc6b63801 | |||
| 7f548e5ba6 | |||
| 2cf1be7348 | |||
| bb932788f9 | |||
| 4c0da9af53 | |||
| 26ef6b2d3b | |||
| 529fb6d3a6 |
@@ -36,7 +36,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="LogoBrd" Grid.Column="1">
|
||||
<Image Source="../Resources/AboutBoxImage.png" Stretch="Uniform"/>
|
||||
<Image Source="../Resources/NewIcons/Logo-Egalware (3).png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
|
||||
+25
-2
@@ -47,6 +47,26 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
' versione CamAuto 2.6l1: gestione tagli con ridotto affondamento
|
||||
Friend Function AddWaterJetMachining(LocaList As List(Of Integer), ByRef nWarn As Integer) As Boolean
|
||||
EgtLuaCreateGlobTable("CAM")
|
||||
SetLuaStandardCamParams()
|
||||
For i As Integer = 0 To LocaList.Count - 1
|
||||
EgtLuaSetGlobIntVar("CAM.TAB_OPERID." & (i + 1).ToString, LocaList(i))
|
||||
Next
|
||||
Dim nErr As Integer = 999
|
||||
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
|
||||
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJets")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function EraseMachinings(nPartId As Integer) As Boolean
|
||||
EgtLuaCreateGlobTable("CAM")
|
||||
EgtLuaSetGlobIntVar("CAM.PARTID", nPartId)
|
||||
@@ -543,6 +563,7 @@ Friend Module CamAuto
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||
' Ciclo sulle lavorazioni
|
||||
Dim nOperId As Integer = EgtGetFirstOperation()
|
||||
Dim LocalListOperId As New List(Of Integer)
|
||||
While nOperId <> GDB_ID.NULL
|
||||
' verifico sia una lavorazione valida di taglio con lama
|
||||
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
|
||||
@@ -557,12 +578,14 @@ Friend Module CamAuto
|
||||
' se abilitato e attivo waterjet, lo aggiungo per completare il taglio
|
||||
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
|
||||
Dim nWarn As Integer = 0
|
||||
AddWaterJetMachining(nOperId, nWarn)
|
||||
LocalListOperId.Add(nOperId)
|
||||
'AddWaterJetMachining(nOperId, nWarn)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nOperId = EgtGetNextOperation(nOperId)
|
||||
End While
|
||||
If LocalListOperId.Count > 0 Then AddWaterJetMachining(LocalListOperId, 0)
|
||||
Return bModified
|
||||
End Function
|
||||
|
||||
|
||||
+18
-8
@@ -27,7 +27,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Griglia per oscurare i bottoni della pagina sottostante-->
|
||||
<Grid Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<Label Name="CsvPathTxBl" Grid.Row="1" Background="White" FontSize="16" VerticalAlignment="Center" Padding="2,5,0,5"/>
|
||||
|
||||
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
||||
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{StaticResource OmagCut_TreeViewGradientGray}">
|
||||
<TreeView.Resources>
|
||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||
<!--renderlo apribile con un solo click -->
|
||||
@@ -62,7 +62,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" Foreground="Black" />
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -123,7 +123,10 @@
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_LightGray}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -131,18 +134,25 @@
|
||||
</HierarchicalDataTemplate>
|
||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||
<DataTemplate DataType="{x:Type self:PartCustomItem}">
|
||||
<Grid Width="246" Margin="0,5,0,5" HorizontalAlignment="Right">
|
||||
<Grid Width="234.8" Margin="0,5,0,5" HorizontalAlignment="Right">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
|
||||
<TextBlock Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
||||
<TextBlock x:Name="TbName" Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
|
||||
<TextBlock x:Name="TbText1" Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
|
||||
<TextBlock x:Name="TbText2" Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
||||
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||
<Setter TargetName="TbName" Property="TextDecorations" Value="Strikethrough" />
|
||||
<Setter TargetName="TbText1" Property="TextDecorations" Value="Strikethrough" />
|
||||
<Setter TargetName="TbText2" Property="TextDecorations" Value="Strikethrough" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports EgtWPFLib
|
||||
Imports System.Reflection
|
||||
Imports System.Globalization
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class CadCutPageUC
|
||||
|
||||
|
||||
@@ -127,11 +127,10 @@ Public Class MoveRawPartPage
|
||||
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||
' altrimenti, aggiorno visualizzazione
|
||||
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||
EgtDraw()
|
||||
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||
End If
|
||||
'---------------------------- AUX TABLE ----------------------------
|
||||
|
||||
EgtDraw()
|
||||
' Carico i parametri di movimento
|
||||
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
||||
' Ricavo la lunghezza del baffo di taglio
|
||||
@@ -860,6 +859,12 @@ Public Class MoveRawPartPage
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Sub RemovePart_KeyCancel(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles m_CurrProjPage.OnKeyCancelDownScene
|
||||
If e.KeyCode = System.Windows.Forms.Keys.Delete Then
|
||||
RemovePartBtn_Click(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
@@ -927,6 +932,7 @@ Public Class MoveRawPartPage
|
||||
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
|
||||
RefreshVisibility()
|
||||
EgtZoom(ZM.ALL, True)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||
@@ -1362,7 +1368,7 @@ Public Class MoveRawPartPage
|
||||
Return
|
||||
End If
|
||||
|
||||
' ------- VISUALIZZAZIONE -------
|
||||
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||
If m_SplitPage.m_bShow Then
|
||||
' verifico se la fase successiva è uno scarico frontale
|
||||
If NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||
|
||||
+16
-14
@@ -12,7 +12,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
@@ -149,29 +149,31 @@
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
|
||||
<UniformGrid Name ="UG2" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="3" >
|
||||
<Button Name="SelectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Seleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="DeselectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Deseleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
<ToggleButton Name="ParkIndBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--LowerButtonGrid-->
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
+144
-9
@@ -9,6 +9,9 @@ Public Class NestPageUC
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Fisetra per la gestione dei parcheggi
|
||||
Private m_SelParkInd As SelParkIndWD
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag per modalità nesting standard o registrazione posizione lastra
|
||||
@@ -144,11 +147,18 @@ Public Class NestPageUC
|
||||
StartCurveWJBtn.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
UG0.Columns = nColumnIn_UG0
|
||||
|
||||
' Gestione dei comandi di parcheggio e selezione (UniformGrid2)
|
||||
'...
|
||||
End Sub
|
||||
|
||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
m_bActive = True
|
||||
LoadParams()
|
||||
Dim ListparkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListparkInd)
|
||||
If ListparkInd.Count > 2 Then ParkIndBtn.IsChecked = True
|
||||
ParkIndBtn_Click()
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
@@ -220,17 +230,21 @@ Public Class NestPageUC
|
||||
m_nCountSpot = 0
|
||||
m_nCountSpotCUT = 0
|
||||
End If
|
||||
EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString)
|
||||
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
|
||||
If m_nCountSpot < 1 Then
|
||||
UG0_Reg.IsEnabled = False
|
||||
UG1_Reg.IsEnabled = False
|
||||
EgtOutLog(" Abilito comandi gestione SPOT")
|
||||
Else
|
||||
UG0_Reg.IsEnabled = True
|
||||
UG1_Reg.IsEnabled = True
|
||||
EgtOutLog(" Disabilito comandi gestione SPOT")
|
||||
End If
|
||||
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
|
||||
If m_nCountSpotCUT < 1 Then
|
||||
InsertSpotRegistration()
|
||||
EgtOutLog(" Creo SPOT_CUT")
|
||||
End If
|
||||
|
||||
' Se necessario riabilito impostazione modificato
|
||||
@@ -1069,8 +1083,7 @@ Public Class NestPageUC
|
||||
End If
|
||||
|
||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -1082,7 +1095,6 @@ Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
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
|
||||
@@ -1566,6 +1578,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Eseguo verifica
|
||||
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then
|
||||
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
' Non superata riporto alla posizione iniziale
|
||||
Else
|
||||
If m_bFromParking Then
|
||||
@@ -1597,7 +1613,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
CountPartInFamily(sRefGroup)
|
||||
End If
|
||||
End If
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
End If
|
||||
m_bFromParking = False
|
||||
End If
|
||||
@@ -2267,7 +2283,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Else
|
||||
StandardInsert()
|
||||
End If
|
||||
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub StandardInsert()
|
||||
@@ -2709,6 +2728,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
End Function
|
||||
|
||||
#End Region ' Manager Counter Part
|
||||
|
||||
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
|
||||
If DragRettanleBtn.IsChecked Then
|
||||
m_bIsCheckedDragRettangle = True
|
||||
@@ -2774,6 +2794,12 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Metto in parcheggio, se in grezzo
|
||||
StoreOnePart(nId)
|
||||
' Aggiorno lo stato di visualizzazione
|
||||
Dim nInfoStatus As Integer = 1
|
||||
' Salvo lo stato (per gestire la navigazione)
|
||||
EgtGetInfo(nId, INFO_PARKSTATUS, nInfoStatus)
|
||||
' Imposto lo stato
|
||||
EgtSetStatus(nId, nInfoStatus)
|
||||
' Eventuale notifiche al VeinMatching
|
||||
VeinMatching.OnRemovePartFromRaw(nId)
|
||||
' Passo al successivo selezionato
|
||||
@@ -2783,6 +2809,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
m_nPartPos = PART_POS.NONE_TABLE
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' ripulisco la lista dei pezzi in parcheggio
|
||||
@@ -2814,6 +2844,29 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function StoreOnePartDXF(nId As Integer, X As Double, Y As Double) As Boolean
|
||||
Const STORE_LARGH As Double = 6000
|
||||
Const STORE_DIST As Double = 200
|
||||
Const STORE_OFFS As Double = 20 + 40 + 20
|
||||
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
|
||||
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
||||
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||
' Recupero box tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
If Not EgtGetTableArea(1, b3Tab) Then
|
||||
b3Tab.Add(New Point3d(0, 0, 0))
|
||||
b3Tab.Add(New Point3d(-3600, -2600, 0))
|
||||
End If
|
||||
Dim vt As New Vector3d(b3Tab.Min.x, b3Tab.Min.y - Y - STORE_DIST, b3Tab.Min.z)
|
||||
EgtMove(nId, vt, GDB_RT.GLOB)
|
||||
' Recupero il centro del pezzo in parcheggio e lo salvo
|
||||
Dim ptCenter As Point3d
|
||||
EgtCenterPoint(nId, GDB_ID.ROOT, ptCenter)
|
||||
EgtSetInfo(nId, "PosInPark", ptCenter)
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function PackPartInStore(nId As Integer) As Boolean
|
||||
' Recupero box tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
@@ -2829,6 +2882,17 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
||||
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
|
||||
|
||||
' Verifico che il pezzo ha una posizione salvata
|
||||
Dim ptCenter As Point3d
|
||||
If EgtGetInfo(nId, "PosInPark", ptCenter) Then
|
||||
Dim ptCurrPos As Point3d
|
||||
EgtCenterPoint(nId, GDB_ID.ROOT, ptCurrPos)
|
||||
Dim vt As New Vector3d(ptCenter - ptCurrPos)
|
||||
EgtMove(nId, vt, GDB_RT.GLOB)
|
||||
Return True
|
||||
End If
|
||||
|
||||
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
|
||||
End Function
|
||||
|
||||
@@ -2917,6 +2981,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
m_CurrProjPage.ShowAreas()
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteBridgeAssociated(nMyId As Integer)
|
||||
@@ -2962,6 +3030,13 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
|
||||
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Recupero il ParkInd attualmente attivo
|
||||
Dim CurrParkInd As ParkInd = SelParkIndWD.GetCurrentParkIndSelected()
|
||||
' Il default è ZERO
|
||||
Dim nCurrParkInd As Integer = 0
|
||||
If Not IsNothing(CurrParkInd) Then
|
||||
nCurrParkInd = CurrParkInd.Ind
|
||||
End If
|
||||
' Numero dei pezzi in tavola
|
||||
Dim nPartTab As Integer = EgtGetPartInRawPartCount(m_nRawId)
|
||||
' Se già selezionati in tavola o non ci sono selezionati e pezzi in tavola
|
||||
@@ -2970,8 +3045,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Seleziono tutti i pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
Dim nInfoParkInd As Integer = -1
|
||||
' Recupero l'indice del parcheggio
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
|
||||
Else
|
||||
nInfoParkInd = 0
|
||||
End If
|
||||
' ------------------ FINE ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
' Se l'indice di parcheggio è valido (uguale al parcheggio corrente)
|
||||
If nInfoParkInd = nCurrParkInd Then
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
End If
|
||||
nPartId = EgtGetNextGroup(nPartId)
|
||||
End While
|
||||
' Aggiorno flag
|
||||
@@ -2981,8 +3069,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Seleziono tutti i pezzi in parcheggio
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
Dim nInfoParkInd As Integer = -1
|
||||
' Recupero l'indice del parcheggio
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
|
||||
Else
|
||||
nInfoParkInd = 0
|
||||
End If
|
||||
' ------------------ FINE ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
' Se l'indice di parcheggio è valido (uguale al parcheggio corrente)
|
||||
If nInfoParkInd = nCurrParkInd Then
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
' Aggiorno flag
|
||||
@@ -3005,6 +3106,33 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub ParkIndBtn_Click() Handles ParkIndBtn.Click
|
||||
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
|
||||
End If
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Public Sub ReloadListParkInd()
|
||||
If Not IsNothing(m_SelParkInd) Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub PartRotOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles PartRotOnBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Se non ci sono pezzi selezionati o non sono in parcheggio, esco
|
||||
@@ -3128,6 +3256,13 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
End Sub
|
||||
|
||||
Private Sub NestPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
' se esiste l'elenco dei parcheggi lo nascondo
|
||||
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
|
||||
End If
|
||||
m_bActive = False
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingHide()
|
||||
End Sub
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
<UserControl x:Class="SelParkIndWD"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Background="Transparent">
|
||||
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.1*"/>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="0.1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.0*"/>
|
||||
<RowDefinition Height="0.1*"/>
|
||||
<RowDefinition Height="10*"/>
|
||||
<RowDefinition Height="0.1*"/>
|
||||
<RowDefinition Height="0.0*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Grid.Column="1" Grid.Row="1" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
|
||||
Visibility="Collapsed"/>
|
||||
<!--TextAlignment="Center"
|
||||
FontSize="20"
|
||||
VerticalAlignment="Center"-->
|
||||
<ListBox Name="ParkIndListBox" Grid.Column="1" Grid.Row="2"
|
||||
ItemsSource="{Binding ItemList}" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" >
|
||||
<UniformGrid Columns="2" Visibility="{Binding TitleVisibility}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding ImgTab}" Height="20" Stretch="Uniform"/>
|
||||
<TextBlock Text="{Binding CountInTab}" Height="20" Width="30">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_ListBoxTextBlock}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsStatusON}" Value="False">
|
||||
<Setter Property="FontStyle" Value="Oblique"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsStatusON}" Value="True">
|
||||
<Setter Property="Foreground" Value="black"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="{Binding ImgPark}" Height="20" Stretch="Uniform"/>
|
||||
<TextBlock Text="{Binding CountInPark}" Height="20" Width="30">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_ListBoxTextBlock}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsStatusON}" Value="False">
|
||||
<Setter Property="FontStyle" Value="Oblique"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsStatusON}" Value="True">
|
||||
<Setter Property="Foreground" Value="black"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</UniformGrid>
|
||||
<Image Source="{Binding Img}" Width="120" Stretch="Uniform" Visibility="{Binding MyVisibilityImg}"/>
|
||||
<Viewbox Name="ViewBoxPark" Visibility="{Binding MyVisibilitySvg}">
|
||||
<ContentPresenter Content="{Binding LocalMyCanvas.CurrCanvas}"/>
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="4" Visibility="Collapsed">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
|
||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,869 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Globalization
|
||||
Imports System.Windows.Ink
|
||||
Imports System.Xml
|
||||
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)
|
||||
Public Const nIndAllOff As Integer = 999
|
||||
|
||||
Sub New(Owner As Window)
|
||||
'Me.Owner = Owner
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Public Sub Me_Laoded() Handles Me.Loaded
|
||||
' Aggiorno la lista
|
||||
UpdateList()
|
||||
' Imposto la selezione del primo parcheggio disponibile
|
||||
UpdateDefaultSelection()
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateList()
|
||||
' Carico lista dei pezzi
|
||||
LoadParkInd(m_ParkIndList)
|
||||
ParkIndListBox.ItemsSource = m_ParkIndList
|
||||
UpdateDefaultSelection()
|
||||
' Forzo l'aggiornamento della grafica
|
||||
ParkIndListBox.Items.Refresh()
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateDefaultSelection()
|
||||
' Procedo a selezionare il primo (E FORSE ANCHE L'UNICO?) parcheggio attivo
|
||||
Dim bFound As Boolean = False
|
||||
For Each ItemPark As ParkInd In m_ParkIndList
|
||||
If ItemPark.IsStatusON Then
|
||||
ParkIndListBox.SelectedItem = ItemPark
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bFound And m_ParkIndList.Count > 0 Then
|
||||
m_ParkIndList(0).Status = GDB_ST.ON_
|
||||
ParkIndListBox.SelectedItem = m_ParkIndList(0)
|
||||
End If
|
||||
'' Provedo a spegnere tutti gli altri parcheggi
|
||||
'For Each ItemParkInd As ParkInd In m_ParkIndList
|
||||
' If ParkIndListBox.SelectedItem.Ind <> ItemParkInd.Ind Then
|
||||
' ItemParkInd.Status = GDB_ST.OFF
|
||||
' SetStatusPartInParkInd(ItemParkInd)
|
||||
' End If
|
||||
'Next
|
||||
End Sub
|
||||
|
||||
Private Sub ParkIndListBox_SelectionChanged() Handles ParkIndListBox.MouseLeftButtonUp
|
||||
' Non so se il click sta accendeno o spegnendo quinid faccio una verifica dello stato attuale del parcheggio
|
||||
Dim localParkInd As ParkInd = ParkIndListBox.SelectedItem
|
||||
' Se l'elemento selezionato è attivo allora esco (perchè altrimenti lo spegnerei)
|
||||
If localParkInd.IsStatusON Then Return
|
||||
Dim bFound As Boolean = False
|
||||
If localParkInd.Ind = nIndAllOff Then
|
||||
localParkInd.Status = GDB_ST.ON_
|
||||
bFound = True
|
||||
End If
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
' Cerco il primo pezzo del parcheggio indicato
|
||||
While nPartId <> GDB_ID.NULL And Not bFound
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
' Se i pezzi non hanno un indice di parcheggio di default vale "0"
|
||||
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
|
||||
If localParkInd.Ind.ToString = sInfoParkInd Then
|
||||
' Determino lo stato da assegnare al parcheggio (prendo il primo pezzo del parcheggio come riferimento)
|
||||
Dim OppositStat As Integer = If(localParkInd.Status = GDB_ST.ON_, GDB_ST.OFF, GDB_ST.ON_)
|
||||
localParkInd.Status = OppositStat
|
||||
bFound = True
|
||||
' termino la ricerca
|
||||
Exit While
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
' Assegno lo stato del parcheggio a tutti i pezzi i parcheggio
|
||||
If bFound Then
|
||||
SetStatusPartInParkInd(localParkInd)
|
||||
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)
|
||||
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)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
#Region "METODI SHARED per gestione della lista parcheggi"
|
||||
|
||||
' Restituisce il primo indice di parcheggio libero
|
||||
Public Shared Function NewParkInd() 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()
|
||||
EgtSetCurrentContext(ProjCtx)
|
||||
Dim LastParkInd As Integer = 0
|
||||
Dim nRawId As Integer = GetCurrentRaw()
|
||||
' Leggo l'indice di parcheggio dei pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
' Se i pezzi non hanno un indice di parcheggio
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
If IsNumeric(sInfoParkInd) Then
|
||||
Dim nInfoParkIndn As Integer = CInt(sInfoParkInd)
|
||||
LastParkInd = Math.Max(LastParkInd, nInfoParkIndn)
|
||||
End If
|
||||
End If
|
||||
nPartId = EgtGetNextGroup(nPartId)
|
||||
End While
|
||||
' Leggo l'indice di parcheggio dei pezzi in parcheggio
|
||||
nPartId = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
' Se i pezzi non hanno un indice di parcheggio (COPIA della funzione sopra)
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
If IsNumeric(sInfoParkInd) Then
|
||||
Dim nInfoParkIndn As Integer = CInt(sInfoParkInd)
|
||||
LastParkInd = Math.Max(LastParkInd, nInfoParkIndn)
|
||||
End If
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
' Ripristino il contesto corrente
|
||||
EgtSetCurrentContext(CurrCtx)
|
||||
Return LastParkInd + 1
|
||||
End Function
|
||||
|
||||
' Gestisce lo stato dei pezzi associati al parcheggio indicato
|
||||
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True)
|
||||
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()
|
||||
EgtSetCurrentContext(ProjCtx)
|
||||
Dim nRawId As Integer = GetCurrentRaw()
|
||||
' Pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
|
||||
If localParkInd.Ind.ToString = sInfoParkInd Then
|
||||
' Salvo lo stato del parcheggio (per gestire la navigazione) ANCHE SE I PEZZI SONO ACCESI
|
||||
EgtSetInfo(nPartId, INFO_PARKSTATUS, localParkInd.Status)
|
||||
End If
|
||||
nPartId = EgtGetNextGroup(nPartId)
|
||||
End While
|
||||
' Pezzi in parcheggio
|
||||
nPartId = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
|
||||
If localParkInd.Ind.ToString = sInfoParkInd Then
|
||||
' Setto lo stato
|
||||
EgtSetStatus(nPartId, localParkInd.Status)
|
||||
' Salvo lo stato (per gestire la navigazione)
|
||||
EgtSetInfo(nPartId, INFO_PARKSTATUS, localParkInd.Status)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
If bDraw Then EgtDraw()
|
||||
' Ripristino il contesto corrente
|
||||
EgtSetCurrentContext(CurrCtx)
|
||||
End Sub
|
||||
|
||||
' Restituuisce la lista dei parcheggi del progetto corrente
|
||||
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd))
|
||||
If IsNothing(P_List) Then Return
|
||||
P_List.Clear()
|
||||
P_List.Add(New ParkInd(nIndAllOff, "All off", 0))
|
||||
' recupero il contesto corrente
|
||||
Dim CurrCtx As Integer = EgtGetCurrentContext()
|
||||
' recupero il contesto del progetto
|
||||
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
|
||||
EgtSetCurrentContext(ProjCtx)
|
||||
Dim nRawId As Integer = GetCurrentRaw()
|
||||
' Pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
Dim nInfoParkInd As Integer = -1
|
||||
' Recupero l'indice del parcheggio
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
|
||||
Else
|
||||
nInfoParkInd = 0
|
||||
End If
|
||||
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
|
||||
If nInfoParkInd > -1 Then
|
||||
' Verifico se nella lista dei parcheggi è già presente l'indice indicato
|
||||
Dim localParkInd As ParkInd = P_List.Find(Function(x) x.Ind = nInfoParkInd)
|
||||
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
|
||||
If IsNothing(localParkInd) Then
|
||||
Dim nStatus As Integer
|
||||
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
|
||||
' EgtGetStatus(nPartId, nStatus)
|
||||
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
|
||||
End If
|
||||
End If
|
||||
nPartId = EgtGetNextGroup(nPartId)
|
||||
End While
|
||||
' Pezzi in parcheggio
|
||||
nPartId = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
Dim nInfoParkInd As Integer = -1
|
||||
' Recupero l'indice del parcheggio
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
|
||||
Else
|
||||
nInfoParkInd = 0
|
||||
End If
|
||||
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
|
||||
If nInfoParkInd > -1 Then
|
||||
' Verifico se nella lista dei parcheggi è già presente l'indice indicato
|
||||
Dim localParkInd As ParkInd = P_List.Find(Function(x) x.Ind = nInfoParkInd)
|
||||
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
|
||||
If IsNothing(localParkInd) Then
|
||||
Dim nStatus As Integer
|
||||
EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus)
|
||||
' EgtGetStatus(nPartId, nStatus)
|
||||
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
|
||||
End If
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
EgtSetCurrentContext(CurrCtx)
|
||||
End Sub
|
||||
|
||||
' Aggiorna la lista dei parcheggi, se "bDraw=true" aggiorno la scena
|
||||
Public Shared Sub UpdateViewOnParkInd(Optional bDraw As Boolean = True)
|
||||
' Ricarico la lista dei parcheggi
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
' Aggiorna la vista dei parcheggi
|
||||
For Each Item As ParkInd In ListParkInd
|
||||
SelParkIndWD.SetStatusPartInParkInd(Item, bDraw)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' Restituisce il primo parcheggio attivo (
|
||||
Public Shared Function GetCurrentParkIndSelected() As ParkInd
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
' Procedo a selezionare il primo (E ANCHE UNICO?..a volte no..) parcheggio attivo -> guarda funzione UpdateList <-
|
||||
For Each ItemPark As ParkInd In ListParkInd
|
||||
If ItemPark.IsStatusON Then
|
||||
Return ItemPark
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
' Restitusice il nome del file immagine del parcheggio (manance solo dell'Indice di parcheggio e dell'esetensione png)
|
||||
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_"
|
||||
Return sParkPath
|
||||
End Function
|
||||
|
||||
#End Region ' Metodi Shared
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ParkInd
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Private m_VisbilityAllOff As Visibility = Visibility.Hidden
|
||||
|
||||
Private m_Ind As Integer
|
||||
Public Property Ind As Integer
|
||||
Get
|
||||
Return m_Ind
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Ind = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Img As String = String.Empty
|
||||
Public Property Img As String
|
||||
Get
|
||||
Return m_Img
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Img = value
|
||||
NotifyPropertyChanged("MyVisibilityImg")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Svg As String = String.Empty
|
||||
Public Property Svg As String
|
||||
Get
|
||||
Return m_Svg
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Svg = value
|
||||
NotifyPropertyChanged("MyVisibilitySvg")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nPartInTable As Integer = 0
|
||||
Public Property nPartInTable As Integer
|
||||
Get
|
||||
Return m_nPartInTable
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPartInTable = value
|
||||
NotifyPropertyChanged(NameOf(nPartInTable))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nPartInPark As Integer = 0
|
||||
Public Property nPartInPark As Integer
|
||||
Get
|
||||
Return m_nPartInPark
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_nPartInPark = value
|
||||
NotifyPropertyChanged(NameOf(nPartInPark))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CountInTab As String
|
||||
Get
|
||||
Return m_nPartInTable.ToString
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ImgTab As String
|
||||
Get
|
||||
Return DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\table.png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CountInPark As String
|
||||
Get
|
||||
Return m_nPartInPark.ToString
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ImgPark As String
|
||||
Get
|
||||
Return DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park.png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Status As Integer
|
||||
|
||||
Public Property Status As Integer
|
||||
Get
|
||||
Return m_Status
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_Status = value
|
||||
NotifyPropertyChanged(NameOf(IsStatusON))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsStatusON As Boolean
|
||||
Get
|
||||
Return (m_Status = GDB_ST.ON_)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MyVisibilityTmg As Visibility
|
||||
Get
|
||||
Return If(Not System.IO.File.Exists(m_Img), Visibility.Collapsed, Visibility.Visible)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MyVisibilitySvg As Visibility
|
||||
Get
|
||||
Return If(Not System.IO.File.Exists(m_Svg), Visibility.Collapsed, Visibility.Visible)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property TitleVisibility As Visibility
|
||||
Get
|
||||
Return If(m_Ind = 999, m_VisbilityAllOff, Visibility.Visible)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_LocalMyCanvas As MyCanvas
|
||||
Public ReadOnly Property LocalMyCanvas As MyCanvas
|
||||
Get
|
||||
Return m_LocalMyCanvas
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Ind As Integer, Name As String, Stat As Integer)
|
||||
m_Ind = Ind
|
||||
m_Name = Name
|
||||
m_Status = Stat
|
||||
' 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"
|
||||
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"
|
||||
Else
|
||||
m_Img = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".png"
|
||||
m_Svg = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".svg"
|
||||
End If
|
||||
|
||||
If MainWindow.m_bShowSVGParkInd Then
|
||||
Dim CanvWidth As Integer = 145
|
||||
Dim CanvHeight As Integer = CInt(CanvWidth / 1.4)
|
||||
m_LocalMyCanvas = New MyCanvas(CanvWidth, CanvHeight)
|
||||
If System.IO.File.Exists(m_Svg) Then
|
||||
ReadMyXML(m_Svg, m_LocalMyCanvas)
|
||||
m_Img = ""
|
||||
End If
|
||||
Else
|
||||
m_Svg = ""
|
||||
End If
|
||||
|
||||
' Conto il numero di pezzi in Tavola
|
||||
CountPartInTable()
|
||||
' Conto il numero di pezzi in parcheggio
|
||||
CountPartInPark()
|
||||
|
||||
End Sub
|
||||
|
||||
' Conta in numero di pezzi di questo parcheggio in Tavola
|
||||
Private Sub CountPartInTable()
|
||||
Dim nCount As Integer = 0
|
||||
Dim nRawId As Integer = GetCurrentRaw()
|
||||
' Leggo l'indice di parcheggio dei pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
' Aggiorno il valore del contatore
|
||||
If IncreaseCounterPart(nPartId, nCount) Then
|
||||
UpdateEntInCanvas(nPartId, 0.2)
|
||||
End If
|
||||
nPartId = EgtGetNextGroup(nPartId)
|
||||
End While
|
||||
m_nPartInTable = nCount
|
||||
End Sub
|
||||
|
||||
' Conta il numero di pezzi di questo parcheggio in Parcheggio
|
||||
Private Sub CountPartInPark()
|
||||
Dim nCount As Integer = 0
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
' Aggiorno il valore del contatore
|
||||
If IncreaseCounterPart(nPartId, nCount) Then
|
||||
UpdateEntInCanvas(nPartId, 1)
|
||||
End If
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
m_nPartInPark = nCount
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateEntInCanvas(nPartId, dOpacity)
|
||||
If Not IsNothing(m_LocalMyCanvas) Then
|
||||
' modifico il colore del pezzo nel SVG
|
||||
Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nPartId, "Region")
|
||||
If nIdRegion <> GDB_ID.NULL Then
|
||||
Dim nIdEnt As Integer = EgtGetFirstInGroup(nIdRegion)
|
||||
While nIdEnt <> GDB_ID.NULL
|
||||
If EgtGetType(nIdEnt) = GDB_TY.SRF_FRGN Then
|
||||
Exit While
|
||||
End If
|
||||
End While
|
||||
If nIdEnt <> GDB_ID.NULL Then
|
||||
Dim sName As String = ""
|
||||
EgtGetName(nIdEnt, sName)
|
||||
Dim Idpath As MyPath = m_LocalMyCanvas.ListPath.Find(Function(x) x.id = sName)
|
||||
If Not IsNothing(Idpath) Then
|
||||
Idpath.fill_opacity = dOpacity
|
||||
m_LocalMyCanvas.UpdateMyPath(Idpath)
|
||||
Idpath.LoadPath()
|
||||
NotifyPropertyChanged(NameOf(LocalMyCanvas))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Verifica se il pezzo passato (da parcheggio o tavola) appartiene al ParkInd corrente e quindi aggiorna il valore di nCount+=1
|
||||
Private Function IncreaseCounterPart(nPartId As Integer, ByRef nCount As Integer) As Boolean
|
||||
Dim bOk As Boolean = False
|
||||
' Se i pezzi non hanno un indice di parcheggio
|
||||
Dim sInfoParkInd As String = String.Empty
|
||||
Dim nInfoParkInd As Integer = -1
|
||||
' Recupero l'indice del parcheggio
|
||||
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
|
||||
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
|
||||
Else
|
||||
nInfoParkInd = 0
|
||||
End If
|
||||
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
|
||||
If nInfoParkInd > -1 Then
|
||||
' e uguale a quallo del parcheggio correntemente selezionato
|
||||
If nInfoParkInd = m_Ind Then
|
||||
nCount = nCount + 1
|
||||
bOk = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
#Region "ELEMENTI PER LA GESTIONE SVG"
|
||||
|
||||
Public Class MyCanvas
|
||||
|
||||
Private m_CurrCanvas As New Canvas
|
||||
Public Property CurrCanvas As Canvas
|
||||
Get
|
||||
Return m_CurrCanvas
|
||||
End Get
|
||||
Set(value As Canvas)
|
||||
m_CurrCanvas = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ListPath As New List(Of MyPath)
|
||||
Public Property ListPath As List(Of MyPath)
|
||||
Get
|
||||
Return m_ListPath
|
||||
End Get
|
||||
Set(value As List(Of MyPath))
|
||||
m_ListPath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_ViewBoxDim As String
|
||||
Public Property ViewBoxDim As String
|
||||
Get
|
||||
Return m_ViewBoxDim
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ViewBoxDim = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Width As Integer, Height As Integer)
|
||||
m_CurrCanvas.Width = Width
|
||||
m_CurrCanvas.Height = Height
|
||||
m_CurrCanvas.ClipToBounds = True
|
||||
End Sub
|
||||
|
||||
Public Sub LoadCanvas()
|
||||
For Each ItemPath As MyPath In m_ListPath
|
||||
m_CurrCanvas.Children.Add(ItemPath.CurrPath)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateMyPath(CurrPath As MyPath)
|
||||
m_CurrCanvas.Children.Remove(CurrPath.CurrPath)
|
||||
m_CurrCanvas.Children.Add(CurrPath.CurrPath)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class MyPath
|
||||
|
||||
Private m_CurrPath As New System.Windows.Shapes.Path
|
||||
Public Property CurrPath As System.Windows.Shapes.Path
|
||||
Get
|
||||
Return m_CurrPath
|
||||
End Get
|
||||
Set(value As System.Windows.Shapes.Path)
|
||||
m_CurrPath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanvX As Double
|
||||
Public ReadOnly Property CanvX As Double
|
||||
Get
|
||||
Return m_CanvX
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_CanvY As Double
|
||||
Public ReadOnly Property CanvY As Double
|
||||
Get
|
||||
Return m_CanvY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DimX As Double
|
||||
Public ReadOnly Property DimX As Double
|
||||
Get
|
||||
Return m_DimX
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_DimY As Double
|
||||
Public ReadOnly Property DimY As Double
|
||||
Get
|
||||
Return m_DimY
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_id As String
|
||||
Public ReadOnly Property id As String
|
||||
Get
|
||||
Return m_id
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_d As String
|
||||
Public ReadOnly Property d As String
|
||||
Get
|
||||
Return m_d
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_fill As String
|
||||
Public Property fill As String
|
||||
Get
|
||||
Return m_fill
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_fill = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_fill_opacity As Double
|
||||
Public Property fill_opacity As Double
|
||||
Get
|
||||
Return m_fill_opacity
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_fill_opacity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_stroke As String
|
||||
Public Property stroke As String
|
||||
Get
|
||||
Return m_stroke
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_stroke = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_stroke_opacity As Double
|
||||
Public Property stroke_opacity As Double
|
||||
Get
|
||||
Return m_stroke_opacity
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_stroke_opacity = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_stroke_width As Double
|
||||
Public Property stroke_width As Double
|
||||
Get
|
||||
Return m_stroke_width
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_stroke_width = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Id As String, D As String, CanvX As Double, CanvY As Double, DimX As Double, DimY As Double, Fill As String, FillOpacity As Double, Stroke As String, StrokeOpacity As Double)
|
||||
m_id = Id
|
||||
m_d = D
|
||||
m_CanvX = CanvX
|
||||
m_CanvY = CanvY
|
||||
m_DimX = DimX
|
||||
m_DimY = DimY
|
||||
m_fill = Fill
|
||||
m_fill_opacity = FillOpacity
|
||||
m_stroke = Stroke
|
||||
m_stroke_opacity = StrokeOpacity
|
||||
LoadPath()
|
||||
End Sub
|
||||
|
||||
Public Sub LoadPath()
|
||||
' Carico la geometria
|
||||
m_CurrPath.Data = Geometry.Parse(d)
|
||||
' Carico il colore di sfondo
|
||||
SetBrushFromRGBString(m_fill, m_CurrPath.Fill)
|
||||
' Applico l'opacità della superificie
|
||||
m_CurrPath.Opacity = m_fill_opacity
|
||||
' Calcolo e applico la traslazione e la scalatura
|
||||
Dim myTransformGroup As New TransformGroup()
|
||||
Dim ScaleX As Double = m_CanvX / DimX
|
||||
Dim ScaleY As Double = m_CanvY / DimY
|
||||
Dim OffX As Double = (m_CanvX - Math.Min(ScaleX, ScaleY) * DimX) / 2
|
||||
Dim OffY As Double = (m_CanvY - Math.Min(ScaleX, ScaleY) * DimY) / 2
|
||||
myTransformGroup.Children.Add(New ScaleTransform(Math.Min(ScaleX, ScaleY), Math.Min(ScaleX, ScaleY)))
|
||||
myTransformGroup.Children.Add(New TranslateTransform(OffX, OffY))
|
||||
m_CurrPath.RenderTransform = myTransformGroup
|
||||
End Sub
|
||||
|
||||
Private Sub SetBrushFromRGBString(sFill As String, ByRef brFill As Brush)
|
||||
If String.IsNullOrEmpty(sFill) Then
|
||||
brFill = Brushes.DarkRed
|
||||
Return
|
||||
End If
|
||||
Dim s1 As String = sFill
|
||||
If s1.Contains("rgb") Then
|
||||
s1 = s1.Replace("rgb(", "")
|
||||
s1 = s1.Replace(")", "")
|
||||
Dim s2 As String = ""
|
||||
For Each s As String In s1.Split(",")
|
||||
s2 &= CInt(s).ToString("x2")
|
||||
Next
|
||||
brFill = New BrushConverter().ConvertFrom("#" & s2)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Module XMLReader
|
||||
|
||||
Public Sub ReadMyXML(FilePath As String, Canv As MyCanvas)
|
||||
'Create the XML Reader
|
||||
Dim m_xmlr As XmlTextReader = New XmlTextReader(FilePath)
|
||||
'Disable whitespace so that you don't have to read over whitespaces
|
||||
m_xmlr.WhitespaceHandling = WhitespaceHandling.None
|
||||
' Leggo la prima riga: '?xml' tag
|
||||
m_xmlr.Read()
|
||||
' Passo a leggere la successiva: 'svg' tag
|
||||
m_xmlr.Read()
|
||||
' Leggo gli attributi di questo tag (dimensioni)
|
||||
Dim ViewBoxDim = m_xmlr.GetAttribute("viewBox")
|
||||
Canv.ViewBoxDim = ViewBoxDim
|
||||
' Elaboro i dati per avere la scalatura del disegno
|
||||
Dim DimViewBox As String() = ViewBoxDim.ToString.Split(" ")
|
||||
Dim DimX As Integer = Math.Abs(CInt(DimViewBox(2))) + Math.Abs(CInt(DimViewBox(0)))
|
||||
Dim DimY As Integer = Math.Abs(CInt(DimViewBox(3))) + Math.Abs(CInt(DimViewBox(1)))
|
||||
|
||||
' Leggo in loop i tag: 'path'
|
||||
While Not m_xmlr.EOF
|
||||
m_xmlr.Read()
|
||||
If Not m_xmlr.IsStartElement() Then
|
||||
Continue While
|
||||
End If
|
||||
' recupero il valore dell'attributo 'id'
|
||||
Dim idAttribute = m_xmlr.GetAttribute("id")
|
||||
' recupero il valore dell'attributo 'd'
|
||||
Dim dAttribute = m_xmlr.GetAttribute("d")
|
||||
' recupero il valore dell'attributo 'fill'
|
||||
Dim fillAttribute = m_xmlr.GetAttribute("fill")
|
||||
' recupero il valore dell'attributo 'fill-opacity'
|
||||
Dim fillOpacityAttribute = m_xmlr.GetAttribute("fill-opacity")
|
||||
' recupero il valore dell'attributo 'stroke'
|
||||
Dim strokeAttribute = m_xmlr.GetAttribute("stroke")
|
||||
' recupero il valore dell'attributo 'stroke-opacity'
|
||||
Dim strokeOpacityAttribute = m_xmlr.GetAttribute("stroke-opacity")
|
||||
' recupero il valore dell'attributo 'stroke - Width'
|
||||
Dim strokeWidthAttribute = m_xmlr.GetAttribute("stroke-width")
|
||||
' carico l'elemento in lista solo se esiste un'immagine
|
||||
If Not String.IsNullOrEmpty(idAttribute) And Not String.IsNullOrEmpty(dAttribute) Then
|
||||
Dim fillOpacity As Double = 1 ' CDbl(fillOpacityAttribute)
|
||||
StringToDouble(fillOpacityAttribute, fillOpacity)
|
||||
Dim strokeOpacity As Double = 1 ' CDbl(strokeOpacityAttribute)
|
||||
StringToDouble(strokeOpacityAttribute, strokeOpacity)
|
||||
Canv.ListPath.Add(New MyPath(idAttribute, dAttribute, Canv.CurrCanvas.Width, Canv.CurrCanvas.Height, DimX, DimY, fillAttribute, fillOpacity, strokeAttribute, strokeOpacity))
|
||||
End If
|
||||
|
||||
End While
|
||||
' Libero il file dalla lettura
|
||||
m_xmlr.Close()
|
||||
' popolo la canvas con le Ptah che ho caricato
|
||||
Canv.LoadCanvas()
|
||||
End Sub
|
||||
|
||||
Public Sub WriteMyXML(FilePath As String, Canv As MyCanvas)
|
||||
|
||||
Dim _namespaceDefault As String = "http://www.w3.org/2000/svg"
|
||||
|
||||
Dim doc As New Xml.XmlDocument
|
||||
|
||||
Dim elm As System.Xml.XmlNode
|
||||
Dim elmSub As System.Xml.XmlNode
|
||||
Dim elmMain As Xml.XmlNode
|
||||
|
||||
doc = New Xml.XmlDocument
|
||||
|
||||
elmMain = doc.CreateElement("svg")
|
||||
elmSub = elmMain.Attributes.Append(doc.CreateAttribute("viewBox"))
|
||||
elmSub.Value = Canv.ViewBoxDim
|
||||
elmSub = elmMain.Attributes.Append(doc.CreateAttribute("xmlns"))
|
||||
elmSub.Value = _namespaceDefault
|
||||
|
||||
For Each itemPath As MyPath In Canv.ListPath
|
||||
elm = elmMain.AppendChild(doc.CreateElement("path"))
|
||||
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("id"))
|
||||
elmSub.Value = itemPath.id
|
||||
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("d"))
|
||||
elmSub.Value = itemPath.d
|
||||
|
||||
If Not String.IsNullOrEmpty(itemPath.fill) Then
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("fill"))
|
||||
elmSub.Value = itemPath.fill
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(itemPath.fill_opacity) Then
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("fill-opacity"))
|
||||
elmSub.Value = itemPath.fill_opacity.ToString(CultureInfo.InvariantCulture)
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(itemPath.stroke) Then
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke"))
|
||||
elmSub.Value = itemPath.stroke
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(itemPath.stroke_opacity) Then
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke-opacity"))
|
||||
elmSub.Value = itemPath.stroke_opacity.ToString(CultureInfo.InvariantCulture)
|
||||
End If
|
||||
|
||||
If Not String.IsNullOrEmpty(itemPath.stroke_width) Then
|
||||
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke-width"))
|
||||
elmSub.Value = itemPath.stroke_width.ToString(CultureInfo.InvariantCulture)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
doc.AppendChild(doc.CreateXmlDeclaration("1.0", "UTF-8", ""))
|
||||
doc.AppendChild(elmMain)
|
||||
doc.Save(FilePath)
|
||||
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
|
||||
#End Region ' Elementi per la gestione SVG
|
||||
+20
-1
@@ -117,7 +117,7 @@ Public Module SplitAuto
|
||||
End If
|
||||
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
||||
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then
|
||||
Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
|
||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||
Dim bIn As Boolean = False
|
||||
Dim bOut As Boolean = False
|
||||
@@ -129,6 +129,25 @@ Public Module SplitAuto
|
||||
If nRes = 0 Then
|
||||
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||
End If
|
||||
|
||||
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||
Mach.m_sLay = NAME_OUTLOOP And
|
||||
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
|
||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||
Dim bIn As Boolean = False
|
||||
Dim bOut As Boolean = False
|
||||
CanExtendSides(Mach, bIn, bOut)
|
||||
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
|
||||
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
|
||||
Mach.m_nInterf <> FMI_TYPE.LI
|
||||
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
|
||||
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
|
||||
Mach.m_nInterf <> FMI_TYPE.LO
|
||||
If nRes = 0 Then
|
||||
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||
End If
|
||||
End If
|
||||
' se trasformabile in taglio di separazione, verifico se lo è
|
||||
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
||||
|
||||
@@ -100,8 +100,14 @@
|
||||
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
|
||||
Height="25" Width="25">
|
||||
<Image Name="LayNbArrImg"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" Stretch="Uniform"/>
|
||||
</ToggleButton>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
+141
-13
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.Drawing
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SplitPageUC
|
||||
@@ -8,6 +9,9 @@ Public Class SplitPageUC
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Private ImageConverter As New ImageSourceConverter
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
||||
@@ -61,6 +65,9 @@ Public Class SplitPageUC
|
||||
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
|
||||
Private m_StartEndModifyOnIntCorner As Boolean = False
|
||||
|
||||
Private m_IsCtrlKeyDown As Boolean = False
|
||||
Private m_IsShiftKeyDown As Boolean = False
|
||||
|
||||
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
|
||||
PrevBtn.IsEnabled = False
|
||||
' Collego lista di oggetti a ListBox
|
||||
@@ -180,6 +187,9 @@ Public Class SplitPageUC
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
End If
|
||||
End If
|
||||
' leggo lo stato del bottone per la visualizzazione delle etichette
|
||||
LayNbArrTgBtn.IsChecked = (GetPrivateProfileInt(S_GENERAL, K_SHOWNBARROW, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
SetLayNbArrTgBtn_Click()
|
||||
End Sub
|
||||
|
||||
' preparo la lista delle lavorazioni da mostrare in interfaccia
|
||||
@@ -453,6 +463,10 @@ Public Class SplitPageUC
|
||||
|
||||
#End Region ' Bridge
|
||||
|
||||
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene_DoubleClick
|
||||
OnOffCut()
|
||||
End Sub
|
||||
|
||||
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à sola visualizzazione
|
||||
If Not m_bActive OrElse m_bShow Then Return
|
||||
@@ -564,6 +578,11 @@ Public Class SplitPageUC
|
||||
m_nDragInd = -1
|
||||
m_nDragType = 0
|
||||
m_nSelected = GDB_ID.NULL
|
||||
If Not IsNothing(MachiningLsBx.SelectedItem) Then
|
||||
MarkMachining(MachiningLsBx.SelectedItem.Ind, False)
|
||||
EgtDraw()
|
||||
End If
|
||||
MachiningLsBx.SelectedIndex = -1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -693,6 +712,11 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
|
||||
' se non attiva la modifica allora esco
|
||||
If m_bShow Then
|
||||
MachiningLsBx.SelectedIndex = -1
|
||||
Return
|
||||
End If
|
||||
If MachiningLsBx.SelectedItems.Count = 0 Then Return
|
||||
If MachiningLsBx.SelectedItems.Count = 1 Then m_bAreHomogeneous = True
|
||||
' creo lista ordinata dei selezionati
|
||||
@@ -733,6 +757,13 @@ Public Class SplitPageUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.MouseDoubleClick
|
||||
' se disabilitata la modifica allora esco
|
||||
If m_bShow Then Return
|
||||
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
|
||||
OnOffCut()
|
||||
End Sub
|
||||
|
||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||
MoveItem(-1)
|
||||
End Sub
|
||||
@@ -741,6 +772,25 @@ Public Class SplitPageUC
|
||||
MoveItem(1)
|
||||
End Sub
|
||||
|
||||
Private Sub LayNbArrTgBtn_Click() Handles LayNbArrTgBtn.Click
|
||||
SetLayNbArrTgBtn_Click()
|
||||
WritePrivateProfileString(S_GENERAL, K_SHOWNBARROW, If(LayNbArrTgBtn.IsChecked, "1", "0"), m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub SetLayNbArrTgBtn_Click()
|
||||
If LayNbArrTgBtn.IsChecked Then
|
||||
StatusOffNumbArrow(GDB_ST.ON_)
|
||||
LayNbArrTgBtn.ToolTip = "Hide"
|
||||
Dim Img As ImageSource = ImageConverter.ConvertFromString("pack://application:,,,/Resources/NewIcons/LightArrowOn.png")
|
||||
LayNbArrImg.Source = Img
|
||||
Else
|
||||
StatusOffNumbArrow(GDB_ST.OFF)
|
||||
LayNbArrTgBtn.ToolTip = "Show"
|
||||
Dim Img As ImageSource = ImageConverter.ConvertFromString("pack://application:,,,/Resources/NewIcons/LightArrowOff.png")
|
||||
LayNbArrImg.Source = Img
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MoveItem(direction As Integer)
|
||||
' Checking selected item
|
||||
If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then
|
||||
@@ -916,11 +966,31 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' ERRORE: questo evento non è eseguito!
|
||||
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.Escape Then
|
||||
' se sono in fase di creazione di un ponticello interrompo
|
||||
DeselectWJBridgesPart()
|
||||
'' DA FARE: quando seleziono Esc devo togliere deselezionare tutte le enità!
|
||||
'Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||
' If e.Key = Key.Escape Then
|
||||
' ' se sono in fase di creazione di un ponticello interrompo
|
||||
' DeselectWJBridgesPart()
|
||||
' EgtDeselectAll()
|
||||
' RemoveMarkAndNumbers()
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub MachiningLsBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyDown
|
||||
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
|
||||
m_IsCtrlKeyDown = True
|
||||
End If
|
||||
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
|
||||
m_IsShiftKeyDown = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_KeyUp(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyUp
|
||||
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
|
||||
m_IsCtrlKeyDown = False
|
||||
End If
|
||||
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
|
||||
m_IsShiftKeyDown = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1831,7 +1901,7 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||
' ------- VISUALIZZAZIONE -------
|
||||
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||
If m_bShow Then
|
||||
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
' recupero l'operazione successiva
|
||||
@@ -1914,22 +1984,22 @@ Public Class SplitPageUC
|
||||
NumberDirectionMachining(nI)
|
||||
Next
|
||||
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
' -------------------- Recupero le lavorazioni indicate come attive -- INIZIO --------------------
|
||||
Dim ActiveMachLst As New List(Of Integer)
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||
If ItemSplitMach.bIsActive Then ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||
Next
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
' -------------------- Recupero le lavorazioni indicate come attive -- FINE --------------------
|
||||
|
||||
' Preparo la lista degli Item
|
||||
ShowMachiningList()
|
||||
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
|
||||
' -------------------- Riattivo le lavorazioni precedenti -- INIZIO --------------------
|
||||
For Each Item As SplitMach In m_MachiningList
|
||||
' spengo tutte le lavorazioni disponibili
|
||||
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
||||
Next
|
||||
|
||||
' riattivo solo quelle indicate come attive
|
||||
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
||||
@@ -1942,7 +2012,7 @@ Public Class SplitPageUC
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
' -------------------- Riattivo le lavorazioni precedenti -- FINE --------------------
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
@@ -2140,6 +2210,33 @@ Public Class SplitPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OnOffCut()
|
||||
If MachiningLsBx.SelectedItems.Count = 1 Then
|
||||
Dim x As NameIdLsBxItem = DirectCast(MachiningLsBx.SelectedItems(0), NameIdLsBxItem)
|
||||
Dim nI As Integer = x.Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
x.bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
x.bIsActive = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
' recupero l'elenco degli elementi selezionati
|
||||
Dim ItemList As New List(Of NameIdLsBxItem)
|
||||
For Each Item As NameIdLsBxItem In MachiningLsBx.SelectedItems
|
||||
ItemList.Add(Item)
|
||||
Next
|
||||
VerifyHomogenousMachining(ItemList)
|
||||
' Abilitazione bottone Next
|
||||
EnableButtons()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyHomogenousMachining(ItemList As List(Of NameIdLsBxItem))
|
||||
If IsNothing(ItemList) OrElse ItemList.Count = 0 Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
@@ -2321,6 +2418,11 @@ Public Class SplitPageUC
|
||||
' Aggiungo a numero info con identificativo della lavorazione e viceversa
|
||||
EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId)
|
||||
EgtSetInfo(m_MachiningList(nI).m_nId, "NbrId", nNbrId)
|
||||
If Not LayNbArrTgBtn.IsChecked Then
|
||||
EgtSetStatus(nNbrId, GDB_ST.OFF)
|
||||
Else
|
||||
EgtSetStatus(nNbrId, GDB_ST.ON_)
|
||||
End If
|
||||
End If
|
||||
' Se taglio con lama, metto la direzione accanto al numero
|
||||
If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then
|
||||
@@ -2332,6 +2434,11 @@ Public Class SplitPageUC
|
||||
' Aggiungo a freccia info con identificativo della lavorazione e viceversa
|
||||
EgtSetInfo(nArrId, "MId", m_MachiningList(nI).m_nId)
|
||||
EgtSetInfo(m_MachiningList(nI).m_nId, "ArrId", nArrId)
|
||||
If Not LayNbArrTgBtn.IsChecked Then
|
||||
EgtSetStatus(nArrId, GDB_ST.OFF)
|
||||
Else
|
||||
EgtSetStatus(nArrId, GDB_ST.ON_)
|
||||
End If
|
||||
Else
|
||||
m_MachiningList(nI).m_nArrId = GDB_ID.NULL
|
||||
End If
|
||||
@@ -2448,6 +2555,27 @@ Public Class SplitPageUC
|
||||
EgtResetMark(nNbrId)
|
||||
EgtResetMark(nArrId)
|
||||
End If
|
||||
If Not LayNbArrTgBtn.IsChecked And Not bMark Then
|
||||
EgtSetStatus(nNbrId, GDB_ST.OFF)
|
||||
EgtSetStatus(nArrId, GDB_ST.OFF)
|
||||
Else
|
||||
EgtSetStatus(nNbrId, GDB_ST.ON_)
|
||||
EgtSetStatus(nArrId, GDB_ST.ON_)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub StatusOffNumbArrow(Status As GDB_ST)
|
||||
For Each Item As SplitMach In m_MachiningList
|
||||
Dim nOperId As Integer = Item.m_nId
|
||||
Dim nNbrId As Integer = Item.m_nNbrId
|
||||
Dim nArrId As Integer = Item.m_nArrId
|
||||
Dim nInd As Integer = m_MachiningList.IndexOf(Item)
|
||||
If nInd >= 0 AndAlso nInd < m_ItemList.Count AndAlso Not m_ItemList(nInd).IsSelected Then
|
||||
EgtSetStatus(nNbrId, Status)
|
||||
EgtSetStatus(nArrId, Status)
|
||||
End If
|
||||
Next
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub ColorNumberArrow(nI As Integer)
|
||||
|
||||
@@ -157,6 +157,8 @@ Module ConstGen
|
||||
' Info per identificazione gruppo pezzi
|
||||
Public Const INFO_REFGROUP As String = "RefGroup"
|
||||
Public Const INFO_COUNTERLY As String = "CounterPz"
|
||||
Public Const INFO_PARKIND As String = "ParkInd"
|
||||
Public Const INFO_PARKSTATUS As String = "ParkStatus"
|
||||
|
||||
' Contrassegno di progetto OmagCut
|
||||
Public Const NAME_PROJMARK As String = "OmagCut"
|
||||
|
||||
@@ -54,6 +54,9 @@ Module ConstIni
|
||||
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
|
||||
Public Const K_PRECISION As String = "Precision"
|
||||
Public Const K_QUITDRAWPAGE As String = "QuitDrawPage"
|
||||
Public Const K_SHOWNBARROW As String = "ShowNbArrow"
|
||||
Public Const K_SHOWEXPIREASSITANCE As String = "ShowExpireAssistance"
|
||||
Public Const K_ENABLEDXFPARK As String = "EnableDXFPark"
|
||||
|
||||
Public Const S_LANGUAGES As String = "Languages"
|
||||
Public Const K_LANGUAGE As String = "Language"
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
||||
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
||||
Public Const K_NAXES As String = "nAxes"
|
||||
Public Const K_RESETSTATUS As String = "ResetStatus"
|
||||
' Nuove variabili
|
||||
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
||||
Public Const K_XYJOG As String = "XYJog"
|
||||
@@ -181,6 +182,9 @@
|
||||
Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY"
|
||||
Public Const K_PHOTO_HQ_OFFSETX As String = "HQOffsetX"
|
||||
Public Const K_PHOTO_HQ_OFFSETY As String = "HQOffsetY"
|
||||
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 S_TOOLS As String = "Tools"
|
||||
Public Const K_DRILLBIT As String = "Drillbit"
|
||||
|
||||
@@ -23,6 +23,9 @@ Public Class ControlsMachineButtonUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
|
||||
Friend Shared m_OutLogTypeButton As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
@@ -76,6 +79,7 @@ Public Class ControlsMachineButtonUC
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
GetTypeButton(MachineButton)
|
||||
Next
|
||||
m_OutLogTypeButton = False
|
||||
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
@@ -87,6 +91,7 @@ Public Class ControlsMachineButtonUC
|
||||
'-------------------------------------------------------------------------------
|
||||
|
||||
Friend Sub GetTypeButton(CurrMachineButton As MachineButton)
|
||||
If Not m_OutLogTypeButton Then Return
|
||||
Dim BtnType As Type = CurrMachineButton.GetType
|
||||
If BtnType Is GetType(NoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
|
||||
@@ -750,8 +755,17 @@ Public MustInherit Class MachineButton
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
|
||||
' versione 2.6h1
|
||||
Dim sCurrTable As String = String.Empty
|
||||
Dim nCuttTable As Integer = 1
|
||||
EgtGetTableName(sCurrTable)
|
||||
If sCurrTable <> "MainTab" Then nCuttTable = 2
|
||||
EgtLuaSetGlobIntVar("CMD.TABLE", nCuttTable)
|
||||
|
||||
EgtLuaCallFunction("CmdString")
|
||||
' Leggo variabili
|
||||
|
||||
' Leggo variabili da file Lua
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
|
||||
@@ -53,14 +53,43 @@ Public Class ManualAxesMoveUC
|
||||
' Imposto check per considerare spessore lama
|
||||
L1SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
||||
L2SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
SetMachineInCurrPos()
|
||||
EgtDraw()
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||
End Sub
|
||||
|
||||
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
m_Timer.Stop()
|
||||
m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove = (L1SawThChBx.IsEnabled And L1SawThChBx.IsChecked) Or
|
||||
(L2SawThChBx.IsEnabled And L2SawThChBx.IsChecked)
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Function SetMachineInCurrPos() As Boolean
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return False
|
||||
' Recupero il nome degli assi macchina
|
||||
Dim sL1 As String = String.Empty
|
||||
Dim sL2 As String = String.Empty
|
||||
Dim sL3 As String = String.Empty
|
||||
Dim sR1 As String = String.Empty
|
||||
Dim sR2 As String = String.Empty
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesNames(sL1, sL2, sL3, sR1, sR2) Then Return False
|
||||
' Visualizzo macchina in posizione
|
||||
EgtSetAxisPos(sL1, dL1)
|
||||
EgtSetAxisPos(sL2, dL2)
|
||||
EgtSetAxisPos(sL3, dL3)
|
||||
EgtSetAxisPos(sR1, dR1)
|
||||
EgtSetAxisPos(sR2, dR2)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub UpdateAxesNames()
|
||||
Dim sL1 As String = String.Empty
|
||||
Dim sL2 As String = String.Empty
|
||||
@@ -125,11 +154,16 @@ Public Class ManualAxesMoveUC
|
||||
Private Sub Timer_tick()
|
||||
UpdateAxesNames()
|
||||
UpdateUseSawThickness()
|
||||
' Aggiorno posizione macchina in disegno
|
||||
SetMachineInCurrPos()
|
||||
' Aggiorno il disegno
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private m_MoveClicked As Boolean = False
|
||||
Private Sub XXBtn_Click(sender As Object, e As MouseButtonEventArgs) Handles L1Btn.PreviewMouseDown, L2Btn.PreviewMouseDown, L3Btn.PreviewMouseDown, R1Btn.PreviewMouseDown, R2Btn.PreviewMouseDown
|
||||
If e.ClickCount > 1 OrElse m_MoveClicked Then
|
||||
EgtOutLog(" → Hold on! Do not click compulsively.")
|
||||
Return
|
||||
End If
|
||||
m_MoveClicked = True
|
||||
@@ -216,6 +250,7 @@ Public Class ManualAxesMoveUC
|
||||
Private Sub SiemensMoveAxis(CurrentBtn As Button)
|
||||
' leggo se stato reset
|
||||
If Not m_CN.bResetState Then
|
||||
EgtOutLog("Reset status is 'False', is denied to execute file '\DirectCmd\AxesMove.lua'.")
|
||||
m_MoveClicked = False
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -530,6 +530,10 @@ Public Class SawTestUC
|
||||
ElseIf nWSide = MCH_SAW_WS.LEFT Then
|
||||
vtPerp = vtDir
|
||||
vtPerp.Rotate(Vector3d.Z_AX, +90)
|
||||
Else
|
||||
m_CurrProjPage.ClearMessage()
|
||||
' 91143 = Set machining side: right or left.
|
||||
m_CurrProjPage.SetInfoMessage(EgtMsg(91143))
|
||||
End If
|
||||
Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick
|
||||
Dim dLen2 As Double = m_dLen / 2
|
||||
|
||||
@@ -22,6 +22,9 @@ Public Class VacuumMachineButtonUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
|
||||
Friend m_OutLogTypeButton As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
@@ -73,8 +76,9 @@ Public Class VacuumMachineButtonUC
|
||||
End While
|
||||
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
GetTypeButton(MachineButton)
|
||||
OutLogTypeButton(MachineButton)
|
||||
Next
|
||||
m_OutLogTypeButton = False
|
||||
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
@@ -85,7 +89,8 @@ Public Class VacuumMachineButtonUC
|
||||
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
|
||||
'-------------------------------------------------------------------------------
|
||||
|
||||
Friend Sub GetTypeButton(CurrMachineButton As MachineButton)
|
||||
Friend Sub OutLogTypeButton(CurrMachineButton As MachineButton)
|
||||
If Not m_OutLogTypeButton Then Return
|
||||
Dim BtnType As Type = CurrMachineButton.GetType
|
||||
If BtnType Is GetType(NoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
|
||||
|
||||
@@ -1174,6 +1174,7 @@ Public Class DrawPageUC
|
||||
If m_ActiveComponentPage = Pages.CompoDimension And m_bInternalCompo Then Return
|
||||
' Se errore esco
|
||||
If Not m_bDrawOk Then Return
|
||||
|
||||
' Nome pezzo
|
||||
Dim sPartName As String = PartNameTxBx.Text
|
||||
' Leggo numero di pezzi da inserire
|
||||
@@ -1205,6 +1206,9 @@ Public Class DrawPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||
' Attivo il parcheggio dei pezzi Draw
|
||||
ActivateParkIndZero()
|
||||
|
||||
Else
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
DrawPage_Unloaded(sender, e)
|
||||
@@ -1239,6 +1243,24 @@ Public Class DrawPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ActivateParkIndZero()
|
||||
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello dei pezzi disegnati "0"
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
For Each ItemParkInd As ParkInd In ListParkInd
|
||||
If ItemParkInd.Ind = 0 Then
|
||||
ItemParkInd.Status = GDB_ST.ON_
|
||||
Else
|
||||
ItemParkInd.Status = GDB_ST.OFF
|
||||
End If
|
||||
Next
|
||||
' Aggiorno lo stato dei pezzi
|
||||
For Each Item As ParkInd In ListParkInd
|
||||
SelParkIndWD.SetStatusPartInParkInd(Item, False)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||
|
||||
+180
-64
@@ -38,6 +38,8 @@ Public Class ImportPageUC
|
||||
Private Const FT_TRF As Integer = 51
|
||||
' Costante per formato CUT
|
||||
Private Const FT_CUT As Integer = 52
|
||||
' Indice del parcheggio corrente
|
||||
Private NewParkInd As Integer = 0
|
||||
|
||||
' Indentificativo del pezzo selezionato
|
||||
Private m_nSelectedPart As Integer = GDB_ID.NULL
|
||||
@@ -82,11 +84,11 @@ Public Class ImportPageUC
|
||||
ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'Reset
|
||||
mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'mm
|
||||
inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'inch
|
||||
OrderListBtn.Content = EgtMsg( 90398) 'Dati Csv
|
||||
TopBtn.Content = EgtMsg( 90384) 'Indica Lato Sopra
|
||||
OrderListBtn.Content = EgtMsg(90398) 'Dati Csv
|
||||
TopBtn.Content = EgtMsg(90384) 'Indica Lato Sopra
|
||||
PartNumTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 15) 'Numero
|
||||
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati
|
||||
FiloTopBtn.Content = EgtMsg( 90400) 'Filo Top
|
||||
FiloTopBtn.Content = EgtMsg(90400) 'Filo Top
|
||||
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto
|
||||
EngraveBtn.Content = "Engrave"
|
||||
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
|
||||
@@ -98,7 +100,6 @@ Public Class ImportPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
' abilitazione importazione TRF
|
||||
m_bEnableTrf = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.TRF_IMPORT))
|
||||
@@ -160,7 +161,7 @@ Public Class ImportPageUC
|
||||
' Verifico esistenza Cad 2d
|
||||
GetPrivateProfileString(S_CAD2D, K_CAD2D_NAME, "", m_sCad2dName, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_CAD2D, K_CAD2D_EXEPATH, "", m_sCad2dPath, m_MainWindow.GetIniFile())
|
||||
Cad2dBtn.IsEnabled = My.Computer.FileSystem.FileExists( m_sCad2dPath)
|
||||
Cad2dBtn.IsEnabled = My.Computer.FileSystem.FileExists(m_sCad2dPath)
|
||||
|
||||
' Pulisco tutto
|
||||
ClearView()
|
||||
@@ -179,7 +180,7 @@ Public Class ImportPageUC
|
||||
UseClosedCurveBtn.Visibility = Windows.Visibility.Visible
|
||||
ResetBtn.Visibility = Windows.Visibility.Visible
|
||||
SideAngleBtn.Visibility = Windows.Visibility.Visible
|
||||
OrderListBtn.Visibility = If( m_bEnableOrderList, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||
OrderListBtn.Visibility = If(m_bEnableOrderList, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||
TopBtn.Visibility = Windows.Visibility.Visible
|
||||
PartNumberGrd.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
@@ -189,7 +190,7 @@ Public Class ImportPageUC
|
||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||
SideAngleBtn.Visibility = Windows.Visibility.Hidden
|
||||
OrderListBtn.Visibility = Windows.Visibility.Hidden
|
||||
TopBtn.Visibility = Windows.Visibility.Hidden
|
||||
TopBtn.Visibility = Windows.Visibility.Hidden
|
||||
PartNumberGrd.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
mmBtn.IsEnabled = True
|
||||
@@ -206,6 +207,8 @@ Public Class ImportPageUC
|
||||
PartNumTxBx.Text = "1"
|
||||
' disabilito ok
|
||||
OkBtn.IsEnabled = False
|
||||
' Azzero l'idice di parcheggio
|
||||
NewParkInd = 0
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGridData()
|
||||
@@ -456,7 +459,7 @@ Public Class ImportPageUC
|
||||
ElseIf DripDrillBtn.IsChecked() Then
|
||||
OnMouseDownSceneUnderDrill(e)
|
||||
ElseIf FiloTopBtn.IsChecked() Then
|
||||
OnMouseDownSceneFiloTop( e)
|
||||
OnMouseDownSceneFiloTop(e)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -586,14 +589,14 @@ Public Class ImportPageUC
|
||||
EgtDeselectObj(nId)
|
||||
EgtDeselectObj(nLayId)
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
||||
EgtRemoveInfo( nLayId, INFO_FILOTOP)
|
||||
EgtRemoveInfo( nLayId, INFO_OFFSET)
|
||||
EgtRemoveInfo( nLayId, INFO_DEPTH)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||
EgtRemoveInfo(nLayId, INFO_FILOTOP)
|
||||
EgtRemoveInfo(nLayId, INFO_OFFSET)
|
||||
EgtRemoveInfo(nLayId, INFO_DEPTH)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
||||
nEntId = EgtGetNext( nEntId)
|
||||
nEntId = EgtGetNext(nEntId)
|
||||
End While
|
||||
m_DeselectListHole.Add(nLayId)
|
||||
m_SelListHole.Remove(nLayId)
|
||||
@@ -602,16 +605,16 @@ Public Class ImportPageUC
|
||||
Dim nLayId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(nId, "ID", nLayId)
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||
EgtSelectObj( nId)
|
||||
EgtSelectObj( nLayId)
|
||||
EgtSetInfo( nLayId, INFO_FILOTOP, 1)
|
||||
EgtSetInfo( nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
|
||||
EgtSetInfo( nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||
EgtSelectObj(nId)
|
||||
EgtSelectObj(nLayId)
|
||||
EgtSetInfo(nLayId, INFO_FILOTOP, 1)
|
||||
EgtSetInfo(nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
|
||||
EgtSetInfo(nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
||||
nEntId = EgtGetNext( nEntId)
|
||||
nEntId = EgtGetNext(nEntId)
|
||||
End While
|
||||
m_SelListHole.Add(nLayId)
|
||||
m_DeselectListHole.Remove(nLayId)
|
||||
@@ -660,7 +663,7 @@ Public Class ImportPageUC
|
||||
' Ciclo sulle regioni
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
|
||||
While EntId <> GDB_ID.NULL
|
||||
If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
|
||||
If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
|
||||
EntId = EgtGetNext(EntId)
|
||||
End While
|
||||
RegionId = EgtGetNextName(PartId, NAME_REGION)
|
||||
@@ -856,20 +859,38 @@ Public Class ImportPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OrderListBtn_Click(sender As Object, e As RoutedEventArgs) Handles OrderListBtn.Click
|
||||
Dim DlgOrderList As New CompoCsvData( m_MainWindow)
|
||||
DlgOrderList.SetData( m_sOrder, m_sList)
|
||||
Dim DlgOrderList As New CompoCsvData(m_MainWindow)
|
||||
DlgOrderList.SetData(m_sOrder, m_sList)
|
||||
If DlgOrderList.ShowDialog() Then
|
||||
DlgOrderList.GetData( m_sOrder, m_sList)
|
||||
DlgOrderList.GetData(m_sOrder, m_sList)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
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()
|
||||
' Se import per pezzi piatti
|
||||
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||
' Eseguo importazione pezzi piatti
|
||||
LoadFlatParts()
|
||||
' altrimenti import per cornici
|
||||
|
||||
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello indicato
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
For Each ItemParkInd As ParkInd In ListParkInd
|
||||
If ItemParkInd.Ind = NewParkInd Then
|
||||
ItemParkInd.Status = GDB_ST.ON_
|
||||
Else
|
||||
ItemParkInd.Status = GDB_ST.OFF
|
||||
End If
|
||||
Next
|
||||
' Aggiorno lo stato dei pezzi
|
||||
For Each Item As ParkInd In ListParkInd
|
||||
SelParkIndWD.SetStatusPartInParkInd(Item, False)
|
||||
Next
|
||||
|
||||
' altrimenti import per cornici
|
||||
Else
|
||||
LoadFrame()
|
||||
End If
|
||||
@@ -879,6 +900,80 @@ Public Class ImportPageUC
|
||||
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
||||
End Sub
|
||||
|
||||
' Creo una immagine del progetto da importare salvato nel percorso di progetto "..\(#ProjInd)_ParkInd_(#ParkInd).png"
|
||||
Public Sub Print()
|
||||
' 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
|
||||
Dim dW As Integer = 120
|
||||
Dim dH As Integer = 120
|
||||
|
||||
If Not MainWindow.m_bShowSVGParkInd Then
|
||||
Try
|
||||
' Prendo l'immagine corrente per la stampa
|
||||
Dim colBackTopColor As Color3d = GetBackTopColor()
|
||||
Dim colBackBottomColor As Color3d = GetBackBottomColor()
|
||||
' 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
|
||||
' 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()
|
||||
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(sPath)
|
||||
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
|
||||
bitmap.Dispose()
|
||||
' la sposto in una BitmapImage
|
||||
Dim bitImage As New System.Windows.Media.Imaging.BitmapImage()
|
||||
bitImage.BeginInit()
|
||||
bitImage.StreamSource = stream
|
||||
bitImage.EndInit()
|
||||
' la sposto in un Visual Control
|
||||
Dim tmpImg As New Image
|
||||
tmpImg.BeginInit()
|
||||
tmpImg.Source = bitImage
|
||||
tmpImg.Stretch = Stretch.Uniform
|
||||
tmpImg.EndInit()
|
||||
' eseguo la stampa
|
||||
Catch
|
||||
' Rrror in executing print
|
||||
EgtOutLog(EgtMsg(50182))
|
||||
End Try
|
||||
Else
|
||||
' Assegno dei nomi ai pezzi (Da controllare bene se funzione sempre)...riassegno i nomi dopo?
|
||||
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||
Dim nIndex As Integer = 0
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
' recupero il primo layer del part
|
||||
Dim nIdLay As Integer = EgtGetFirstLayer(nIdPart)
|
||||
While nIdLay <> GDB_ID.NULL
|
||||
Dim nIdEnt As Integer = EgtGetFirstInGroup(nIdLay)
|
||||
While nIdEnt <> GDB_ID.NULL
|
||||
EgtSetName(nIdEnt, nIndex.ToString)
|
||||
nIdEnt = EgtGetNext(nIdEnt)
|
||||
nIndex = nIndex + 1
|
||||
End While
|
||||
nIdLay = EgtGetNextLayer(nIdLay)
|
||||
End While
|
||||
nIdPart = EgtGetNextPart(nIdPart)
|
||||
End While
|
||||
EgtExportSvg(GDB_ID.ROOT, SelParkIndWD.GetPathCurrProj() & NewParkInd.ToString & ".svg")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LoadFlatParts()
|
||||
' Cancello regioni di selezione dai pezzi
|
||||
Dim PartId As Integer = EgtGetFirstPart()
|
||||
@@ -951,21 +1046,36 @@ Public Class ImportPageUC
|
||||
If My.Computer.FileSystem.FileExists(sTmpFile) Then
|
||||
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||
End If
|
||||
|
||||
' Calcolo l'area dei pezzi inseriti
|
||||
Dim dNewArea As Double = 0
|
||||
Dim nId As Integer = nFirstId
|
||||
While nId <> GDB_ID.NULL
|
||||
' Definisco l'indice di parcheggio asssganto al pezzo
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
EgtSetInfo(nId, INFO_PARKIND, NewParkInd.ToString)
|
||||
' Imposto lo stato
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
' Salvo lo stato (per gestire la navigazione)
|
||||
EgtSetInfo(nId, INFO_PARKSTATUS, GDB_ST.ON_)
|
||||
End If
|
||||
dNewArea += GeomCalc.GetPartArea(nId)
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
' Nascondo tutti i pezzi inseriti (per evitare interferenze con pezzi in fase di parcheggio)
|
||||
nId = nFirstId
|
||||
Dim GlobBBox As New BBox3d
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim bboxTemp As New BBox3d
|
||||
EgtGetBBox(nId, 0, bboxTemp)
|
||||
GlobBBox.Add(bboxTemp)
|
||||
EgtSetStatus(nId, GDB_ST.OFF)
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
Dim x As Double = GlobBBox.DimX
|
||||
Dim Y As Double = GlobBBox.DimY
|
||||
|
||||
' Ciclo sui pezzi inseriti
|
||||
nId = nFirstId
|
||||
@@ -1002,7 +1112,12 @@ Public Class ImportPageUC
|
||||
' Imposto path di provenienza
|
||||
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
|
||||
' Inserisco in parcheggio
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
|
||||
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
|
||||
' Mantengo la posizione relativa tra i pezzi
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, x, Y)
|
||||
Else
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
|
||||
End If
|
||||
' Recupero Id di pezzo successivo
|
||||
Dim nNextId As Integer = EgtGetNextPart(nId)
|
||||
' Se richiesto posizionamento diretto, lo eseguo
|
||||
@@ -1425,8 +1540,9 @@ Public Class ImportPageUC
|
||||
If nType = GDB_TY.CRV_LINE Or nType = GDB_TY.CRV_ARC Or nType = GDB_TY.CRV_COMPO Then
|
||||
vCrvId.Add(nCrvId)
|
||||
End If
|
||||
ElseIf DripDrillBtn.IsChecked
|
||||
if nType = GDB_TY.CRV_ARC
|
||||
ElseIf DripDrillBtn.IsChecked Then
|
||||
|
||||
If nType = GDB_TY.CRV_ARC Then
|
||||
vCrvId.Add(nCrvId)
|
||||
End If
|
||||
End If
|
||||
@@ -1452,11 +1568,11 @@ Public Class ImportPageUC
|
||||
|
||||
Private Sub Cad2dBtn_Click(sender As Object, e As RoutedEventArgs) Handles Cad2dBtn.Click
|
||||
|
||||
Dim ProcsCad2d As Process() = Process.GetProcessesByName( m_sCad2dName)
|
||||
Dim ProcsCad2d As Process() = Process.GetProcessesByName(m_sCad2dName)
|
||||
If ProcsCad2d.Length() > 0 Then
|
||||
ShowWindow( ProcsCad2d(0).MainWindowHandle, 3)
|
||||
ShowWindow(ProcsCad2d(0).MainWindowHandle, 3)
|
||||
Else
|
||||
Process.Start( m_sCad2dPath)
|
||||
Process.Start(m_sCad2dPath)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1465,42 +1581,42 @@ End Class
|
||||
|
||||
Public Class IconListBoxItem
|
||||
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
Me.Name = String.Empty
|
||||
Me.PictureID = 0
|
||||
End Sub
|
||||
Sub New()
|
||||
Me.Name = String.Empty
|
||||
Me.PictureID = 0
|
||||
End Sub
|
||||
|
||||
Sub New(Name As String, PictureID As Integer)
|
||||
Me.Name = Name
|
||||
Me.PictureID = PictureID
|
||||
End Sub
|
||||
Sub New(Name As String, PictureID As Integer)
|
||||
Me.Name = Name
|
||||
Me.PictureID = PictureID
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
+4
-4
@@ -3,15 +3,15 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Title="OpenFile" Height="500.6" Width="426.6" WindowStyle="None"
|
||||
Title="OpenFile" Height="587.4" Width="500.6" WindowStyle="None"
|
||||
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
|
||||
Background="Transparent">
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal"
|
||||
HorizontalAlignment="Center">
|
||||
<ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto">
|
||||
<TextBlock Name="LicenseMsgTxBl" MaxWidth="340"
|
||||
<TextBlock Name="LicenseMsgTxBl" MaxWidth="425"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
Public Sub Init() Handles Me.Initialized
|
||||
IconTxBl.Text = "⚠️"
|
||||
LicenseTxBl.Text = "Warning" & vbCrLf & m_sTitle
|
||||
LicenseTxBl.Text = m_sTitle
|
||||
m_sMessage = m_sMessage.Replace("/n", "£")
|
||||
Dim sItems As String() = m_sMessage.Split("£")
|
||||
For Index As Integer = 0 To sItems.Count - 1
|
||||
|
||||
@@ -1265,7 +1265,7 @@ Public Class AlarmsPageUC
|
||||
System.Threading.Thread.Sleep(300)
|
||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||
' Creo MsgBox di attesa
|
||||
Dim MsgBoxStateInfo As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_DIRECTCUTPAGEUC + 41), EgtMsg(MSG_DIRECTCUTPAGEUC + 42), True, EgtMsgBox.Buttons.CANCEL, EgtMsgBox.Icons.NULL)
|
||||
Dim MsgBoxStateInfo As New EgtMsgBox(m_MainWindow, String.Format(EgtMsg(MSG_DIRECTCUTPAGEUC + 41), ToolForProbing.m_ToolName), EgtMsg(MSG_DIRECTCUTPAGEUC + 42), True, EgtMsgBox.Buttons.CANCEL, EgtMsgBox.Icons.NULL)
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
' Definisco flag tastatura
|
||||
Dim bProbingOk As Boolean = False
|
||||
|
||||
@@ -1662,7 +1662,9 @@ Public Class CurrentMachine
|
||||
Dim dToolDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
||||
' Confronto con massimo ammesso
|
||||
Return (dToolDiam <= dMaxSawDiamForProbe)
|
||||
Dim bOk As Boolean = dToolDiam <= dMaxSawDiamForProbe
|
||||
If Not bOk Then EgtOutLog("WARNING: Saw diameter to big for probing")
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function GetPrivateProfileMaterial(
|
||||
|
||||
@@ -61,7 +61,7 @@ Public Class MachiningDbPageUC
|
||||
StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)}
|
||||
RouFinStepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39)}
|
||||
ExtCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(MSG_COMBOBOXPARAM + 45)}
|
||||
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44)}
|
||||
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(90852)}
|
||||
|
||||
' Assegno array a combobox
|
||||
WorkSideCmBx.ItemsSource = WorkSide
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Name="LogoBrd" Background="Transparent">
|
||||
<Image Source="{DynamicResource LogoOmagImg}" Stretch="Uniform" Margin="1"/>
|
||||
<Image Source="../Resources/NewIcons/logo-OmCut.png" Stretch="Uniform" Margin="1"/>
|
||||
</Border>
|
||||
|
||||
<!-- ** Definizione della Grid delle tab ** -->
|
||||
|
||||
+24
-11
@@ -26,6 +26,8 @@ Class MainWindow
|
||||
' Variabile che definisce l'avvio forzato in modalità FRAME
|
||||
Friend m_OnlyFrame As Boolean = False
|
||||
|
||||
Public Shared m_bShowSVGParkInd As Boolean = True
|
||||
|
||||
' Dichiarazione delle Page UserControl
|
||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
||||
@@ -343,8 +345,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2606, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2606, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2612, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2612, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||
@@ -461,6 +463,7 @@ Class MainWindow
|
||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
||||
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||
EgtOutLog("Warning: Missing file 'TestWork.lua' in folder 'DirectCmd', buttun 'TEST' collapsed!")
|
||||
Else
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
||||
End If
|
||||
@@ -655,26 +658,36 @@ Class MainWindow
|
||||
|
||||
Dim sAssStatus As String = " discontinued"
|
||||
Dim nAssLeftDays As Integer
|
||||
' MESSAGGIO...
|
||||
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
|
||||
If nAssLeftDays > 30 Then
|
||||
If nAssLeftDays > 0 Then
|
||||
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
|
||||
ElseIf nAssLeftDays > 0 Then
|
||||
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||
'sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||
Else
|
||||
sAssStatus = "to be renewed by today"
|
||||
sAssStatus = "Expired"
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim bShowInfoAssistance As Boolean = True
|
||||
bShowInfoAssistance = (GetPrivateProfileInt(S_GENERAL, K_SHOWEXPIREASSITANCE, "1", GetIniFile) <> 0)
|
||||
' Or nAssLeftDays = 358
|
||||
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then
|
||||
Dim sMsg As String = EgtMsg(91141) ' Assistenza in scadenza /nContattare assistenza:/n
|
||||
If bShowInfoAssistance And ((nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28) Then
|
||||
' 91145=Avviso importante
|
||||
Dim sMsg_Title As String = EgtMsg(91145)
|
||||
' 91146=Il contratto di aggiornamento della licenza in uso scadrà tra {0} giorni./n
|
||||
Dim sMsg_AssStatus As String = String.Format(EgtMsg(91146), nAssLeftDays.ToString())
|
||||
' 91147=Se desiderate rimanere aggiornati e continuare ad usufruire dei benefici del servizio, vi invitiamo a contattare la nostra assistenza al seguente indirizzo:/n
|
||||
Dim sMsg_RefAssistance As String = EgtMsg(91147)
|
||||
Dim sAssistance As String = String.Empty
|
||||
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
|
||||
Dim sItems As String() = sAssistance.Split(","c)
|
||||
For Each Item As String In sItems
|
||||
sMsg &= " → " & Item.Trim & " /n"
|
||||
sMsg_RefAssistance &= " → " & Item.Trim & " /n"
|
||||
Next
|
||||
Dim MyLicWn As New LicenseWindow(Me, sMsg, "Assistance " & sAssStatus)
|
||||
' 91148=Grazie per la vostra collaborazione.
|
||||
Dim sMsg_ThankYou As String = EgtMsg(91148)
|
||||
Dim MyLicWn As New LicenseWindow(Me, sMsg_AssStatus & sMsg_RefAssistance & sMsg_ThankYou, sMsg_Title)
|
||||
MyLicWn.WindowStartupLocation = WindowStartupLocation.CenterOwner
|
||||
MyLicWn.Show()
|
||||
End If
|
||||
|
||||
@@ -1326,7 +1339,7 @@ Class MainWindow
|
||||
If m_OnlyFrame Then
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
m_ActivePage <> Pages.RawPart And m_ActivePage <> Pages.DirectCut And m_ActivePage <> Pages.Simulation Then
|
||||
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91142), EgtMsg(91143), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91141), EgtMsg(91142), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
'' Gestione stato FastGrid
|
||||
'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject()
|
||||
' Cancello progetto salvato con nome da file ini
|
||||
|
||||
@@ -22,7 +22,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagCUT")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2024 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.6.6.2")>
|
||||
<Assembly: AssemblyFileVersion("2.6.6.2")>
|
||||
<Assembly: AssemblyVersion("2.6.12.1")>
|
||||
<Assembly: AssemblyFileVersion("2.6.12.1")>
|
||||
|
||||
+231
-73
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports EgtWPFLib.EgtMsgBox
|
||||
Imports OmagCUT.CN_generico
|
||||
|
||||
Public Class CNCommunication
|
||||
@@ -240,6 +241,17 @@ Public Class CNCommunication
|
||||
m_bInInches = (GetPrivateProfileInt(S_AXES, K_ININCHES, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
End Sub
|
||||
|
||||
Private Sub KillSimensCom(sProcessName As String)
|
||||
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
||||
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
||||
For Each proc As System.Diagnostics.Process In pList
|
||||
If proc.ProcessName.ToString = sAppName Then
|
||||
proc.Kill()
|
||||
EgtOutLog("ProcessKill : " & """" & sProcessName & """")
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub InitCn()
|
||||
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
@@ -377,6 +389,9 @@ Public Class CNCommunication
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.VacuumOff, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_BYPASSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
|
||||
' ver 2.6i1 : nuova gestione SiemensONE
|
||||
GetPrivateProfileString(S_NCDATA, K_RESETSTATUS, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.ResetStatus, sVal)
|
||||
|
||||
' nuove variabili: stato dei nuovi pulsanti
|
||||
nVal = GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile())
|
||||
@@ -407,8 +422,9 @@ Public Class CNCommunication
|
||||
EgtOutLog("Error starting NC communication : " & ex.Message)
|
||||
End Try
|
||||
|
||||
'' Per forzare la lettura delle variabili siemens di configurazione
|
||||
'm_nNCType = 3
|
||||
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
|
||||
' m_nNCType = 3
|
||||
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
|
||||
|
||||
Select Case m_nNCType
|
||||
Case 0 'Debug
|
||||
@@ -434,33 +450,27 @@ Public Class CNCommunication
|
||||
Try
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
|
||||
Dim sArg As String = "-start """ & m_sCNSiemensPath & """"
|
||||
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
KillSimensCom(m_sCNSiemensHMIPath)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
If m_CN.m_IsSiemensOne Then
|
||||
|
||||
' ' Creo l'abbonamento delle seguenti varibili che saranno sempre lette in ciclo dal Siemenscomm
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
|
||||
' ' stati bottoni ventose
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac), VarType.TInteger, 1)
|
||||
' ' stati porte
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed), VarType.TInteger, 2)
|
||||
' ' ventose
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
' ' stati bottoni parte 2
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.CBAxes), VarType.TInteger, 4)
|
||||
' ' ampere e ampere override
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Spindle), VarType.TDouble, 0)
|
||||
' m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
|
||||
|
||||
' Leggo tutte le varaibili che sono state caricate nel percorso [NcData] del file *.ini
|
||||
Dim nIndexArrayBool As Integer = 0
|
||||
Dim nIndexArrayInt As Integer = 0
|
||||
Dim nIndexArrayLong As Integer = 0
|
||||
Dim nIndexArrayDoub As Integer = 0
|
||||
Dim nIndexArrayStr As Integer = 0
|
||||
' Creo un vettore che mi permetta di risalire a cose contiene ogni vettore FLAG (di tipo Enum)
|
||||
' lista che associa Indice del vettore al nome (per associazioni Bit a Bit)
|
||||
Dim ListIndexToVar As New List(Of IndexArrayToBit)
|
||||
' Creo un vettore che mi permetta di risalire a cosa contiene ogni vettore FLAG (di tipo Enum)
|
||||
For ItemIndex As Integer = 0 To m_CN.m_szCnDataVar.Count - 1
|
||||
' escludo i Flag 'Comm' e 'Refresh'
|
||||
If ItemIndex = CnData.Comm Or ItemIndex = CnData.Refresh Then
|
||||
@@ -478,7 +488,12 @@ Public Class CNCommunication
|
||||
End If
|
||||
nVarType = VarType.TBoolean
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayBool)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayBool, ItemIndex, nVarType))
|
||||
Dim NewRefFlafSiemens As RefereceFlagSimens = New RefereceFlagSimens(nIndexArrayBool, ItemIndex, nVarType)
|
||||
If sItem.Count = 3 Then
|
||||
' forzo la lettura della variabile di default (ignoro lo stato letto da CN)
|
||||
NewRefFlafSiemens.DefaultValue = sItem(2)
|
||||
End If
|
||||
ListReferenceIndex.Add(NewRefFlafSiemens)
|
||||
nIndexArrayBool += 1
|
||||
Case 1
|
||||
If nIndexArrayInt > 14 Then
|
||||
@@ -512,6 +527,40 @@ Public Class CNCommunication
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayStr)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayStr, ItemIndex, nVarType))
|
||||
nIndexArrayStr += 1
|
||||
Case 5
|
||||
If nIndexArrayInt > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
' verifico se devo riempire un vettore con bit
|
||||
Dim sSubItem As String() = sItem(1).Split("."c)
|
||||
' //My. name. Is Bond._James Bond!
|
||||
Dim sVarName = String.Join(".", sSubItem.Take(sSubItem.Length - 1)) ' //My. name. Is Bond
|
||||
Dim sIndexBit = sSubItem.Last() ' //_James Bond!
|
||||
If sSubItem.Count > 1 And IsNumeric(sIndexBit) Then
|
||||
Dim bFound As Boolean = False
|
||||
Dim nIndexArrayInt_1 As Integer = nIndexArrayInt
|
||||
For Each VarSiemens As IndexArrayToBit In ListIndexToVar
|
||||
If VarSiemens.sNameVar.Trim = sVarName.Trim Then
|
||||
nIndexArrayInt_1 = VarSiemens.nIndex
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
nVarType = VarType.TInteger
|
||||
m_CN.DVariables_Read_Subscription(sVarName, nVarType, nIndexArrayInt_1)
|
||||
Dim NewRefFlafSiemens As RefereceFlagSimens = New RefereceFlagSimens(nIndexArrayInt_1, ItemIndex, nVarType, sIndexBit)
|
||||
If sItem.Count = 3 Then
|
||||
' forzo la lettura della variabile di default (ignoro lo stato letto da CN)
|
||||
NewRefFlafSiemens.DefaultValue = sItem(2)
|
||||
End If
|
||||
ListReferenceIndex.Add(NewRefFlafSiemens)
|
||||
If Not bFound Then
|
||||
nIndexArrayInt += 1
|
||||
ListIndexToVar.Add(New IndexArrayToBit(nIndexArrayInt_1, sVarName.Trim))
|
||||
End If
|
||||
Else
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è inidicato il bit associato")
|
||||
End If
|
||||
Case Else
|
||||
If nIndexArrayInt > 14 Then
|
||||
Continue For
|
||||
@@ -522,6 +571,8 @@ Public Class CNCommunication
|
||||
nIndexArrayInt += 1
|
||||
End Select
|
||||
End If
|
||||
Else
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è indicato il tipo (0→Bool,1→Int,2→Long,3→Double,4→String,5→Bit)")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -529,6 +580,7 @@ Public Class CNCommunication
|
||||
|
||||
' Recupero il perocorso delle variabili PLC
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||
|
||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
End If
|
||||
@@ -1056,6 +1108,68 @@ Public Class CNCommunication
|
||||
'Laser = 16384
|
||||
End Enum
|
||||
|
||||
#Region "MASCHERA per conttrollo Bit a Bit"
|
||||
<Flags()>
|
||||
Public Enum Mask As Integer
|
||||
bit_Err = -1
|
||||
bit_0 = &H1 ' 1
|
||||
bit_1 = &H2 ' 2
|
||||
bit_2 = &H4 ' 4
|
||||
bit_3 = &H8 ' 8
|
||||
bit_4 = &H10 ' 16
|
||||
bit_5 = &H20 ' 32
|
||||
bit_6 = &H40 ' 64
|
||||
bit_7 = &H80 ' 128
|
||||
bit_8 = &H100 ' 256
|
||||
bit_9 = &H200 ' 512
|
||||
bit_10 = &H400 ' 1024
|
||||
bit_11 = &H800 ' 2048
|
||||
bit_12 = &H1000 ' 4096
|
||||
bit_13 = &H2000 ' 8192
|
||||
bit_14 = &H4000 ' 16384
|
||||
bit_15 = &H8000 ' 32768
|
||||
End Enum
|
||||
|
||||
Public Function GetMaskByBit(IndexBit As Integer) As Mask
|
||||
Dim Bit_ As Mask = Mask.bit_Err
|
||||
Select Case IndexBit
|
||||
Case 0
|
||||
Bit_ = Mask.bit_0
|
||||
Case 1
|
||||
Bit_ = Mask.bit_1
|
||||
Case 2
|
||||
Bit_ = Mask.bit_2
|
||||
Case 3
|
||||
Bit_ = Mask.bit_3
|
||||
Case 4
|
||||
Bit_ = Mask.bit_4
|
||||
Case 5
|
||||
Bit_ = Mask.bit_5
|
||||
Case 6
|
||||
Bit_ = Mask.bit_6
|
||||
Case 7
|
||||
Bit_ = Mask.bit_7
|
||||
Case 8
|
||||
Bit_ = Mask.bit_8
|
||||
Case 9
|
||||
Bit_ = Mask.bit_9
|
||||
Case 10
|
||||
Bit_ = Mask.bit_10
|
||||
Case 11
|
||||
Bit_ = Mask.bit_11
|
||||
Case 12
|
||||
Bit_ = Mask.bit_12
|
||||
Case 13
|
||||
Bit_ = Mask.bit_13
|
||||
Case 14
|
||||
Bit_ = Mask.bit_14
|
||||
Case 15
|
||||
Bit_ = Mask.bit_15
|
||||
End Select
|
||||
Return Bit_
|
||||
End Function
|
||||
#End Region ' Maschera per controllo Bit a Bit
|
||||
|
||||
Public Function IsSetAll(value As Integer, flag As Integer) As Boolean
|
||||
' somma Bit a Bit
|
||||
Return ((value And flag) = flag)
|
||||
@@ -1071,7 +1185,7 @@ Public Class CNCommunication
|
||||
|
||||
m_MachineStatus.DisplaySpeed()
|
||||
|
||||
m_MachineStatus.DisplayPower()
|
||||
'm_MachineStatus.DisplayPower()
|
||||
|
||||
m_MachineStatus.DisplayVar()
|
||||
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
|
||||
@@ -1104,74 +1218,48 @@ Public Class CNCommunication
|
||||
End If
|
||||
End If
|
||||
|
||||
' lettura delle variabili abbonate
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
|
||||
' ' lettura variabili stati mancanti su Siemens
|
||||
' Dim nVarValue As Integer = m_CN.n_data(0)
|
||||
' EgtOutLog("Variabile PLC control addr: " & 1 & " value: " & nVarValue)
|
||||
' m_CN.bSpindleState = IsSetAll(nVarValue, ControlStates.Spindle)
|
||||
' m_CN.bLaserTracState = IsSetAll(nVarValue, ControlStates.LaserTrac)
|
||||
' m_CN.bCoolantState = IsSetAll(nVarValue, ControlStates.Coolant)
|
||||
' m_CN.bInternalCoolantState = IsSetAll(nVarValue, ControlStates.InternalCoolant)
|
||||
' m_CN.bExternCoolantState = IsSetAll(nVarValue, ControlStates.ExternCoolant)
|
||||
' m_CN.bCBAxesState = IsSetAll(nVarValue, ControlStates.CAxis)
|
||||
' m_CN.bAirBlowState = IsSetAll(nVarValue, ControlStates.AirBlow)
|
||||
' m_CN.bHomeState = IsSetAll(nVarValue, ControlStates.Home)
|
||||
' m_CN.bTableUpState = IsSetAll(nVarValue, ControlStates.TableUp)
|
||||
' m_CN.bTableDownState = IsSetAll(nVarValue, ControlStates.TableDown)
|
||||
' m_CN.bLimitZState = IsSetAll(nVarValue, ControlStates.LimitZ)
|
||||
' m_CN.b5AxesState = IsSetAll(nVarValue, ControlStates.Axis5)
|
||||
|
||||
'nVarValue = m_CN.n_data(1)
|
||||
''EgtOutLog("Variabile PLC vacuum addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac) & " value: " & nVarValue)
|
||||
'm_CN.bVacuumUp = IsSetAll(nVarValue, VacuumStates.VacuumUp)
|
||||
'm_CN.bVacuumDown = IsSetAll(nVarValue, VacuumStates.VacuumDown)
|
||||
'm_CN.bVacuum2Up = IsSetAll(nVarValue, VacuumStates.Vacuum2Up)
|
||||
'm_CN.bVacuum2Down = IsSetAll(nVarValue, VacuumStates.Vacuum2Down)
|
||||
'm_CN.bVacuum1State = IsSetAll(nVarValue, VacuumStates.Vacuum1State)
|
||||
'm_CN.bVacuum2State = IsSetAll(nVarValue, VacuumStates.Vacuum2State)
|
||||
'm_CN.bVacuum3State = IsSetAll(nVarValue, VacuumStates.Vacuum3State)
|
||||
'm_CN.bVacuum4State = IsSetAll(nVarValue, VacuumStates.Vacuum4State)
|
||||
'm_CN.bVacuum5State = IsSetAll(nVarValue, VacuumStates.Vacuum5State)
|
||||
'm_CN.bVacuum6State = IsSetAll(nVarValue, VacuumStates.Vacuum6State)
|
||||
'm_CN.bOpenAllState = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State And m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
|
||||
'm_CN.bCloseAllState = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State And Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
|
||||
'm_CN.bOpen123State = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State)
|
||||
'm_CN.bOpen456State = (m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
|
||||
'm_CN.bClose123State = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State)
|
||||
'm_CN.bClose456State = (Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
|
||||
'm_CN.bBlowState = IsSetAll(nVarValue, VacuumStates.AirBlow)
|
||||
'm_CN.bVacuumOn = IsSetAll(nVarValue, VacuumStates.VacuumOn)
|
||||
'm_CN.bVacuumOff = IsSetAll(nVarValue, VacuumStates.VacuumOff)
|
||||
'm_CN.bBypassState = IsSetAll(nVarValue, VacuumStates.BypassState)
|
||||
'
|
||||
'nVarValue = m_CN.n_data(2)
|
||||
''EgtOutLog("Variabile PLC door addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed) & " value: " & nVarValue)
|
||||
'm_CN.nDoorClosedState = nVarValue
|
||||
'
|
||||
'nVarValue = m_CN.n_data(4)
|
||||
''EgtOutLog("Variabile PLC control 2 addr: " & 3 & " value: " & nVarValue)
|
||||
'm_CN.bLaserState = IsSetAll(nVarValue, ControlStates2.Laser)
|
||||
'm_CN.bHsm = IsSetAll(nVarValue, ControlStates2.Hsm)
|
||||
'm_CN.bResetState = IsSetAll(nVarValue, ControlStates2.ResetState)
|
||||
'm_CN.bFeedHold = IsSetAll(nVarValue, ControlStates2.FeedHold)
|
||||
'm_CN.bSpeedHold = IsSetAll(nVarValue, ControlStates2.SpindleHold)
|
||||
|
||||
'------------ SINUMERIK ONE ----------------------------------------------
|
||||
For IndxLst As Integer = 0 To ListReferenceIndex.Count - 1
|
||||
Dim nType As Integer = ListReferenceIndex(IndxLst).TypeArray
|
||||
Dim nFlag As Integer = ListReferenceIndex(IndxLst).FlagIndex
|
||||
Dim nIndex As Integer = ListReferenceIndex(IndxLst).SiemnesArrayIndex
|
||||
Dim nIndexBit As Integer = ListReferenceIndex(IndxLst).IndexBit
|
||||
Dim sDefaultValue As String = ListReferenceIndex(IndxLst).DefaultValue
|
||||
Dim b_temp As Boolean = False
|
||||
Dim n_temp As Boolean = 0
|
||||
Dim n_temp As Integer = 0
|
||||
Dim l_temp As Long = 0.0
|
||||
Dim d_temp As Double = 0.0
|
||||
' leggo il valore caricato
|
||||
Select Case nType
|
||||
Case VarType.TBoolean
|
||||
b_temp = m_CN.b_data(nIndex)
|
||||
If Not String.IsNullOrEmpty(sDefaultValue) Then
|
||||
' ver 2.6i1
|
||||
Try
|
||||
b_temp = CBool(sDefaultValue)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Default boolean value of flag " & nFlag.ToString & " is not Boolean, verify the form: True or true or 1, False or false or 0")
|
||||
b_temp = m_CN.b_data(nIndex)
|
||||
End Try
|
||||
Else
|
||||
b_temp = m_CN.b_data(nIndex)
|
||||
End If
|
||||
Case VarType.TInteger
|
||||
n_temp = m_CN.n_data(nIndex)
|
||||
' VENTOSE: lettura dato da intero Bit a Bit (ver_2.6h1), ritorno un Boolean
|
||||
If Not String.IsNullOrEmpty(sDefaultValue) Then
|
||||
' ver 2.6i1
|
||||
Try
|
||||
b_temp = CBool(sDefaultValue)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Default bit value of flag " & nFlag.ToString & " is not Boolean, verify the form: True or true or 1, False or false or 0")
|
||||
b_temp = ReadBit(nIndexBit, n_temp)
|
||||
End Try
|
||||
Else
|
||||
b_temp = ReadBit(nIndexBit, n_temp)
|
||||
End If
|
||||
Case VarType.TLong
|
||||
l_temp = m_CN.l_data(nIndex)
|
||||
Case VarType.TDouble
|
||||
@@ -1196,6 +1284,8 @@ Public Class CNCommunication
|
||||
Else
|
||||
m_nCountRefresh = m_nCountRefresh + 1
|
||||
End If
|
||||
Case CN_generico.CnData.Power
|
||||
m_CN.d_spindle_power = d_temp
|
||||
Case CN_generico.CnData.Spindle ' (7) Stato rotazione mandrino
|
||||
m_CN.bSpindleState = b_temp
|
||||
Case CN_generico.CnData.Coolant ' (8) Stato acqua
|
||||
@@ -1287,6 +1377,8 @@ Public Class CNCommunication
|
||||
Case CN_generico.CnData.nAxes ' (55)
|
||||
m_CN.n_index_is_G24_active = nIndex
|
||||
m_CN.b5AxesState = b_temp
|
||||
Case CN_generico.CnData.ResetStatus ' (56)
|
||||
m_CN.bResetState = b_temp
|
||||
|
||||
End Select
|
||||
Next
|
||||
@@ -1294,6 +1386,8 @@ Public Class CNCommunication
|
||||
|
||||
End If
|
||||
|
||||
m_MachineStatus.DisplayPower()
|
||||
|
||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
@@ -1383,6 +1477,14 @@ Public Class CNCommunication
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function ReadBit(IndexBit As Integer, Val As Integer) As Boolean
|
||||
If IndexBit < 0 Then Return False
|
||||
Dim _mask = GetMaskByBit(IndexBit)
|
||||
If _mask = Mask.bit_Err Then Return False
|
||||
If (Val And _mask) = 0 Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
||||
Return m_CN.SetProgramMainOrSub(bMain)
|
||||
End Function
|
||||
@@ -1390,6 +1492,11 @@ Public Class CNCommunication
|
||||
Friend Function SendProgram(ByVal sCncPath As String, ByVal nNumProg As Integer,
|
||||
Optional bActivate As Boolean = True) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
' m_nNCType = 2
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
|
||||
' Download programma
|
||||
If m_MainWindow.m_bNCLink Then
|
||||
bOk = (m_nNCType > 0)
|
||||
@@ -1423,7 +1530,7 @@ Public Class CNCommunication
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
|
||||
EgtOutLog("Download_NC_prog(" & sCncPath & ", " & sNumProg.ToString & ")")
|
||||
' -------------- START DOWNLOAD --------------
|
||||
TimeSpanInit()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
@@ -1600,6 +1707,9 @@ Public Class RefereceFlagSimens
|
||||
Private m_SiemnesArrayIndex As Integer
|
||||
Private m_FlagIndex As Integer
|
||||
Private m_TypeArray As Integer
|
||||
' Opzionale
|
||||
Private m_IndexBit As Integer = -1
|
||||
Private m_DefaultValue As String = ""
|
||||
|
||||
Public Property SiemnesArrayIndex As Integer
|
||||
Get
|
||||
@@ -1628,10 +1738,58 @@ Public Class RefereceFlagSimens
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IndexBit As String
|
||||
Get
|
||||
Return m_IndexBit
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_IndexBit = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DefaultValue As String
|
||||
Get
|
||||
Return m_DefaultValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_DefaultValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(IndArray As Integer, Flag As Integer, nType As Integer)
|
||||
m_SiemnesArrayIndex = IndArray
|
||||
m_FlagIndex = Flag
|
||||
m_TypeArray = nType
|
||||
End Sub
|
||||
|
||||
Sub New(IndArray As Integer, Flag As Integer, nType As Integer, nIndBit As Integer)
|
||||
m_SiemnesArrayIndex = IndArray
|
||||
m_FlagIndex = Flag
|
||||
m_TypeArray = nType
|
||||
m_IndexBit = nIndBit
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IndexArrayToBit
|
||||
|
||||
Private m_nIndex As Integer = 0
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sNameVar As String = ""
|
||||
Public ReadOnly Property sNameVar As String
|
||||
Get
|
||||
Return m_sNameVar
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Index As Integer, NameVar As String)
|
||||
m_nIndex = Index
|
||||
m_sNameVar = NameVar
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -228,7 +228,7 @@ Public Class CN_Siemens
|
||||
Public Overrides Sub DVariables_Read_Subscription(VarAddr As String, ParType As Short, Index As Integer)
|
||||
' Ricevo il percorso della varibile, il tipo
|
||||
Dim n_ret As Short = Read_subscription(VarAddr, ParType, Index)
|
||||
'EgtOutLog("CN SIEMENS Dopo lettura abbonamento")
|
||||
EgtOutLog(" ABBONAMENTO (Esito: " & n_ret.ToString & ") -> Address: " & VarAddr & ", Type: " & ParType.ToString & ", Index: " & Index.ToString)
|
||||
End Sub
|
||||
|
||||
'
|
||||
|
||||
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
||||
Public Const MAX_VAR As Short = 100
|
||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||
Public Const MAX_TOOLS As Short = 100
|
||||
Public Const NUM_DATA = 56 ' Numero di dati del CN (Speed,Feed,...)
|
||||
Public Const NUM_DATA = 57 ' Numero di dati del CN (Speed,Feed,...)
|
||||
|
||||
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
||||
|
||||
@@ -72,6 +72,8 @@ Public MustInherit Class CN_generico
|
||||
EnablePC = 54
|
||||
|
||||
nAxes = 55
|
||||
|
||||
ResetStatus = 56
|
||||
End Enum
|
||||
|
||||
Public Enum Type As Short
|
||||
|
||||
+5
-6
@@ -603,16 +603,15 @@ Module M_MMFiles
|
||||
'EgtOutLog("Write_Nc_var start dell'm_mmFiles")
|
||||
SiemensSend.n_Command = CMD.CMD_Read_NC_subscription
|
||||
SiemensSend.sz_string_2 = VarAddr ' indirizzo su CN dell' oggetto da scrivere
|
||||
EgtOutLog(" Sottoscrivo lettura di '" & VarAddr & "'")
|
||||
EgtOutLog(" → Sottoscrivo lettura di '" & VarAddr & "'")
|
||||
SiemensSend.n_param1 = Index ' tipo di dato da scrivere
|
||||
EgtOutLog(" Indice del vettore associato '" & Index & "'")
|
||||
EgtOutLog(" Indice del vettore associato '" & Index & "'")
|
||||
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
|
||||
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
|
||||
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
|
||||
execute_command()
|
||||
m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message = SiemensRet.sz_interf_error_message
|
||||
|
||||
EgtOutLog("sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
|
||||
EgtOutLog("n_result: " & SiemensRet.n_result)
|
||||
EgtOutLog(" sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
|
||||
EgtOutLog(" n_result: " & SiemensRet.n_result)
|
||||
Return SiemensRet.n_result
|
||||
End Function
|
||||
|
||||
|
||||
+2
-2
@@ -1297,14 +1297,14 @@ Namespace Num
|
||||
End Function
|
||||
|
||||
Function VerifyBusy() As eStateType
|
||||
For I As Integer = 0 To 50
|
||||
For I As Integer = 0 To 150
|
||||
If global_state <> eStateType.READY Then
|
||||
System.Threading.Thread.Sleep(SLEEP_TIME)
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
EgtOutLog("eStateType: " & global_state.ToString & " -- if eStateType=0 it means READY")
|
||||
Return global_state
|
||||
|
||||
End Function
|
||||
|
||||
@@ -180,6 +180,9 @@
|
||||
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
||||
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CadCuts\SelParkIndWD.xaml.vb">
|
||||
<DependentUpon>SelParkIndWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CAM\CamPolishing.vb" />
|
||||
<Compile Include="DirectCuts\ControlsDirectCutUC.xaml.vb">
|
||||
<DependentUpon>ControlsDirectCutUC.xaml</DependentUpon>
|
||||
@@ -455,6 +458,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CadCuts\SelParkIndWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DirectCuts\ControlsDirectCutUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -1376,8 +1383,19 @@
|
||||
<Resource Include="Resources\NewIcons\Move-Spot-Reg.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %282%29.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %283%29.png" />
|
||||
<Resource Include="Resources\NewIcons\RawHeight.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\LightArrowOff.png" />
|
||||
<Resource Include="Resources\NewIcons\LightArrowOn.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale -->
|
||||
@@ -72,7 +71,8 @@
|
||||
|
||||
</Border>
|
||||
|
||||
<ProgressBar Name="PhotoProgress" Grid.Row="2" Height="50" Margin="10,0,10,0" Minimum="0" Maximum="100"/>
|
||||
|
||||
<ProgressBar Name="PhotoProgress" Grid.Row="2" Height="50" Margin="10,0,10,0" Minimum="0" Maximum="100"/>
|
||||
|
||||
<Border Name="OutMessageBrd" Grid.Row="2" >
|
||||
<TextBlock Name="OutMessageTxBl" TextAlignment="Center"
|
||||
@@ -81,6 +81,13 @@
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Name="SceneHostGrid" Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="1.2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Windows.Interop
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
@@ -7,8 +8,10 @@ Imports EgtWPFLib5
|
||||
Public Class CurrentProjectPageUC
|
||||
' Dichiarazione eventi
|
||||
Friend Event OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnKeyCancelDownScene(sender As Object, e As System.Windows.Forms.KeyEventArgs)
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
' Dichiarazione delle Page UserControl
|
||||
@@ -17,7 +20,8 @@ Public Class CurrentProjectPageUC
|
||||
Private m_bFirst As Boolean = True
|
||||
' Dichiarazione Scene
|
||||
Friend WithEvents CurrentProjectScene As New Scene
|
||||
Private CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
' Nella pagina Nest gestisco la dimensione della scena per visualizzare la lista dei parcheggi
|
||||
Public CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||
' Identificativo progetto corrente
|
||||
Private m_nCurrProj As Integer = 0
|
||||
' Dati del grezzo
|
||||
@@ -53,9 +57,11 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||
CurrentProjectSceneHost.Child = CurrentProjectScene
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 0)
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
' CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
'Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||
Me.SceneHostGrid.Children.Add(CurrentProjectSceneHost)
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
MaterialTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
|
||||
@@ -190,7 +196,8 @@ Public Class CurrentProjectPageUC
|
||||
' Inizializzo gestore lavorazioni
|
||||
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
|
||||
m_bFirst = False
|
||||
|
||||
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, "OrtoGraphic", 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetCameraType(bOrtoGraphic, True)
|
||||
' creo nuovo progetto
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
'NewProject()
|
||||
@@ -336,6 +343,10 @@ Public Class CurrentProjectPageUC
|
||||
RaiseEvent OnMouseDownScene(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.MouseDoubleClick
|
||||
RaiseEvent OnMouseDownScene_DoubleClick(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseMoveScene
|
||||
RaiseEvent OnMouseMoveScene(sender, e)
|
||||
End Sub
|
||||
@@ -348,6 +359,10 @@ Public Class CurrentProjectPageUC
|
||||
SetInfoMessage(DistToString(vtDist))
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyKeyCancelDownScene(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles CurrentProjectScene.KeyDown
|
||||
RaiseEvent OnKeyCancelDownScene(sender, e)
|
||||
End Sub
|
||||
|
||||
' Gestione progetto
|
||||
|
||||
Friend Sub SetNextProjectIndex()
|
||||
@@ -425,6 +440,12 @@ Public Class CurrentProjectPageUC
|
||||
While nId2 <> GDB_ID.NULL
|
||||
' Inserisco correttamente in parcheggio
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
|
||||
' Aggiorno lo stato di visualizzazione
|
||||
Dim nInfoStatus As Integer = 1
|
||||
' Salvo lo stato (per gestire la navigazione)
|
||||
EgtGetInfo(nId2, INFO_PARKSTATUS, nInfoStatus)
|
||||
' Imposto lo stato
|
||||
EgtSetStatus(nId2, nInfoStatus)
|
||||
' Notifica a WeinMatching per modifica Id
|
||||
VeinMatching.UpdatePart(nId2)
|
||||
' Passo al pezzo successivo
|
||||
@@ -444,7 +465,7 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function AdjustAdditionalTable( Optional bForced As Boolean = False) As Boolean
|
||||
Friend Function AdjustAdditionalTable(Optional bForced As Boolean = False) As Boolean
|
||||
' Recupero altezza sottotavola corrente
|
||||
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetFirstMachGroup(), MACH_FIXT_GROUP)
|
||||
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
|
||||
@@ -456,7 +477,7 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se valore cambiato, aggiorno...
|
||||
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
|
||||
Dim bChanged As Boolean = ( Math.Abs(dDeltaZ) > EPS_SMALL)
|
||||
Dim bChanged As Boolean = (Math.Abs(dDeltaZ) > EPS_SMALL)
|
||||
If bChanged Or bForced Then
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
|
||||
@@ -469,9 +490,9 @@ Public Class CurrentProjectPageUC
|
||||
ShowPhoto(False)
|
||||
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
|
||||
While nRawGrpId <> GDB_ID.NULL
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup( nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName( nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart( nRawGrpId)
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName(nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart(nRawGrpId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
@@ -499,10 +520,10 @@ Public Class CurrentProjectPageUC
|
||||
EgtGetTableName(sNameTable)
|
||||
Dim nRefAddTabId = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(EgtGetTableId(sNameTable), "SOLID"), MACH_ADD_TABLE)
|
||||
If nRefAddTabId <> GDB_ID.NULL Then
|
||||
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId)
|
||||
EgtSetStatus( nAddTabId, GDB_ST.ON_)
|
||||
EgtScale( nAddTabId, new Frame3d( ptMin), 1, 1, dAddTable / 10)
|
||||
' altrimenti la creo
|
||||
nAddTabId = EgtCopyGlob(nRefAddTabId, nFixtId)
|
||||
EgtSetStatus(nAddTabId, GDB_ST.ON_)
|
||||
EgtScale(nAddTabId, New Frame3d(ptMin), 1, 1, dAddTable / 10)
|
||||
' altrimenti la creo
|
||||
Else
|
||||
' Aggiungo sovratavola nel gruppo dei bloccaggi
|
||||
ptMax.z -= DELTAZ_ADDTAB
|
||||
@@ -513,7 +534,7 @@ Public Class CurrentProjectPageUC
|
||||
' Sistemazioni finali
|
||||
If nAddTabId = GDB_ID.NULL Then Return False
|
||||
EgtSetName(nAddTabId, MACH_ADD_TABLE)
|
||||
EgtSetColor(nAddTabId, New Color3d(150, 75, 0, 100), True)
|
||||
If nRefAddTabId = GDB_ID.NULL Then EgtSetColor(nAddTabId, New Color3d(150, 75, 0, 100), True)
|
||||
EgtSetInfo(nAddTabId, KEY_ADD_TABLE, dAddTable)
|
||||
Return True
|
||||
End Function
|
||||
@@ -570,6 +591,9 @@ Public Class CurrentProjectPageUC
|
||||
Else
|
||||
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Dichiaro progetto non modificato
|
||||
EgtResetModified()
|
||||
Return True
|
||||
@@ -594,8 +618,8 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se la macchina del file è quella impostata
|
||||
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
|
||||
AdjustAdditionalTable( True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
AdjustAdditionalTable(True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
Else
|
||||
' Emetto messaggio
|
||||
Dim sOut As String = EgtMsg(90320) & " (" & sFileMachine & ")" ' Macchina diversa
|
||||
@@ -758,15 +782,15 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ExportProject( sPath As String) As Boolean
|
||||
Friend Function ExportProject(sPath As String) As Boolean
|
||||
' Copio eventuale fotografia
|
||||
Dim nPhotoId As Integer = GetPhoto()
|
||||
If nPhotoId <> GDB_ID.NULL Then
|
||||
' Path originale
|
||||
Dim sPhoto As String = String.Empty
|
||||
EgtGetPhotoPath( nPhotoId, sPhoto)
|
||||
EgtGetPhotoPath(nPhotoId, sPhoto)
|
||||
' Nuova path
|
||||
Dim sNewPhoto As String = Path.ChangeExtension( sPath, Path.GetExtension( sPhoto))
|
||||
Dim sNewPhoto As String = Path.ChangeExtension(sPath, Path.GetExtension(sPhoto))
|
||||
' Se diverse, eseguo copia
|
||||
If Not String.Equals(sPhoto, sNewPhoto, StringComparison.InvariantCultureIgnoreCase) Then
|
||||
Try
|
||||
@@ -781,7 +805,7 @@ Public Class CurrentProjectPageUC
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido
|
||||
AddProjectMark()
|
||||
' Eseguo copia
|
||||
Return SaveFile( sPath)
|
||||
Return SaveFile(sPath)
|
||||
End Function
|
||||
|
||||
Friend Function GetCurrentProject() As Integer
|
||||
@@ -868,7 +892,7 @@ Public Class CurrentProjectPageUC
|
||||
EgtSetName(nMarkId, NAME_PROJMARK)
|
||||
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||
' altrimenti, aggiorno il flag dei tagli ridotti
|
||||
' altrimenti, aggiorno il flag dei tagli ridotti
|
||||
Else
|
||||
Dim nMarkReducedCut As Integer = 0
|
||||
If Not EgtGetInfo(nMarkId, INFO_REDUCEDCUT, nMarkReducedCut) OrElse nMarkReducedCut <> nReducedCut Then
|
||||
@@ -1327,23 +1351,23 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
' Gestione area pezzi totale e area pezzi da produrre
|
||||
|
||||
Friend Function SetTotalArea( dTotArea As Double) As Boolean
|
||||
Friend Function SetTotalArea(dTotArea As Double) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
End Function
|
||||
|
||||
Friend Function UpdateTotalArea( dNewArea As Double) As Boolean
|
||||
Friend Function UpdateTotalArea(dNewArea As Double) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dTotArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea)
|
||||
dTotArea = Math.Max( dTotArea + dNewArea, 0)
|
||||
EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
dTotArea = Math.Max(dTotArea + dNewArea, 0)
|
||||
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
End Function
|
||||
|
||||
Friend Function GetTotalArea() As Double
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dTotArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea)
|
||||
EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
Return dTotArea
|
||||
End Function
|
||||
|
||||
@@ -1351,17 +1375,17 @@ Public Class CurrentProjectPageUC
|
||||
Dim dToProdArea As Double = 0
|
||||
' Se programma non ancora inviato al CN, ciclo sui pezzi nella lastra
|
||||
If GetProjectNcProgSent() = 0 Then
|
||||
Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
|
||||
Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
|
||||
While nPartInRawId <> GDB_ID.NULL
|
||||
dToProdArea += GeomCalc.GetPartArea( nPartInRawId)
|
||||
nPartInRawId = EgtGetNextPartInRawPart( nPartInRawId)
|
||||
dToProdArea += GeomCalc.GetPartArea(nPartInRawId)
|
||||
nPartInRawId = EgtGetNextPartInRawPart(nPartInRawId)
|
||||
End While
|
||||
End If
|
||||
' Ciclo sui pezzi in parcheggio
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
dToProdArea += GeomCalc.GetPartArea( nPartId)
|
||||
nPartId = EgtGetNextPart( nPartId)
|
||||
dToProdArea += GeomCalc.GetPartArea(nPartId)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
@@ -1370,16 +1394,16 @@ Public Class CurrentProjectPageUC
|
||||
Friend Function GetToProduceArea() As Double
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dToProdArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
EgtGetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
Return dToProdArea
|
||||
End Function
|
||||
|
||||
Friend Sub ShowAreas()
|
||||
' Recupero il gruppo di Mark e lo svuoto
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
EgtEmptyGroup( nMarkId)
|
||||
EgtEmptyGroup(nMarkId)
|
||||
' Se non sono da visualizzare esco
|
||||
if GetPrivateProfileInt( S_STATISTICS, K_SHOWAREAS, 0, m_MainWindow.GetMachIniFile()) = 0 Then Return
|
||||
If GetPrivateProfileInt(S_STATISTICS, K_SHOWAREAS, 0, m_MainWindow.GetMachIniFile()) = 0 Then Return
|
||||
' Recupero dati
|
||||
Dim dTotArea As Double = GetTotalArea()
|
||||
Dim dToProdArea As Double = GetToProduceArea()
|
||||
@@ -1391,20 +1415,19 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Scritte
|
||||
Const TEXT_DIST As Double = 100
|
||||
Dim ptIns As New Point3d( b3Tab.Center().x, b3Tab.Max().y + TEXT_DIST, b3Tab.Max().z)
|
||||
Dim ptIns As New Point3d(b3Tab.Center().x, b3Tab.Max().y + TEXT_DIST, b3Tab.Max().z)
|
||||
Dim dCoeff As Double = 1.0 / 1000000.0
|
||||
Dim sUnit As String = " m²"
|
||||
If Not EgtUiUnitsAreMM() Then
|
||||
dCoeff = 1.0 / ( 12 * ONEINCH * 12 * ONEINCH)
|
||||
dCoeff = 1.0 / (12 * ONEINCH * 12 * ONEINCH)
|
||||
sUnit = " ft²"
|
||||
End If
|
||||
Dim sText As String = EgtMsg( 90328) & " " & DoubleToString( dTotArea * dCoeff, 3) & sUnit & " " &
|
||||
EgtMsg( 90329) & " " & DoubleToString( dToProdArea * dCoeff, 3) & sUnit
|
||||
Dim nText As Integer = EgtCreateTextAdv( nMarkId, ptIns, 0, sText, "", 500, False, 100, 1, 0, INS_POS.MC)
|
||||
EgtSetColor( nText, New Color3d( 0, 0, 0))
|
||||
Dim sText As String = EgtMsg(90328) & " " & DoubleToString(dTotArea * dCoeff, 3) & sUnit & " " &
|
||||
EgtMsg(90329) & " " & DoubleToString(dToProdArea * dCoeff, 3) & sUnit
|
||||
Dim nText As Integer = EgtCreateTextAdv(nMarkId, ptIns, 0, sText, "", 500, False, 100, 1, 0, INS_POS.MC)
|
||||
EgtSetColor(nText, New Color3d(0, 0, 0))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetAreasStatus( bShow As Boolean)
|
||||
Friend Sub SetAreasStatus(bShow As Boolean)
|
||||
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
If nMarkId = GDB_ID.NULL Then Return
|
||||
|
||||
@@ -1412,7 +1435,7 @@ Public Class CurrentProjectPageUC
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If bOldEnMod Then EgtDisableModified()
|
||||
' Cambio stato visualizzazione
|
||||
EgtSetStatus( nMarkId, If( bShow, GDB_ST.ON_, GDB_ST.OFF))
|
||||
EgtSetStatus(nMarkId, If(bShow, GDB_ST.ON_, GDB_ST.OFF))
|
||||
' Se necessario riabilito impostazione modificato
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
@@ -99,8 +99,38 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
' Scelta tavola della macchina
|
||||
Dim nTabInd As Integer = ChooseTable()
|
||||
|
||||
' Creo una copia di tutte le immagini usata nella lista dei parcheggi
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
' Creo nuovo progetto
|
||||
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||
|
||||
|
||||
' 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
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
|
||||
|
||||
|
||||
' Gestione stato FastGrid
|
||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||
End Sub
|
||||
@@ -233,6 +263,9 @@ Public Class ProjectMgrUC
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut Then
|
||||
ShowAllCurrPhaseMachinings()
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -333,6 +366,10 @@ Public Class ProjectMgrUC
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dHeight)
|
||||
' Raggio lama
|
||||
dHeight = dHeight / 2
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Raggio
|
||||
dThick = 0
|
||||
dHeight = 0
|
||||
Else
|
||||
' Diametro FRESA/FORETTO (l'altezza non serve: posizione calcolata tiene conto del Tip Tool)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dThick)
|
||||
@@ -371,7 +408,7 @@ Public Class ProjectMgrUC
|
||||
If Not EgtGetTableRef(1, m_ptTabOri) Then Return
|
||||
' recupero il punto medio della curva
|
||||
EgtMidPoint(nIdSelected, GDB_ID.ROOT, ptMid)
|
||||
ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight
|
||||
ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight + m_MainWindow.m_CurrentMachine.dAdditionalTable
|
||||
' Offset dovuto allo spessore Utensile
|
||||
ptMid -= vtOffset * dThick
|
||||
|
||||
@@ -399,6 +436,10 @@ Public Class ProjectMgrUC
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Forzo B90
|
||||
dB1 = 90
|
||||
' Forzo la pozione in Z alla quota di Home (per evitare l'errore di fine corsa asse Z)
|
||||
Dim dHomeZ As Double = 0
|
||||
EgtGetAxisHomePos("Z", dHomeZ)
|
||||
ptMid.z = dHomeZ
|
||||
Else
|
||||
' Se utensile speciale
|
||||
If CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
@@ -424,6 +465,7 @@ Public Class ProjectMgrUC
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
If nStat <> 0 Then
|
||||
EgtOutLog("Out of stroke: " & nStat)
|
||||
vtDirT = -vtDirT
|
||||
ptMid -= vtDirT * dThick
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
@@ -455,6 +497,12 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
' calcolo la posizione degli assi lineari X, Y, Z ( correggere il punto ptMid.z sommando il raggio utensile)
|
||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
If nStat <> 0 Then
|
||||
EgtOutLog("2nd attemp out of stroke: " & nStat)
|
||||
End If
|
||||
End If
|
||||
|
||||
'--------------------------- Comunico i movimenti in origine macchina al CN ----------------------------------------
|
||||
@@ -744,6 +792,12 @@ Public Class ProjectMgrUC
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
' leggo il nome della tavola da cui sto lanciando il progetto
|
||||
Dim sTabeName As String = String.Empty
|
||||
EgtGetTableName(sTabeName)
|
||||
Dim bDoubleProg As Boolean = (GetPrivateProfileInt(S_PRODUCTIONLINE, "DoubleProg", 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
|
||||
' Leggo eventuale variabile per lavorazione con 2 tavole in parallelo (standard E80027)
|
||||
Dim nVarProgTwins As Integer = 1
|
||||
If Not String.IsNullOrWhiteSpace(m_CurrMachine.sVarProgTwins) Then
|
||||
@@ -757,8 +811,26 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' Verifico se posso scrivere nell'area 1
|
||||
If nVarProg1 = 0 And (nVarProg2 <> 1 Or nVarProgTwins = 2) Then
|
||||
Dim bSendToAre1 As Boolean = (nVarProg1 = 0 And (nVarProg2 <> 1 Or nVarProgTwins = 2))
|
||||
Dim bSendToAre2 As Boolean = (nVarProg2 = 0 And (nVarProg1 <> 1 Or nVarProgTwins = 2))
|
||||
|
||||
If bDoubleProg Then
|
||||
If sTabeName = MAIN_TAB Then
|
||||
' spedisco il programma da tavola 1 solo se CN ha terminato programma 901
|
||||
bSendToAre1 = (nVarProg1 = 0)
|
||||
bSendToAre2 = False
|
||||
EgtOutLog(" Invio programma da tavola 1")
|
||||
Else
|
||||
' spedisco il programma da tavola 2 solo se CN ha terminato programma 902
|
||||
bSendToAre1 = False
|
||||
bSendToAre2 = (nVarProg2 = 0)
|
||||
EgtOutLog(" Invio programma da tavola 2")
|
||||
End If
|
||||
End If
|
||||
|
||||
If bSendToAre1 Then
|
||||
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg1, False) Then
|
||||
' Dichiaro part program inviato
|
||||
@@ -775,7 +847,7 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
m_CurrNcComm.SetProgramMainOrSub(True)
|
||||
' Altrimenti verifico se posso scrivere nell'area 2
|
||||
ElseIf nVarProg2 = 0 And (nVarProg1 <> 1 Or nVarProgTwins = 2) Then
|
||||
ElseIf bSendToAre2 Then
|
||||
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg2, False) Then
|
||||
' Dichiaro part program inviato
|
||||
@@ -795,6 +867,12 @@ Public Class ProjectMgrUC
|
||||
Else
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90318)) 'La macchina non accetta il programma CN
|
||||
End If
|
||||
' avvio programma solo se DoubleProg
|
||||
If (GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 And bDoubleProg) And
|
||||
(bSendToAre1 Or bSendToAre2) Then
|
||||
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
|
||||
MyCicloStartWD.ShowDialog()
|
||||
End If
|
||||
|
||||
End If
|
||||
#End If
|
||||
@@ -967,7 +1045,8 @@ Public Class ProjectMgrUC
|
||||
'EgtLuaSetGlobNumVar("CMD.SAWTH", dThick)
|
||||
|
||||
EgtTdbSetCurrTool(SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLNAME", SelTestTool.ToolAlias)
|
||||
EgtLuaSetGlobStringVar("CMD.TLNAME", SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLALIAS", SelTestTool.ToolAlias)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
EgtLuaSetGlobNumVar("CMD.SAWTH", dThick)
|
||||
|
||||
@@ -347,6 +347,13 @@ Public Class Camera
|
||||
|
||||
' ------------------------------------ accensione riflettori ------------------------------------
|
||||
|
||||
' ------------------------------------ mando la testa in home ------------------------------------
|
||||
If Not GoHomeForPhoto() Then
|
||||
EgtOutLog("Error in positioning")
|
||||
End If
|
||||
|
||||
' ------------------------------------ mando la testa in home ------------------------------------
|
||||
|
||||
' Scatto una foto con eventuale riconoscimento del contorno (il programma deve essere già attivo)
|
||||
Dim bOk As Boolean = False
|
||||
Dim sArgs As String = "2 0"
|
||||
@@ -364,6 +371,64 @@ Public Class Camera
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Function GoHomeForPhoto() As Boolean
|
||||
Dim bGoHome As Boolean = GetPrivateProfileInt(S_PHOTO, K_ENABELE_GOHOME_FOR_PHOTO, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
' Se non configurato esco senza generare errore
|
||||
If Not bGoHome Then Return True
|
||||
' Costruisco il bottone per potere eseguire il comando MDI
|
||||
Dim GoHome As MachineButton = Nothing
|
||||
Dim sDirectCmdFile As String = String.Empty
|
||||
GetPrivateProfileString(S_PHOTO, K_CAMERA_DIRECT_CMD, "", sDirectCmdFile, m_MainWindow.GetMachIniFile())
|
||||
If String.IsNullOrEmpty(sDirectCmdFile) Then
|
||||
Return False
|
||||
Else
|
||||
EgtOutLog("Direct command for positionig head: " & sDirectCmdFile)
|
||||
End If
|
||||
GoHome = New TwoStateButton("", sDirectCmdFile, "", "", "")
|
||||
' eseguo lo script lua associato
|
||||
GoHome.ExecuteMDICommand(GoHome.TLuaScriptName)
|
||||
' Leggo nome variabile posizione home raggiunta
|
||||
Dim CameraStateNameVar As String = String.Empty
|
||||
GetPrivateProfileString(S_PHOTO, K_CAMERA_STATE_VAR, "", CameraStateNameVar, m_MainWindow.GetMachIniFile())
|
||||
If String.IsNullOrEmpty(CameraStateNameVar) Then
|
||||
'Return False
|
||||
Else
|
||||
EgtOutLog("Variable for read status of positioning head: " & CameraStateNameVar)
|
||||
End If
|
||||
' 91144=Going home
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91144))
|
||||
UpdateUI()
|
||||
' Eseguo reset variabile posizione home raggiunta
|
||||
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(CameraStateNameVar, "0")
|
||||
System.Threading.Thread.Sleep(300)
|
||||
' Definisco flag posizionamento completato
|
||||
Dim bPositionOk As Boolean = False
|
||||
For I As Integer = 0 To 40
|
||||
' Devo rileggere la variabile ad ogni ciclo
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(CameraStateNameVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
Dim CameraStateVal As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
Select Case CameraStateVal
|
||||
Case 0
|
||||
' Non faccio alcunchè perchè si sta posizionando
|
||||
Case 1
|
||||
' Posizionamento completato
|
||||
bPositionOk = True
|
||||
Exit For
|
||||
Case 2
|
||||
' Errore
|
||||
bPositionOk = False
|
||||
Exit For
|
||||
End Select
|
||||
End If
|
||||
System.Threading.Thread.Sleep(900)
|
||||
Next
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
UpdateUI()
|
||||
Return bPositionOk
|
||||
End Function
|
||||
|
||||
Private Function WaitPhoto(nInd As Integer) As Boolean
|
||||
' Ciclo di ricerca foto scattata
|
||||
Dim nMaxThick = 10 * m_nTimeout
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 6.3 KiB |
@@ -362,6 +362,10 @@ Module Utility
|
||||
EgtSetStatus(nPartId, GDB_ST.ON_)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
|
||||
' Visualizzo gli elementi attivi in parcheggio
|
||||
SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Se necessario, ripristino precedente impostazione modificato
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
@@ -4,27 +4,77 @@
|
||||
TextBlock.FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Height="500" Width="500" ShowInTaskbar="False" Initialized="Window_Initialized" MinWidth="300" MinHeight="300">
|
||||
|
||||
<Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="91"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Button Name="NewBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="New"/>
|
||||
<Button Name="ExportBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Export"/>
|
||||
<Button Name="AssemblyBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="3D"/>
|
||||
<Button Name="ImportCurrProjBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Import"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="91"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Top" DockPanel.Dock="Top">
|
||||
<Button Name="NewBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="New"/>
|
||||
<Button Name="ExportBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Export"/>
|
||||
<Button Name="AssemblyBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="3D"/>
|
||||
<Button Name="ImportCurrProjBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Import"/>
|
||||
<ToggleButton Name="MeasureBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource MeasureImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Name="DistanceStkPnl" Orientation="Vertical" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Margin="10,0,0,0">
|
||||
<!--Distanza-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="MeasureLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
|
||||
Text="Dist=" HorizontalAlignment="Right" />
|
||||
<TextBlock Name="MeasureValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<!--Proiezione in X-->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="dXLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
|
||||
Text="dX=" HorizontalAlignment="Right"/>
|
||||
<TextBlock Name="dXValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<!--Proiezione in Y -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="dYLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
|
||||
Text="dY=" HorizontalAlignment="Right"/>
|
||||
<TextBlock Name="dYValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
<!--Proiezione in Z -->
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="dZLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
|
||||
Text="dZ=" HorizontalAlignment="Right"/>
|
||||
<TextBlock Name="dZValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
|
||||
HorizontalAlignment="Left"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -82,6 +82,8 @@ Public Class VeinMatchingWindow
|
||||
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
||||
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
||||
m_bFirst = False
|
||||
' nascondo la visulizzazione dei campi
|
||||
DistanceStkPnl.Visibility = Visibility.Hidden
|
||||
End If
|
||||
' inibisco selezione diretta da Scene
|
||||
VeinMatchingScene.SetStatusNull()
|
||||
@@ -194,6 +196,25 @@ Public Class VeinMatchingWindow
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles VeinMatchingScene.OnShowDistanceVector
|
||||
Dim sMsg As String = DistToString(vtDist)
|
||||
Dim sItemsMsg As String() = sMsg.Split(vbCrLf)
|
||||
If sItemsMsg.Count > 1 Then
|
||||
' stampo solo il valore di lunghezza
|
||||
MeasureValTxBl.Text = sItemsMsg(0).Split("="c)(1)
|
||||
sItemsMsg(1) = sItemsMsg(1).Trim
|
||||
Dim sSubItemMsg As String() = sItemsMsg(1).Split(" "c)
|
||||
If sSubItemMsg.Count > 1 Then
|
||||
dXValTxBl.Text = sSubItemMsg(0).Split("="c)(1)
|
||||
dYValTxBl.Text = sSubItemMsg(1).Split("="c)(1)
|
||||
dZValTxBl.Text = sSubItemMsg(2).Split("="c)(1)
|
||||
End If
|
||||
Else
|
||||
MeasureValTxBl.Text = sMsg
|
||||
End If
|
||||
DistanceStkPnl.Visibility = Visibility.Visible
|
||||
End Sub
|
||||
|
||||
Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click
|
||||
VeinMatching.Clear()
|
||||
End Sub
|
||||
@@ -211,6 +232,25 @@ Public Class VeinMatchingWindow
|
||||
VeinMatching.LoadCurrPartFromProj()
|
||||
End Sub
|
||||
|
||||
Private Sub MeasureBtn_Checked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Checked
|
||||
VeinMatchingScene.SetStatusGetDistance()
|
||||
Dim ptRef1 As Point3d
|
||||
If EgtGetTableRef(1, ptRef1) Then
|
||||
EgtSetGridFrame(New Frame3d(ptRef1))
|
||||
VeinMatchingScene.SetGridCursorPos(True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MeasureBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Unchecked
|
||||
VeinMatchingScene.ResetStatusGetDistance()
|
||||
VeinMatchingScene.SetStatusNull()
|
||||
MeasureValTxBl.Text = ""
|
||||
dXValTxBl.Text = ""
|
||||
dYValTxBl.Text = ""
|
||||
dZValTxBl.Text = ""
|
||||
DistanceStkPnl.Visibility = Visibility.Hidden
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Friend Module VeinMatching
|
||||
|
||||
Reference in New Issue
Block a user