Compare commits
156 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97ec72e3e1 | |||
| ca3193b9a4 | |||
| 93e7144753 | |||
| 31e6bbaca7 | |||
| 8935622888 | |||
| c47370405c | |||
| a04e2cbe62 | |||
| da980a649e | |||
| 4c282d7531 | |||
| a941f963c2 | |||
| eab341d7fe | |||
| 9c7d60d307 | |||
| a7adcdcaca | |||
| acb8ceed4d | |||
| 65d8f58b45 | |||
| 07cf7ced42 | |||
| b1410ca11c | |||
| 1975f46995 | |||
| 6863186e07 | |||
| b434f80030 | |||
| 959fb2e44f | |||
| 941e7837be | |||
| 680505af10 | |||
| b0bfa67d2a | |||
| 29d8c1e29b | |||
| e5d4f223f8 | |||
| 3cfc7276c9 | |||
| 0c0233b27e | |||
| 4e8925515d | |||
| 3b552b2f4e | |||
| 0d4d853834 | |||
| 37fcbe8240 | |||
| 4393f282b7 | |||
| 6844a8c77c | |||
| 659405c52f | |||
| 6905a8d6dc | |||
| d8ba23894e | |||
| aba1572f95 | |||
| fdb0ed598b | |||
| 4cb3518346 | |||
| 56b8ee88d3 | |||
| d0439f2b05 | |||
| 997e8c380d | |||
| d49c231541 | |||
| 8d82058e49 | |||
| d6a9cac6b4 | |||
| 4ce898c25c | |||
| 6f59cddd80 | |||
| c8b018f6df | |||
| e287e827c4 | |||
| 68e9a9201d | |||
| 8946bf3a00 | |||
| aeb0be0590 | |||
| a15acb6528 | |||
| e7e9d26b75 | |||
| d9de23daca | |||
| ad5c9331ba | |||
| b67330b509 | |||
| ca66108145 | |||
| 379ccc7519 | |||
| b751c27773 | |||
| 14e1c254f0 | |||
| 6f08e5f520 | |||
| 7d8933cc39 | |||
| 2179996bff | |||
| 316bcc89ea | |||
| 17f41f1563 | |||
| 6a17b88283 | |||
| ce151e5db7 | |||
| b303fe2615 | |||
| 6f248ec645 | |||
| 3e0d43c1d8 | |||
| 70b1822446 | |||
| 17d6ced974 | |||
| db145af965 | |||
| 037fdb41b6 | |||
| f89fe7fefd | |||
| 6ecbd7f545 | |||
| 734f480f67 | |||
| 87fa5cc6dd | |||
| 5b00409abe | |||
| 0f3b91e847 | |||
| 3befbecd3c | |||
| b6d2cc434c | |||
| 800a589285 | |||
| 2618d3f14c | |||
| bb32a4e500 | |||
| 6d266819db | |||
| 3ce8965206 | |||
| d924f4c107 | |||
| b141bda34d | |||
| ecb599c5c1 | |||
| 957a012de5 | |||
| 12277387b6 | |||
| ac92d1b4df | |||
| 5fe84aa6fd | |||
| b3ec57fb79 | |||
| c5f8e1f3fd | |||
| 202a63329b | |||
| 8cdc527943 | |||
| 61bb35fda2 | |||
| ee70e8f4c2 | |||
| 4d0e700d50 | |||
| 4432893794 | |||
| 9fa98d78a5 | |||
| e1d166375a | |||
| 4e669bc577 | |||
| 73a1caf1d0 | |||
| 322497121d | |||
| 468270cbab | |||
| 71ce283bad | |||
| 576d547a85 | |||
| a79316f290 | |||
| 51ee7a0c92 | |||
| 237eeb8871 | |||
| abe1b3a430 | |||
| 7e205a6424 | |||
| a7d7c66e2b | |||
| 7bb35e4694 | |||
| 65e72391d8 | |||
| 32e4d6d76b | |||
| 59b9354551 | |||
| 7315166ca7 | |||
| b9875ba243 | |||
| f7bcdff766 | |||
| 47b98c6392 | |||
| a0f5585391 | |||
| a6457ece76 | |||
| e93c4e41a3 | |||
| abaf1ac3a8 | |||
| ed4fc25c5d | |||
| d1d48bf8a4 | |||
| 4e0d362b36 | |||
| 1afdc8551f | |||
| d17cd8d2d8 | |||
| cc11ab463f | |||
| d322dc192d | |||
| 24ab2e0ba8 | |||
| 8aec6c87b0 | |||
| 24fa5e089a | |||
| 29eae5517a | |||
| 1ce036a0f6 | |||
| dd5dd7c93c | |||
| 393559d41a | |||
| 45f6639dcd | |||
| de989f5762 | |||
| c33d6c1e77 | |||
| a1b2158404 | |||
| 05e94943e0 | |||
| 6bba5143f9 | |||
| 3957f66ec1 | |||
| 46f7e78efc | |||
| f81970accc | |||
| 165ed71234 | |||
| 01b04e6a9d | |||
| 8a8ff33110 |
@@ -27,6 +27,14 @@
|
|||||||
<EgtWPFLib:EgtTextBox Name="ValueTxBx" Grid.Column="1" Grid.Row="1"
|
<EgtWPFLib:EgtTextBox Name="ValueTxBx" Grid.Column="1" Grid.Row="1"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<ComboBox Name="ValueCmBx" Grid.Column="1" Grid.Row="1">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" FontSize="20" />
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
|
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.Row="3" Grid.RowSpan="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.5*"/>
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports System.Collections.ObjectModel
|
||||||
|
|
||||||
Public Class EditValueWD
|
Public Class EditValueWD
|
||||||
|
|
||||||
@@ -8,29 +9,77 @@ Public Class EditValueWD
|
|||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
Private m_sMsg As String = "Value"
|
Private m_sMsg As String = "Value"
|
||||||
Private m_sValue As String = ""
|
Private m_sValue As String = ""
|
||||||
|
Private m_sList As ObservableCollection(Of String)
|
||||||
|
Private m_IsText As Boolean = True
|
||||||
|
|
||||||
|
' avvia la visualizzazione della textbox
|
||||||
Sub New(Owner As Window, Optional sMsg As String = "")
|
Sub New(Owner As Window, Optional sMsg As String = "")
|
||||||
Me.Owner = Owner
|
Me.Owner = Owner
|
||||||
m_sMsg = sMsg
|
m_sMsg = sMsg
|
||||||
|
m_IsText = True
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function SetVal( dVal As Double) As Boolean
|
Friend Function SetVal(dVal As Double, Optional ByVal bLen As Boolean = False) As Boolean
|
||||||
m_sValue = DoubleToString( dVal, 3)
|
If bLen Then
|
||||||
|
m_sValue = LenToString(dVal, 3)
|
||||||
|
Else
|
||||||
|
m_sValue = DoubleToString(dVal, 3)
|
||||||
|
End If
|
||||||
ValueTxBx.Text = m_sValue
|
ValueTxBx.Text = m_sValue
|
||||||
Return true
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function GetVal() As Double
|
' avvia la visualizzazione della combobox
|
||||||
|
Sub New(Owner As Window, sList As ObservableCollection(Of String), Optional sMsg As String = "")
|
||||||
|
Me.Owner = Owner
|
||||||
|
m_sMsg = sMsg
|
||||||
|
m_IsText = False
|
||||||
|
InitializeComponent()
|
||||||
|
m_sList = sList
|
||||||
|
SetComboBox(m_sList)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function GetVal(Optional ByVal bLen As Boolean = False) As Double
|
||||||
Dim dVal As Double = 0
|
Dim dVal As Double = 0
|
||||||
StringToDouble( m_sValue, dVal)
|
If bLen Then
|
||||||
|
StringToLen(m_sValue, dVal)
|
||||||
|
Else
|
||||||
|
StringToDouble(m_sValue, dVal)
|
||||||
|
End If
|
||||||
Return dVal
|
Return dVal
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function SetComboBox(sList As ObservableCollection(Of String)) As Boolean
|
||||||
|
ValueCmBx.ItemsSource = sList
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function SetItemComboBox(sItem As String) As Boolean
|
||||||
|
For Each MyItem As String In ValueCmBx.ItemsSource
|
||||||
|
If MyItem = sItem Then
|
||||||
|
ValueCmBx.SelectedItem = MyItem
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function GetItemComboBox() As String
|
||||||
|
Dim sVal As String = ValueCmBx.SelectedItem
|
||||||
|
Return sVal
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub EditValueWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub EditValueWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||||
ValueTxbl.Text = m_sMsg
|
ValueTxbl.Text = m_sMsg
|
||||||
|
If m_IsText Then
|
||||||
|
ValueCmBx.Visibility = Visibility.Collapsed
|
||||||
|
ValueTxBx.Visibility = Visibility.Visible
|
||||||
|
Else
|
||||||
|
ValueCmBx.Visibility = Visibility.Visible
|
||||||
|
ValueTxBx.Visibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub EditValueWD_Rendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
Private Sub EditValueWD_Rendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50"
|
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
|
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
|
||||||
Text="°"/>
|
Text="°"/>
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ Public Class MoveRawPartPage
|
|||||||
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi
|
||||||
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
||||||
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
||||||
|
' Visibilità comando Scrap
|
||||||
|
Private m_ScrapsVisibility As Visibility = Visibility.Visible
|
||||||
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
@@ -92,7 +93,12 @@ Public Class MoveRawPartPage
|
|||||||
ScrapsVisibility = Visibility.Collapsed
|
ScrapsVisibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
' aggiorno la grafica
|
' aggiorno la grafica
|
||||||
ScrapsBtn.Visibility = ScrapsVisibility
|
m_ScrapsVisibility = ScrapsVisibility
|
||||||
|
If m_ScrapsVisibility <> Visibility.Visible Then
|
||||||
|
Grid.SetColumnSpan(RemovePartBtn, 3)
|
||||||
|
Else
|
||||||
|
Grid.SetColumnSpan(RemovePartBtn, 2)
|
||||||
|
End If
|
||||||
'---------------------------- SCRAPS ----------------------------
|
'---------------------------- SCRAPS ----------------------------
|
||||||
|
|
||||||
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
||||||
@@ -178,7 +184,7 @@ Public Class MoveRawPartPage
|
|||||||
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
||||||
PauseBtn.Visibility = Windows.Visibility.Hidden
|
PauseBtn.Visibility = Windows.Visibility.Hidden
|
||||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||||
ScrapsBtn.Visibility = Windows.Visibility.Visible
|
ScrapsBtn.Visibility = m_ScrapsVisibility
|
||||||
' altrimenti per movimento con ventose
|
' altrimenti per movimento con ventose
|
||||||
ElseIf Not m_SplitPage.m_bOnAuxTab Then
|
ElseIf Not m_SplitPage.m_bOnAuxTab Then
|
||||||
UpBtn.Visibility = Windows.Visibility.Visible
|
UpBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -196,7 +202,7 @@ Public Class MoveRawPartPage
|
|||||||
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
BottomRBtn.Visibility = Windows.Visibility.Hidden
|
||||||
PauseBtn.Visibility = Windows.Visibility.Hidden
|
PauseBtn.Visibility = Windows.Visibility.Hidden
|
||||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||||
ScrapsBtn.Visibility = Windows.Visibility.Visible
|
ScrapsBtn.Visibility = m_ScrapsVisibility
|
||||||
' altrimenti per movimento finale dei pezzi
|
' altrimenti per movimento finale dei pezzi
|
||||||
Else
|
Else
|
||||||
UpBtn.Visibility = Windows.Visibility.Hidden
|
UpBtn.Visibility = Windows.Visibility.Hidden
|
||||||
@@ -249,9 +255,6 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
|
|
||||||
' verifico che siano state salvate correttamente le info della tavola di scarico
|
|
||||||
EgtSaveFile("c:\EgtData\OmagCUT\Temp\AuxTab.nge", NGE.BIN)
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
@@ -323,9 +326,9 @@ Public Class MoveRawPartPage
|
|||||||
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
|
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
|
||||||
Dim AverageDensity As Double = 2700
|
Dim AverageDensity As Double = 2700
|
||||||
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
|
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
|
||||||
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||||
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
If PutVacuumCupsOnRaw(nId, rmData) Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
@@ -834,14 +837,18 @@ Public Class MoveRawPartPage
|
|||||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
' Sposto il grezzo in battuta sul corner
|
' Sposto il grezzo in battuta sul corner
|
||||||
Dim dAngRaw As Double = 0
|
Dim dAngRaw As Double = 0
|
||||||
|
Dim dNewAngRot As Double = 0
|
||||||
|
|
||||||
Dim AngRotList As New List(Of Double)
|
Dim AngRotList As New List(Of Double)
|
||||||
|
|
||||||
' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola
|
' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola
|
||||||
If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return
|
If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return
|
||||||
|
Dim bb3dRaw As New BBox3d
|
||||||
|
EgtGetRawPartBBox(nRawId, bb3dRaw)
|
||||||
|
Dim ForceToRotate As Boolean = bb3dRaw.DimX < bb3dRaw.DimY
|
||||||
|
|
||||||
' provo a verificare di poter depositare il pezzo (senza applicare delle rotazioni)
|
' provo a verificare di poter depositare il pezzo (senza applicare delle rotazioni)
|
||||||
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
|
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Or ForceToRotate Then
|
||||||
' se sono impostati degli step di rotazione
|
' se sono impostati degli step di rotazione
|
||||||
If AngRotList.Count > 0 Then
|
If AngRotList.Count > 0 Then
|
||||||
Dim bOkRotate As Boolean = False
|
Dim bOkRotate As Boolean = False
|
||||||
@@ -871,12 +878,16 @@ Public Class MoveRawPartPage
|
|||||||
' sposto il pezzo in questa posizione
|
' sposto il pezzo in questa posizione
|
||||||
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
|
EgtMoveToCornerRawPart(nRawId, ptCorner, MCH_CR.BL)
|
||||||
' riprovo il movimento
|
' riprovo il movimento
|
||||||
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
|
dNewAngRot = GetPrefRotAng(dAngRaw)
|
||||||
|
'dNewAngRot = DeltaAngC
|
||||||
|
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dNewAngRot) Then
|
||||||
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
|
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
|
||||||
' riposiziono il pezzo come era prima
|
' riposiziono il pezzo come era prima
|
||||||
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw)
|
||||||
|
EgtDraw()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
dAngRaw = dNewAngRot
|
||||||
Else
|
Else
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -902,17 +913,18 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
' Determino il movimento effettuato
|
' Determino il movimento effettuato
|
||||||
Dim ptNewRawCen As Point3d
|
Dim ptNewRawCen As Point3d
|
||||||
EgtGetRawPartCenter(nRawId, ptNewRawCen)
|
EgtGetRawPartCenter(nRawId, ptNewRawCen)
|
||||||
' Se tutto bene, aggiorno lista movimenti
|
' Se tutto bene, aggiorno lista movimenti
|
||||||
If bRawOk Then
|
If bRawOk Then
|
||||||
AddRawMoveData(nRawId, ptNewRawCen - ptRawCen, m_RawMoveDataList)
|
AddRawMoveData(nRawId, ptNewRawCen - ptRawCen, m_RawMoveDataList)
|
||||||
If dAngRaw <> 0 Then AddRawMoveData(nRawId, -dAngRaw, m_RawMoveDataList)
|
If dAngRaw <> 0 Then AddRawMoveData(nRawId, dAngRaw, m_RawMoveDataList)
|
||||||
' altrimenti annullo il movimento
|
' altrimenti annullo il movimento
|
||||||
Else
|
Else
|
||||||
EgtMoveRawPart(nRawId, ptRawCen - ptNewRawCen)
|
EgtMoveRawPart(nRawId, ptRawCen - ptNewRawCen)
|
||||||
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw)
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 3)) ' Posizione scelta già occupata
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 3)) ' Posizione scelta già occupata
|
||||||
End If
|
End If
|
||||||
' Disabilito pezzo e nascondo le ventose
|
' Disabilito pezzo e nascondo le ventose
|
||||||
@@ -985,6 +997,15 @@ Public Class MoveRawPartPage
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' determino la migliore rotazione per portare il pezzo in orizzontale
|
||||||
|
Private Function GetPrefRotAng(ByVal dAngDeg As Double) As Double
|
||||||
|
Dim dNewAngDeg As Double = -dAngDeg
|
||||||
|
If dAngDeg > 90 And dAngDeg < 270 Then
|
||||||
|
dNewAngDeg = 180 - dAngDeg
|
||||||
|
End If
|
||||||
|
Return dNewAngDeg
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||||
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
||||||
If m_RawMoveDataList.Count = 0 Then Return
|
If m_RawMoveDataList.Count = 0 Then Return
|
||||||
@@ -1000,6 +1021,8 @@ Public Class MoveRawPartPage
|
|||||||
|
|
||||||
' recupero disposizione fase corrente
|
' recupero disposizione fase corrente
|
||||||
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
|
' imposto la pausa nella disposizione corrente
|
||||||
|
SetPause(nDispId)
|
||||||
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
||||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
' imposto eventuale movimento pezzi su tavola ausiliaria
|
||||||
@@ -1029,7 +1052,7 @@ Public Class MoveRawPartPage
|
|||||||
End While
|
End While
|
||||||
|
|
||||||
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
||||||
SetPause(nCurrDisposition)
|
'SetPause(nCurrDisposition)
|
||||||
m_nCurrDisposition = nCurrDisposition
|
m_nCurrDisposition = nCurrDisposition
|
||||||
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
|
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
@@ -1080,7 +1103,7 @@ Public Class MoveRawPartPage
|
|||||||
|
|
||||||
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
|
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
|
||||||
' verifico se la fasa precedente è di tipo scarico
|
' verifico se la fasa precedente è di tipo scarico
|
||||||
If IsDispUnloadOnAuxTab(nPrevDispId) Then
|
If IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
|
||||||
EgtSetCurrPhase(m_nCurrPhase - 1)
|
EgtSetCurrPhase(m_nCurrPhase - 1)
|
||||||
m_nCurrDisposition = nPrevDispId
|
m_nCurrDisposition = nPrevDispId
|
||||||
m_nCurrPhase -= 1
|
m_nCurrPhase -= 1
|
||||||
@@ -1117,7 +1140,7 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
||||||
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
|
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
|
||||||
EgtSetCurrPhase(m_nCurrPhase + 1)
|
EgtSetCurrPhase(m_nCurrPhase + 1)
|
||||||
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
||||||
m_nCurrPhase += 1
|
m_nCurrPhase += 1
|
||||||
@@ -1174,7 +1197,7 @@ Public Class MoveRawPartPage
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
||||||
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer)
|
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer) As Integer
|
||||||
' verifico se la fase precedente è uno scarico su tavola ausiliaria
|
' verifico se la fase precedente è uno scarico su tavola ausiliaria
|
||||||
Dim bVal As Integer = 0
|
Dim bVal As Integer = 0
|
||||||
EgtGetInfo(nCurrDispId, "Pat", bVal)
|
EgtGetInfo(nCurrDispId, "Pat", bVal)
|
||||||
@@ -1182,7 +1205,7 @@ Public Class MoveRawPartPage
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
||||||
Public Function GetNextDisposition(nCurrDisposId As Integer)
|
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
|
||||||
Dim nDispId As Integer = nCurrDisposId
|
Dim nDispId As Integer = nCurrDisposId
|
||||||
While nDispId <> GDB_ID.NULL
|
While nDispId <> GDB_ID.NULL
|
||||||
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
|
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="NestPage_Initialized" Loaded="NestPage_Loaded" Unloaded="NestPage_Unloaded">
|
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="NestPage_Initialized" Loaded="NestPage_Loaded" Unloaded="NestPage_Unloaded">
|
||||||
|
|
||||||
<!-- Definizione della NestPage -->
|
<!-- Definizione della NestPage -->
|
||||||
<Grid Name="NestPageGrid" >
|
<Grid Name="NestPageGrid">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="3*"/>
|
<ColumnDefinition Width="3*"/>
|
||||||
<ColumnDefinition Width="12*"/>
|
<ColumnDefinition Width="12*"/>
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50"
|
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
|
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
|
||||||
Text="°"/>
|
Text="°"/>
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ Public Class NestPageUC
|
|||||||
Private m_bMaximizeMove As Boolean = False
|
Private m_bMaximizeMove As Boolean = False
|
||||||
Private m_dAngStep As Double = 0
|
Private m_dAngStep As Double = 0
|
||||||
Private m_bReducedCut As Boolean = False
|
Private m_bReducedCut As Boolean = False
|
||||||
|
|
||||||
|
Private m_bKeyCtrlPressed As Boolean = False
|
||||||
|
Private m_bKeyLeftShiftPressed As Boolean = False
|
||||||
|
Private m_dAngTotal As Double = 0
|
||||||
|
Private m_dStartAng As Double = 0
|
||||||
|
Private m_bStartRot As Boolean = False
|
||||||
|
Private m_bStartMove As Boolean = False
|
||||||
|
|
||||||
' Dati per tolleranza spessore Trf
|
' Dati per tolleranza spessore Trf
|
||||||
Private m_dTrfThickTolerance As Double = 0
|
Private m_dTrfThickTolerance As Double = 0
|
||||||
' Dati movimento registrazione grezzo
|
' Dati movimento registrazione grezzo
|
||||||
@@ -94,6 +102,7 @@ Public Class NestPageUC
|
|||||||
RemovePartBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 3) 'Remove part - Elimina pezzo
|
RemovePartBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 3) 'Remove part - Elimina pezzo
|
||||||
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
|
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
|
||||||
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
||||||
|
DragRettanleBtn.ToolTip = "Strech"
|
||||||
|
|
||||||
Dim nColumsIn_UG1 As Integer = 2
|
Dim nColumsIn_UG1 As Integer = 2
|
||||||
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
||||||
@@ -1053,7 +1062,9 @@ Public Class NestPageUC
|
|||||||
m_locPrev = e.Location
|
m_locPrev = e.Location
|
||||||
m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev)
|
m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||||
m_bDragToStart = m_bDrag
|
m_bDragToStart = m_bDrag
|
||||||
|
' attivo la modalità di traslazione e rotazione senza cltrollo collisioni (solo in fase di Drag)
|
||||||
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
|
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
|
||||||
|
m_bKeyLeftShiftPressed = m_bVerify
|
||||||
m_vtTotMove = Vector3d.NULL()
|
m_vtTotMove = Vector3d.NULL()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1116,16 +1127,74 @@ Public Class NestPageUC
|
|||||||
m_bVerify = True
|
m_bVerify = True
|
||||||
m_bFromParking = True
|
m_bFromParking = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Inizio esecuzione di drag
|
' Inizio esecuzione di drag
|
||||||
m_bDragging = True
|
m_bDragging = True
|
||||||
' Ricavo il punto corrente in coordinate mondo
|
' Ricavo il punto corrente in coordinate mondo
|
||||||
Dim ptCurr As Point3d
|
Dim ptCurr As Point3d
|
||||||
EgtUnProjectPoint(e.Location, ptCurr)
|
EgtUnProjectPoint(e.Location, ptCurr)
|
||||||
|
|
||||||
|
' la rotazione è attivabile solo se premuto il tasto Ctrl (e non sono in parheggio)
|
||||||
|
m_bKeyCtrlPressed = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Control) > 0
|
||||||
|
|
||||||
|
'-------------Inizio ROTAZIONE ----------------
|
||||||
|
If m_bKeyCtrlPressed AndAlso (Not m_bFromParking OrElse m_bKeyLeftShiftPressed) Then
|
||||||
|
' Calcolo il centro di rotazione come centro del cluster
|
||||||
|
Dim ptCen As Point3d
|
||||||
|
If Not EgtGetPartPartClusterCenterGlob(nMoveId, ptCen) Then Return
|
||||||
|
' definisco il vettore dal centro del pezzo alla posizione del cursore
|
||||||
|
Dim vtCurr As Vector3d = ptCurr - ptCen
|
||||||
|
Dim dLen, dHAng, dVAng As Double
|
||||||
|
' recupero l'angolo orizzontale del vettore
|
||||||
|
vtCurr.ToSpherical(dLen, dHAng, dVAng)
|
||||||
|
If Not m_bStartRot Then
|
||||||
|
m_dAngTotal = 0
|
||||||
|
' notifico una rotazione
|
||||||
|
m_bStartRot = True
|
||||||
|
m_dStartAng = dVAng
|
||||||
|
End If
|
||||||
|
Dim dDeltaAng As Double = dVAng - m_dStartAng
|
||||||
|
' gestione del passaggio da 0° → 360° evitando mantenendo la visualizzazione fluida
|
||||||
|
If Math.Abs(dDeltaAng) > 90 Then
|
||||||
|
If m_dStartAng < 180 And dVAng > 180 Then
|
||||||
|
dDeltaAng = dVAng - 360 - m_dStartAng
|
||||||
|
ElseIf m_dStartAng > 180 And dVAng < 180 Then
|
||||||
|
dDeltaAng = dVAng - m_dStartAng + 360
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' Rotazione del pezzo attorno al suo centro
|
||||||
|
If Math.Abs(dDeltaAng) > EPS_ANG_SMALL Then
|
||||||
|
' se il tasto Shift è premuto (disabilitato il controllo collisioni durante il Drag)
|
||||||
|
If m_bKeyLeftShiftPressed Then
|
||||||
|
EgtRotate(nMoveId, ptCen, Vector3d.Z_AX(), dDeltaAng, GDB_RT.GLOB)
|
||||||
|
m_dAngTotal += dDeltaAng
|
||||||
|
Else
|
||||||
|
' esegue la rotazione fino ad incontrare un altro pezzo
|
||||||
|
RotatePartInsideBond(dDeltaAng, nMoveId)
|
||||||
|
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||||
|
' Eventuale notifica al VeinMatching
|
||||||
|
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
VeinMatching.OnMovePartInRaw(nId)
|
||||||
|
nId = EgtGetNextSelectedObj()
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
m_dStartAng = dVAng
|
||||||
|
End If
|
||||||
|
'-------------Fine ROTAZIONE ----------------
|
||||||
|
|
||||||
|
Else
|
||||||
|
' -------------Inizio TRASLAZIONE ---------------
|
||||||
' Ricavo il vettore di movimento
|
' Ricavo il vettore di movimento
|
||||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||||
' Muovo i pezzi selezionati di quanto possibile
|
' Muovo i pezzi selezionati di quanto possibile
|
||||||
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
||||||
' Se movimento con sola verifica finale
|
' notifico una traslazione
|
||||||
|
If Not m_bStartMove Then
|
||||||
|
m_bStartMove = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Se movimento con sola verifica finale (disabilitato il controllo collisioni durante il Drag)
|
||||||
If m_bVerify Then
|
If m_bVerify Then
|
||||||
EgtMove(nMoveId, vtMove)
|
EgtMove(nMoveId, vtMove)
|
||||||
m_vtTotMove += vtMove
|
m_vtTotMove += vtMove
|
||||||
@@ -1159,8 +1228,13 @@ Public Class NestPageUC
|
|||||||
End If
|
End If
|
||||||
m_CurrProjPage.ResetOrderMachiningFlag()
|
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||||
End If
|
End If
|
||||||
|
' -------------Fine TRASLAZIONE ---------------
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Eventuale notifica al VeinMatching
|
' Eventuale notifica al VeinMatching
|
||||||
|
If m_bStartMove OrElse m_bStartRot Then
|
||||||
If nMoveId = GDB_ID.SEL Then
|
If nMoveId = GDB_ID.SEL Then
|
||||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
@@ -1171,6 +1245,7 @@ Public Class NestPageUC
|
|||||||
VeinMatching.OnMovePartInRaw(nMoveId)
|
VeinMatching.OnMovePartInRaw(nMoveId)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Aggiorno il punto precedente
|
' Aggiorno il punto precedente
|
||||||
m_ptPrev = ptCurr
|
m_ptPrev = ptCurr
|
||||||
' Terminata esecuzione di drag
|
' Terminata esecuzione di drag
|
||||||
@@ -1202,47 +1277,31 @@ Public Class NestPageUC
|
|||||||
|
|
||||||
' Se eseguito drag
|
' Se eseguito drag
|
||||||
If Not m_bDragToStart Then
|
If Not m_bDragToStart Then
|
||||||
' Se movimento con sola verifica finale
|
' Se movimento con sola verifica finale ----- TRASLAZIONE
|
||||||
If m_bVerify Then
|
If Not m_bStartRot And m_bStartMove Then
|
||||||
' Determino cosa verificare
|
VerifyMove()
|
||||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
' Se movimento con sola verifica finale ----- TRASLAZIONE + ROTAZIONE
|
||||||
' Aggiorno regioni per nesting
|
ElseIf m_bStartRot And m_bStartMove Then
|
||||||
UpdateNestRegions()
|
If Not m_bFromParking Then
|
||||||
EnableReferenceRegion(False)
|
VerifyRot()
|
||||||
' Eseguo verifica
|
|
||||||
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then
|
|
||||||
m_CurrProjPage.ResetOrderMachiningFlag()
|
|
||||||
' Non superata riporto alla posizione iniziale
|
|
||||||
Else
|
Else
|
||||||
|
' forzo il reset delle info di rotazione
|
||||||
|
m_dStartAng = 0
|
||||||
|
m_dAngTotal = 0
|
||||||
|
m_bStartRot = False
|
||||||
|
End If
|
||||||
|
VerifyMove()
|
||||||
|
' verifico se la posizione finale della rotazione è corretta ----- ROTAZIONE
|
||||||
|
ElseIf m_bStartRot And Not m_bStartMove Then
|
||||||
If m_bFromParking Then
|
If m_bFromParking Then
|
||||||
m_CurrProjPage.ClearMessage()
|
VerifyMove()
|
||||||
PreRemoveOnePart(nMoveId)
|
' forzo il reset delle info di rotazione
|
||||||
VeinMatching.OnRemovePartFromRaw(nMoveId)
|
m_dStartAng = 0
|
||||||
|
m_dAngTotal = 0
|
||||||
|
m_bStartRot = False
|
||||||
Else
|
Else
|
||||||
EgtMove(nMoveId, -m_vtTotMove)
|
VerifyRot()
|
||||||
' Eventuale notifica al VeinMatching
|
|
||||||
If nMoveId = GDB_ID.SEL Then
|
|
||||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
|
||||||
While nId <> GDB_ID.NULL
|
|
||||||
VeinMatching.OnMovePartInRaw(nId)
|
|
||||||
nId = EgtGetNextSelectedObj()
|
|
||||||
End While
|
|
||||||
Else
|
|
||||||
VeinMatching.OnMovePartInRaw(nMoveId)
|
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
'---------------------- COUNTER PART ----------------------
|
|
||||||
Dim sRefGroup As String = String.Empty
|
|
||||||
If EgtGetInfo(nMoveId, INFO_REFGROUP, sRefGroup) Then
|
|
||||||
' accendo il layer che contiene il contatore (spento in fase di Drag)
|
|
||||||
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nMoveId, INFO_COUNTERLY)
|
|
||||||
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
|
|
||||||
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
|
||||||
CountPartInFamily(sRefGroup)
|
|
||||||
End If
|
|
||||||
'---------------------- COUNTER PART ----------------------
|
|
||||||
End If
|
|
||||||
m_bFromParking = False
|
|
||||||
' altrimenti caso con verifica durante il movimento
|
' altrimenti caso con verifica durante il movimento
|
||||||
Else
|
Else
|
||||||
' Basta reset alla fine
|
' Basta reset alla fine
|
||||||
@@ -1294,8 +1353,8 @@ Public Class NestPageUC
|
|||||||
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
' Reset
|
' Reset
|
||||||
|
GetFamilyGroupInPark()
|
||||||
m_bDrag = False
|
m_bDrag = False
|
||||||
m_nIdToSel = GDB_ID.NULL
|
m_nIdToSel = GDB_ID.NULL
|
||||||
m_nIdToDesel = GDB_ID.NULL
|
m_nIdToDesel = GDB_ID.NULL
|
||||||
@@ -1306,6 +1365,70 @@ Public Class NestPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub VerifyMove()
|
||||||
|
If m_bVerify Then
|
||||||
|
' Determino cosa verificare
|
||||||
|
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||||
|
' Aggiorno regioni per nesting
|
||||||
|
UpdateNestRegions()
|
||||||
|
EnableReferenceRegion(False)
|
||||||
|
' Eseguo verifica
|
||||||
|
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then
|
||||||
|
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||||
|
' Non superata riporto alla posizione iniziale
|
||||||
|
Else
|
||||||
|
If m_bFromParking Then
|
||||||
|
m_CurrProjPage.ClearMessage()
|
||||||
|
PreRemoveOnePart(nMoveId)
|
||||||
|
VeinMatching.OnRemovePartFromRaw(nMoveId)
|
||||||
|
Else
|
||||||
|
EgtMove(nMoveId, -m_vtTotMove)
|
||||||
|
' Eventuale notifica al VeinMatching
|
||||||
|
If nMoveId = GDB_ID.SEL Then
|
||||||
|
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
VeinMatching.OnMovePartInRaw(nId)
|
||||||
|
nId = EgtGetNextSelectedObj()
|
||||||
|
End While
|
||||||
|
Else
|
||||||
|
VeinMatching.OnMovePartInRaw(nMoveId)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
|
' solo se pezzo disposto in tavola
|
||||||
|
If m_bFromParking Then
|
||||||
|
Dim sRefGroup As String = String.Empty
|
||||||
|
If EgtGetInfo(nMoveId, INFO_REFGROUP, sRefGroup) Then
|
||||||
|
' accendo il layer che contiene il contatore (spento in fase di Drag)
|
||||||
|
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nMoveId, INFO_COUNTERLY)
|
||||||
|
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
|
||||||
|
' aggiorno il layer che indica il numero di pezzi in parcheggio
|
||||||
|
CountPartInFamily(sRefGroup)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
'---------------------- COUNTER PART ----------------------
|
||||||
|
End If
|
||||||
|
m_bFromParking = False
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub VerifyRot()
|
||||||
|
' se comando Shift è stato attivato
|
||||||
|
If m_bKeyLeftShiftPressed Then
|
||||||
|
' Determino cosa verificare
|
||||||
|
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||||
|
If Not EgtVerifyPart(nMoveId, m_bReducedCut) Then
|
||||||
|
Dim ptCen As Point3d
|
||||||
|
If Not EgtGetPartPartClusterCenterGlob(nMoveId, ptCen) Then Return
|
||||||
|
EgtRotate(nMoveId, ptCen, Vector3d.Z_AX(), -m_dAngTotal, GDB_RT.GLOB)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' resetto i valori
|
||||||
|
m_dStartAng = 0
|
||||||
|
m_dAngTotal = 0
|
||||||
|
m_bStartRot = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function SelectPart(nPartId As Integer, bNotifyVM As Boolean) As Boolean
|
Friend Function SelectPart(nPartId As Integer, bNotifyVM As Boolean) As Boolean
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Determino se pezzo in tavola o in parcheggio
|
' Determino se pezzo in tavola o in parcheggio
|
||||||
@@ -1577,7 +1700,7 @@ Public Class NestPageUC
|
|||||||
If m_nPartPos <> PART_POS.IN_TABLE Then
|
If m_nPartPos <> PART_POS.IN_TABLE Then
|
||||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
' Se pezzo con rotazione libera
|
' Se pezzo con rotazione libera (in parcheggio)
|
||||||
If Not EgtExistsInfo(nId, INFO_PARTROT) Then
|
If Not EgtExistsInfo(nId, INFO_PARTROT) Then
|
||||||
' Calcolo il centro di rotazione come centro del pezzo
|
' Calcolo il centro di rotazione come centro del pezzo
|
||||||
Dim ptCen As Point3d
|
Dim ptCen As Point3d
|
||||||
@@ -1613,26 +1736,31 @@ Public Class NestPageUC
|
|||||||
Return True
|
Return True
|
||||||
' Altrimenti li ruoto tenendo conto delle collisioni
|
' Altrimenti li ruoto tenendo conto delle collisioni
|
||||||
Else
|
Else
|
||||||
|
Return RotatePartInsideBond(dAngRotDeg, GDB_ID.SEL)
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' verifica che la rotazione sia ammessa
|
||||||
|
Private Function RotatePartInsideBond(dAngRotDeg As Double, nIdMove As Integer) As Boolean
|
||||||
' Verifico se ci sono dei pezzi bloccati in rotazione
|
' Verifico se ci sono dei pezzi bloccati in rotazione
|
||||||
Dim bLockedRot As Boolean = GetLockOnRotation(GDB_ID.SEL)
|
Dim bLockedRot As Boolean = GetLockOnRotation(nIdMove)
|
||||||
' Se tutti i pezzi possono ruotare
|
' Se tutti i pezzi possono ruotare
|
||||||
If Not bLockedRot Then
|
If Not bLockedRot Then
|
||||||
' Calcolo il centro di rotazione come centro del cluster
|
' Calcolo il centro di rotazione come centro del cluster
|
||||||
Dim ptCen As Point3d
|
Dim ptCen As Point3d
|
||||||
If Not EgtGetPartPartClusterCenterGlob(GDB_ID.SEL, ptCen) Then Return False
|
If Not EgtGetPartPartClusterCenterGlob(nIdMove, ptCen) Then Return False
|
||||||
' Aggiorno regioni per nesting
|
' Aggiorno regioni per nesting
|
||||||
UpdateNestRegions()
|
UpdateNestRegions()
|
||||||
EnableReferenceRegion(False)
|
EnableReferenceRegion(False)
|
||||||
' Verifico rotazione complessiva
|
' Verifico rotazione complessiva
|
||||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
EgtRotate(nIdMove, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
|
||||||
If EgtVerifyPart(GDB_ID.SEL, m_bReducedCut) Then Return True
|
If EgtVerifyPart(nIdMove, m_bReducedCut) Then Return True
|
||||||
' Provo rotazione parziale (dopo aver annullato la complessiva)
|
' Provo rotazione parziale (dopo aver annullato la complessiva)
|
||||||
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
|
EgtRotate(nIdMove, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
|
||||||
Return EgtRotatePart(GDB_ID.SEL, m_bReducedCut, ptCen, dAngRotDeg)
|
Return EgtRotatePart(nIdMove, m_bReducedCut, ptCen, dAngRotDeg)
|
||||||
Else
|
Else
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub UserRotateAllRawParts(dAngDeg As Double)
|
Private Sub UserRotateAllRawParts(dAngDeg As Double)
|
||||||
@@ -2314,6 +2442,11 @@ Public Class NestPageUC
|
|||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' ripulisco la lista dei pezzi in parcheggio
|
||||||
|
Friend Sub ResetListOfGruopInPark()
|
||||||
|
m_ListOfGroupInPark.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function StoreOnePart(nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean
|
Friend Function StoreOnePart(nId As Integer, Optional ByVal bForced As Boolean = False) As Boolean
|
||||||
' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
|
' Se pezzo in grezzo, metto in parcheggio (sempre possibile)
|
||||||
If bForced OrElse
|
If bForced OrElse
|
||||||
|
|||||||
@@ -98,14 +98,15 @@ Public Module SplitAuto
|
|||||||
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
||||||
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
||||||
Dim nEntId, nSub As Integer
|
Dim nEntId, nSub As Integer
|
||||||
If EgtGetMachiningGeometry( 0, nEntId, nSub) Then
|
If EgtGetMachiningGeometry(0, nEntId, nSub) Then
|
||||||
If EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse EgtGetType( nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng)
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng)
|
||||||
EgtGetInfo( nEntId, If( Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
|
||||||
Mach.m_bEnableInvert = GetEnableInvert( nEntId)
|
EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen)
|
||||||
EgtMidVector( nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
Mach.m_bEnableInvert = GetEnableInvert(nEntId)
|
||||||
|
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||||
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
||||||
Mach.m_nEntId = nEntId
|
Mach.m_nEntId = nEntId
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -63,17 +63,27 @@
|
|||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"
|
<ListBox Name="MachiningLsBx" Grid.Row="1"
|
||||||
SelectionMode="Extended">
|
SelectionMode="Extended">
|
||||||
<ListBox.ItemContainerStyle>
|
<ListBox.ItemTemplate>
|
||||||
<Style TargetType="ListBoxItem">
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Name}">
|
||||||
|
<TextBlock.Style>
|
||||||
|
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_CurrProjSummeryTextBlock}">
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||||
|
<Setter Property="TextDecorations" Value="Strikethrough"/>
|
||||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
</ListBox.ItemContainerStyle>
|
</TextBlock.Style>
|
||||||
|
</TextBlock>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<Grid Grid.Row="2">
|
<Grid Grid.Row="2">
|
||||||
@@ -122,23 +132,31 @@
|
|||||||
<Button Name="CutBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="CutBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="CutStartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Inizio-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="CutEndBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource Fine-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
<!-- solo per macchine con lavorazioni Waterjet -->
|
<!-- solo per macchine con lavorazioni Waterjet -->
|
||||||
<ToggleButton Name="BridgesWJBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
<ToggleButton Name="BridgesWJBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource PonticelliWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
|
<!--solo per macchine con lavorazioni Waterjet-->
|
||||||
|
<Button Name="QualityWJBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource QualityWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
<!-- solo per macchine con lavorazioni Waterjet -->
|
<!-- solo per macchine con lavorazioni Waterjet -->
|
||||||
<ToggleButton Name="BridgesDeleteWJBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
<ToggleButton Name="BridgesDeleteWJBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource PonticelliDeleteWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource PonticelliDeleteWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
<Button Name="CutEndBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
|
||||||
<Image Source="{DynamicResource Fine-Allunga-AccorciaImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ Public Class SplitPageUC
|
|||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MOVE_PARTS) AndAlso
|
||||||
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
|
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
|
||||||
' verifico se è abilitata la possibiltà di allungare i lati interni
|
' verifico se è abilitata la possibiltà di allungare i lati interni
|
||||||
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
' Nascondo eventuali pezzi in parcheggio
|
' Nascondo eventuali pezzi in parcheggio
|
||||||
HideParkedParts()
|
HideParkedParts()
|
||||||
' Nascondo eventuale contorno da foto
|
' Nascondo eventuale contorno da foto
|
||||||
@@ -978,6 +978,54 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub QualityWJBtn_Click(Sender As Object, e As RoutedEventArgs) Handles QualityWJBtn.Click
|
||||||
|
Dim bFirstWJ As Boolean = True
|
||||||
|
Dim sQuality As String = String.Empty
|
||||||
|
' Recupero la lavorazione corrente
|
||||||
|
If m_CurrFirstInd = -1 Then Return
|
||||||
|
Dim bGenModif As Boolean = False
|
||||||
|
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||||
|
If Not m_ItemList(Index).IsSelected Then
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
Dim nI As Integer = m_ItemList(Index).Ind
|
||||||
|
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||||
|
Dim nMachiningType As Integer = EgtGetOperationType(nOperId)
|
||||||
|
' se altrimenti getto d'acqua
|
||||||
|
If nMachiningType = MCH_MY.WATERJETTING Then
|
||||||
|
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||||
|
If bFirstWJ Then
|
||||||
|
EgtSetCurrMachining(nOperId)
|
||||||
|
' Dialogo richiesta valore
|
||||||
|
Dim ValWnd As New EditValueWD(m_MainWindow, m_MainWindow.m_CurrentMachine.Qualities, "Quality")
|
||||||
|
If EgtGetInfo(nOperId, "Quality", sQuality) Then
|
||||||
|
ValWnd.SetItemComboBox(sQuality)
|
||||||
|
Else
|
||||||
|
ValWnd.SetItemComboBox(m_MainWindow.m_CurrentMachine.sCurrWaterJettingQuality)
|
||||||
|
End If
|
||||||
|
If Not ValWnd.ShowDialog() Then Return
|
||||||
|
sQuality = ValWnd.GetItemComboBox
|
||||||
|
' comunico che ho letto il primo dato
|
||||||
|
bFirstWJ = False
|
||||||
|
End If
|
||||||
|
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||||
|
' Modifica della lavorazione
|
||||||
|
EgtSetCurrMachining(nOperId)
|
||||||
|
EgtSetInfo(nOperId, "Quality", sQuality)
|
||||||
|
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||||
|
' verifico interferenza
|
||||||
|
bGenModif = True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' Se modificato qualcosa
|
||||||
|
If bGenModif Then
|
||||||
|
EgtDraw()
|
||||||
|
m_bModified = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function AdjustBothCuts(nI As Integer,
|
Private Function AdjustBothCuts(nI As Integer,
|
||||||
Optional bAllForced As Boolean = False,
|
Optional bAllForced As Boolean = False,
|
||||||
Optional bAccForced As Boolean = False) As Boolean
|
Optional bAccForced As Boolean = False) As Boolean
|
||||||
@@ -1332,6 +1380,7 @@ Public Class SplitPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
|
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
|
||||||
|
Dim bLen As Boolean = True
|
||||||
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
||||||
Dim bFirstInd As Boolean = True
|
Dim bFirstInd As Boolean = True
|
||||||
Dim bFirstMill As Boolean = True
|
Dim bFirstMill As Boolean = True
|
||||||
@@ -1367,10 +1416,10 @@ Public Class SplitPageUC
|
|||||||
If bFirstInd Then
|
If bFirstInd Then
|
||||||
' Dialogo richiesta valore
|
' Dialogo richiesta valore
|
||||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||||
ValWnd.SetVal(dOrigUsal)
|
ValWnd.SetVal(dOrigUsal, bLen)
|
||||||
If Not ValWnd.ShowDialog() Then Return
|
If Not ValWnd.ShowDialog() Then Return
|
||||||
' carico il valore letto dal testierino virtuale
|
' carico il valore letto dal testierino virtuale
|
||||||
dUsal = ValWnd.GetVal()
|
dUsal = ValWnd.GetVal(bLen)
|
||||||
' comunico che ho letto il primo dato
|
' comunico che ho letto il primo dato
|
||||||
bFirstInd = False
|
bFirstInd = False
|
||||||
End If
|
End If
|
||||||
@@ -1425,10 +1474,10 @@ Public Class SplitPageUC
|
|||||||
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
' ------------------ INIZIO PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||||
' Dialogo richiesta valore
|
' Dialogo richiesta valore
|
||||||
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||||
ValWnd.SetVal(dOrigUsal)
|
ValWnd.SetVal(dOrigUsal, bLen)
|
||||||
If Not ValWnd.ShowDialog() Then Return
|
If Not ValWnd.ShowDialog() Then Return
|
||||||
' carico il valore letto dal testierino virtuale
|
' carico il valore letto dal testierino virtuale
|
||||||
dUsal = ValWnd.GetVal()
|
dUsal = ValWnd.GetVal(bLen)
|
||||||
' comunico che ho letto il primo dato
|
' comunico che ho letto il primo dato
|
||||||
bFirstMill = False
|
bFirstMill = False
|
||||||
End If
|
End If
|
||||||
@@ -1506,6 +1555,7 @@ Public Class SplitPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
|
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
|
||||||
|
Dim bLen As Boolean = True
|
||||||
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
' abilito la finestra per inserire i valori solo per il primo elemento della lista (di default tutti gli altri oggetti assumono lo stesso valore)
|
||||||
Dim bFirstInd As Boolean = True
|
Dim bFirstInd As Boolean = True
|
||||||
Dim bFirstMill As Boolean = True
|
Dim bFirstMill As Boolean = True
|
||||||
@@ -1540,9 +1590,9 @@ Public Class SplitPageUC
|
|||||||
If bFirstInd Then
|
If bFirstInd Then
|
||||||
' Dialogo richiesta valore
|
' Dialogo richiesta valore
|
||||||
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
Dim ValWnd As New EditValueWD(m_MainWindow, "SAW: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||||
ValWnd.SetVal(dOrigUeal)
|
ValWnd.SetVal(dOrigUeal, bLen)
|
||||||
If Not ValWnd.ShowDialog() Then Return
|
If Not ValWnd.ShowDialog() Then Return
|
||||||
dUeal = ValWnd.GetVal()
|
dUeal = ValWnd.GetVal(bLen)
|
||||||
bFirstInd = False
|
bFirstInd = False
|
||||||
End If
|
End If
|
||||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||||
@@ -1595,9 +1645,9 @@ Public Class SplitPageUC
|
|||||||
If bFirstMill Then
|
If bFirstMill Then
|
||||||
' Dialogo richiesta valore
|
' Dialogo richiesta valore
|
||||||
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
Dim ValWnd As New EditValueWD(m_MainWindow, "MILL: " & EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||||
ValWnd.SetVal(dOrigUeal)
|
ValWnd.SetVal(dOrigUeal, bLen)
|
||||||
If Not ValWnd.ShowDialog() Then Return
|
If Not ValWnd.ShowDialog() Then Return
|
||||||
dUeal = ValWnd.GetVal()
|
dUeal = ValWnd.GetVal(bLen)
|
||||||
bFirstMill = False
|
bFirstMill = False
|
||||||
End If
|
End If
|
||||||
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
' ------------------ FINE PREPARAZIONE TASTIERINO VIRTUALE ------------------
|
||||||
@@ -1958,7 +2008,7 @@ Public Class SplitPageUC
|
|||||||
Dim MyCuts As New List(Of Integer)
|
Dim MyCuts As New List(Of Integer)
|
||||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||||
If m_MachiningList(nI).m_bEnabled And
|
If m_MachiningList(nI).m_bEnabled And
|
||||||
( m_MachiningList(nI).m_sLay = NAME_OUTLOOP Or m_MachiningList(nI).m_sLay = NAME_INLOOP) Then
|
(m_MachiningList(nI).m_sLay = NAME_OUTLOOP Or m_MachiningList(nI).m_sLay = NAME_INLOOP) Then
|
||||||
MyCuts.Add(m_MachiningList(nI).m_nId)
|
MyCuts.Add(m_MachiningList(nI).m_nId)
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -1970,7 +2020,7 @@ Public Class SplitPageUC
|
|||||||
PrevBtn.IsEnabled = (m_nCurrPhase > 1)
|
PrevBtn.IsEnabled = (m_nCurrPhase > 1)
|
||||||
' Per bottone NEXT
|
' Per bottone NEXT
|
||||||
' Se abilitato manipolatore e non è con waterjet
|
' Se abilitato manipolatore e non è con waterjet
|
||||||
If ( m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Or
|
If (m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Or
|
||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP)) And
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_MANIP)) And
|
||||||
Not m_MainWindow.m_CurrentMachine.bWaterJetting Then
|
Not m_MainWindow.m_CurrentMachine.bWaterJetting Then
|
||||||
' Se in modifica
|
' Se in modifica
|
||||||
@@ -2032,6 +2082,7 @@ Public Class SplitPageUC
|
|||||||
PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause
|
PauseBtn.IsEnabled = Not m_bShow And m_MainWindow.m_CurrentMachine.bEnablePause
|
||||||
BridgesWJBtn.IsEnabled = Not m_bShow
|
BridgesWJBtn.IsEnabled = Not m_bShow
|
||||||
BridgesDeleteWJBtn.IsEnabled = Not m_bShow
|
BridgesDeleteWJBtn.IsEnabled = Not m_bShow
|
||||||
|
QualityWJBtn.IsEnabled = Not m_bShow
|
||||||
|
|
||||||
' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive
|
' nascondo i comandi che non devono essere visualizzati in funzione delle lavorazioni attive
|
||||||
If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining) Then
|
If m_nCountSawing = 0 And (m_nCountWaterjetting > 0 Or m_nCountOtherMachining) Then
|
||||||
@@ -2151,13 +2202,16 @@ Public Class SplitPageUC
|
|||||||
If CutStartBtn.Visibility = Visibility.Hidden Then
|
If CutStartBtn.Visibility = Visibility.Hidden Then
|
||||||
BridgesWJBtn.Visibility = Visibility.Visible
|
BridgesWJBtn.Visibility = Visibility.Visible
|
||||||
BridgesDeleteWJBtn.Visibility = Visibility.Visible
|
BridgesDeleteWJBtn.Visibility = Visibility.Visible
|
||||||
|
QualityWJBtn.Visibility = Visibility.Visible
|
||||||
Else
|
Else
|
||||||
BridgesWJBtn.Visibility = Visibility.Hidden
|
BridgesWJBtn.Visibility = Visibility.Hidden
|
||||||
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
|
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
|
||||||
|
QualityWJBtn.Visibility = Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
BridgesWJBtn.Visibility = Visibility.Hidden
|
BridgesWJBtn.Visibility = Visibility.Hidden
|
||||||
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
|
BridgesDeleteWJBtn.Visibility = Visibility.Hidden
|
||||||
|
QualityWJBtn.Visibility = Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2179,7 +2233,7 @@ Public Class SplitPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub NumberDirectionMachining( nI As Integer, Optional bNumber As Boolean = True)
|
Private Sub NumberDirectionMachining(nI As Integer, Optional bNumber As Boolean = True)
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
' Determino se seconda lavorazione
|
' Determino se seconda lavorazione
|
||||||
Dim sName As String = String.Empty
|
Dim sName As String = String.Empty
|
||||||
@@ -2213,28 +2267,28 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If bNumber Then
|
If bNumber Then
|
||||||
Dim nNbrId As Integer = EgtCreateTextAdv( m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
|
Dim nNbrId As Integer = EgtCreateTextAdv(m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
|
||||||
300, False, dHtxt, dRat, 0, INS_POS.MC)
|
300, False, dHtxt, dRat, 0, INS_POS.MC)
|
||||||
m_MachiningList(nI).m_nNbrId = nNbrId
|
m_MachiningList(nI).m_nNbrId = nNbrId
|
||||||
' Aggiungo a numero info con identificativo della lavorazione e viceversa
|
' Aggiungo a numero info con identificativo della lavorazione e viceversa
|
||||||
EgtSetInfo( nNbrId, "MId", m_MachiningList(nI).m_nId)
|
EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId)
|
||||||
EgtSetInfo( m_MachiningList(nI).m_nId, "NbrId", nNbrId)
|
EgtSetInfo(m_MachiningList(nI).m_nId, "NbrId", nNbrId)
|
||||||
End If
|
End If
|
||||||
' Se taglio con lama, metto la direzione accanto al numero
|
' Se taglio con lama, metto la direzione accanto al numero
|
||||||
If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then
|
If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then
|
||||||
Dim ptStart As New Point3d( ptCen + m_MachiningList(nI).m_vtDir * dHtxt)
|
Dim ptStart As New Point3d(ptCen + m_MachiningList(nI).m_vtDir * dHtxt)
|
||||||
Dim vtDir As New Vector3d( m_MachiningList(nI).m_vtDir)
|
Dim vtDir As New Vector3d(m_MachiningList(nI).m_vtDir)
|
||||||
Dim bTwin As Boolean = ( Not m_MachiningList(nI).m_bEnableInvert OrElse Math.Abs( m_MachiningList(nI).m_dSideAng) > 0.1)
|
Dim bTwin As Boolean = (Not m_MachiningList(nI).m_bEnableInvert OrElse Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1)
|
||||||
Dim nArrId As Integer = AddMachiningDirection( ptStart, vtDir, dHtxt, bTwin)
|
Dim nArrId As Integer = AddMachiningDirection(ptStart, vtDir, dHtxt, bTwin)
|
||||||
m_MachiningList(nI).m_nArrId = nArrId
|
m_MachiningList(nI).m_nArrId = nArrId
|
||||||
' Aggiungo a freccia info con identificativo della lavorazione e viceversa
|
' Aggiungo a freccia info con identificativo della lavorazione e viceversa
|
||||||
EgtSetInfo( nArrId, "MId", m_MachiningList(nI).m_nId)
|
EgtSetInfo(nArrId, "MId", m_MachiningList(nI).m_nId)
|
||||||
EgtSetInfo( m_MachiningList(nI).m_nId, "ArrId", nArrId)
|
EgtSetInfo(m_MachiningList(nI).m_nId, "ArrId", nArrId)
|
||||||
Else
|
Else
|
||||||
m_MachiningList(nI).m_nArrId = GDB_ID.NULL
|
m_MachiningList(nI).m_nArrId = GDB_ID.NULL
|
||||||
End If
|
End If
|
||||||
' Assegno colore a numero e freccia
|
' Assegno colore a numero e freccia
|
||||||
ColorNumberArrow( nI)
|
ColorNumberArrow(nI)
|
||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2296,18 +2350,18 @@ Public Class SplitPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function AddMachiningDirection( ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
|
Private Function AddMachiningDirection(ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
|
||||||
Dim dArrX As Double = dLen * Math.Cos( 30 * Math.PI / 180)
|
Dim dArrX As Double = dLen * Math.Cos(30 * Math.PI / 180)
|
||||||
Dim dArrY As Double = dLen * Math.Sin( 30 * Math.PI / 180)
|
Dim dArrY As Double = dLen * Math.Sin(30 * Math.PI / 180)
|
||||||
Dim nTmpId As Integer = EgtCreateLine( m_nNbrGrpId, Point3d.ORIG() + dArrY * Vector3d.Y_AX(), Point3d.ORIG() + dArrX * Vector3d.X_AX())
|
Dim nTmpId As Integer = EgtCreateLine(m_nNbrGrpId, Point3d.ORIG() + dArrY * Vector3d.Y_AX(), Point3d.ORIG() + dArrX * Vector3d.X_AX())
|
||||||
Dim nCrvId As Integer = EgtCreateCurveCompo( m_nNbrGrpId, nTmpId, True)
|
Dim nCrvId As Integer = EgtCreateCurveCompo(m_nNbrGrpId, nTmpId, True)
|
||||||
EgtAddCurveCompoLine( nCrvId, Point3d.ORIG() - dArrY * Vector3d.Y_AX())
|
EgtAddCurveCompoLine(nCrvId, Point3d.ORIG() - dArrY * Vector3d.Y_AX())
|
||||||
If bTwin Then
|
If bTwin Then
|
||||||
EgtAddCurveCompoLine( nCrvId, Point3d.ORIG() + 2 * dArrX * Vector3d.X_AX())
|
EgtAddCurveCompoLine(nCrvId, Point3d.ORIG() + 2 * dArrX * Vector3d.X_AX())
|
||||||
EgtCloseCurveCompo( nCrvId)
|
EgtCloseCurveCompo(nCrvId)
|
||||||
End If
|
End If
|
||||||
Dim frLoc As New Frame3d( ptStart, vtDir, Vector3d.Z_AX() ^ vtDir, Vector3d.Z_AX())
|
Dim frLoc As New Frame3d(ptStart, vtDir, Vector3d.Z_AX() ^ vtDir, Vector3d.Z_AX())
|
||||||
EgtTransform( nCrvId, frLoc)
|
EgtTransform(nCrvId, frLoc)
|
||||||
Return nCrvId
|
Return nCrvId
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -2338,35 +2392,35 @@ Public Class SplitPageUC
|
|||||||
Private Sub MarkNumberArrow(nI As Integer, bMark As Boolean)
|
Private Sub MarkNumberArrow(nI As Integer, bMark As Boolean)
|
||||||
If nI < 0 Then Return
|
If nI < 0 Then Return
|
||||||
Dim nNbrId As Integer = m_MachiningList(nI).m_nNbrId
|
Dim nNbrId As Integer = m_MachiningList(nI).m_nNbrId
|
||||||
Dim nArrId As Integer = m_MachiningList( nI).m_nArrId
|
Dim nArrId As Integer = m_MachiningList(nI).m_nArrId
|
||||||
If bMark Then
|
If bMark Then
|
||||||
EgtSetMark( nNbrId)
|
EgtSetMark(nNbrId)
|
||||||
EgtSetMark( nArrId)
|
EgtSetMark(nArrId)
|
||||||
Else
|
Else
|
||||||
EgtResetMark( nNbrId)
|
EgtResetMark(nNbrId)
|
||||||
EgtResetMark( nArrId)
|
EgtResetMark(nArrId)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ColorNumberArrow( nI As Integer)
|
Private Sub ColorNumberArrow(nI As Integer)
|
||||||
If nI < 0 Then Return
|
If nI < 0 Then Return
|
||||||
Dim nNbrId As Integer = m_MachiningList( nI).m_nNbrId
|
Dim nNbrId As Integer = m_MachiningList(nI).m_nNbrId
|
||||||
Dim nArrId As Integer = m_MachiningList( nI).m_nArrId
|
Dim nArrId As Integer = m_MachiningList(nI).m_nArrId
|
||||||
If m_MachiningList( nI).m_bEnabled Then
|
If m_MachiningList(nI).m_bEnabled Then
|
||||||
If m_MachiningList( nI).m_nInterf = FMI_TYPE.NONE Then
|
If m_MachiningList(nI).m_nInterf = FMI_TYPE.NONE Then
|
||||||
EgtSetColor( nNbrId, COL_MCH_FREE)
|
EgtSetColor(nNbrId, COL_MCH_FREE)
|
||||||
EgtSetColor( nArrId, COL_MCH_FREE)
|
EgtSetColor(nArrId, COL_MCH_FREE)
|
||||||
Else
|
Else
|
||||||
EgtSetColor( nNbrId, COL_MCH_INTERF)
|
EgtSetColor(nNbrId, COL_MCH_INTERF)
|
||||||
EgtSetColor( nArrId, COL_MCH_INTERF)
|
EgtSetColor(nArrId, COL_MCH_INTERF)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If m_MachiningList( nI).m_nInterf = FMI_TYPE.NONE Then
|
If m_MachiningList(nI).m_nInterf = FMI_TYPE.NONE Then
|
||||||
EgtResetColor( nNbrId)
|
EgtResetColor(nNbrId)
|
||||||
EgtResetColor( nArrId)
|
EgtResetColor(nArrId)
|
||||||
ElseIf Not m_MachiningList( nI).m_bEnabled Then
|
ElseIf Not m_MachiningList(nI).m_bEnabled Then
|
||||||
EgtSetColor( nNbrId, COL_MCH_DIS_INTERF)
|
EgtSetColor(nNbrId, COL_MCH_DIS_INTERF)
|
||||||
EgtSetColor( nArrId, COL_MCH_DIS_INTERF)
|
EgtSetColor(nArrId, COL_MCH_DIS_INTERF)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2392,38 +2446,38 @@ Public Class SplitPageUC
|
|||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SwapStartEndData( nI As Integer)
|
Private Sub SwapStartEndData(nI As Integer)
|
||||||
' Swap angoli precedente e successivo
|
' Swap angoli precedente e successivo
|
||||||
Dim dAng As Double = m_MachiningList( nI).m_dPrevAng
|
Dim dAng As Double = m_MachiningList(nI).m_dPrevAng
|
||||||
m_MachiningList( nI).m_dPrevAng = m_MachiningList( nI).m_dNextAng
|
m_MachiningList(nI).m_dPrevAng = m_MachiningList(nI).m_dNextAng
|
||||||
m_MachiningList( nI).m_dNextAng = dAng
|
m_MachiningList(nI).m_dNextAng = dAng
|
||||||
' Swap lunghezze libere
|
' Swap lunghezze libere
|
||||||
Dim dFreeLen As Double = m_MachiningList( nI).m_dStartFreeLen
|
Dim dFreeLen As Double = m_MachiningList(nI).m_dStartFreeLen
|
||||||
m_MachiningList( nI).m_dStartFreeLen = m_MachiningList( nI).m_dEndFreeLen
|
m_MachiningList(nI).m_dStartFreeLen = m_MachiningList(nI).m_dEndFreeLen
|
||||||
m_MachiningList( nI).m_dEndFreeLen = dFreeLen
|
m_MachiningList(nI).m_dEndFreeLen = dFreeLen
|
||||||
' Swap stato di allungamento
|
' Swap stato di allungamento
|
||||||
Dim bAll As Boolean = m_MachiningList( nI).m_bStartAll
|
Dim bAll As Boolean = m_MachiningList(nI).m_bStartAll
|
||||||
m_MachiningList( nI).m_bStartAll = m_MachiningList( nI).m_bEndAll
|
m_MachiningList(nI).m_bStartAll = m_MachiningList(nI).m_bEndAll
|
||||||
m_MachiningList( nI).m_bEndAll = bAll
|
m_MachiningList(nI).m_bEndAll = bAll
|
||||||
' Swap possibilità di allungamento
|
' Swap possibilità di allungamento
|
||||||
Dim bCanAll As Boolean = m_MachiningList( nI).m_bCanStartAll
|
Dim bCanAll As Boolean = m_MachiningList(nI).m_bCanStartAll
|
||||||
m_MachiningList( nI).m_bCanStartAll = m_MachiningList( nI).m_bCanEndAll
|
m_MachiningList(nI).m_bCanStartAll = m_MachiningList(nI).m_bCanEndAll
|
||||||
m_MachiningList( nI).m_bCanEndAll = bCanAll
|
m_MachiningList(nI).m_bCanEndAll = bCanAll
|
||||||
' Swap stato interferenza
|
' Swap stato interferenza
|
||||||
if ( m_MachiningList( nI).m_nInterf And FMI_TYPE.LI) <> 0 And ( m_MachiningList( nI).m_nInterf And FMI_TYPE.LO) = 0 Then
|
If (m_MachiningList(nI).m_nInterf And FMI_TYPE.LI) <> 0 And (m_MachiningList(nI).m_nInterf And FMI_TYPE.LO) = 0 Then
|
||||||
m_MachiningList( nI).m_nInterf -= FMI_TYPE.LI
|
m_MachiningList(nI).m_nInterf -= FMI_TYPE.LI
|
||||||
m_MachiningList( nI).m_nInterf += FMI_TYPE.LO
|
m_MachiningList(nI).m_nInterf += FMI_TYPE.LO
|
||||||
ElseIf ( m_MachiningList( nI).m_nInterf And FMI_TYPE.LI) = 0 And ( m_MachiningList( nI).m_nInterf And FMI_TYPE.LO) <> 0 Then
|
ElseIf (m_MachiningList(nI).m_nInterf And FMI_TYPE.LI) = 0 And (m_MachiningList(nI).m_nInterf And FMI_TYPE.LO) <> 0 Then
|
||||||
m_MachiningList( nI).m_nInterf += FMI_TYPE.LI
|
m_MachiningList(nI).m_nInterf += FMI_TYPE.LI
|
||||||
m_MachiningList( nI).m_nInterf -= FMI_TYPE.LO
|
m_MachiningList(nI).m_nInterf -= FMI_TYPE.LO
|
||||||
End If
|
End If
|
||||||
' Swap Allungamento Utente
|
' Swap Allungamento Utente
|
||||||
Dim dOrigUsal As Double = 0
|
Dim dOrigUsal As Double = 0
|
||||||
EgtGetInfo( m_MachiningList( nI).m_nId, INFO_MCH_USER_SAL, dOrigUsal)
|
EgtGetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||||
Dim dOrigUeal As Double = 0
|
Dim dOrigUeal As Double = 0
|
||||||
EgtGetInfo( m_MachiningList( nI).m_nId, INFO_MCH_USER_EAL, dOrigUeal)
|
EgtGetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||||
EgtSetInfo( m_MachiningList( nI).m_nId, INFO_MCH_USER_SAL, dOrigUeal)
|
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_SAL, dOrigUeal)
|
||||||
EgtSetInfo( m_MachiningList( nI).m_nId, INFO_MCH_USER_EAL, dOrigUsal)
|
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_EAL, dOrigUsal)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -67,17 +67,17 @@ Module VacuumCups
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' carico i dati macchina relativi al peso massimo movimentabile
|
' carico i dati macchina relativi al peso massimo movimentabile
|
||||||
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
|
Friend Sub SetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
|
||||||
m_RawDensity = Density
|
m_RawDensity = Density
|
||||||
m_MaxWeightSinglePlugger = MaxSingle
|
m_MaxWeightSinglePlugger = MaxSingle
|
||||||
m_MaxWeightDoublePlugger = MaxDouble
|
m_MaxWeightDoublePlugger = MaxDouble
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
|
Friend Sub SetRotationForExtraStrokeY(Rotate As Boolean)
|
||||||
bRotateVacuumNearExtraStrokeY = Rotate
|
bRotateVacuumNearExtraStrokeY = Rotate
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
|
Friend Sub SetRotationForExtraStrokeX(Rotate As Boolean)
|
||||||
bRotateVacuumNearExtraStrokeX = Rotate
|
bRotateVacuumNearExtraStrokeX = Rotate
|
||||||
End Sub
|
End Sub
|
||||||
Friend Function GetVacuumId() As Integer
|
Friend Function GetVacuumId() As Integer
|
||||||
@@ -451,14 +451,14 @@ Module VacuumCups
|
|||||||
Dim dPreferredRot As Double = m_dPreferredRot
|
Dim dPreferredRot As Double = m_dPreferredRot
|
||||||
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
|
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
|
||||||
' verifico l'orientamento del pezzo
|
' verifico l'orientamento del pezzo
|
||||||
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
|
If bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
|
||||||
' se l'orientamento è verticale
|
' se l'orientamento è verticale
|
||||||
If frMinRect.Orig().x < b3Tab.Center().x Then
|
If frMinRect.Orig().x < b3Tab.Center().x Then
|
||||||
dPreferredRot = m_dPrefVertRotXMinus
|
dPreferredRot = m_dPrefVertRotXMinus
|
||||||
Else
|
Else
|
||||||
dPreferredRot = m_dPrefVertRotXPlus
|
dPreferredRot = m_dPrefVertRotXPlus
|
||||||
End If
|
End If
|
||||||
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
|
ElseIf bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
|
||||||
' se l'orientemanto è orizzontale e la macchina è stata abilitata
|
' se l'orientemanto è orizzontale e la macchina è stata abilitata
|
||||||
If frMinRect.Orig().y < b3Tab.Center().y Then
|
If frMinRect.Orig().y < b3Tab.Center().y Then
|
||||||
dPreferredRot = m_dPrefVertRotYPlus
|
dPreferredRot = m_dPrefVertRotYPlus
|
||||||
@@ -467,7 +467,7 @@ Module VacuumCups
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
|
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
|
||||||
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
Dim dAngDelta As Double = If(Math.Abs(b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
||||||
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
||||||
dRotAngDeg -= dAngDelta
|
dRotAngDeg -= dAngDelta
|
||||||
End While
|
End While
|
||||||
@@ -539,16 +539,34 @@ Module VacuumCups
|
|||||||
Return dDist
|
Return dDist
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
Private Function IsHorizontal(dDegAng As Double) As Boolean
|
||||||
|
If (Math.Abs(dDegAng) > 45 And Math.Abs(dDegAng) < 135) Or (Math.Abs(dDegAng) > 225 And Math.Abs(dDegAng) < 315) Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' assegnate le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
||||||
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||||
Dim dX, dY, dZ As Double
|
' Posizione Home dell'asse rotante
|
||||||
Dim nStat As Integer
|
|
||||||
Dim dCHome As Double
|
Dim dCHome As Double
|
||||||
EgtGetAxisHomePos("C", dCHome)
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
' Corse dell'asse
|
||||||
|
Dim dCMin As Double
|
||||||
|
EgtGetAxisMin("C", dCMin)
|
||||||
|
Dim dCMax As Double
|
||||||
|
EgtGetAxisMax("C", dCMax)
|
||||||
|
' Porto l'angolo nel range
|
||||||
|
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
|
||||||
|
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
|
||||||
|
' Imposto la ventosa come fosse un utensile
|
||||||
EgtSetCalcTool("", "H4", 1)
|
EgtSetCalcTool("", "H4", 1)
|
||||||
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
|
' Calcolo gli assi macchina
|
||||||
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
|
Dim dX, dY, dZ As Double
|
||||||
|
Dim nStat As Integer
|
||||||
|
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
|
||||||
|
' Verifico le corse
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
|
||||||
Return nStat
|
Return nStat
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,8 @@ Module ConstGen
|
|||||||
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
||||||
' Info per nome progetti
|
' Info per nome progetti
|
||||||
Public Const INFO_PROJNAME As String = "ProjName"
|
Public Const INFO_PROJNAME As String = "ProjName"
|
||||||
|
' Info per parcheggio asse C
|
||||||
|
Public Const INFO_CAXESHOME As String = "CAxesHome"
|
||||||
|
|
||||||
' Nome layer delle regioni
|
' Nome layer delle regioni
|
||||||
Public Const NAME_REGION As String = "Region"
|
Public Const NAME_REGION As String = "Region"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Module ConstIni
|
|||||||
Public Const S_GENERAL As String = "General"
|
Public Const S_GENERAL As String = "General"
|
||||||
Public Const K_DEBUG As String = "Debug"
|
Public Const K_DEBUG As String = "Debug"
|
||||||
Public Const K_LICENCE As String = "Licence"
|
Public Const K_LICENCE As String = "Licence"
|
||||||
|
Public Const K_NETKEY As String = "NetKey"
|
||||||
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||||
Public Const K_MESSAGES As String = "Messages"
|
Public Const K_MESSAGES As String = "Messages"
|
||||||
Public Const K_SUPPORT As String = "Support"
|
Public Const K_SUPPORT As String = "Support"
|
||||||
@@ -49,6 +50,8 @@ Module ConstIni
|
|||||||
Public Const K_SMARTMACHININGPAGE As String = "SmartMachiningPage"
|
Public Const K_SMARTMACHININGPAGE As String = "SmartMachiningPage"
|
||||||
Public Const K_STARTPROGRAM As String = "StartProgram"
|
Public Const K_STARTPROGRAM As String = "StartProgram"
|
||||||
Public Const K_GENERATECN As String = "GenerateCN"
|
Public Const K_GENERATECN As String = "GenerateCN"
|
||||||
|
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
|
||||||
|
Public Const K_PRECISION As String = "Precision"
|
||||||
|
|
||||||
|
|
||||||
Public Const S_LANGUAGES As String = "Languages"
|
Public Const S_LANGUAGES As String = "Languages"
|
||||||
@@ -113,6 +116,8 @@ Module ConstIni
|
|||||||
Public Const K_LASTCOLOR As String = "LastColor"
|
Public Const K_LASTCOLOR As String = "LastColor"
|
||||||
Public Const K_COLOR As String = "Color"
|
Public Const K_COLOR As String = "Color"
|
||||||
|
|
||||||
|
Public Const S_FRAMECOMPO As String = "FrameCompo"
|
||||||
|
|
||||||
Public Const S_EXTCOMPO As String = "Compo"
|
Public Const S_EXTCOMPO As String = "Compo"
|
||||||
|
|
||||||
Public Const S_INTCOMPO As String = "InternalCompo"
|
Public Const S_INTCOMPO As String = "InternalCompo"
|
||||||
@@ -220,6 +225,12 @@ Module ConstIni
|
|||||||
Public Const K_RAWOFFSX As String = "OffsX"
|
Public Const K_RAWOFFSX As String = "OffsX"
|
||||||
Public Const K_RAWOFFSY As String = "OffsY"
|
Public Const K_RAWOFFSY As String = "OffsY"
|
||||||
Public Const K_RAWKERF As String = "Kerf"
|
Public Const K_RAWKERF As String = "Kerf"
|
||||||
|
Public Const K_ENABLEOTHERREFTAB As String = "EnableOtherRefTab"
|
||||||
|
Public Const K_OTHERREFTAB As String = "OtherRefTab"
|
||||||
|
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
|
||||||
|
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
|
||||||
|
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
|
||||||
|
|
||||||
|
|
||||||
Public Const S_RAWMOVE As String = "RawMove"
|
Public Const S_RAWMOVE As String = "RawMove"
|
||||||
Public Const K_RAWSTEP As String = "Step"
|
Public Const K_RAWSTEP As String = "Step"
|
||||||
@@ -327,6 +338,9 @@ Module ConstIni
|
|||||||
Public Const K_DC_TEST_LENGTH As String = "TestLength"
|
Public Const K_DC_TEST_LENGTH As String = "TestLength"
|
||||||
Public Const K_DC_TEST_ANGH As String = "TestAngH"
|
Public Const K_DC_TEST_ANGH As String = "TestAngH"
|
||||||
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
|
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
|
||||||
|
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
|
||||||
|
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
|
||||||
|
Public Const K_ENABLEINVERT As String = "EnableInvert"
|
||||||
|
|
||||||
Public Const S_STATDATA As String = "StatData"
|
Public Const S_STATDATA As String = "StatData"
|
||||||
Public Const K_SD_DAY As String = "Day"
|
Public Const K_SD_DAY As String = "Day"
|
||||||
|
|||||||
@@ -46,6 +46,16 @@
|
|||||||
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
||||||
Public Const K_PHOTODELEY As String = "PhotoDeley"
|
Public Const K_PHOTODELEY As String = "PhotoDeley"
|
||||||
|
|
||||||
|
Public Const S_NCFANUC As String = "NcFanuc"
|
||||||
|
Public Const K_SETNCMODE As String = "SetNcMode"
|
||||||
|
Public Const K_BASEADDRINT As String = "BaseAddrInt"
|
||||||
|
Public Const K_BASEADDRBIT As String = "BaseAddrBit"
|
||||||
|
Public Const K_NUMVARINT As String = "NumVarInt"
|
||||||
|
Public Const K_NUMVARBIT As String = "NumVarBit"
|
||||||
|
|
||||||
|
Public Const S_EXECLUA As String = "ExecLua"
|
||||||
|
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
||||||
|
|
||||||
Public Const S_NCDATA As String = "NcData"
|
Public Const S_NCDATA As String = "NcData"
|
||||||
Public Const K_NEWVARIABLE As String = "NewVariable"
|
Public Const K_NEWVARIABLE As String = "NewVariable"
|
||||||
Public Const K_NEWCONSOLE As String = "NewConsole"
|
Public Const K_NEWCONSOLE As String = "NewConsole"
|
||||||
@@ -75,6 +85,7 @@
|
|||||||
Public Const K_TABLEDOWN As String = "TableDown"
|
Public Const K_TABLEDOWN As String = "TableDown"
|
||||||
Public Const K_MANUAL As String = "Manual"
|
Public Const K_MANUAL As String = "Manual"
|
||||||
Public Const K_DOORCLOSED As String = "DoorClosed"
|
Public Const K_DOORCLOSED As String = "DoorClosed"
|
||||||
|
Public Const K_DOOROPENDED As String = "DoorOpened"
|
||||||
Public Const K_LIMITZ As String = "LimitZ"
|
Public Const K_LIMITZ As String = "LimitZ"
|
||||||
Public Const K_POWEROVR As String = "PowerOvr"
|
Public Const K_POWEROVR As String = "PowerOvr"
|
||||||
Public Const K_PARKING As String = "Parking"
|
Public Const K_PARKING As String = "Parking"
|
||||||
@@ -109,6 +120,7 @@
|
|||||||
Public Const K_FEEDHOLD As String = "FeedHold"
|
Public Const K_FEEDHOLD As String = "FeedHold"
|
||||||
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
||||||
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
||||||
|
Public Const K_NAXES As String = "nAxes"
|
||||||
' Nuove variabili
|
' Nuove variabili
|
||||||
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
||||||
Public Const K_XYJOG As String = "XYJog"
|
Public Const K_XYJOG As String = "XYJog"
|
||||||
@@ -216,6 +228,10 @@
|
|||||||
Public Const K_MACH_CUTFSEVLEN As String = "CutFsevLen"
|
Public Const K_MACH_CUTFSEVLEN As String = "CutFsevLen"
|
||||||
Public Const K_MACH_CUTFSEVPERC As String = "CutFsevPerc"
|
Public Const K_MACH_CUTFSEVPERC As String = "CutFsevPerc"
|
||||||
Public Const K_USELASERORIGIN As String = "UseLaserOrigin"
|
Public Const K_USELASERORIGIN As String = "UseLaserOrigin"
|
||||||
|
Public Const K_HOLES_DIAMITERWJ As String = "HolesDiameterWJ"
|
||||||
|
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
||||||
|
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
||||||
|
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
||||||
' DrillMillC90
|
' DrillMillC90
|
||||||
' CutLongDxSx
|
' CutLongDxSx
|
||||||
' AngRotMultiCut
|
' AngRotMultiCut
|
||||||
@@ -263,6 +279,7 @@
|
|||||||
Public Const S_MACH_PROBING As String = "Probing"
|
Public Const S_MACH_PROBING As String = "Probing"
|
||||||
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
||||||
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
||||||
|
Public Const K_TOOLLENGTH As String = "ToolLength"
|
||||||
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
||||||
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,177 @@
|
|||||||
|
<UserControl x:Class="ControlsDirectCutUC"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
DataContext="Self"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:OmagCUT="clr-namespace:OmagCUT"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||||
|
|
||||||
|
<Grid Name="LeftButtonGrid" Grid.Row="1" >
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<!--<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="7*"/>-->
|
||||||
|
<RowDefinition Height="9*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<!-- Definizione della Grid laterale -->
|
||||||
|
<Grid Name="CutTypeGrid" Grid.Row="1" >
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<!--<RowDefinition Height="1*"/>-->
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Button Name="ManualBtn" Grid.Column="2" Grid.Row="0"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Movimento-manualeImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="ManualTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="SingleCutBtn" Grid.Row="1"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Taglio-singoloImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SingleCutTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="MultipleCutBtn" Grid.Row="2"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Taglio-multiploImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="MultipleCutTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="GridCutBtn" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Taglio-grigliaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="GridCutTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
|
<Button Name="SingleDrillBtn" Grid.Row="4"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Foro-singoloImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SingleDrillTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="FlatteningCutBtn" Grid.Row="5"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource SpianaturaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="FlatteningCutTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!--<Button Name="PolishingBtn" Grid.Row="6"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource LucidaturaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="PolishingTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>-->
|
||||||
|
|
||||||
|
<!--<Button Name="CopyTemplateBtn" Grid.Row="7"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Copia-dimaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="CopyTemplateTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>-->
|
||||||
|
|
||||||
|
<Button Name="SquaringBtn" Grid.Row="6"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Copia-dimaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SquaringTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<!--<Button Name="SawTestBtn" Grid.Row="6"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Test-lamaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SawTestTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>-->
|
||||||
|
|
||||||
|
<Grid Name="ChangeUCGrid" Grid.Row="7">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Name="ChangeUCBtn" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<!--<Image Name="ImageCompo9" Source="{DynamicResource NumericKeyboardArrowImg}" />-->
|
||||||
|
<TextBlock Name="ChangeUCTxBl" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,265 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
Public Class ControlsDirectCutUC
|
||||||
|
|
||||||
|
' Dichiarazione delle Page UserControl
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
' ---- MAI USATA ---- nuova finestra per i comandi per il taglio manuale nuovo
|
||||||
|
Friend m_SingleCutAuto As SingleCutAuto
|
||||||
|
' ---- MAI USATA ----
|
||||||
|
Friend m_MachineButtons As MachineButtonsUC
|
||||||
|
Friend m_ManualAxesMove As ManualAxesMoveUC
|
||||||
|
Friend m_SingleCut As SingleCutUC
|
||||||
|
Friend m_SingleDrill As SingleDrillUC
|
||||||
|
Friend m_MultipleCut As MultipleCut
|
||||||
|
Friend m_GridCut As GridCut
|
||||||
|
Friend m_FlatteningCut As FlatteningCut
|
||||||
|
Friend m_Squaring As SquaringUC
|
||||||
|
Friend m_ControlsMachineButton As ControlsMachineButtonUC
|
||||||
|
Friend m_VacuumMachineButton As VacuumMachineButtonUC
|
||||||
|
|
||||||
|
Friend m_ControlDirectCutPage1 As ControlsDirectCutUC1
|
||||||
|
|
||||||
|
' Stato di visualizzazione della macchina
|
||||||
|
Friend m_bShowMachine As Boolean = False
|
||||||
|
Friend m_nMachLook As Integer = MCH_LOOK.ALL
|
||||||
|
' Dati generali CN
|
||||||
|
Friend m_CN As CN_generico
|
||||||
|
Private m_bFirst As Boolean = True
|
||||||
|
' Riferimento alla pagina correntemente attiva
|
||||||
|
Friend m_ActiveDirectCutPage As DirectCutPages = DirectCutPages.DirectCut
|
||||||
|
' Variabili che indicano attivazione paginette con bottoni macchina
|
||||||
|
Private m_ControlsBtn_IsActive As Boolean
|
||||||
|
|
||||||
|
Public Shared m_dZSafe As Double = 52
|
||||||
|
|
||||||
|
' Variabile che indica se sono attivi i bottoni macchina nuovi o vecchi
|
||||||
|
Friend m_NewMachineButtonsType As Boolean
|
||||||
|
' Indica che la finestra del talio Singolo deve essere di tipo manuale
|
||||||
|
Friend m_bManulaCut As Boolean = False
|
||||||
|
|
||||||
|
' elenco dei nuovi bottoni
|
||||||
|
Private m_ButtonJogList As New List(Of MachineButton)
|
||||||
|
|
||||||
|
Enum DirectCutPages
|
||||||
|
' pagina principale di tagli diretti
|
||||||
|
DirectCut
|
||||||
|
' nuova pagina di tagli diretti
|
||||||
|
DirectCut1
|
||||||
|
' elenco dei comandi associati
|
||||||
|
ManualAxesMove
|
||||||
|
SingleCut
|
||||||
|
MultipleCut
|
||||||
|
GridCut
|
||||||
|
FlatteningCut
|
||||||
|
Polishing
|
||||||
|
CopyTemplate
|
||||||
|
SawTest
|
||||||
|
SingleCutAuto
|
||||||
|
SingleDrill
|
||||||
|
Squaring
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private Sub ControlsDirectCutUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
' leggo la configurazione del programma per i nuovi tagli manuali
|
||||||
|
m_bManulaCut = GetPrivateProfileInt(S_GENERAL, K_MANUAL_CUT, 0, m_MainWindow.GetIniFile()) <> 0
|
||||||
|
|
||||||
|
'Creazione delle Page UserControl
|
||||||
|
m_MachineButtons = New MachineButtonsUC
|
||||||
|
m_ManualAxesMove = New ManualAxesMoveUC
|
||||||
|
m_SingleCut = New SingleCutUC
|
||||||
|
m_SingleDrill = New SingleDrillUC
|
||||||
|
m_MultipleCut = New MultipleCut
|
||||||
|
m_GridCut = New GridCut
|
||||||
|
m_FlatteningCut = New FlatteningCut
|
||||||
|
m_Squaring = New SquaringUC
|
||||||
|
m_ControlsMachineButton = New ControlsMachineButtonUC
|
||||||
|
m_VacuumMachineButton = New VacuumMachineButtonUC
|
||||||
|
' reiferimento alla pagina succesiva
|
||||||
|
m_ControlDirectCutPage1 = New ControlsDirectCutUC1
|
||||||
|
' Costruisco la finestra per il nuovo tipo di taglio manuale
|
||||||
|
m_SingleCutAuto = New SingleCutAuto
|
||||||
|
|
||||||
|
'Posizionemento nella griglia delle Page UserControl DirectCutPageUC
|
||||||
|
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||||
|
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
|
||||||
|
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||||
|
If m_bManulaCut Then
|
||||||
|
m_SingleCutAuto.SetValue(Grid.RowProperty, 1)
|
||||||
|
Else
|
||||||
|
m_SingleCut.SetValue(Grid.RowProperty, 1)
|
||||||
|
End If
|
||||||
|
m_SingleDrill.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_MultipleCut.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_GridCut.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_FlatteningCut.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_Squaring.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
|
|
||||||
|
' ManualBtn.Content = EgtMsg(90201)
|
||||||
|
ManualTxt.Text = EgtMsg(90201)
|
||||||
|
'SingleCutBtn.Content = EgtMsg(90202)
|
||||||
|
SingleCutTxt.Text = EgtMsg(90202)
|
||||||
|
'SingleDrillBtn.Content = "Foro singolo"
|
||||||
|
SingleDrillTxt.Text = EgtMsg(90258)
|
||||||
|
'MultipleCutBtn.Content = EgtMsg(90203)
|
||||||
|
MultipleCutTxt.Text = EgtMsg(90203)
|
||||||
|
'GridCutBtn.Content = EgtMsg(90204)
|
||||||
|
GridCutTxt.Text = EgtMsg(90204)
|
||||||
|
'FlatteningCutBtn.Content = EgtMsg(90206)
|
||||||
|
FlatteningCutTxt.Text = EgtMsg(90206)
|
||||||
|
' 90261=Squaring
|
||||||
|
SquaringTxt.Text = EgtMsg(90261)
|
||||||
|
' 90409=Others
|
||||||
|
ChangeUCTxBl.Text = EgtMsg(90409)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ControlsDirectCutUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
' Se rientro da simulazione
|
||||||
|
If m_ActiveDirectCutPage = DirectCutPages.SingleCut Then
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleCut)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.SingleCutAuto Then
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleCutAuto)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.MultipleCut Then
|
||||||
|
LeftButtonGrid.Children.Add(m_MultipleCut)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.GridCut Then
|
||||||
|
LeftButtonGrid.Children.Add(m_GridCut)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.FlatteningCut Then
|
||||||
|
LeftButtonGrid.Children.Add(m_FlatteningCut)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.SingleDrill Then
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleDrill)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.Squaring Then
|
||||||
|
LeftButtonGrid.Children.Add(m_Squaring)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.MachineButtonUC Or
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.VacuumButtonUC Then
|
||||||
|
' Caso standard
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||||
|
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||||
|
Dim bH1Exists As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||||
|
|
||||||
|
ManualBtn.IsEnabled = bH1Exists
|
||||||
|
' sviluppo rimasto in sospeso
|
||||||
|
If m_bManulaCut Then
|
||||||
|
' anche se non è presente un grezzo mantengo abilitato il bottone
|
||||||
|
SingleCutBtn.IsEnabled = True
|
||||||
|
Else
|
||||||
|
SingleCutBtn.IsEnabled = bRawOk
|
||||||
|
End If
|
||||||
|
MultipleCutBtn.IsEnabled = bRawOk
|
||||||
|
GridCutBtn.IsEnabled = bRawOk
|
||||||
|
SingleDrillBtn.IsEnabled = (bRawOk And bH1Exists)
|
||||||
|
FlatteningCutBtn.IsEnabled = (bRawOk And bH1Exists)
|
||||||
|
SquaringBtn.IsEnabled = bRawOk
|
||||||
|
|
||||||
|
' aggiorno la visualizzazione dei parametri
|
||||||
|
ReloadParam()
|
||||||
|
|
||||||
|
' Nascondo i pezzi in parcheggio
|
||||||
|
HideParkedParts()
|
||||||
|
EgtZoom(ZM.ALL)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' ricarico i parametri utensili per definizione
|
||||||
|
Public Sub ReloadParam()
|
||||||
|
Dim sCurrSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
Dim sCurrSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
|
Dim bSaw As Boolean = False
|
||||||
|
|
||||||
|
' se esiste una lavorazione di lama corrente vuol dire che deve essere preferita
|
||||||
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
|
End If
|
||||||
|
m_SingleCut.SetEnableParam(bSaw)
|
||||||
|
m_MultipleCut.SetEnableParam(bSaw)
|
||||||
|
m_GridCut.SetEnableParam(bSaw)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "COMMAND CLICK BTN"
|
||||||
|
|
||||||
|
Private Sub ManualBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_ManualAxesMove)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.ManualAxesMove
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SingleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleCutBtn.Click
|
||||||
|
If m_bManulaCut Then
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleCutAuto)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.SingleCutAuto
|
||||||
|
Else
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleCut)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.SingleCut
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MultipleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles MultipleCutBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_MultipleCut)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.MultipleCut
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub GridCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles GridCutBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_GridCut)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.GridCut
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub FlatteningCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles FlatteningCutBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_FlatteningCut)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.FlatteningCut
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SquaringBtn_Click(sender As Object, e As RoutedEventArgs) Handles SquaringBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_Squaring)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.Squaring
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SingleDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleDrillBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_SingleDrill)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.SingleDrill
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' cambio pagina
|
||||||
|
Private Sub ChangeUCBtn_Click(sender As Object, e As RoutedEventArgs) Handles ChangeUCBtn.Click
|
||||||
|
DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
||||||
|
m_MainWindow.m_DirectCutPageUC.LoadDirectCutUC1()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Command Click Btn
|
||||||
|
|
||||||
|
|
||||||
|
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
Select Case m_ActiveDirectCutPage
|
||||||
|
Case DirectCutPages.DirectCut Or DirectCutPages.ManualAxesMove
|
||||||
|
' Non è necessario fare alcunché
|
||||||
|
Case DirectCutPages.SingleCut
|
||||||
|
LeftButtonGrid.Children.Remove(m_SingleCut)
|
||||||
|
Case DirectCutPages.SingleCutAuto
|
||||||
|
LeftButtonGrid.Children.Remove(m_SingleCutAuto)
|
||||||
|
Case DirectCutPages.MultipleCut
|
||||||
|
LeftButtonGrid.Children.Remove(m_MultipleCut)
|
||||||
|
Case DirectCutPages.GridCut
|
||||||
|
LeftButtonGrid.Children.Remove(m_GridCut)
|
||||||
|
Case DirectCutPages.FlatteningCut
|
||||||
|
LeftButtonGrid.Children.Remove(m_FlatteningCut)
|
||||||
|
Case DirectCutPages.SingleDrill
|
||||||
|
LeftButtonGrid.Children.Remove(m_SingleDrill)
|
||||||
|
Case DirectCutPages.Squaring
|
||||||
|
LeftButtonGrid.Children.Remove(m_Squaring)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<UserControl x:Class="ControlsDirectCutUC1"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
DataContext="Self"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:OmagCUT="clr-namespace:OmagCUT"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||||
|
|
||||||
|
<Grid Name="LeftButtonGrid" Grid.Row="1" >
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<!--<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="7*"/>-->
|
||||||
|
<RowDefinition Height="9*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<!-- Definizione della Grid laterale -->
|
||||||
|
<Grid Name="CutTypeGrid" Grid.Row="1" >
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<!--<RowDefinition Height="1*"/>-->
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Button Name="SawTestBtn" Grid.Row="0"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Test-lamaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SawTestTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="PolishingBtn" Grid.Row="1"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource LucidaturaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="PolishingTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="CopyTemplateBtn" Grid.Row="2"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Copia-dimaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="CopyTemplateTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Grid Name="ChangeUC1Grid" Grid.Row="7">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Name="ChangeUC1Btn" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Image Name="ImageCompo9" Source="{DynamicResource NumericKeyboardArrowImg}" />
|
||||||
|
<!--<TextBlock Name="LabelCompo9" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>-->
|
||||||
|
</Grid>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
Public Class ControlsDirectCutUC1
|
||||||
|
|
||||||
|
' Dichiarazione delle Page UserControl
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
Friend m_Polishing As Polishing
|
||||||
|
Friend m_CopyTemplate As CopyTemplateUC
|
||||||
|
Friend m_SawTest As SawTestUC
|
||||||
|
|
||||||
|
' Stato di visualizzazione della macchina
|
||||||
|
Friend m_bShowMachine As Boolean = False
|
||||||
|
Friend m_nMachLook As Integer = MCH_LOOK.ALL
|
||||||
|
' Dati generali CN
|
||||||
|
Friend m_CN As CN_generico
|
||||||
|
Private m_bFirst As Boolean = True
|
||||||
|
' Riferimento alla pagina correntemente attiva
|
||||||
|
Friend m_ActiveDirectCutPage As DirectCutPages = DirectCutPages.DirectCut
|
||||||
|
' Variabili che indicano attivazione paginette con bottoni macchina
|
||||||
|
Private m_ControlsBtn_IsActive As Boolean
|
||||||
|
|
||||||
|
Public Shared m_dZSafe As Double = 52
|
||||||
|
|
||||||
|
' Variabile che indica se sono attivi i bottoni macchina nuovi o vecchi
|
||||||
|
Friend m_NewMachineButtonsType As Boolean
|
||||||
|
' Indica che la finestra del talio Singolo deve essere di tipo manuale
|
||||||
|
Friend m_bManulaCut As Boolean = False
|
||||||
|
|
||||||
|
Enum DirectCutPages
|
||||||
|
DirectCut
|
||||||
|
DirectCut1
|
||||||
|
Polishing
|
||||||
|
CopyTemplate
|
||||||
|
SawTest
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private Sub ControlsDirectCutUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
' leggo la configurazione del programma per i nuovi tagli manuali
|
||||||
|
m_bManulaCut = GetPrivateProfileInt(S_GENERAL, K_MANUAL_CUT, 0, m_MainWindow.GetIniFile()) <> 0
|
||||||
|
|
||||||
|
'Creazione delle Page UserControl
|
||||||
|
m_SawTest = New SawTestUC
|
||||||
|
m_Polishing = New Polishing
|
||||||
|
m_CopyTemplate = New CopyTemplateUC
|
||||||
|
|
||||||
|
'Posizionemento nella griglia delle Page UserControl
|
||||||
|
m_SawTest.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_Polishing.SetValue(Grid.RowProperty, 1)
|
||||||
|
m_CopyTemplate.SetValue(Grid.RowProperty, 1)
|
||||||
|
|
||||||
|
' assegno i nomi ai pulsanti
|
||||||
|
SawTestTxt.Text = EgtMsg(90207)
|
||||||
|
PolishingTxt.Text = EgtMsg(90231)
|
||||||
|
'CopyTemplateBtn.Content = EgtMsg(90209)
|
||||||
|
CopyTemplateTxt.Text = EgtMsg(90209)
|
||||||
|
'SquaringTxt.Text = "Squaring"
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ControlsDirectCutUC1_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
' Se rientro da simulazione
|
||||||
|
If m_ActiveDirectCutPage = DirectCutPages.SawTest Then
|
||||||
|
LeftButtonGrid.Children.Add(m_SawTest)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.CopyTemplate Then
|
||||||
|
Me.LeftButtonGrid.Children.Add(m_CopyTemplate)
|
||||||
|
Return
|
||||||
|
ElseIf m_ActiveDirectCutPage = DirectCutPages.Polishing Then
|
||||||
|
Me.LeftButtonGrid.Children.Add(m_Polishing)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Caso standard
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.DirectCut1
|
||||||
|
|
||||||
|
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||||
|
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||||
|
Dim bH1Exists As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||||
|
|
||||||
|
PolishingBtn.IsEnabled = (bRawOk And m_MainWindow.m_CurrentMachine.bPolishing)
|
||||||
|
SawTestBtn.IsEnabled = (bRawOk And bH1Exists)
|
||||||
|
CopyTemplateBtn.IsEnabled = bH1Exists
|
||||||
|
|
||||||
|
' aggiorno la visualizzazione dei parametri
|
||||||
|
ReloadParam()
|
||||||
|
|
||||||
|
' Nascondo i pezzi in parcheggio
|
||||||
|
HideParkedParts()
|
||||||
|
EgtZoom(ZM.ALL)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' ricarica i dati utensili
|
||||||
|
Public Sub ReloadParam()
|
||||||
|
Dim sCurrSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
Dim sCurrSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
|
Dim bSaw As Boolean = False
|
||||||
|
|
||||||
|
' se esiste una lavorazione di lama corrente vuol dire che deve essere preferita
|
||||||
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
|
End If
|
||||||
|
'm_SingleCut.SetEnableParam(bSaw)
|
||||||
|
'm_MultipleCut.SetEnableParam(bSaw)
|
||||||
|
'm_GridCut.SetEnableParam(bSaw)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#Region "COMMAND CLICK BTN"
|
||||||
|
Private Sub SawTestBtn_Click(sender As Object, e As RoutedEventArgs) Handles SawTestBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_SawTest)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.SawTest
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub PolishingBtn_Click(sender As Object, e As RoutedEventArgs) Handles PolishingBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_Polishing)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.Polishing
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CopyTemplateBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyTemplateBtn.Click
|
||||||
|
LeftButtonGrid.Children.Add(m_CopyTemplate)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.CopyTemplate
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ChangeUC1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ChangeUC1Btn.Click
|
||||||
|
DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
|
m_ActiveDirectCutPage = DirectCutPages.DirectCut1
|
||||||
|
m_MainWindow.m_DirectCutPageUC.LoadDirectCutUC()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Command Click Btn
|
||||||
|
|
||||||
|
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
Select Case m_ActiveDirectCutPage
|
||||||
|
Case DirectCutPages.SawTest
|
||||||
|
LeftButtonGrid.Children.Remove(m_SawTest)
|
||||||
|
Case DirectCutPages.Polishing
|
||||||
|
LeftButtonGrid.Children.Remove(m_Polishing)
|
||||||
|
Case DirectCutPages.CopyTemplate
|
||||||
|
LeftButtonGrid.Children.Remove(m_CopyTemplate)
|
||||||
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -76,6 +76,11 @@ Public Class ControlsMachineButtonUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "STATE CHANGED"
|
||||||
|
' ------------------------------------------------------------------------------
|
||||||
|
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
|
||||||
|
'-------------------------------------------------------------------------------
|
||||||
|
|
||||||
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||||
Dim SpindleButton As TwoStateButton = Nothing
|
Dim SpindleButton As TwoStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
@@ -255,38 +260,34 @@ Public Class ControlsMachineButtonUC
|
|||||||
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
If MachineButton.StateFlag = K_DOORCLOSED Then
|
If MachineButton.StateFlag = K_DOORCLOSED Then
|
||||||
'If TypeOf MachineButton Is NoStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, NoStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is TwoStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, TwoStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is ThreeStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, ThreeStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is DoubleCommandButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, DoubleCommandButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is PressedCommandButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, PressedCommandButton)
|
|
||||||
'End If
|
|
||||||
DoorClosedButton = MachineButton
|
DoorClosedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
If MachineButton.StateFlag = "DoorOpened" Then
|
If MachineButton.StateFlag = K_DOOROPENDED Then
|
||||||
DoorOpenedButton = MachineButton
|
DoorOpenedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorClosedButton) Then
|
If Not IsNothing(DoorClosedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
Case 1, 2
|
Case 1, 2
|
||||||
|
' porta in movimento/aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorOpenedButton) Then
|
If Not IsNothing(DoorOpenedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
Case 1
|
Case 1
|
||||||
|
' porta in movimento
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||||
Case 2
|
Case 2
|
||||||
|
' porta chiusa
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
@@ -372,6 +373,7 @@ Public Class ControlsMachineButtonUC
|
|||||||
'End If
|
'End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' State Range
|
||||||
|
|
||||||
Public Function GetPrivateProfileMachineButtons(
|
Public Function GetPrivateProfileMachineButtons(
|
||||||
ByVal lpAppName As String,
|
ByVal lpAppName As String,
|
||||||
@@ -569,13 +571,64 @@ Public MustInherit Class MachineButton
|
|||||||
EgtOutLog("dopo scrittura seconda variabile")
|
EgtOutLog("dopo scrittura seconda variabile")
|
||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
|
Case 4
|
||||||
|
' ------------------------------------ FANUC ------------------------------------
|
||||||
|
' eventuale scrittura di linea di comando MDI
|
||||||
|
If Not String.IsNullOrEmpty(CmdString) Then
|
||||||
|
' attivo mpdalità MDI
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' salvo la stringa di comando ricevuta dal file lua
|
||||||
|
m_CN.sz_ManualDataInput = CmdString
|
||||||
|
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||||
|
m_CN.MDI_command()
|
||||||
|
End If
|
||||||
|
' attivo modalità AUTO
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
If String.IsNullOrEmpty(EValue) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue As Boolean
|
||||||
|
If EValue.Trim = "1" Then bEValue = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||||
|
End If
|
||||||
|
' eventale caricamento seconda variabile
|
||||||
|
If String.IsNullOrEmpty(EValue2) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber2)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber2.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue2 As Boolean
|
||||||
|
If EValue2.Trim = "1" Then bEValue2 = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||||
|
End If
|
||||||
|
Return
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' assegno la modalità di funzionamento
|
' assegno la modalità di funzionamento
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
Case 1, 2
|
Case 1, 2, 4
|
||||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
@@ -599,7 +652,7 @@ Public MustInherit Class MachineButton
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
End If
|
End If
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
' riprostino la modalità manuale
|
' ripristino la modalità manuale..?? siucuri ??
|
||||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -620,6 +673,7 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||||
|
|
||||||
Dim dSpeed As Double = 0
|
Dim dSpeed As Double = 0
|
||||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||||
@@ -628,6 +682,18 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||||
|
|
||||||
|
' versione 2.5e1
|
||||||
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||||
|
Dim sToolPos As String = String.Empty
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||||
|
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||||
|
End If
|
||||||
|
Dim dToolDiam As Double = 0
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||||
|
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
@@ -789,6 +855,7 @@ Public Class NoStateButton
|
|||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
' FANUC, SIEMENS
|
||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ Public Class CopyTemplateUC
|
|||||||
' Riferimenti a pagine
|
' Riferimenti a pagine
|
||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||||
|
Private m_refControlDirectCutUC As ControlsDirectCutUC1
|
||||||
|
|
||||||
' Flag di pagina attiva
|
' Flag di pagina attiva
|
||||||
Private m_bActive As Boolean = False
|
Private m_bActive As Boolean = False
|
||||||
' Array stringhe modalità di acquisizione dei punti
|
' Array stringhe modalità di acquisizione dei punti
|
||||||
@@ -59,6 +61,7 @@ Public Class CopyTemplateUC
|
|||||||
|
|
||||||
Private Sub CopyTemplate_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub CopyTemplate_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||||
|
m_refControlDirectCutUC = m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC1
|
||||||
m_bActive = True
|
m_bActive = True
|
||||||
SaveBtn.IsEnabled = False
|
SaveBtn.IsEnabled = False
|
||||||
LineBtn.IsChecked = True
|
LineBtn.IsChecked = True
|
||||||
@@ -254,8 +257,7 @@ Public Class CopyTemplateUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_refControlDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function EraseCopyTemplatePart() As Boolean
|
Private Function EraseCopyTemplatePart() As Boolean
|
||||||
|
|||||||
@@ -43,14 +43,16 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- Definizione della Grid laterale -->
|
<!-- Definizione della Grid laterale -->
|
||||||
|
<!--
|
||||||
<Grid Name="LeftButtonGrid" Grid.Row="1" >
|
<Grid Name="LeftButtonGrid" Grid.Row="1" >
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="7*"/>
|
<RowDefinition Height="7*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
-->
|
||||||
<!-- Definizione della Grid laterale -->
|
<!-- Definizione della Grid laterale -->
|
||||||
<Grid Name="CutTypeGrid" Grid.Row="1" >
|
<!--<Grid Name="CutTypeGrid" Grid.Row="1" >
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
@@ -154,7 +156,8 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="CopyTemplateBtn" Grid.Row="7"
|
-->
|
||||||
|
<!--<Button Name="CopyTemplateBtn" Grid.Row="7"
|
||||||
Style="{DynamicResource OmagCut_YellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -165,6 +168,19 @@
|
|||||||
<TextBlock Name="CopyTemplateTxt" Grid.Column="1"
|
<TextBlock Name="CopyTemplateTxt" Grid.Column="1"
|
||||||
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Button>-->
|
||||||
|
<!--
|
||||||
|
<Button Name="SquaringBtn" Grid.Row="7"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="80"/>
|
||||||
|
<ColumnDefinition Width="140"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{DynamicResource Copia-dimaImg}" Style="{DynamicResource OmagCut_ButtonIcon}" Grid.Column="0" />
|
||||||
|
<TextBlock Name="SquaringTxt" Grid.Column="1"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="SawTestBtn" Grid.Row="8"
|
<Button Name="SawTestBtn" Grid.Row="8"
|
||||||
@@ -180,9 +196,10 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</Grid>
|
</Grid>-->
|
||||||
|
<!--
|
||||||
|
|
||||||
</Grid>
|
</Grid>-->
|
||||||
|
|
||||||
<!-- Definizione della Grid laterale per bottoni macchina -->
|
<!-- Definizione della Grid laterale per bottoni macchina -->
|
||||||
<Grid Name="MachineButtonGrid" Grid.Row="1">
|
<Grid Name="MachineButtonGrid" Grid.Row="1">
|
||||||
@@ -201,7 +218,11 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="5*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
<!--<ColumnDefinition Width="1*"/>-->
|
<!--<ColumnDefinition Width="1*"/>-->
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -240,8 +261,16 @@
|
|||||||
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
<!--<Image Source="{DynamicResource VacuumImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>-->
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
|
<!--Parking-->
|
||||||
|
<ToggleButton Name="ParkingBtn" Grid.Column="6"
|
||||||
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--Comando Manula/MDI-->
|
<!--Comando Manula/MDI-->
|
||||||
<Button Name="ManualModeBtn" Grid.Column="7"
|
<Button Name="ManualModeBtn" Grid.Column="11"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -7,18 +7,20 @@ Public Class DirectCutPageUC
|
|||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
Friend m_MachineButtons As MachineButtonsUC
|
Friend m_MachineButtons As MachineButtonsUC
|
||||||
Friend m_ManualAxesMove As ManualAxesMoveUC
|
Friend m_ManualAxesMove As ManualAxesMoveUC
|
||||||
Friend m_SingleCut As SingleCutUC
|
|
||||||
Friend m_SingleDrill As SingleDrillUC
|
|
||||||
' nuova finestra per i comandi per il taglio manuale nuovo
|
|
||||||
Friend m_SingleCutAuto As SingleCutAuto
|
|
||||||
Friend m_MultipleCut As MultipleCut
|
|
||||||
Friend m_GridCut As GridCut
|
|
||||||
Friend m_FlatteningCut As FlatteningCut
|
|
||||||
Friend m_Polishing As Polishing
|
|
||||||
Friend m_CopyTemplate As CopyTemplateUC
|
|
||||||
Friend m_SawTest As SawTestUC
|
|
||||||
Friend m_ControlsMachineButton As ControlsMachineButtonUC
|
Friend m_ControlsMachineButton As ControlsMachineButtonUC
|
||||||
Friend m_VacuumMachineButton As VacuumMachineButtonUC
|
Friend m_VacuumMachineButton As VacuumMachineButtonUC
|
||||||
|
Friend m_ControlsDirectCutUC As ControlsDirectCutUC
|
||||||
|
Friend m_ControlsDirectCutUC1 As ControlsDirectCutUC1
|
||||||
|
|
||||||
|
Friend m_ActiveControl As Controls
|
||||||
|
Enum Controls
|
||||||
|
DirectCutUC
|
||||||
|
DirectCutUC1
|
||||||
|
MachineButtonUC
|
||||||
|
VacuumButtonUC
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
|
||||||
' Stato di visualizzazione della macchina
|
' Stato di visualizzazione della macchina
|
||||||
Friend m_bShowMachine As Boolean = False
|
Friend m_bShowMachine As Boolean = False
|
||||||
@@ -26,8 +28,6 @@ Public Class DirectCutPageUC
|
|||||||
' Dati generali CN
|
' Dati generali CN
|
||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
Private m_bFirst As Boolean = True
|
Private m_bFirst As Boolean = True
|
||||||
' Riferimento alla pagina correntemente attiva
|
|
||||||
Friend m_ActiveDirectCutPage As DirectCutPages = DirectCutPages.DirectCut
|
|
||||||
' Variabili che indicano attivazione paginette con bottoni macchina
|
' Variabili che indicano attivazione paginette con bottoni macchina
|
||||||
Private m_ControlsBtn_IsActive As Boolean
|
Private m_ControlsBtn_IsActive As Boolean
|
||||||
|
|
||||||
@@ -41,94 +41,42 @@ Public Class DirectCutPageUC
|
|||||||
' elenco dei nuovi bottoni
|
' elenco dei nuovi bottoni
|
||||||
Private m_ButtonJogList As New List(Of MachineButton)
|
Private m_ButtonJogList As New List(Of MachineButton)
|
||||||
|
|
||||||
Enum DirectCutPages
|
|
||||||
DirectCut
|
|
||||||
ManualAxesMove
|
|
||||||
SingleCut
|
|
||||||
MultipleCut
|
|
||||||
GridCut
|
|
||||||
FlatteningCut
|
|
||||||
Polishing
|
|
||||||
CopyTemplate
|
|
||||||
SawTest
|
|
||||||
SingleCutAuto
|
|
||||||
SingleDrill
|
|
||||||
End Enum
|
|
||||||
|
|
||||||
Private Sub DirectCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub DirectCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' leggo la configurazione del programma per i nuovi tagli manuali
|
|
||||||
m_bManulaCut = GetPrivateProfileInt(S_GENERAL, K_MANUAL_CUT, 0, m_MainWindow.GetIniFile()) <> 0
|
|
||||||
|
|
||||||
'Creazione delle Page UserControl
|
'Creazione delle Page UserControl
|
||||||
m_MachineButtons = New MachineButtonsUC
|
m_MachineButtons = New MachineButtonsUC
|
||||||
m_ManualAxesMove = New ManualAxesMoveUC
|
m_ManualAxesMove = New ManualAxesMoveUC
|
||||||
m_SingleCut = New SingleCutUC
|
|
||||||
m_SingleDrill = New SingleDrillUC
|
|
||||||
m_MultipleCut = New MultipleCut
|
|
||||||
m_GridCut = New GridCut
|
|
||||||
m_FlatteningCut = New FlatteningCut
|
|
||||||
m_Polishing = New Polishing
|
|
||||||
m_CopyTemplate = New CopyTemplateUC
|
|
||||||
m_SawTest = New SawTestUC
|
|
||||||
m_ControlsMachineButton = New ControlsMachineButtonUC
|
m_ControlsMachineButton = New ControlsMachineButtonUC
|
||||||
m_VacuumMachineButton = New VacuumMachineButtonUC
|
m_VacuumMachineButton = New VacuumMachineButtonUC
|
||||||
' Costruisco la finestra per il nuovo tipo di taglio manuale
|
m_ControlsDirectCutUC = New ControlsDirectCutUC
|
||||||
m_SingleCutAuto = New SingleCutAuto
|
m_ControlsDirectCutUC1 = New ControlsDirectCutUC1
|
||||||
|
|
||||||
'Posizionemento nella griglia delle Page UserControl
|
'Posizionemento nella griglia delle Page UserControl
|
||||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
|
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, m_MachineButtons.nCountButton)
|
||||||
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||||
If m_bManulaCut Then
|
|
||||||
m_SingleCutAuto.SetValue(Grid.RowProperty, 1)
|
m_ControlsDirectCutUC.SetValue(Grid.RowProperty, 1)
|
||||||
Else
|
m_ControlsDirectCutUC1.SetValue(Grid.RowProperty, 1)
|
||||||
m_SingleCut.SetValue(Grid.RowProperty, 1)
|
|
||||||
End If
|
|
||||||
m_SingleDrill.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_MultipleCut.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_GridCut.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_FlatteningCut.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_Polishing.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_CopyTemplate.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_SawTest.SetValue(Grid.RowProperty, 1)
|
|
||||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
|
|
||||||
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
||||||
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [VacuumMachButtons])
|
||||||
|
Dim bCollapsedVacuumButton As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_VACUUMMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
If Not m_NewMachineButtonsType Then
|
If Not m_NewMachineButtonsType Then
|
||||||
'Assegno MachineButtons alla pagina
|
'Assegno MachineButtons alla pagina
|
||||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||||
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
' se non sono configurate le ventose allora nascondo il comando
|
||||||
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
If m_NewMachineButtonsType AndAlso bCollapsedVacuumButton Then
|
||||||
ManualBtn.IsEnabled = False
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
ManualModeBtn.Visibility = Windows.Visibility.Hidden
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' ManualBtn.Content = EgtMsg(90201)
|
|
||||||
ManualTxt.Text = EgtMsg(90201)
|
|
||||||
'SingleCutBtn.Content = EgtMsg(90202)
|
|
||||||
SingleCutTxt.Text = EgtMsg(90202)
|
|
||||||
'SingleDrillBtn.Content = "Foro singolo"
|
|
||||||
SingleDrillTxt.Text = EgtMsg(90258)
|
|
||||||
'MultipleCutBtn.Content = EgtMsg(90203)
|
|
||||||
MultipleCutTxt.Text = EgtMsg(90203)
|
|
||||||
'GridCutBtn.Content = EgtMsg(90204)
|
|
||||||
GridCutTxt.Text = EgtMsg(90204)
|
|
||||||
'FlatteningCutBtn.Content = EgtMsg(90206)
|
|
||||||
FlatteningCutTxt.Text = EgtMsg(90206)
|
|
||||||
'PolishingBtn.Content = EgtMsg(90231)
|
|
||||||
PolishingTxt.Text = EgtMsg(90231)
|
|
||||||
'CopyTemplateBtn.Content = EgtMsg(90209)
|
|
||||||
CopyTemplateTxt.Text = EgtMsg(90209)
|
|
||||||
'SawTestBtn.Content = EgtMsg(90207)
|
|
||||||
SawTestTxt.text = EgtMsg(90207)
|
|
||||||
|
|
||||||
|
|
||||||
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
||||||
' leggo il numero di assi attivi nella macchina
|
' leggo il numero di assi attivi nella macchina
|
||||||
Dim AxesNumber = GetPrivateProfileInt(S_AXES, K_AXESNUM, 5, m_MainWindow.GetMachIniFile())
|
Dim AxesNumber = GetPrivateProfileInt(S_AXES, K_AXESNUM, 5, m_MainWindow.GetMachIniFile())
|
||||||
@@ -176,59 +124,10 @@ Public Class DirectCutPageUC
|
|||||||
' lo stato di questi comandi vieni carico dalla lettura del PLC (refresh)
|
' lo stato di questi comandi vieni carico dalla lettura del PLC (refresh)
|
||||||
'----------- FINE NUOVI BOTTONI------------
|
'----------- FINE NUOVI BOTTONI------------
|
||||||
|
|
||||||
' Se rientro da simulazione
|
LoadLastDirectCutControls()
|
||||||
If m_ActiveDirectCutPage = DirectCutPages.SingleCut Then
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleCut)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.SingleCutAuto Then
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleCutAuto)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.MultipleCut Then
|
|
||||||
LeftButtonGrid.Children.Add(m_MultipleCut)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.GridCut Then
|
|
||||||
LeftButtonGrid.Children.Add(m_GridCut)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.FlatteningCut Then
|
|
||||||
LeftButtonGrid.Children.Add(m_FlatteningCut)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.Polishing Then
|
|
||||||
LeftButtonGrid.Children.Add(m_Polishing)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.SawTest Then
|
|
||||||
LeftButtonGrid.Children.Add(m_SawTest)
|
|
||||||
Return
|
|
||||||
ElseIf m_ActiveDirectCutPage = DirectCutPages.SingleDrill Then
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleDrill)
|
|
||||||
Return
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Caso standard
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
|
||||||
|
|
||||||
' Se macchina fotografica abilitata
|
' Se macchina fotografica abilitata
|
||||||
PhotoBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO)
|
PhotoBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO)
|
||||||
|
|
||||||
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
|
||||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
|
||||||
Dim bH1Exists As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
|
||||||
|
|
||||||
ManualBtn.IsEnabled = bH1Exists
|
|
||||||
' sviluppo rimasto in sospeso
|
|
||||||
If m_bManulaCut Then
|
|
||||||
' anche se non è presente un grezzo mantengo abilitato il bottone
|
|
||||||
SingleCutBtn.IsEnabled = True
|
|
||||||
Else
|
|
||||||
SingleCutBtn.IsEnabled = bRawOk
|
|
||||||
End If
|
|
||||||
MultipleCutBtn.IsEnabled = bRawOk
|
|
||||||
GridCutBtn.IsEnabled = bRawOk
|
|
||||||
SingleDrillBtn.IsEnabled = (bRawOk And bH1Exists)
|
|
||||||
FlatteningCutBtn.IsEnabled = (bRawOk And bH1Exists)
|
|
||||||
PolishingBtn.IsEnabled = (bRawOk And m_MainWindow.m_CurrentMachine.bPolishing)
|
|
||||||
SawTestBtn.IsEnabled = (bRawOk And bH1Exists)
|
|
||||||
CopyTemplateBtn.IsEnabled = bH1Exists
|
|
||||||
|
|
||||||
' aggiorno la visualizzazione dei parametri
|
' aggiorno la visualizzazione dei parametri
|
||||||
ReloadParam()
|
ReloadParam()
|
||||||
|
|
||||||
@@ -247,9 +146,9 @@ Public Class DirectCutPageUC
|
|||||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
End If
|
End If
|
||||||
m_SingleCut.SetEnableParam(bSaw)
|
m_ControlsDirectCutUC.m_SingleCut.SetEnableParam(bSaw)
|
||||||
m_MultipleCut.SetEnableParam(bSaw)
|
m_ControlsDirectCutUC.m_MultipleCut.SetEnableParam(bSaw)
|
||||||
m_GridCut.SetEnableParam(bSaw)
|
m_ControlsDirectCutUC.m_GridCut.SetEnableParam(bSaw)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetVisibilityJogButtuns()
|
Private Sub SetVisibilityJogButtuns()
|
||||||
@@ -257,6 +156,7 @@ Public Class DirectCutPageUC
|
|||||||
ZCBtn.Visibility = Visibility.Collapsed
|
ZCBtn.Visibility = Visibility.Collapsed
|
||||||
ZBBtn.Visibility = Visibility.Collapsed
|
ZBBtn.Visibility = Visibility.Collapsed
|
||||||
RemoteBtn.Visibility = Visibility.Collapsed
|
RemoteBtn.Visibility = Visibility.Collapsed
|
||||||
|
ParkingBtn.Visibility = Visibility.Collapsed
|
||||||
|
|
||||||
Dim Item As MachineButton = Nothing
|
Dim Item As MachineButton = Nothing
|
||||||
For Each Item In m_ButtonJogList
|
For Each Item In m_ButtonJogList
|
||||||
@@ -277,6 +177,10 @@ Public Class DirectCutPageUC
|
|||||||
RemoteBtn.Visibility = Visibility.Visible
|
RemoteBtn.Visibility = Visibility.Visible
|
||||||
RemoteBtn.Foreground = Brushes.White
|
RemoteBtn.Foreground = Brushes.White
|
||||||
RemoteBtn.Content = "Remote"
|
RemoteBtn.Content = "Remote"
|
||||||
|
Case K_PARKING
|
||||||
|
ParkingBtn.Visibility = Visibility.Visible
|
||||||
|
ParkingBtn.Foreground = Brushes.White
|
||||||
|
ParkingBtn.ToolTip = "Parking"
|
||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
@@ -305,63 +209,13 @@ Public Class DirectCutPageUC
|
|||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ManualBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_ManualAxesMove)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.ManualAxesMove
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub SingleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleCutBtn.Click
|
|
||||||
If m_bManulaCut Then
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleCutAuto)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.SingleCutAuto
|
|
||||||
Else
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleCut)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.SingleCut
|
|
||||||
End If
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub MultipleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles MultipleCutBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_MultipleCut)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.MultipleCut
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub GridCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles GridCutBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_GridCut)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.GridCut
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub FlatteningCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles FlatteningCutBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_FlatteningCut)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.FlatteningCut
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub PolishingBtn_Click(sender As Object, e As RoutedEventArgs) Handles PolishingBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_Polishing)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.Polishing
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub CopyTemplateBtn_Click(sender As Object, e As RoutedEventArgs) Handles CopyTemplateBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_CopyTemplate)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.CopyTemplate
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub SawTestBtn_Click(sender As Object, e As RoutedEventArgs) Handles SawTestBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_SawTest)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.SawTest
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub SingleDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleDrillBtn.Click
|
|
||||||
LeftButtonGrid.Children.Add(m_SingleDrill)
|
|
||||||
m_ActiveDirectCutPage = DirectCutPages.SingleDrill
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub ControlsMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles ControlsMachineBtn.Click
|
Private Sub ControlsMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles ControlsMachineBtn.Click
|
||||||
If ControlsMachineBtn.IsChecked Then
|
If ControlsMachineBtn.IsChecked Then
|
||||||
m_ControlsMachineButton = New ControlsMachineButtonUC
|
m_ControlsMachineButton = New ControlsMachineButtonUC
|
||||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
||||||
|
m_ActiveControl = Controls.MachineButtonUC
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
@@ -374,6 +228,7 @@ Public Class DirectCutPageUC
|
|||||||
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
||||||
|
m_ActiveControl = Controls.VacuumButtonUC
|
||||||
If ControlsMachineBtn.IsChecked Then
|
If ControlsMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
@@ -383,7 +238,21 @@ Public Class DirectCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'------------------NUOVI BOTTONI PER GESTIONE JOYSTICK-------------------------------------------------
|
Friend Sub LoadDirectCutUC()
|
||||||
|
ManageControls()
|
||||||
|
m_ActiveControl = Controls.DirectCutUC
|
||||||
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub LoadDirectCutUC1()
|
||||||
|
ManageControls()
|
||||||
|
m_ActiveControl = Controls.DirectCutUC1
|
||||||
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC1)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
#Region "[JogButtons]"
|
||||||
|
|
||||||
Private Sub XYBtn_Click(sender As Object, e As RoutedEventArgs) Handles XYBtn.Click
|
Private Sub XYBtn_Click(sender As Object, e As RoutedEventArgs) Handles XYBtn.Click
|
||||||
' riverco in elenco il bottone XYJog
|
' riverco in elenco il bottone XYJog
|
||||||
Dim XYJogButton As MachineButton = Nothing
|
Dim XYJogButton As MachineButton = Nothing
|
||||||
@@ -513,7 +382,45 @@ Public Class DirectCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'------------------NUOVI BOTTONI PER GESTIONE JOYSTICK-------------------------------------------------
|
Private Sub ParkingBtn_Click(sender As Object, e As RoutedEventArgs) Handles ParkingBtn.Click
|
||||||
|
Dim ParkingButton As MachineButton = Nothing
|
||||||
|
Dim ItemButton As MachineButton = Nothing
|
||||||
|
For Each ItemButton In m_ButtonJogList
|
||||||
|
If ItemButton.StateFlag = K_PARKING Then
|
||||||
|
ParkingButton = ItemButton
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If IsNothing(ParkingButton) Then Return
|
||||||
|
' eseguo lo script lua associato
|
||||||
|
Dim CurrentBtn As Primitives.ToggleButton = e.Source
|
||||||
|
Dim sLuaFileName As String = String.Empty
|
||||||
|
' verifico lo stato del bottone per avviare il giusto script
|
||||||
|
If CurrentBtn.IsChecked() Then
|
||||||
|
sLuaFileName = ParkingButton.TLuaScriptName
|
||||||
|
Else
|
||||||
|
sLuaFileName = ParkingButton.FLuaScriptName
|
||||||
|
End If
|
||||||
|
ParkingButton.ExecuteMDICommand(sLuaFileName)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub ParkingStateChanged(bParkingState As Boolean)
|
||||||
|
' devo decodificare il tipo di pulsante, quindi eseguire la conversione...
|
||||||
|
Dim ParkingButton As TwoStateButton = Nothing
|
||||||
|
For Each MachineButton As MachineButton In m_ButtonJogList
|
||||||
|
If MachineButton.StateFlag.Trim = K_PARKING Then
|
||||||
|
ParkingButton = MachineButton
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If Not IsNothing(ParkingButton) Then
|
||||||
|
ParkingButton.SetIsChecked(bParkingState)
|
||||||
|
ParkingButton.IsChecked = bParkingState
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region '[JogButtons]
|
||||||
|
|
||||||
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
||||||
If m_bShowMachine Then
|
If m_bShowMachine Then
|
||||||
' aggiorno lo stato
|
' aggiorno lo stato
|
||||||
@@ -522,6 +429,8 @@ Public Class DirectCutPageUC
|
|||||||
m_nMachLook = MCH_LOOK.TAB_HEAD
|
m_nMachLook = MCH_LOOK.TAB_HEAD
|
||||||
Case MCH_LOOK.TAB_HEAD
|
Case MCH_LOOK.TAB_HEAD
|
||||||
m_nMachLook = MCH_LOOK.TAB_TOOL
|
m_nMachLook = MCH_LOOK.TAB_TOOL
|
||||||
|
Case MCH_LOOK.TAB_TOOL
|
||||||
|
m_nMachLook = MCH_LOOK.TAB
|
||||||
Case Else
|
Case Else
|
||||||
m_nMachLook = MCH_LOOK.ALL
|
m_nMachLook = MCH_LOOK.ALL
|
||||||
End Select
|
End Select
|
||||||
@@ -532,36 +441,40 @@ Public Class DirectCutPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
Select Case m_ActiveDirectCutPage
|
ManageControls()
|
||||||
Case DirectCutPages.DirectCut Or DirectCutPages.ManualAxesMove
|
End Sub
|
||||||
' Non è necessario fare alcunché
|
|
||||||
Case DirectCutPages.SingleCut
|
Friend Sub ManageControls()
|
||||||
LeftButtonGrid.Children.Remove(m_SingleCut)
|
Select Case m_ActiveControl
|
||||||
Case DirectCutPages.SingleCutAuto
|
Case Controls.DirectCutUC
|
||||||
LeftButtonGrid.Children.Remove(m_SingleCutAuto)
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
Case DirectCutPages.MultipleCut
|
m_ControlsDirectCutUC.DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
LeftButtonGrid.Children.Remove(m_MultipleCut)
|
Case Controls.DirectCutUC1
|
||||||
Case DirectCutPages.GridCut
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
||||||
LeftButtonGrid.Children.Remove(m_GridCut)
|
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
Case DirectCutPages.FlatteningCut
|
Case Controls.MachineButtonUC
|
||||||
LeftButtonGrid.Children.Remove(m_FlatteningCut)
|
|
||||||
Case DirectCutPages.Polishing
|
|
||||||
LeftButtonGrid.Children.Remove(m_Polishing)
|
|
||||||
Case DirectCutPages.CopyTemplate
|
|
||||||
LeftButtonGrid.Children.Remove(m_CopyTemplate)
|
|
||||||
Case DirectCutPages.SawTest
|
|
||||||
LeftButtonGrid.Children.Remove(m_SawTest)
|
|
||||||
Case DirectCutPages.SingleDrill
|
|
||||||
LeftButtonGrid.Children.Remove(m_SingleDrill)
|
|
||||||
End Select
|
|
||||||
If ControlsMachineBtn.IsChecked Then
|
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
End If
|
Case Controls.VacuumButtonUC
|
||||||
If VacuumMachineBtn.IsChecked Then
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
End If
|
End Select
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub LoadLastDirectCutControls()
|
||||||
|
Select Case m_ActiveControl
|
||||||
|
Case Controls.DirectCutUC
|
||||||
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
||||||
|
Case Controls.DirectCutUC1
|
||||||
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC1)
|
||||||
|
Case Else
|
||||||
|
m_ActiveControl = Controls.DirectCutUC
|
||||||
|
MachineButtonGrid.Children.Add(m_ControlsDirectCutUC)
|
||||||
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
|
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
|
|||||||
@@ -186,11 +186,14 @@ Public Class FlatteningCut
|
|||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
|
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
|
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString( m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||||
|
' imposto la Z di sicurezza corretta
|
||||||
|
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||||
|
EgtMdbSave()
|
||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -568,6 +571,7 @@ Public Class FlatteningCut
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -610,7 +614,7 @@ Public Class FlatteningCut
|
|||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||||
EgtMdbSave()
|
EgtMdbSave()
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
||||||
@@ -623,7 +627,8 @@ Public Class FlatteningCut
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
||||||
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
||||||
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||||
GetDrillFromDrilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling)
|
'GetDrillFromDrilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling)
|
||||||
|
GetMillFromMilling(sCurrMill, m_MainWindow.m_CurrentMachine.sCurrMilling)
|
||||||
' recupero informazioni della fresa in uso
|
' recupero informazioni della fresa in uso
|
||||||
EgtTdbSetCurrTool(sCurrMill)
|
EgtTdbSetCurrTool(sCurrMill)
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint)
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dFootPrint)
|
||||||
|
|||||||
@@ -61,12 +61,12 @@
|
|||||||
|
|
||||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="5" Grid.ColumnSpan="2">
|
<Grid Grid.Row="5" Grid.ColumnSpan="2">
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<TextBlock Name="DimPzXTxBl" Grid.Column="2" Grid.Row="0"
|
<TextBlock Name="DimPzXTxBl" Grid.Column="2" Grid.Row="0"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPzXTxBx" Grid.Column="0" Grid.Row="1" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPzXTxBx" Grid.Column="0" Grid.Row="1" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPzXTxBx" Grid.Column="2" Grid.Row="1" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPzXTxBx" Grid.Column="2" Grid.Row="1" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
<TextBlock Name="DimPzYTxBl" Grid.Column="2" Grid.Row="2"
|
<TextBlock Name="DimPzYTxBl" Grid.Column="2" Grid.Row="2"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPzYTxBx" Grid.Column="0" Grid.Row="3" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPzYTxBx" Grid.Column="0" Grid.Row="3" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPzYTxBx" Grid.Column="2" Grid.Row="3" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPzYTxBx" Grid.Column="2" Grid.Row="3" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ Public Class GridCut
|
|||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -494,6 +494,7 @@ Public Class GridCut
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -534,7 +535,7 @@ Public Class GridCut
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateGridCut() As Boolean
|
Private Function CreateGridCut() As Boolean
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ Public Class MachineButtonsUC
|
|||||||
Private m_DirectCutPage As DirectCutPageUC
|
Private m_DirectCutPage As DirectCutPageUC
|
||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
|
|
||||||
|
Public nCountButton As Integer = 11
|
||||||
|
|
||||||
Private m_bOnlyLaser As Boolean = False
|
Private m_bOnlyLaser As Boolean = False
|
||||||
Private m_bFirst As Boolean = True
|
Private m_bFirst As Boolean = True
|
||||||
|
|
||||||
@@ -76,6 +78,9 @@ Public Class MachineButtonsUC
|
|||||||
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
' notifico nella variabile pubblica il numero di pulsanti inseriti nella barra
|
||||||
|
nCountButton = m_nCount
|
||||||
|
|
||||||
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
|
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
|
||||||
For nIndex As Integer = 0 To m_nCount - 1
|
For nIndex As Integer = 0 To m_nCount - 1
|
||||||
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
||||||
@@ -267,9 +272,62 @@ Public Class MachineButtonsUC
|
|||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
' CONTROLLO FANUC
|
||||||
|
Case 4
|
||||||
|
' ------------------------------------ FANUC ------------------------------------
|
||||||
|
' eventuale scrittura di linea di comando MDI
|
||||||
|
If Not String.IsNullOrEmpty(CmdString) Then
|
||||||
|
' attivo mpdalità MDI
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' salvo la stringa di comando ricevuta dal file lua
|
||||||
|
m_CN.sz_ManualDataInput = CmdString
|
||||||
|
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||||
|
m_CN.MDI_command()
|
||||||
|
End If
|
||||||
|
' attivo modalità AUTO
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
If String.IsNullOrEmpty(EValue) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue As Boolean
|
||||||
|
If EValue.Trim = "1" Then bEValue = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||||
|
End If
|
||||||
|
' eventale caricamento seconda variabile
|
||||||
|
If String.IsNullOrEmpty(EValue2) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber2)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber2.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue2 As Boolean
|
||||||
|
If EValue2.Trim = "1" Then bEValue2 = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||||
|
End If
|
||||||
|
Return
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' Imposto modalità MDI per controlli num
|
' Imposto modalità MDI per controlli num
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
@@ -286,6 +344,8 @@ Public Class MachineButtonsUC
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
|
Case 4
|
||||||
|
' Nicola: 27/03/2023 attivazione della funzione M# indicata?
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If b2Start Then
|
If b2Start Then
|
||||||
@@ -320,6 +380,17 @@ Public Class MachineButtonsUC
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||||
|
' versione 2.5e1
|
||||||
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||||
|
Dim sToolPos As String = String.Empty
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||||
|
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||||
|
End If
|
||||||
|
Dim dToolDiam As Double = 0
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||||
|
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
|
|||||||
@@ -69,10 +69,10 @@
|
|||||||
<EgtWPFLib:EgtTextBox x:Name="L3TxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox x:Name="L3TxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<Button x:Name="R1Btn" Grid.Row="4" Height="60" Width="60" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<Button x:Name="R1Btn" Grid.Row="4" Height="60" Width="60" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<EgtWPFLib:EgtTextBox x:Name="R1TxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox x:Name="R1TxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<Button x:Name="R2Btn" Grid.Row="5" Height="60" Width="60" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<Button x:Name="R2Btn" Grid.Row="5" Height="60" Width="60" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||||
<EgtWPFLib:EgtTextBox x:Name="R2TxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox x:Name="R2TxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||||
|
|||||||
@@ -21,10 +21,12 @@ Public Class ManualAxesMoveUC
|
|||||||
' Messaggi
|
' Messaggi
|
||||||
L1SawThChBx.Content = EgtMsg(90232) ' Spessore lama
|
L1SawThChBx.Content = EgtMsg(90232) ' Spessore lama
|
||||||
L2SawThChBx.Content = EgtMsg(90232) ' Spessore lama
|
L2SawThChBx.Content = EgtMsg(90232) ' Spessore lama
|
||||||
|
|
||||||
AddHandler m_Timer.Tick, AddressOf Timer_tick
|
AddHandler m_Timer.Tick, AddressOf Timer_tick
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ManualAxesMove_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub ManualAxesMove_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
m_CN = m_MainWindow.m_DirectCutPageUC.m_CN
|
||||||
' Valori feed e speed da lama corrente
|
' Valori feed e speed da lama corrente
|
||||||
Dim dTemp As Double = 0
|
Dim dTemp As Double = 0
|
||||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||||
@@ -207,7 +209,7 @@ Public Class ManualAxesMoveUC
|
|||||||
System.Threading.Thread.Sleep(150)
|
System.Threading.Thread.Sleep(150)
|
||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
' m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||||
m_MoveClicked = False
|
m_MoveClicked = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -338,7 +340,7 @@ Public Class ManualAxesMoveUC
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
Private Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub G0Btn_Checked(sender As Object, e As RoutedEventArgs) Handles G0Btn.Checked
|
Private Sub G0Btn_Checked(sender As Object, e As RoutedEventArgs) Handles G0Btn.Checked
|
||||||
|
|||||||
@@ -68,12 +68,12 @@
|
|||||||
|
|
||||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="5"
|
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="5"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="6" Grid.ColumnSpan="2" Visibility="Visible">
|
<Grid Grid.Row="6" Grid.ColumnSpan="2" Visibility="Visible">
|
||||||
@@ -124,70 +124,70 @@
|
|||||||
|
|
||||||
<TextBlock Name="Num1TxBl" Grid.Column="0" Grid.Row="0"
|
<TextBlock Name="Num1TxBl" Grid.Column="0" Grid.Row="0"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz1TxBx" Grid.Column="1" Grid.Row="0" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz1TxBx" Grid.Column="1" Grid.Row="0" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz1TxBx" Grid.Column="3" Grid.Row="0" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz1TxBx" Grid.Column="3" Grid.Row="0" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num2TxBl" Grid.Column="0" Grid.Row="1"
|
<TextBlock Name="Num2TxBl" Grid.Column="0" Grid.Row="1"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz2TxBx" Grid.Column="1" Grid.Row="1" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz2TxBx" Grid.Column="1" Grid.Row="1" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz2TxBx" Grid.Column="3" Grid.Row="1" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz2TxBx" Grid.Column="3" Grid.Row="1" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num3TxBl" Grid.Column="0" Grid.Row="2"
|
<TextBlock Name="Num3TxBl" Grid.Column="0" Grid.Row="2"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz3TxBx" Grid.Column="1" Grid.Row="2" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz3TxBx" Grid.Column="1" Grid.Row="2" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz3TxBx" Grid.Column="3" Grid.Row="2" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz3TxBx" Grid.Column="3" Grid.Row="2" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num4TxBl" Grid.Column="0" Grid.Row="3"
|
<TextBlock Name="Num4TxBl" Grid.Column="0" Grid.Row="3"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz4TxBx" Grid.Column="1" Grid.Row="3" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz4TxBx" Grid.Column="1" Grid.Row="3" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz4TxBx" Grid.Column="3" Grid.Row="3" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz4TxBx" Grid.Column="3" Grid.Row="3" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num5TxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="Num5TxBl" Grid.Column="0" Grid.Row="4"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz5TxBx" Grid.Column="1" Grid.Row="4" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz5TxBx" Grid.Column="1" Grid.Row="4" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz5TxBx" Grid.Column="3" Grid.Row="4" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz5TxBx" Grid.Column="3" Grid.Row="4" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num6TxBl" Grid.Column="0" Grid.Row="5"
|
<TextBlock Name="Num6TxBl" Grid.Column="0" Grid.Row="5"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz6TxBx" Grid.Column="1" Grid.Row="5" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz6TxBx" Grid.Column="1" Grid.Row="5" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz6TxBx" Grid.Column="3" Grid.Row="5" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz6TxBx" Grid.Column="3" Grid.Row="5" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num7TxBl" Grid.Column="0" Grid.Row="6"
|
<TextBlock Name="Num7TxBl" Grid.Column="0" Grid.Row="6"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz7TxBx" Grid.Column="1" Grid.Row="6" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz7TxBx" Grid.Column="1" Grid.Row="6" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz7TxBx" Grid.Column="3" Grid.Row="6" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz7TxBx" Grid.Column="3" Grid.Row="6" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num8TxBl" Grid.Column="0" Grid.Row="7"
|
<TextBlock Name="Num8TxBl" Grid.Column="0" Grid.Row="7"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz8TxBx" Grid.Column="1" Grid.Row="7" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz8TxBx" Grid.Column="1" Grid.Row="7" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz8TxBx" Grid.Column="3" Grid.Row="7" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz8TxBx" Grid.Column="3" Grid.Row="7" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num9TxBl" Grid.Column="0" Grid.Row="8"
|
<TextBlock Name="Num9TxBl" Grid.Column="0" Grid.Row="8"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz9TxBx" Grid.Column="1" Grid.Row="8" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz9TxBx" Grid.Column="1" Grid.Row="8" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz9TxBx" Grid.Column="3" Grid.Row="8" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz9TxBx" Grid.Column="3" Grid.Row="8" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="Num10TxBl" Grid.Column="0" Grid.Row="9"
|
<TextBlock Name="Num10TxBl" Grid.Column="0" Grid.Row="9"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="NumPz10TxBx" Grid.Column="1" Grid.Row="9" Width="75"
|
<EgtWPFLib:EgtTextBox Name="NumPz10TxBx" Grid.Column="1" Grid.Row="9" Width="75" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DimPz10TxBx" Grid.Column="3" Grid.Row="9" Width="75"
|
<EgtWPFLib:EgtTextBox Name="DimPz10TxBx" Grid.Column="3" Grid.Row="9" Width="75"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ Public Class MultipleCut
|
|||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -540,6 +540,7 @@ Public Class MultipleCut
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -580,7 +581,7 @@ Public Class MultipleCut
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateMultipleCut() As Boolean
|
Private Function CreateMultipleCut() As Boolean
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ Public Class Polishing
|
|||||||
' Riferimenti a pagine
|
' Riferimenti a pagine
|
||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||||
|
Private m_refControlDirectCutUC As ControlsDirectCutUC1
|
||||||
|
|
||||||
' Flag di pagina attiva
|
' Flag di pagina attiva
|
||||||
Private m_bActive As Boolean = False
|
Private m_bActive As Boolean = False
|
||||||
' Flag di simulazione in corso
|
' Flag di simulazione in corso
|
||||||
@@ -30,6 +32,7 @@ Public Class Polishing
|
|||||||
Private Sub Polishing_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub Polishing_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
' Attivo la pagina
|
' Attivo la pagina
|
||||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||||
|
m_refControlDirectCutUC = m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC1
|
||||||
m_bActive = True
|
m_bActive = True
|
||||||
' Se rientro da simulazione
|
' Se rientro da simulazione
|
||||||
If m_bSimul Then
|
If m_bSimul Then
|
||||||
@@ -72,7 +75,7 @@ Public Class Polishing
|
|||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_refControlDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC1.DirectCutPages.DirectCut
|
||||||
' Cancello eventuali lucidature
|
' Cancello eventuali lucidature
|
||||||
RemovePolishings()
|
RemovePolishings()
|
||||||
' Riattivo eventuali lavorazioni presenti
|
' Riattivo eventuali lavorazioni presenti
|
||||||
@@ -148,6 +151,7 @@ Public Class Polishing
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_refControlDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -188,7 +192,7 @@ Public Class Polishing
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_refControlDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreatePolishing( sKitName As String) As Boolean
|
Private Function CreatePolishing( sKitName As String) As Boolean
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="OffsetTxBl" Grid.Column="0" Grid.Row="5"
|
<TextBlock Name="OffsetTxBl" Grid.Column="0" Grid.Row="5"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Public Class SawTestUC
|
|||||||
' Riferimenti a pagine
|
' Riferimenti a pagine
|
||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||||
|
Private m_refControlDirectCutUC As ControlsDirectCutUC1
|
||||||
' Flag di pagina attiva
|
' Flag di pagina attiva
|
||||||
Private m_bActive As Boolean = False
|
Private m_bActive As Boolean = False
|
||||||
' Flag di simulazione in corso
|
' Flag di simulazione in corso
|
||||||
@@ -76,6 +77,7 @@ Public Class SawTestUC
|
|||||||
Private Sub SawTest_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub SawTest_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
' Attivo la pagina
|
' Attivo la pagina
|
||||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||||
|
m_refControlDirectCutUC = m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC1
|
||||||
m_bActive = True
|
m_bActive = True
|
||||||
' Se rientro da simulazione
|
' Se rientro da simulazione
|
||||||
If m_bSimul Then
|
If m_bSimul Then
|
||||||
@@ -139,7 +141,7 @@ Public Class SawTestUC
|
|||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_TEST_OFFSET, DoubleToString( m_dOffset, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString( S_DIRECTCUTS, K_DC_TEST_OFFSET, DoubleToString( m_dOffset, 2), m_MainWindow.GetIniFile())
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_refControlDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC1.DirectCutPages.DirectCut1
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -419,6 +421,7 @@ Public Class SawTestUC
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_refControlDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -459,7 +462,7 @@ Public Class SawTestUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_refControlDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateSingleCut() As Boolean
|
Private Function CreateSingleCut() As Boolean
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ Public Class SingleCutAuto
|
|||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -715,6 +715,7 @@ Public Class SingleCutAuto
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -758,7 +759,7 @@ Public Class SingleCutAuto
|
|||||||
' reimposto il precedetne utensile e lavorazione
|
' reimposto il precedetne utensile e lavorazione
|
||||||
m_MainWindow.m_CurrentMachine.sCurrSaw = m_PrecSaw
|
m_MainWindow.m_CurrentMachine.sCurrSaw = m_PrecSaw
|
||||||
m_MainWindow.m_CurrentMachine.sCurrSawing = m_PrecSawing
|
m_MainWindow.m_CurrentMachine.sCurrSawing = m_PrecSawing
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateSingleCut() As Boolean
|
Private Function CreateSingleCut() As Boolean
|
||||||
|
|||||||
@@ -69,12 +69,12 @@
|
|||||||
|
|
||||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="5"
|
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="5"
|
||||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
|
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="OffsetTxBl" Grid.Column="0" Grid.Row="6"
|
<TextBlock Name="OffsetTxBl" Grid.Column="0" Grid.Row="6"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Threading
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class SingleCutUC
|
Public Class SingleCutUC
|
||||||
|
|
||||||
@@ -43,6 +44,10 @@ Public Class SingleCutUC
|
|||||||
Private Const MIN_CUT_LEN As Double = 10.0
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||||
' Costanti che indicano la modalità di acquisizione dei punti
|
' Costanti che indicano la modalità di acquisizione dei punti
|
||||||
|
|
||||||
|
' Utilizzato per aggiornare la posizione della macchina
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
|
||||||
Private Enum PT_MODE As Integer
|
Private Enum PT_MODE As Integer
|
||||||
SAW = 0
|
SAW = 0
|
||||||
LASER = 1
|
LASER = 1
|
||||||
@@ -68,14 +73,14 @@ Public Class SingleCutUC
|
|||||||
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||||
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||||
' Carico i dati dell'ultimo taglio
|
' Carico i dati dell'ultimo taglio
|
||||||
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
||||||
m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
|
m_dLen = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_LENGTH, m_dLen, m_MainWindow.GetIniFile())
|
||||||
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||||
m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
|
m_dAngV = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_ANGV, m_dAngV, m_MainWindow.GetIniFile())
|
||||||
m_dOffset = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_OFFSET, m_dOffset, m_MainWindow.GetIniFile())
|
m_dOffset = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_OFFSET, m_dOffset, m_MainWindow.GetIniFile())
|
||||||
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
m_ptTipP1.x = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
||||||
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_SING_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub SingleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -92,6 +97,10 @@ Public Class SingleCutUC
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
' riavvio il timer per visualizzare la poszione della macchina
|
||||||
|
If Not IsNothing(m_RefreshTimer) Then
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Disabilito registrazione progetto modificato
|
' Disabilito registrazione progetto modificato
|
||||||
@@ -114,7 +123,7 @@ Public Class SingleCutUC
|
|||||||
m_bPointP1Ok = False
|
m_bPointP1Ok = False
|
||||||
m_bPointP2Ok = False
|
m_bPointP2Ok = False
|
||||||
' Inizializzo primo punto acquisito dal disegno
|
' Inizializzo primo punto acquisito dal disegno
|
||||||
m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG())
|
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
|
||||||
m_ptPrev.z = m_ptRawMax.z
|
m_ptPrev.z = m_ptRawMax.z
|
||||||
' Disegno crocetta che indica il punto acquisito
|
' Disegno crocetta che indica il punto acquisito
|
||||||
CreateCross(m_nTempLay, m_ptPrev)
|
CreateCross(m_nTempLay, m_ptPrev)
|
||||||
@@ -138,26 +147,45 @@ Public Class SingleCutUC
|
|||||||
' Deseleziono bottone primo punto
|
' Deseleziono bottone primo punto
|
||||||
Point1Btn.IsChecked = False
|
Point1Btn.IsChecked = False
|
||||||
|
|
||||||
' la visualizzazione dei comandi è gestira dalla DirectCutPageUC richiamando la funzione ReloadParam
|
' la visualizzazione dei comandi è gestita dalla DirectCutPageUC richiamando la funzione ReloadParam
|
||||||
|
|
||||||
|
' forzo la macchina ad essere visibile fin da subito
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB
|
||||||
|
' Creo il timer il timer per aggiornare il posizionamento della macchina
|
||||||
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
|
' Avvi il timer
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshTimer_tick()
|
||||||
|
' se è impostata la visualizzazione della sola tavola allora non aggiorno il disegno
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB Then Return
|
||||||
|
' Aggiorno visualizzazione
|
||||||
|
SetMachineInCurrPos()
|
||||||
|
' Aggiorno il disegno
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
' Salvo i dati correnti
|
' Salvo i dati correnti
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_DEPTH, DoubleToString(m_dDepth, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_LENGTH, DoubleToString(m_dLen, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGH, DoubleToString(m_dAngO, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString( m_dAngV, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_ANGV, DoubleToString(m_dAngV, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_OFFSET, DoubleToString(m_dOffset, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_OFFSET, DoubleToString(m_dOffset, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_SAWTH, If(m_bSawTh, "1", "0"), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_SAWTH, If(m_bSawTh, "1", "0"), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_SING_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -171,6 +199,8 @@ Public Class SingleCutUC
|
|||||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
|
' interrompo il Timer per aggiornare la visualizzazione del posizionamento macchina
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -298,6 +328,7 @@ Public Class SingleCutUC
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
||||||
Point1Btn.IsChecked = True
|
Point1Btn.IsChecked = True
|
||||||
' Abilito e deseleziono secondo punto
|
' Abilito e deseleziono secondo punto
|
||||||
@@ -476,7 +507,7 @@ Public Class SingleCutUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SawThick_Click( sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
|
Private Sub SawThick_Click(sender As Object, e As RoutedEventArgs) Handles SawThChBx.Click
|
||||||
' Recupero lo stato di check
|
' Recupero lo stato di check
|
||||||
m_bSawTh = SawThChBx.IsChecked()
|
m_bSawTh = SawThChBx.IsChecked()
|
||||||
' Disegno il taglio
|
' Disegno il taglio
|
||||||
@@ -524,6 +555,7 @@ Public Class SingleCutUC
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -535,8 +567,8 @@ Public Class SingleCutUC
|
|||||||
m_CurrProjPage.SetWarningMessage( "Trial Version")
|
m_CurrProjPage.SetWarningMessage( "Trial Version")
|
||||||
#Else
|
#Else
|
||||||
' Verifico non sia versione Ufficio
|
' Verifico non sia versione Ufficio
|
||||||
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
m_CurrProjPage.SetWarningMessage( "Office Version")
|
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Verifico ci sia un taglio valido
|
' Verifico ci sia un taglio valido
|
||||||
@@ -564,7 +596,7 @@ Public Class SingleCutUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateSingleCut() As Boolean
|
Private Function CreateSingleCut() As Boolean
|
||||||
@@ -582,7 +614,7 @@ Public Class SingleCutUC
|
|||||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
EgtTdbSetCurrTool(sSaw)
|
EgtTdbSetCurrTool(sSaw)
|
||||||
Dim dThick As Double = 0
|
Dim dThick As Double = 0
|
||||||
' se è impostata una lavorazione di lama
|
' Se è impostata una lavorazione di lama
|
||||||
If Not String.IsNullOrEmpty(sSawing) Then
|
If Not String.IsNullOrEmpty(sSawing) Then
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||||
End If
|
End If
|
||||||
@@ -598,14 +630,19 @@ Public Class SingleCutUC
|
|||||||
Dim ptStart As Point3d = m_ptTipP1
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
ptStart.z = 0
|
ptStart.z = 0
|
||||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||||
If Math.Abs(m_dOffset) > 10 * EPS_SMALL Then
|
' Applico la correzione di spessore lama -> anche se Offset=0! ver_2.5b1
|
||||||
Dim dTotOffset = m_dOffset
|
Dim dTotOffset = m_dOffset
|
||||||
If m_bSawTh Then dTotOffset += If( m_dOffset > 0, dThick, -dThick)
|
If m_bSawTh Then
|
||||||
|
dTotOffset += If(m_dOffset > 0, dThick, -dThick)
|
||||||
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
|
Else
|
||||||
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
End If
|
End If
|
||||||
' Imposto affondamento e angolo di fianco sul taglio
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
|
' Imposto se disabilitare l'inversine di direzione del taglio
|
||||||
|
If Not m_MainWindow.m_CurrentMachine.bEnableInvert Then EgtSetInfo(nCutId, INFO_ENABLE_INVERT, 0)
|
||||||
' Creo layer per crocetta di riferimento
|
' Creo layer per crocetta di riferimento
|
||||||
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
||||||
' Aggiungo crocetta/e
|
' Aggiungo crocetta/e
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ Public Class SingleDrillUC
|
|||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
' Rimuovo eventuale pezzo per taglio diretto
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
@@ -342,6 +342,7 @@ Public Class SingleDrillUC
|
|||||||
m_bSimul = True
|
m_bSimul = True
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
@@ -382,7 +383,7 @@ Public Class SingleDrillUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
m_MainWindow.m_DirectCutPageUC.LeftButtonGrid.Children.Remove(Me)
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function CreateSingleDrill() As Boolean
|
Private Function CreateSingleDrill() As Boolean
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
<UserControl x:Class="SquaringUC"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||||
|
|
||||||
|
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{StaticResource OmagCut_LightGray}">-->
|
||||||
|
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
|
||||||
|
|
||||||
|
<!-- Definizione della Grid MultipleCut -->
|
||||||
|
<Grid Name="SingleCutGrid" >
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="2*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<!--<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<ToggleButton Name="Point1Btn" Grid.Column="0"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource Acquisisci-P1Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
|
||||||
|
<ToggleButton Name="Point2Btn" Grid.Column="1"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource Acquisisci-P2Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
</Grid>-->
|
||||||
|
|
||||||
|
<!--<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
|
Margin="6,0,6,0">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>-->
|
||||||
|
|
||||||
|
<!--<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||||
|
|
||||||
|
<TextBlock Name="OffsetTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="OffsetTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<TextBlock Name="ExtraLenTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="ExtraLenTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<!--<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>-->
|
||||||
|
|
||||||
|
<!--<Grid Grid.Row="5" Grid.ColumnSpan="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1.5*"/>
|
||||||
|
<ColumnDefinition Width="2"/>
|
||||||
|
<ColumnDefinition Width="1.5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" Background="Black" />
|
||||||
|
|
||||||
|
<TextBlock Name="NumPzXTxBl" Grid.Column="0" Grid.Row="0"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<TextBlock Name="DimPzXTxBl" Grid.Column="2" Grid.Row="0"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
|
||||||
|
<EgtWPFLib:EgtTextBox Name="NumPzXTxBx" Grid.Column="0" Grid.Row="1" Width="75"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="DimPzXTxBx" Grid.Column="2" Grid.Row="1" Width="75"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock Name="NumPzYTxBl" Grid.Column="0" Grid.Row="2"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<TextBlock Name="DimPzYTxBl" Grid.Column="2" Grid.Row="2"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
|
||||||
|
<EgtWPFLib:EgtTextBox Name="NumPzYTxBx" Grid.Column="0" Grid.Row="3" Width="75"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="DimPzYTxBx" Grid.Column="2" Grid.Row="3" Width="75"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<TextBlock Name="SideTxBl" Grid.Row="6" Grid.ColumnSpan="2"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<CheckBox Name="SideChBx" Grid.Row="6" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
|
HorizontalAlignment="Right" Margin="0,0,6,0"/>-->
|
||||||
|
|
||||||
|
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
|
||||||
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource EseguiImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,442 @@
|
|||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
|
Public Class SquaringUC
|
||||||
|
|
||||||
|
' Riferimenti a pagine
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||||
|
' Flag di pagina attiva
|
||||||
|
Private m_bActive As Boolean = False
|
||||||
|
' Flag di simulazione in corso
|
||||||
|
Private m_bSimul As Boolean = False
|
||||||
|
|
||||||
|
' Origine tavola e dati grezzo
|
||||||
|
Private m_bRawOk As Boolean = False
|
||||||
|
Private m_ptTabOri As Point3d
|
||||||
|
Private m_ptRawMin As Point3d
|
||||||
|
Private m_ptRawMax As Point3d
|
||||||
|
' Parametri P1 acquisito
|
||||||
|
Private m_ptTipP1 As Point3d
|
||||||
|
Private m_vtToolP1 As Vector3d
|
||||||
|
' Parametri P2 acquisito
|
||||||
|
Private m_ptTipP2 As Point3d
|
||||||
|
Private m_vtToolP2 As Vector3d
|
||||||
|
' Parametri della lavorazione
|
||||||
|
Private m_bCutOk As Boolean = False
|
||||||
|
Private m_dDepth As Double = 0
|
||||||
|
Private m_dOffsetSquaring As Double = 150
|
||||||
|
Private m_dExtraLength As Double = 0
|
||||||
|
Private m_dAngO As Double = 180
|
||||||
|
Private m_dAngV As Double = 0
|
||||||
|
Private m_nNumX As Integer = 0
|
||||||
|
Private m_dDimX As Double = 0
|
||||||
|
Private m_nNumY As Integer = 0
|
||||||
|
Private m_dDimY As Double = 0
|
||||||
|
Private m_bHeadSide As Boolean = False
|
||||||
|
|
||||||
|
' Punto selezionato nel disegno
|
||||||
|
Private m_ptPrev As Point3d
|
||||||
|
' Layer per crocette temporanee
|
||||||
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
' Costanti
|
||||||
|
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||||
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
|
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||||
|
|
||||||
|
'Costante che indica il lato in cui posizionare i tagli
|
||||||
|
Private Enum CutSide As Integer
|
||||||
|
Left
|
||||||
|
Right
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private Sub GridCut_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
OffsetTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 28)
|
||||||
|
' 90260=Extra length
|
||||||
|
ExtraLenTxBl.Text = EgtMsg(90260)
|
||||||
|
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||||
|
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||||
|
|
||||||
|
' Carico i dati dell'ultimo taglio
|
||||||
|
m_dOffsetSquaring = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_OFFSET_SQUARING, m_dOffsetSquaring, m_MainWindow.GetIniFile())
|
||||||
|
m_dExtraLength = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_EXTRA_LEN_SQUARING, m_dExtraLength, m_MainWindow.GetIniFile())
|
||||||
|
m_dDepth = 0
|
||||||
|
m_dAngO = 90
|
||||||
|
m_dAngV = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_ANGV, m_dAngV, m_MainWindow.GetIniFile())
|
||||||
|
m_nNumX = 1
|
||||||
|
m_dDimX = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, m_MainWindow.GetIniFile())
|
||||||
|
m_nNumY = 1
|
||||||
|
m_dDimY = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
|
||||||
|
m_bHeadSide = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Squaring_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
' Attivo la pagina
|
||||||
|
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||||
|
m_bActive = True
|
||||||
|
' Se rientro da simulazione
|
||||||
|
If m_bSimul Then
|
||||||
|
m_bSimul = False
|
||||||
|
' Disabilito registrazione progetto modificato
|
||||||
|
EgtDisableModified()
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||||
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
|
EgtDraw()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Disabilito registrazione progetto modificato
|
||||||
|
EgtDisableModified()
|
||||||
|
' Creo layer temporaneo per crocette
|
||||||
|
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||||
|
' Origine tavola
|
||||||
|
m_bRawOk = True
|
||||||
|
If Not EgtGetTableRef(1, m_ptTabOri) Then
|
||||||
|
m_bRawOk = False
|
||||||
|
EgtOutLog("Error on TableRef1")
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Dati del grezzo
|
||||||
|
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then
|
||||||
|
m_bRawOk = False
|
||||||
|
EgtOutLog("Error on RawBox")
|
||||||
|
End If
|
||||||
|
' calcolo lalavorazione di squadratura
|
||||||
|
RefreshSquaring()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshSquaring()
|
||||||
|
If Not m_bRawOk Then Return
|
||||||
|
|
||||||
|
Dim m_ThickSaw As Double
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, m_ThickSaw)
|
||||||
|
|
||||||
|
m_dDepth = CamAuto.GetRawHeight()
|
||||||
|
m_dDimX = Math.Abs(m_ptRawMax.x - m_ptRawMin.x) - 2 * (m_dOffsetSquaring)
|
||||||
|
m_dDimY = Math.Abs(m_ptRawMax.y - m_ptRawMin.y) - 2 * (m_dOffsetSquaring)
|
||||||
|
|
||||||
|
Dim ptStart As New Point3d(m_ptRawMin.x + m_dOffsetSquaring - m_ThickSaw, m_ptRawMin.y + m_dOffsetSquaring, m_ptRawMin.z)
|
||||||
|
Dim ptEnd As New Point3d(ptStart.x + m_dDimX, ptStart.y, m_ptRawMin.z)
|
||||||
|
|
||||||
|
SetCoordVisibility(True)
|
||||||
|
ShowCoord()
|
||||||
|
|
||||||
|
OffsetTxBx.Text = LenToString(m_dOffsetSquaring, 1)
|
||||||
|
ExtraLenTxBx.Text = LenToString(m_dExtraLength, 1)
|
||||||
|
m_bCutOk = False
|
||||||
|
UpdateSimulOkBtn()
|
||||||
|
|
||||||
|
SquaringPoint(ptStart, ptEnd)
|
||||||
|
m_ptPrev = ptStart
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub Squaring_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
|
' Salvo i dati correnti
|
||||||
|
' Salvo i dati correnti
|
||||||
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_OFFSET_SQUARING, DoubleToString(m_dOffsetSquaring, 2), m_MainWindow.GetIniFile())
|
||||||
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_EXTRA_LEN_SQUARING, DoubleToString(m_dExtraLength, 2), m_MainWindow.GetIniFile())
|
||||||
|
' Se non vado in simulazione
|
||||||
|
If Not m_bSimul Then
|
||||||
|
' Dichiaro sottopagina da non riattivare
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
|
' Rimuovo layer temporaneo per crocette
|
||||||
|
EgtErase(m_nTempLay)
|
||||||
|
' Rimuovo eventuale pezzo per taglio diretto
|
||||||
|
EraseDirectCutPart()
|
||||||
|
' Riattivo eventuali lavorazioni presenti
|
||||||
|
ActivateAllMachinings()
|
||||||
|
' Abilito registrazione progetto modificato
|
||||||
|
EgtEnableModified()
|
||||||
|
' Nascondo la macchina
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||||
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
' Dichiaro pagina non attiva
|
||||||
|
m_bActive = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub UpdateSimulOkBtn()
|
||||||
|
If m_bCutOk Then
|
||||||
|
SimulBtn.IsEnabled = True
|
||||||
|
SimulBtn.Foreground = Brushes.Black
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
OkBtn.Foreground = Brushes.Black
|
||||||
|
Else
|
||||||
|
SimulBtn.IsEnabled = False
|
||||||
|
SimulBtn.Foreground = Brushes.DarkGray
|
||||||
|
OkBtn.IsEnabled = False
|
||||||
|
OkBtn.Foreground = Brushes.DarkGray
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SquaringPoint(ptMin As Point3d, ptMax As Point3d)
|
||||||
|
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||||
|
EgtEmptyGroup(m_nTempLay)
|
||||||
|
' Verifico configurazione tavola e grezzo
|
||||||
|
If Not m_bRawOk Then Return
|
||||||
|
|
||||||
|
' Recupero dati utensile e testa corrente
|
||||||
|
Dim sTool As String = ""
|
||||||
|
Dim sHead As String = ""
|
||||||
|
Dim nExit As Integer = 0
|
||||||
|
EgtGetCalcTool(sTool, sHead, nExit)
|
||||||
|
'------------- BOTTOM LEFT -------------------
|
||||||
|
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||||
|
m_ptTipP1 = ptMin
|
||||||
|
' Porto il tip nell'origine tavola
|
||||||
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
|
' Reimposto eventuale precedente utensile
|
||||||
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
'------------- TOP RIGHT -------------------
|
||||||
|
' Assegno punto selezionato nel disegno a m_ptTipP2
|
||||||
|
m_ptTipP2 = ptMax
|
||||||
|
' Porto il tip nell'origine tavola
|
||||||
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
|
' Reimposto eventuale precedente utensile
|
||||||
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
|
' Se il secondo punto non coincide con il primo, disegno il taglio
|
||||||
|
Dim vtDiff As Vector3d = m_ptTipP2 - m_ptTipP1
|
||||||
|
vtDiff.z = 0
|
||||||
|
Dim dLen As Double
|
||||||
|
Dim dAngVertDeg As Double
|
||||||
|
Dim dAngOrizzDeg As Double
|
||||||
|
vtDiff.ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
|
||||||
|
If dLen > EPS_SMALL Then
|
||||||
|
m_dAngO = dAngOrizzDeg
|
||||||
|
CreateGridCut()
|
||||||
|
' visuliazzo tavola
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||||
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OffsetTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetTxBx.EgtClosed
|
||||||
|
' Verifico che l'offset impostato non sia superiore a quello massimo
|
||||||
|
Dim dMaxOffset As Double = Math.Min(m_dDimX, m_dDimY) / 2 - 15
|
||||||
|
Dim dOffset As Double = 0
|
||||||
|
StringToLen(OffsetTxBx.Text, dOffset)
|
||||||
|
If dOffset < 0 Then
|
||||||
|
dOffset = 0
|
||||||
|
ElseIf dOffset > dMaxOffset Then
|
||||||
|
dOffset = dMaxOffset
|
||||||
|
End If
|
||||||
|
m_dOffsetSquaring = dOffset
|
||||||
|
OffsetTxBx.Text = LenToString(m_dOffsetSquaring, 2)
|
||||||
|
' Disegno il taglio
|
||||||
|
RefreshSquaring()
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ExtraLength_EgtClosed(sender As Object, e As EventArgs) Handles ExtraLenTxBx.EgtClosed
|
||||||
|
' Verifico che il valore indicato sia almeno maggiore dell'offset indicato
|
||||||
|
Dim dOffset As Double = 0
|
||||||
|
StringToLen(OffsetTxBx.Text, dOffset)
|
||||||
|
Dim MadExtraLeng As Double = Math.Abs(dOffset)
|
||||||
|
Dim dExtraLen As Double
|
||||||
|
StringToLen(ExtraLenTxBx.Text, dExtraLen)
|
||||||
|
If dExtraLen < 0 AndAlso dExtraLen < -MadExtraLeng Then
|
||||||
|
dExtraLen = 0
|
||||||
|
End If
|
||||||
|
m_dExtraLength = dExtraLen
|
||||||
|
ExtraLenTxBx.Text = LenToString(m_dExtraLength, 2)
|
||||||
|
' Disegno il taglio
|
||||||
|
RefreshSquaring()
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||||
|
' Verifico ci sia un taglio valido
|
||||||
|
If Not m_bCutOk Then Return
|
||||||
|
' Salvo il progetto con le lavorazioni
|
||||||
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
|
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||||
|
' Predispongo passaggio a simulazione
|
||||||
|
m_bSimul = True
|
||||||
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(m_MainWindow.m_DirectCutPageUC)
|
||||||
|
m_MainWindow.m_PrevActivePage = MainWindow.Pages.DirectCut
|
||||||
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_SimulationPage)
|
||||||
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Simulation
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
|
#If TRIAL Then
|
||||||
|
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||||
|
#Else
|
||||||
|
' Verifico non sia versione Ufficio
|
||||||
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
|
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Verifico ci sia un taglio valido
|
||||||
|
If Not m_bCutOk Then Return
|
||||||
|
' Salvo il progetto con le lavorazioni
|
||||||
|
Dim sMchPath As String = m_MainWindow.GetTempDir() & "\" & "DirectProj.nge"
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SaveFile(sMchPath, False)
|
||||||
|
' Genero file CNC (lancio anche se errore in precedenza)
|
||||||
|
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||||
|
Dim bOk As Boolean = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion())
|
||||||
|
' Se errore in generazione, segnalo l'errore ed esco
|
||||||
|
If Not bOk Then
|
||||||
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||||
|
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||||
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
|
' lancio eventuale lua post-trasmissione
|
||||||
|
m_MainWindow.ExecSentProgScript(True)
|
||||||
|
End If
|
||||||
|
#End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.LeftButtonGrid.Children.Remove(Me)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function CreateGridCut() As Boolean
|
||||||
|
' Verifico sia definito il punto iniziale e il grezzo
|
||||||
|
If Not m_bRawOk Then
|
||||||
|
m_bCutOk = False
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
' Spessore grezzo
|
||||||
|
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||||
|
' Rimuovo eventuale vecchio pezzo per taglio diretto
|
||||||
|
EraseDirectCutPart()
|
||||||
|
' Disattivo eventuali lavorazioni presenti
|
||||||
|
DeactivateAllMachinings()
|
||||||
|
' Creo nuovo pezzo per il taglio diretto
|
||||||
|
Dim nPartId = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
EgtSetName(nPartId, NAME_DIRECTCUT)
|
||||||
|
Dim nLayerId = EgtCreateGroup(nPartId)
|
||||||
|
EgtSetName(nLayerId, NAME_OUTLOOP)
|
||||||
|
' Creo il taglio parallelo alla lama
|
||||||
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
|
ptStart.z = 0
|
||||||
|
' Funzione che crea i tagli successivi al primo
|
||||||
|
MultiplyCut(nLayerId)
|
||||||
|
' Calcolo punto di inserimento nel grezzo
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
EgtGetBBoxGlob(nPartId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||||
|
Dim ptIns As Point3d = ptMin + (m_ptTabOri - m_ptRawMin)
|
||||||
|
ptIns.z = dRawHeight
|
||||||
|
' Inserisco il pezzo nel grezzo
|
||||||
|
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
|
||||||
|
' Inserisco la lavorazione
|
||||||
|
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
' Eventuale eliminazione Home finale
|
||||||
|
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||||
|
RemoveFinalHome()
|
||||||
|
End If
|
||||||
|
UpdateSimulOkBtn()
|
||||||
|
Return m_bCutOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function MultiplyCut(nLayerId As Integer) As Boolean
|
||||||
|
' Recupero lo spessore del taglio della lama o del waterjet correntemente attiva
|
||||||
|
Dim nType As Integer = 0
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||||
|
Dim dThick As Double = 0
|
||||||
|
EgtTdbGetCurrToolParam(If(nType = MCH_TY.SAW_STD, MCH_TP.THICK, MCH_TP.DIAM), dThick)
|
||||||
|
' Ricalcolo lo spessore in base all'inclinazione
|
||||||
|
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
|
||||||
|
' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
|
||||||
|
Dim dRotAngOX As Double = 90
|
||||||
|
' Recupero dati da interfaccia
|
||||||
|
Dim dDimPzX As Double = m_dDimX
|
||||||
|
Dim nNumPzX As Integer = m_nNumX
|
||||||
|
Dim dDimPzY As Double = m_dDimY
|
||||||
|
Dim nNumPzY As Integer = m_nNumY
|
||||||
|
' Definisco vettore di spostamento
|
||||||
|
Dim vtDelta As Vector3d
|
||||||
|
' Calcolo primo taglio parallelo
|
||||||
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
|
ptStart.z = 0
|
||||||
|
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
||||||
|
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
|
||||||
|
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
||||||
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
|
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
||||||
|
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
|
' Allungo la geometria
|
||||||
|
EgtExtendCurveStartByLen(nCutParaId, m_dOffsetSquaring + m_dExtraLength)
|
||||||
|
EgtExtendCurveEndByLen(nCutParaId, m_dOffsetSquaring + +m_dExtraLength)
|
||||||
|
' Calcolo vettore di spostamento
|
||||||
|
vtDelta = Vector3d.FromPolar((dDimPzY + dThick), m_dAngO)
|
||||||
|
' Ruoto il vettore di traslazione
|
||||||
|
vtDelta.Rotate(Vector3d.Z_AX, dRotAngOX)
|
||||||
|
For Index As Integer = 1 To nNumPzY
|
||||||
|
Dim vtPerpMove As Vector3d = Index * vtDelta
|
||||||
|
' Creo copie
|
||||||
|
Dim nCut2Id = EgtCopyGlob(nCutParaId, nLayerId)
|
||||||
|
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
|
||||||
|
Next
|
||||||
|
' Calcolo primo taglio perpendicolare
|
||||||
|
Dim dLenY As Double = dThick + (dDimPzY + dThick) * nNumPzY
|
||||||
|
' Arretro il punto di partenza di uno spessore lama
|
||||||
|
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
|
||||||
|
Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY + 0.2)
|
||||||
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
|
EgtSetInfo(nCutPerpId, INFO_DEPTH, m_dDepth)
|
||||||
|
EgtSetInfo(nCutPerpId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
|
' Allungo la geometria
|
||||||
|
EgtExtendCurveStartByLen(nCutPerpId, m_dOffsetSquaring + m_dExtraLength)
|
||||||
|
EgtExtendCurveEndByLen(nCutPerpId, m_dOffsetSquaring + +m_dExtraLength)
|
||||||
|
' Calcolo secondo vettore di spostamento
|
||||||
|
vtDelta = Vector3d.FromPolar((dDimPzX + dThick), m_dAngO)
|
||||||
|
For Index As Integer = 1 To nNumPzX
|
||||||
|
Dim vtPerpMove As Vector3d = vtDelta * Index
|
||||||
|
' Creo copie
|
||||||
|
Dim nCut3Id = EgtCopyGlob(nCutPerpId, nLayerId)
|
||||||
|
EgtMove(nCut3Id, vtPerpMove, GDB_RT.GLOB)
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub SetCoordVisibility(bShow As Boolean)
|
||||||
|
XcoordTxBl.Visibility = If(bShow, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
|
XcoordTxBx.Visibility = If(bShow, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
|
YcoordTxBl.Visibility = If(bShow, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
|
YcoordTxBx.Visibility = If(bShow, Windows.Visibility.Visible, Windows.Visibility.Hidden)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ShowCoord()
|
||||||
|
Dim ptText As Point3d = m_ptPrev
|
||||||
|
ptText.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
|
XcoordTxBx.Text = LenToString(ptText.x, 2)
|
||||||
|
YcoordTxBx.Text = LenToString(ptText.y, 2)
|
||||||
|
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
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
@@ -199,12 +199,12 @@
|
|||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
Grid.Column="2" Grid.Row="1"
|
Grid.Column="2" Grid.Row="1"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Width="60" Height="30" Margin="0,0,0,0"
|
Width="60" Height="30" Margin="0,0,0,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="Parameter2FTxBx"
|
<EgtWPFLib:EgtTextBox Name="Parameter2FTxBx"
|
||||||
Grid.Column="3" Grid.Row="1"
|
Grid.Column="3" Grid.Row="1"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Width="60" Height="30" Margin="0,0,0,0"
|
Width="60" Height="30" Margin="0,0,0,0" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<!-- Spessore aletta -->
|
<!-- Spessore aletta -->
|
||||||
|
|||||||
@@ -96,8 +96,14 @@ Public Class AlzFrontUC
|
|||||||
Dim LabelId As Integer = GDB_ID.NULL
|
Dim LabelId As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
' definisco i valori delle altezza e degli angoli di spoglia per le alzatine e i frontalini (letti da file ini del programma)
|
' definisco i valori delle altezza e degli angoli di spoglia per le alzatine e i frontalini (letti da file ini del programma)
|
||||||
GetPrivateProfileString(S_ALZFRONT, K_ALZ_HEIGHT, "0", Parameter1ATxBx.Text, m_MainWindow.GetIniFile)
|
Dim sVal As String = String.Empty
|
||||||
GetPrivateProfileString(S_ALZFRONT, K_FRONT_HEIGHT, "0", Parameter1FTxBx.Text, m_MainWindow.GetIniFile)
|
Dim dVal As Double = 0
|
||||||
|
GetPrivateProfileString(S_ALZFRONT, K_ALZ_HEIGHT, "0", sVal, m_MainWindow.GetIniFile)
|
||||||
|
Utility.StringToDouble(sVal, dVal)
|
||||||
|
Parameter1ATxBx.Text = Utility.LenToString(dVal, 4)
|
||||||
|
GetPrivateProfileString(S_ALZFRONT, K_FRONT_HEIGHT, "0", sVal, m_MainWindow.GetIniFile)
|
||||||
|
Utility.StringToDouble(sVal, dVal)
|
||||||
|
Parameter1FTxBx.Text = Utility.LenToString(dVal, 4)
|
||||||
GetPrivateProfileString(S_ALZFRONT, K_ALZ_DELTA_ANG, "0", Parameter2ATxBx.Text, m_MainWindow.GetIniFile)
|
GetPrivateProfileString(S_ALZFRONT, K_ALZ_DELTA_ANG, "0", Parameter2ATxBx.Text, m_MainWindow.GetIniFile)
|
||||||
GetPrivateProfileString(S_ALZFRONT, K_FRONT_DELTA_ANG, "0", Parameter2FTxBx.Text, m_MainWindow.GetIniFile)
|
GetPrivateProfileString(S_ALZFRONT, K_FRONT_DELTA_ANG, "0", Parameter2FTxBx.Text, m_MainWindow.GetIniFile)
|
||||||
Parameter5TxBx.Text = Utility.LenToString(m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight, 2)
|
Parameter5TxBx.Text = Utility.LenToString(m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight, 2)
|
||||||
@@ -607,9 +613,9 @@ Public Class AlzFrontUC
|
|||||||
Private Sub ParameterA1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1ATxBx.EgtClosed
|
Private Sub ParameterA1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1ATxBx.EgtClosed
|
||||||
' Nuovo angolo di inclinazione
|
' Nuovo angolo di inclinazione
|
||||||
Dim dValue As Double
|
Dim dValue As Double
|
||||||
StringToDouble(Parameter1ATxBx.Text, dValue)
|
StringToLen(Parameter1ATxBx.Text, dValue)
|
||||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||||
WritePrivateProfileString("Alz&Front", "A_Height", Parameter1ATxBx.Text, m_MainWindow.GetIniFile())
|
WritePrivateProfileString("Alz&Front", "A_Height", DoubleToString(dValue, 3), m_MainWindow.GetIniFile())
|
||||||
' aggiorno il disegno
|
' aggiorno il disegno
|
||||||
LoadCurrentCompo()
|
LoadCurrentCompo()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -618,9 +624,9 @@ Public Class AlzFrontUC
|
|||||||
Private Sub Parameter1FTxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1FTxBx.EgtClosed
|
Private Sub Parameter1FTxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1FTxBx.EgtClosed
|
||||||
' Nuovo angolo di inclinazione
|
' Nuovo angolo di inclinazione
|
||||||
Dim dValue As Double
|
Dim dValue As Double
|
||||||
StringToDouble(Parameter1FTxBx.Text, dValue)
|
StringToLen(Parameter1FTxBx.Text, dValue)
|
||||||
' salvo il valore nel file ini e inserisco il valore nel file lua
|
' salvo il valore nel file ini e inserisco il valore nel file lua
|
||||||
WritePrivateProfileString("Alz&Front", "F_Height", Parameter1FTxBx.Text, m_MainWindow.GetIniFile())
|
WritePrivateProfileString("Alz&Front", "F_Height", DoubleToString(dValue, 3), m_MainWindow.GetIniFile())
|
||||||
' aggiorno il disegno
|
' aggiorno il disegno
|
||||||
LoadCurrentCompo()
|
LoadCurrentCompo()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
|
|||||||
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
||||||
If Not String.IsNullOrEmpty(sCompoDir) Then
|
If Not String.IsNullOrEmpty(sCompoDir) Then
|
||||||
bEnableAlzFront = True
|
bEnableAlzFront = True
|
||||||
AlzFrontBtn.Content = "Alzatine & Frontalini"
|
AlzFrontBtn.Content = EgtMsg(91137)
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Collapsed
|
AlzFrontBtn.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
@@ -75,6 +75,7 @@ Public Class CompoDimensionUC
|
|||||||
m_DrawPage.sCompoName.StartsWith("PBagno") Then
|
m_DrawPage.sCompoName.StartsWith("PBagno") Then
|
||||||
ShowInternalBtn(True)
|
ShowInternalBtn(True)
|
||||||
ShowAlzFrontBtn(bEnableAlzFront)
|
ShowAlzFrontBtn(bEnableAlzFront)
|
||||||
|
m_DrawPage.MessageGrid.Visibility = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
ShowInternalBtn(False)
|
ShowInternalBtn(False)
|
||||||
ShowAlzFrontBtn(False)
|
ShowAlzFrontBtn(False)
|
||||||
@@ -106,8 +107,10 @@ Public Class CompoDimensionUC
|
|||||||
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
||||||
If value Then
|
If value Then
|
||||||
AlzFrontBtn.Visibility = Visibility.Visible
|
AlzFrontBtn.Visibility = Visibility.Visible
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Hidden
|
AlzFrontBtn.Visibility = Visibility.Hidden
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
|
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
|
||||||
TextAlignment="Right"/>
|
TextAlignment="Right"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60"
|
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -283,6 +283,19 @@ Public Class DrawPageUC
|
|||||||
m_sCsvOrder = ""
|
m_sCsvOrder = ""
|
||||||
m_sCsvList = ""
|
m_sCsvList = ""
|
||||||
m_sCsvName = ""
|
m_sCsvName = ""
|
||||||
|
|
||||||
|
' Visuliazzazione dei bottoni per modifica dei componenti
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
SideAngleBtn.Visibility = Visibility.Hidden
|
||||||
|
FiloTopBtn.Visibility = Visibility.Hidden
|
||||||
|
EngraveBtn.Visibility = Visibility.Hidden
|
||||||
|
DripCutBtn.Visibility = Visibility.Hidden
|
||||||
|
Else
|
||||||
|
SideAngleBtn.Visibility = Visibility.Visible
|
||||||
|
FiloTopBtn.Visibility = Visibility.Visible
|
||||||
|
EngraveBtn.Visibility = Visibility.Visible
|
||||||
|
DripCutBtn.Visibility = Visibility.Visible
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
||||||
@@ -553,6 +566,7 @@ Public Class DrawPageUC
|
|||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Navigazione nelle due pagine per la selezione dei componenti da disegnare
|
||||||
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
DrawPage_Unloaded(sender, e)
|
DrawPage_Unloaded(sender, e)
|
||||||
@@ -604,6 +618,10 @@ Public Class DrawPageUC
|
|||||||
MakePreview(sMsg)
|
MakePreview(sMsg)
|
||||||
MessageTxBl.Text = sMsg
|
MessageTxBl.Text = sMsg
|
||||||
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
|
MessageGrid.Background = If(m_bDrawOk, Brushes.Transparent, Application.Current.FindResource("OmagCut_Red"))
|
||||||
|
|
||||||
|
' EseguoUpdate del solido
|
||||||
|
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
|
||||||
|
|
||||||
' aggiorno visualizzazione
|
' aggiorno visualizzazione
|
||||||
EgtSetView(VT.TOP, False)
|
EgtSetView(VT.TOP, False)
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -613,7 +631,8 @@ Public Class DrawPageUC
|
|||||||
' Costruisco path completa del componente
|
' Costruisco path completa del componente
|
||||||
Dim sPath = m_sCompoDir & "\" & m_sCompoName
|
Dim sPath = m_sCompoDir & "\" & m_sCompoName
|
||||||
' Carico il file
|
' Carico il file
|
||||||
Return EgtLuaExecFile(sPath)
|
Dim bOk As Boolean = EgtLuaExecFile(sPath)
|
||||||
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function ReadAndShowVariables() As Boolean
|
Private Function ReadAndShowVariables() As Boolean
|
||||||
@@ -644,10 +663,17 @@ Public Class DrawPageUC
|
|||||||
m_CompoDimension.GetNameEdit(j).Text = m_CVars(i - 1).m_sName
|
m_CompoDimension.GetNameEdit(j).Text = m_CVars(i - 1).m_sName
|
||||||
m_CompoDimension.GetNameEdit(j).Visibility = Windows.Visibility.Visible
|
m_CompoDimension.GetNameEdit(j).Visibility = Windows.Visibility.Visible
|
||||||
m_CompoDimension.GetValueEdit(j).Text = m_CVars(i - 1).ToString()
|
m_CompoDimension.GetValueEdit(j).Text = m_CVars(i - 1).ToString()
|
||||||
|
'Dim dVal As Double
|
||||||
|
'StringToLen(m_CVars(i - 1).ToString(), dVal)
|
||||||
|
'm_CompoDimension.GetValueEdit(j).Text = LenToString(dVal, 3)
|
||||||
m_CompoDimension.GetValueEdit(j).Visibility = Windows.Visibility.Visible
|
m_CompoDimension.GetValueEdit(j).Visibility = Windows.Visibility.Visible
|
||||||
If m_CVars(i - 1).m_nType = 5 Then
|
If m_CVars(i - 1).m_nType = 5 Then
|
||||||
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).Keyboard = EgtTextBox.KeyboardType.Alphanumeric
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).Keyboard = EgtTextBox.KeyboardType.Alphanumeric
|
||||||
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).KeyboardDimension = 600
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).KeyboardDimension = 600
|
||||||
|
ElseIf m_CVars(i - 1).m_nType = 4 Then
|
||||||
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).Keyboard = EgtTextBox.KeyboardType.Calculator
|
||||||
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).IsLength = False
|
||||||
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).KeyboardDimension = 300
|
||||||
Else
|
Else
|
||||||
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).Keyboard = EgtTextBox.KeyboardType.Calculator
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).Keyboard = EgtTextBox.KeyboardType.Calculator
|
||||||
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).KeyboardDimension = 300
|
TryCast(m_CompoDimension.GetValueEdit(j), EgtTextBox).KeyboardDimension = 300
|
||||||
@@ -1117,6 +1143,30 @@ Public Class DrawPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function MakeSectionFrameInsert() As Boolean
|
||||||
|
' m_MainWindow.m_ImportPageUC.LoadFrame()
|
||||||
|
' recupero il primo layer del primo pezzo
|
||||||
|
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
|
||||||
|
If nLayerId = GDB_ID.NULL Then Return False
|
||||||
|
' percorso in cui salvare tempora
|
||||||
|
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Frame.Nge"
|
||||||
|
If Not EgtSaveObjToFile(nLayerId, sTmpFile, NGE.BIN) Then Return False
|
||||||
|
' Passo al contesto principale
|
||||||
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
|
' Inserisco il pezzo
|
||||||
|
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
|
||||||
|
EgtInsertFile(sTmpFile)
|
||||||
|
' Ne recupero l'Id
|
||||||
|
Dim nPartId As Integer = EgtGetLastPart()
|
||||||
|
' Creo la cornice
|
||||||
|
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
|
||||||
|
' Ricalcolo lavorazioni
|
||||||
|
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||||
|
' Cancello il file
|
||||||
|
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
m_bBackFromInternalCompo = False
|
m_bBackFromInternalCompo = False
|
||||||
m_bInternalCompo = False
|
m_bInternalCompo = False
|
||||||
@@ -1132,7 +1182,12 @@ Public Class DrawPageUC
|
|||||||
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
||||||
' Passo al contesto principale
|
' Passo al contesto principale
|
||||||
'MakeInsert(InsNbr, sPartName)
|
'MakeInsert(InsNbr, sPartName)
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
MakeSectionFrameInsert()
|
||||||
|
Else
|
||||||
MakeMultipleInsert(InsNbr, sPartName)
|
MakeMultipleInsert(InsNbr, sPartName)
|
||||||
|
End If
|
||||||
|
|
||||||
' Aggiorno ambiente principale
|
' Aggiorno ambiente principale
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' Elimino nome del componente precedente
|
' Elimino nome del componente precedente
|
||||||
@@ -1146,7 +1201,7 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1167,7 +1222,7 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||||
@@ -1485,7 +1540,10 @@ Public Class DrawPageUC
|
|||||||
Case 2 ' intero
|
Case 2 ' intero
|
||||||
Return m_nVal.ToString()
|
Return m_nVal.ToString()
|
||||||
Case 3 ' lunghezza
|
Case 3 ' lunghezza
|
||||||
Return DoubleToString(EgtToUiUnits(m_dVal), 4)
|
'Dim dVal As Double
|
||||||
|
'StringToLen(m_sVal, dVal)
|
||||||
|
Return LenToString(m_dVal, 4)
|
||||||
|
'Return DoubleToString(EgtToUiUnits(m_dVal), 4)
|
||||||
Case 4 ' double
|
Case 4 ' double
|
||||||
Return DoubleToString(m_dVal, 4)
|
Return DoubleToString(m_dVal, 4)
|
||||||
Case 5 ' stringa
|
Case 5 ' stringa
|
||||||
@@ -1510,12 +1568,13 @@ Public Class DrawPageUC
|
|||||||
End If
|
End If
|
||||||
Case 3 ' lunghezza
|
Case 3 ' lunghezza
|
||||||
Dim dVal As Double
|
Dim dVal As Double
|
||||||
If StringToDouble(sVal, dVal) Then
|
|
||||||
If bConvertUnits Then
|
If bConvertUnits Then
|
||||||
m_dVal = EgtFromUiUnits(dVal)
|
StringToLen(sVal, dVal)
|
||||||
Else
|
m_dVal = dVal
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
StringToDouble(sVal, dVal)
|
||||||
m_dVal = dVal
|
m_dVal = dVal
|
||||||
End If
|
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
Case 4 ' double
|
Case 4 ' double
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib5
|
||||||
|
|
||||||
Public Class FiloTopUC
|
Public Class FiloTopUC
|
||||||
|
|
||||||
@@ -38,17 +39,18 @@ Public Class FiloTopUC
|
|||||||
m_CallingPage = m_MainWindow.m_ActivePage
|
m_CallingPage = m_MainWindow.m_ActivePage
|
||||||
|
|
||||||
' Imposto messaggi
|
' Imposto messaggi
|
||||||
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
|
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||||
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
|
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||||
|
Parameter3TxBl.Text = EgtMsg(91138)
|
||||||
|
|
||||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||||
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
||||||
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
|
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
|
||||||
' Imposto contesto corrente
|
' Imposto contesto corrente
|
||||||
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||||
' Imposto contesto corrente
|
' Imposto contesto corrente
|
||||||
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Gestisco visualizzazione dei parametri
|
' Gestisco visualizzazione dei parametri
|
||||||
@@ -57,9 +59,9 @@ Public Class FiloTopUC
|
|||||||
Parameter3TxBl.Visibility = Windows.Visibility.Visible
|
Parameter3TxBl.Visibility = Windows.Visibility.Visible
|
||||||
|
|
||||||
' Aggiorno valori
|
' Aggiorno valori
|
||||||
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
|
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
|
||||||
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
|
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
|
||||||
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
|
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
|
||||||
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
|
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
|
||||||
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
|
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
|
||||||
Parameter3ChBx.IsChecked = m_bCornerradius
|
Parameter3ChBx.IsChecked = m_bCornerradius
|
||||||
@@ -80,8 +82,8 @@ Public Class FiloTopUC
|
|||||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||||
While nLayId <> GDB_ID.NULL
|
While nLayId <> GDB_ID.NULL
|
||||||
Dim sLayName As String = ""
|
Dim sLayName As String = ""
|
||||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||||
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
|
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
|
||||||
End If
|
End If
|
||||||
nLayId = EgtGetNextLayer(nLayId)
|
nLayId = EgtGetNextLayer(nLayId)
|
||||||
End While
|
End While
|
||||||
@@ -101,13 +103,16 @@ Public Class FiloTopUC
|
|||||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||||
While nLayId <> GDB_ID.NULL
|
While nLayId <> GDB_ID.NULL
|
||||||
Dim sLayName As String = ""
|
Dim sLayName As String = ""
|
||||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||||
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
|
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
|
||||||
End If
|
End If
|
||||||
nLayId = EgtGetNextLayer(nLayId)
|
nLayId = EgtGetNextLayer(nLayId)
|
||||||
End While
|
End While
|
||||||
nPartId = EgtGetNextPart(nPartId)
|
nPartId = EgtGetNextPart(nPartId)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
|
Private Sub Parameter3ChBx_Checked() Handles Parameter3ChBx.Click
|
||||||
@@ -215,12 +220,16 @@ Public Class FiloTopUC
|
|||||||
EgtRemoveInfo(nLayId, "FiloTopRef")
|
EgtRemoveInfo(nLayId, "FiloTopRef")
|
||||||
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If bOk Then Utility.CreateSolid3D(m_MainWindow.GetIniFile())
|
||||||
|
|
||||||
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
||||||
End If
|
End If
|
||||||
nLayId = EgtGetNextLayer(nLayId)
|
nLayId = EgtGetNextLayer(nLayId)
|
||||||
End While
|
End While
|
||||||
nPartId = EgtGetNextPart(nPartId)
|
nPartId = EgtGetNextPart(nPartId)
|
||||||
End While
|
End While
|
||||||
|
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
|
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
|
||||||
TextAlignment="Right"/>
|
TextAlignment="Right"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60"
|
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
|
|||||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
||||||
|
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetButton(ByVal nInd As Integer) As Button
|
Private Function GetButton(ByVal nInd As Integer) As Button
|
||||||
@@ -167,7 +168,7 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
||||||
CurrentBtn = DirectCast(e.Source, Button)
|
CurrentBtn = DirectCast(e.Source, Button)
|
||||||
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
|
Dim CompoName As String = If(m_MainWindow.FrameCutBtn.IsChecked, S_FRAMECOMPO, S_COMPO) & GetIndexFromButton(CurrentBtn).ToString
|
||||||
m_sCurrCompoFam = CompoName
|
m_sCurrCompoFam = CompoName
|
||||||
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
||||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -251,6 +252,11 @@ Public Class MainComponentPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadPage()
|
Private Sub LoadPage()
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
LoadFramePage()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
Dim nDeltaSecondPage As Integer = 8
|
Dim nDeltaSecondPage As Integer = 8
|
||||||
' Leggo numero di componenti presenti
|
' Leggo numero di componenti presenti
|
||||||
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -325,16 +331,86 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadFramePage()
|
||||||
|
Dim nDeltaSecondPage As Integer = 8
|
||||||
|
' Leggo numero di componenti presenti
|
||||||
|
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
|
' Calcolo indici a seconda della pagina in cui sono
|
||||||
|
If m_bIsFirstPage Then
|
||||||
|
ClearButton(nCompoNumber)
|
||||||
|
nDeltaSecondPage = 0
|
||||||
|
Else
|
||||||
|
ClearButton(nCompoNumber)
|
||||||
|
nDeltaSecondPage = 8
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Creazione converter da String a ImageSource
|
||||||
|
Dim ImageConverter As New ImageSourceConverter
|
||||||
|
Dim ThicknessConverter As New ThicknessConverter
|
||||||
|
|
||||||
|
'Assegnazione immagine e testo ai Button
|
||||||
|
For index As Integer = 1 To 8
|
||||||
|
Dim CustomThickness As New Thickness(0)
|
||||||
|
Dim nCompoName As Integer = GetPrivateProfileInt(S_FRAMECOMPO & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
|
||||||
|
Dim sCompoImage As String = ""
|
||||||
|
Dim sCompoImageSource As ImageSource
|
||||||
|
|
||||||
|
'verifico presenza immagine e la aggiungo
|
||||||
|
If GetPrivateProfileString(S_FRAMECOMPO & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
|
||||||
|
Try
|
||||||
|
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
|
||||||
|
GetImage(index).Height = 65
|
||||||
|
GetImage(index).Width = 65
|
||||||
|
GetImage(index).Source = sCompoImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & sCompoImage)
|
||||||
|
sCompoImage = String.Empty
|
||||||
|
GetImage(index).Height = 0
|
||||||
|
GetImage(index).Width = 0
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
'Se non c'è l'immagine azzero la distanza tra testo e immagine
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End If
|
||||||
|
|
||||||
|
'verifico presenza testo
|
||||||
|
If nCompoName > 0 Then
|
||||||
|
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
|
||||||
|
'verifico presenza immagine
|
||||||
|
If sCompoImage.Length > 0 Then
|
||||||
|
'se la lunghezza del testo è maggiore di 15 lo taglio
|
||||||
|
If sCompoName.Length > 15 Then
|
||||||
|
sCompoName = sCompoName.Substring(0, 15)
|
||||||
|
End If
|
||||||
|
GetLabel(index).Text = sCompoName
|
||||||
|
'Se ci sono sia testo che immagine imposto un margine di 10
|
||||||
|
CustomThickness.Right = 10
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
Else
|
||||||
|
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
|
||||||
|
If sCompoName.Length > 20 Then
|
||||||
|
sCompoName = sCompoName.Substring(0, 20)
|
||||||
|
End If
|
||||||
|
GetLabel(index).Text = sCompoName
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
'Se non c'è testo azzero la distanza tra testo e immagine
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
' Gestione bottone altri componenti
|
' Gestione bottone altri componenti
|
||||||
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
||||||
If m_bIsFirstPage Then
|
If m_bIsFirstPage Then
|
||||||
m_bIsFirstPage = False
|
m_bIsFirstPage = False
|
||||||
LoadPage()
|
LoadPage()
|
||||||
'Compo9.SetValue(Grid.ColumnProperty, 1)
|
|
||||||
'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
|
|
||||||
'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
|
|
||||||
'ImageCompo9.Visibility = Windows.Visibility.Visible
|
|
||||||
'LabelCompo9.Visibility = Windows.Visibility.Hidden
|
|
||||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<TextBlock Name="Entity1" Grid.Row="1" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity1" Grid.Row="1" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A1" Grid.Column="1" Grid.Row="1" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A1" Grid.Column="1" Grid.Row="1" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A1TxBx" Grid.Column="2" Grid.Row="1" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A1TxBx" Grid.Column="2" Grid.Row="1" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H1TxBx" Grid.Column="3" Grid.Row="1" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H1TxBx" Grid.Column="3" Grid.Row="1" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<TextBlock Name="Entity2" Grid.Row="2" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity2" Grid.Row="2" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A2" Grid.Column="1" Grid.Row="2" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A2" Grid.Column="1" Grid.Row="2" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A2TxBx" Grid.Column="2" Grid.Row="2" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A2TxBx" Grid.Column="2" Grid.Row="2" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H2TxBx" Grid.Column="3" Grid.Row="2" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H2TxBx" Grid.Column="3" Grid.Row="2" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
<TextBlock Name="Entity3" Grid.Row="3" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity3" Grid.Row="3" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A3" Grid.Column="1" Grid.Row="3" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A3" Grid.Column="1" Grid.Row="3" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A3TxBx" Grid.Column="2" Grid.Row="3" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A3TxBx" Grid.Column="2" Grid.Row="3" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H3TxBx" Grid.Column="3" Grid.Row="3" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H3TxBx" Grid.Column="3" Grid.Row="3" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<TextBlock Name="Entity4" Grid.Row="4" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity4" Grid.Row="4" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A4" Grid.Column="1" Grid.Row="4" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A4" Grid.Column="1" Grid.Row="4" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A4TxBx" Grid.Column="2" Grid.Row="4" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A4TxBx" Grid.Column="2" Grid.Row="4" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H4TxBx" Grid.Column="3" Grid.Row="4" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H4TxBx" Grid.Column="3" Grid.Row="4" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
<TextBlock Name="Entity5" Grid.Row="5" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity5" Grid.Row="5" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A5" Grid.Column="1" Grid.Row="5" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A5" Grid.Column="1" Grid.Row="5" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A5TxBx" Grid.Column="2" Grid.Row="5" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A5TxBx" Grid.Column="2" Grid.Row="5" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H5TxBx" Grid.Column="3" Grid.Row="5" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H5TxBx" Grid.Column="3" Grid.Row="5" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<TextBlock Name="Entity6" Grid.Row="6" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity6" Grid.Row="6" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A6" Grid.Column="1" Grid.Row="6" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A6" Grid.Column="1" Grid.Row="6" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A6TxBx" Grid.Column="2" Grid.Row="6" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A6TxBx" Grid.Column="2" Grid.Row="6" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H6TxBx" Grid.Column="3" Grid.Row="6" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H6TxBx" Grid.Column="3" Grid.Row="6" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
<TextBlock Name="Entity7" Grid.Row="7" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity7" Grid.Row="7" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A7" Grid.Column="1" Grid.Row="7" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A7" Grid.Column="1" Grid.Row="7" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A7TxBx" Grid.Column="2" Grid.Row="7" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A7TxBx" Grid.Column="2" Grid.Row="7" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H7TxBx" Grid.Column="3" Grid.Row="7" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H7TxBx" Grid.Column="3" Grid.Row="7" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
<TextBlock Name="Entity8" Grid.Row="8" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity8" Grid.Row="8" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A8" Grid.Column="1" Grid.Row="8" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A8" Grid.Column="1" Grid.Row="8" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A8TxBx" Grid.Column="2" Grid.Row="8" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A8TxBx" Grid.Column="2" Grid.Row="8" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H8TxBx" Grid.Column="3" Grid.Row="8" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H8TxBx" Grid.Column="3" Grid.Row="8" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
<TextBlock Name="Entity9" Grid.Row="9" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity9" Grid.Row="9" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A9" Grid.Column="1" Grid.Row="9" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A9" Grid.Column="1" Grid.Row="9" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A9TxBx" Grid.Column="2" Grid.Row="9" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A9TxBx" Grid.Column="2" Grid.Row="9" Width="60" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H9TxBx" Grid.Column="3" Grid.Row="9" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H9TxBx" Grid.Column="3" Grid.Row="9" Width="60"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
@@ -128,7 +128,7 @@
|
|||||||
<TextBlock Name="Entity10" Grid.Row="10" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
<TextBlock Name="Entity10" Grid.Row="10" Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
<CheckBox Name="A10" Grid.Column="1" Grid.Row="10" Height="30" Width="40" HorizontalAlignment="Right"
|
<CheckBox Name="A10" Grid.Column="1" Grid.Row="10" Height="30" Width="40" HorizontalAlignment="Right"
|
||||||
Margin="-20,0,0,0"/>
|
Margin="-20,0,0,0"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="A10TxBx" Grid.Column="2" Grid.Row="10" Width="60"
|
<EgtWPFLib:EgtTextBox Name="A10TxBx" Grid.Column="2" Grid.Row="10" Width="60" IsLength="False"
|
||||||
Margin="0,0,0,-2"
|
Margin="0,0,0,-2"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="H10TxBx" Grid.Column="3" Grid.Row="10" Width="60"
|
<EgtWPFLib:EgtTextBox Name="H10TxBx" Grid.Column="3" Grid.Row="10" Width="60"
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
<UniformGrid Rows="1" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" Width="90" >
|
<UniformGrid Rows="1" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" Width="90" >
|
||||||
<EgtWPFLib:EgtTextBox Name="Parameter2aTxBx"
|
<EgtWPFLib:EgtTextBox Name="Parameter2aTxBx"
|
||||||
Grid.Column="2" Grid.Row="12"
|
Grid.Column="2" Grid.Row="12"
|
||||||
Width="40" Height="30"
|
Width="40" Height="30" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="Parameter2bTxBx"
|
<EgtWPFLib:EgtTextBox Name="Parameter2bTxBx"
|
||||||
Grid.Column="3" Grid.Row="12"
|
Grid.Column="3" Grid.Row="12"
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
<EgtWPFLib:EgtTextBox Name="Parameter5TxBx"
|
<EgtWPFLib:EgtTextBox Name="Parameter5TxBx"
|
||||||
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4"
|
Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4"
|
||||||
Margin="0,0,0,-2"
|
Margin="0,0,0,-2"
|
||||||
Width="85" Height="30"
|
Width="85" Height="30" IsLength="False"
|
||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -171,27 +171,27 @@ Public Class SideAngleUC
|
|||||||
|
|
||||||
' Aggiorno valori
|
' Aggiorno valori
|
||||||
If m_Mode = ModeOpt.DRIP Then
|
If m_Mode = ModeOpt.DRIP Then
|
||||||
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
|
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
|
||||||
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
|
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
|
||||||
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
|
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
|
||||||
m_dDripShort = GetPrivateProfileDouble( S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
|
m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
|
||||||
Parameter1TxBx.Text = LenToString( m_dDripOffset, 3)
|
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
|
||||||
Parameter2TxBx.Text = LenToString( m_dDripOffset2, 3)
|
Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
|
||||||
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
|
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
|
||||||
Parameter4TxBx.Text = LenToString( m_dDripShort, 3)
|
Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
|
||||||
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
||||||
m_dDripOffset = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
|
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET, 20, m_MainWindow.GetIniFile())
|
||||||
m_nEngrNbr2 = GetPrivateProfileInt( S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
|
m_nEngrNbr2 = GetPrivateProfileInt(S_SIDES, K_ENGRAVENUMBER2, 1, m_MainWindow.GetIniFile())
|
||||||
m_dDripOffset2 = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
|
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEOFFSET2, 0, m_MainWindow.GetIniFile())
|
||||||
m_dDripDepth = GetPrivateProfileDouble( S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
|
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH, 10, m_MainWindow.GetIniFile())
|
||||||
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
|
m_dEngraveDepth2 = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0, m_MainWindow.GetIniFile())
|
||||||
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
|
m_dEngraveAngle = GetPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0, m_MainWindow.GetIniFile())
|
||||||
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
|
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
|
||||||
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
|
Parameter2aTxBx.Text = m_nEngrNbr2.ToString()
|
||||||
Parameter2bTxBx.Text = LenToString( m_dDripOffset2, 3)
|
Parameter2bTxBx.Text = LenToString(m_dDripOffset2, 3)
|
||||||
Parameter3TxBx.Text = LenToString( m_dDripDepth, 3)
|
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
|
||||||
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
|
Parameter4TxBx.Text = LenToString(m_dEngraveDepth2, 3)
|
||||||
Parameter5TxBx.Text = LenToString(m_dEngraveAngle, 3)
|
Parameter5TxBx.Text = DoubleToString(m_dEngraveAngle, 3)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
@@ -311,8 +311,8 @@ Public Class SideAngleUC
|
|||||||
' Attualmente il vaore m_nCount è inizializzato ad "1"..
|
' Attualmente il vaore m_nCount è inizializzato ad "1"..
|
||||||
' Bottoni Prev Next
|
' Bottoni Prev Next
|
||||||
If m_nCount <= MAX_LINES Then
|
If m_nCount <= MAX_LINES Then
|
||||||
PrevBtn.Visibility= Windows.Visibility.Hidden
|
PrevBtn.Visibility = Windows.Visibility.Hidden
|
||||||
NextBtn.Visibility= Windows.Visibility.Hidden
|
NextBtn.Visibility = Windows.Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
|
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
|
||||||
PrevBtn.Visibility = Windows.Visibility.Visible
|
PrevBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -495,15 +495,15 @@ Public Class SideAngleUC
|
|||||||
'-------------> Restituisce gli oggetto della grafica assegnato l'indice
|
'-------------> Restituisce gli oggetto della grafica assegnato l'indice
|
||||||
|
|
||||||
' quando esco salvo nel file l'ultima configurazione per le incisioni
|
' quando esco salvo nel file l'ultima configurazione per le incisioni
|
||||||
Private Sub SideAngleUC_Unloaded( sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||||
' Ricavo nome pezzo
|
' Ricavo nome pezzo
|
||||||
Dim PartId As Integer = EgtGetFirstInGroup( GDB_ID.ROOT)
|
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||||
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
|
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
|
||||||
If m_Mode = ModeOpt.SIDEANGLE Then
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
||||||
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
|
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
|
||||||
Else
|
Else
|
||||||
EgtEmptyGroup( EgtGetFirstNameInGroup( PartId, SIDE_ANGLE_LAYER))
|
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
|
||||||
End If
|
End If
|
||||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||||
' Nessuna azione necessaria
|
' Nessuna azione necessaria
|
||||||
@@ -516,7 +516,7 @@ Public Class SideAngleUC
|
|||||||
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
|
'WritePrivateProfileString( S_SIDES, K_DRIPSHORT, DoubleToString( m_dDripShort, 3), m_MainWindow.GetIniFile())
|
||||||
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
ElseIf m_Mode = ModeOpt.ENGRAVE Then
|
||||||
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET, LenToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString( S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_SIDES, K_ENGRAVENUMBER2, m_nEngrNbr2.ToString(), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_SIDES, K_ENGRAVEOFFSET2, LenToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
|
||||||
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3), m_MainWindow.GetIniFile())
|
||||||
@@ -579,6 +579,10 @@ Public Class SideAngleUC
|
|||||||
' Creo le geometrie dei gocciolatoi
|
' Creo le geometrie dei gocciolatoi
|
||||||
CreateDripGeom(PartId)
|
CreateDripGeom(PartId)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' se abilitato e dimensione solido da sotto: creo il solido
|
||||||
|
Utility.CreateSolid3D(m_MainWindow.GetIniFile())
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -600,7 +604,7 @@ Public Class SideAngleUC
|
|||||||
For nIndex As Integer = 1 To m_nCount
|
For nIndex As Integer = 1 To m_nCount
|
||||||
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
|
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
|
||||||
' Imposto check box (se sono stati definiti il numero corretto di CheckBox
|
' Imposto check box (se sono stati definiti il numero corretto di CheckBox
|
||||||
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
|
If nIndex < (m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
|
||||||
Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
|
Dim nChIndex As Integer = nIndex - (m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
|
||||||
' verifico se l'entità ha un gocciolatoio
|
' verifico se l'entità ha un gocciolatoio
|
||||||
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
|
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
|
||||||
@@ -973,15 +977,15 @@ Public Class SideAngleUC
|
|||||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||||
If m_nCurrPage = 1 Then Return
|
If m_nCurrPage = 1 Then Return
|
||||||
m_nCurrPage -= 1
|
m_nCurrPage -= 1
|
||||||
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
||||||
TxBlChBxView()
|
TxBlChBxView()
|
||||||
RefreshCheckAndValue()
|
RefreshCheckAndValue()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||||
If m_nCount <= ( m_nCurrPage - 1) * MAX_LINES Then Return
|
If m_nCount <= (m_nCurrPage - 1) * MAX_LINES Then Return
|
||||||
m_nCurrPage += 1
|
m_nCurrPage += 1
|
||||||
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
m_nShow = Math.Min(m_nCount - (m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
||||||
TxBlChBxView()
|
TxBlChBxView()
|
||||||
RefreshCheckAndValue()
|
RefreshCheckAndValue()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -993,7 +997,7 @@ Public Class SideAngleUC
|
|||||||
Dim bVal As Boolean = CurrCheckBox.IsChecked()
|
Dim bVal As Boolean = CurrCheckBox.IsChecked()
|
||||||
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
|
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
|
||||||
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
||||||
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
|
||||||
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
|
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
|
||||||
' aggiorno l'entità con i valori scritti nel campo di testo
|
' aggiorno l'entità con i valori scritti nel campo di testo
|
||||||
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
|
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sCurrSide)
|
||||||
@@ -1192,7 +1196,7 @@ Public Class SideAngleUC
|
|||||||
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
|
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
|
||||||
End If
|
End If
|
||||||
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
||||||
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
|
||||||
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
||||||
' Lo modifico nella geometria e nella lista inclinazioni
|
' Lo modifico nella geometria e nella lista inclinazioni
|
||||||
ModifySideAngle(sCurrSide, dSideAngle)
|
ModifySideAngle(sCurrSide, dSideAngle)
|
||||||
@@ -1262,7 +1266,7 @@ Public Class SideAngleUC
|
|||||||
HeelTxBx.Text = "0"
|
HeelTxBx.Text = "0"
|
||||||
End If
|
End If
|
||||||
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
||||||
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
Dim nCurrSide As Integer = (m_nCurrPage - 1) * MAX_LINES + SideIndex - (MAX_LINES - m_nShow)
|
||||||
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
||||||
' Lo modifico nella geometria e nella lista inclinazioni
|
' Lo modifico nella geometria e nella lista inclinazioni
|
||||||
ModifySideHeel(sCurrSide, dSideHeel)
|
ModifySideHeel(sCurrSide, dSideHeel)
|
||||||
@@ -1417,7 +1421,7 @@ Public Class SideAngleUC
|
|||||||
Private Sub Parameter5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter5TxBx.EgtClosed
|
Private Sub Parameter5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter5TxBx.EgtClosed
|
||||||
If m_Mode = ModeOpt.ENGRAVE Then
|
If m_Mode = ModeOpt.ENGRAVE Then
|
||||||
' Recupero il valore
|
' Recupero il valore
|
||||||
StringToLen(Parameter5TxBx.Text, m_dEngraveAngle)
|
StringToDouble(Parameter5TxBx.Text, m_dEngraveAngle)
|
||||||
' Creo le geometrie dei gocciolatoi
|
' Creo le geometrie dei gocciolatoi
|
||||||
RefreshSideAngleText()
|
RefreshSideAngleText()
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -64,7 +64,8 @@
|
|||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.8*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
<RowDefinition Height="2.5*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
|
<RowDefinition Height="1.7*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
@@ -124,6 +125,13 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
|
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
|
||||||
|
<Button Name="CompoBtn"
|
||||||
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
|
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ Public Class FrameCutPageUC
|
|||||||
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' Visualizzo il bottone per l'importazione dei compo frame
|
||||||
|
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
|
||||||
' Recupero dimensioni e kerf del grezzo
|
' Recupero dimensioni e kerf del grezzo
|
||||||
m_nRawId = EgtGetFirstRawPart()
|
m_nRawId = EgtGetFirstRawPart()
|
||||||
GetRawBox(m_RawBox)
|
GetRawBox(m_RawBox)
|
||||||
@@ -436,6 +438,16 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
|
||||||
|
m_MainWindow.TestOff()
|
||||||
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
||||||
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||||
If Not MyCreateFrame( nPartId) Then
|
If Not MyCreateFrame( nPartId) Then
|
||||||
EgtErase( nPartId)
|
EgtErase( nPartId)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="1"
|
<TextBlock Name="AngleCutExtraLenTxBl" Grid.Column="0" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2"
|
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2"
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="IntArcMaxSideAngTxBl" Grid.Column="0" Grid.Row="3"
|
<TextBlock Name="IntArcMaxSideAngTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="IntArcMaxSideAngTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="IntArcMaxSideAngTxBx" Grid.Column="1" Grid.Row="3" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<TextBlock Name="PreCutExitTxBl" Grid.Column="0" Grid.Row="4"
|
<TextBlock Name="PreCutExitTxBl" Grid.Column="0" Grid.Row="4"
|
||||||
@@ -184,22 +184,48 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<!--Parametri WaterJet: 1 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
||||||
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="1"
|
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
<Grid Grid.Column="3" Grid.Row="2">
|
<Grid Grid.Column="3" Grid.Row="2">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="145*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="23*"/>
|
||||||
|
<ColumnDefinition Width="169*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="WjIntCutsTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
<TextBlock Name="WjIntCutsTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,0,10" VerticalAlignment="Bottom" />
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||||
<CheckBox Name="WjIntCutsChBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
<CheckBox Name="WjIntCutsChBx" Grid.Column="2" Grid.Row="0" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||||
|
|
||||||
|
<TextBlock Name="HolesDiameterWJTxBl" Grid.Column="0" Grid.Row="1"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="HolesDiameterWJTxBx" Grid.Column="2" Grid.Row="1" Margin="10,0,10,0"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock Name="HolesOffsetWJTxBl" Grid.Column="0" Grid.Row="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="HolesOffsetWJTxBx" Grid.Column="2" Grid.Row="2" Margin="10,0,10,0"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock Name="MinRadiusWJTxBl" Grid.Column="0" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="2" Margin="10,0,10,0"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="MinRadiusWJTxBx" Grid.Column="2" Grid.Row="3" Margin="10,0,10,0"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
|
<TextBlock Name="OneHoleInCornerWJTxBl" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="10,0,10,0" />
|
||||||
|
<CheckBox Name="OneHoleInCornerWJChBx" Grid.Column="2" Grid.Row="4" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
|
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
||||||
|
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
@@ -712,7 +738,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
<TextBlock Name="CfrPercTxBl" Grid.Column="0" Grid.Row="1"
|
<TextBlock Name="CfrPercTxBl" Grid.Column="0" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="CfrPercTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CfrPercTxBx" Grid.Column="1" Grid.Row="1" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -801,19 +827,23 @@
|
|||||||
<Grid Grid.Column="0" Grid.Row="8">
|
<Grid Grid.Column="0" Grid.Row="8">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="2.5*"/>
|
<ColumnDefinition Width="2.5*"/>
|
||||||
<ColumnDefinition Width="5*"/>
|
<ColumnDefinition Width="2.5*"/>
|
||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="4.5*"/>
|
||||||
|
<ColumnDefinition Width="1.8*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button x:Name="SawProbingBtn"
|
<Button x:Name="SawProbingBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource SawProbeImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource SawProbeImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button x:Name="ExecLuaBtn" Grid.Column="1"
|
||||||
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource PlayImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<TextBlock Name="UseLaserOriginTxBl" Grid.Column="2"
|
||||||
<TextBlock Name="UseLaserOriginTxBl" Grid.Column="1"
|
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||||
<CheckBox Name="UseLaserOriginChBx" Style="{DynamicResource OmagCut_CheckBox_Single}" Grid.Column="2"
|
<CheckBox Name="UseLaserOriginChBx" Style="{DynamicResource OmagCut_CheckBox_Single}" Grid.Column="3"
|
||||||
HorizontalAlignment="Right" Margin="10,0,10,0"/>
|
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Public Class AlarmsPageUC
|
|||||||
|
|
||||||
Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
|
||||||
'Assegno liste a combobox
|
' Assegno liste a combobox
|
||||||
CurrSawCmBx.ItemsSource = m_SawList
|
CurrSawCmBx.ItemsSource = m_SawList
|
||||||
CurrDrillCmBx.ItemsSource = m_DrillList
|
CurrDrillCmBx.ItemsSource = m_DrillList
|
||||||
CurrMillCmBx.ItemsSource = m_MillList
|
CurrMillCmBx.ItemsSource = m_MillList
|
||||||
@@ -37,14 +37,24 @@ Public Class AlarmsPageUC
|
|||||||
CurrWJetCmBx.ItemsSource = m_WaterJetList
|
CurrWJetCmBx.ItemsSource = m_WaterJetList
|
||||||
AuxiliaryToolCmBx.ItemsSource = m_AuxToolTypeList
|
AuxiliaryToolCmBx.ItemsSource = m_AuxToolTypeList
|
||||||
|
|
||||||
|
' Variabile che accorcia il riferimento alla macchina corrente
|
||||||
|
m_CurrentMachine = m_MainWindow.m_CurrentMachine
|
||||||
|
|
||||||
' Assegno lista ad elenco materiali
|
' Assegno lista ad elenco materiali
|
||||||
MaterialsLstBx.ItemsSource = m_MainWindow.m_CurrentMachine.Materials
|
MaterialsLstBx.ItemsSource = m_CurrentMachine.Materials
|
||||||
|
|
||||||
' Se non è impostato il controllo numerico, nascondo il bottone di tastatura lama
|
' Se non è impostato il controllo numerico, nascondo il bottone di tastatura lama
|
||||||
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||||
SawProbingBtn.Visibility = Windows.Visibility.Hidden
|
SawProbingBtn.Visibility = Windows.Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Se esiste un file lua valido allora mostro il pulsante per l'esecuzione dello script
|
||||||
|
If Not String.IsNullOrEmpty(GetExecLuaFile()) And
|
||||||
|
ExecLuaBtn.Visibility = Visibility.Visible Then
|
||||||
|
Else
|
||||||
|
ExecLuaBtn.Visibility = Visibility.Hidden
|
||||||
|
End If
|
||||||
|
|
||||||
' Imposto i messaggi letti dal file dei messaggi
|
' Imposto i messaggi letti dal file dei messaggi
|
||||||
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
|
CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1)
|
||||||
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
|
AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2)
|
||||||
@@ -81,7 +91,13 @@ Public Class AlarmsPageUC
|
|||||||
TmDepthTxBl.Text = EgtMsg( 91063) ' Profondità
|
TmDepthTxBl.Text = EgtMsg( 91063) ' Profondità
|
||||||
TmWidthTxBl.Text = EgtMsg( 91064) ' Larghezza
|
TmWidthTxBl.Text = EgtMsg( 91064) ' Larghezza
|
||||||
WJsParamGpBx.Header = EgtMsg( 91058) ' Parametri waterjet
|
WJsParamGpBx.Header = EgtMsg( 91058) ' Parametri waterjet
|
||||||
WjIntCutsTxBl.Text = EgtMsg( 90930) ' Sempre sugli interni
|
WjIntCutsTxBl.Text = EgtMsg(90930) ' Sempre sugli interni
|
||||||
|
'-- INIZIO -- nuovi parametri per preforo lavello
|
||||||
|
HolesDiameterWJTxBl.Text = "Diameter"
|
||||||
|
HolesOffsetWJTxBl.Text = "Offset"
|
||||||
|
MinRadiusWJTxBl.Text = "Min Radius"
|
||||||
|
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
|
||||||
|
'-- FINE -- nuovi parametri per preforo lavello
|
||||||
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
||||||
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
||||||
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
||||||
@@ -116,8 +132,6 @@ Public Class AlarmsPageUC
|
|||||||
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
|
|
||||||
If m_bFirst Then
|
If m_bFirst Then
|
||||||
' Variabile che accorcia il riferimento alla macchina corrente
|
|
||||||
m_CurrentMachine = m_MainWindow.m_CurrentMachine
|
|
||||||
|
|
||||||
' in assenza dell'uscita H1 nascondo i parametri lama
|
' in assenza dell'uscita H1 nascondo i parametri lama
|
||||||
If EgtGetHeadId("H1") = GDB_ID.NULL Then
|
If EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||||
@@ -331,6 +345,16 @@ Public Class AlarmsPageUC
|
|||||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
WjIntCutsChBx.IsChecked =
|
WjIntCutsChBx.IsChecked =
|
||||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
|
' Lavorazione preforo lavello con WaterJet
|
||||||
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_HOLES_DIAMITERWJ, 0, m_MainWindow.GetMachIniFile())
|
||||||
|
HolesDiameterWJTxBx.Text = LenToString(dVal, 2)
|
||||||
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_HOLES_OFFSETWJ, 0, m_MainWindow.GetMachIniFile())
|
||||||
|
HolesOffsetWJTxBx.Text = LenToString(dVal, 2)
|
||||||
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MIN_RADIUSWJ, 0, m_MainWindow.GetMachIniFile())
|
||||||
|
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
||||||
|
OneHoleInCornerWJChBx.IsChecked =
|
||||||
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
|
|
||||||
' Leggo accorciamento angoli con fresa
|
' Leggo accorciamento angoli con fresa
|
||||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||||
ShortTxBx.Text = LenToString(dVal, 2)
|
ShortTxBx.Text = LenToString(dVal, 2)
|
||||||
@@ -343,7 +367,7 @@ Public Class AlarmsPageUC
|
|||||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_ENGRAVING_WIDTH, 0, m_MainWindow.GetMachIniFile())
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_ENGRAVING_WIDTH, 0, m_MainWindow.GetMachIniFile())
|
||||||
TmWidthTxBx.Text = LenToString(dVal, 2)
|
TmWidthTxBx.Text = LenToString(dVal, 2)
|
||||||
' Flag per movimento in home alla fine dei tagli diretti
|
' Flag per movimento in home alla fine dei tagli diretti
|
||||||
FinalHomeChBx.IsChecked = m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome
|
FinalHomeChBx.IsChecked = m_CurrentMachine.bDirectCutsFinalHome
|
||||||
' Leggo tagli ridotti per interferenza in nesting
|
' Leggo tagli ridotti per interferenza in nesting
|
||||||
CompleteCutsChBx.IsChecked =
|
CompleteCutsChBx.IsChecked =
|
||||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0)
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0)
|
||||||
@@ -365,7 +389,7 @@ Public Class AlarmsPageUC
|
|||||||
AdditionalTableTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 36) & " " & GetCurrentTable().ToString()
|
AdditionalTableTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 36) & " " & GetCurrentTable().ToString()
|
||||||
End If
|
End If
|
||||||
' Leggo altezza sovratavola
|
' Leggo altezza sovratavola
|
||||||
dVal = m_MainWindow.m_CurrentMachine.dAdditionalTable
|
dVal = m_CurrentMachine.dAdditionalTable
|
||||||
AdditionalTableTxBx.Text = LenToString(dVal, 2)
|
AdditionalTableTxBx.Text = LenToString(dVal, 2)
|
||||||
' Leggo soglia e tolleranza per contorno grezzo da foto
|
' Leggo soglia e tolleranza per contorno grezzo da foto
|
||||||
ThresholdTxBx.Text = m_MainWindow.m_Camera.Threshold.ToString()
|
ThresholdTxBx.Text = m_MainWindow.m_Camera.Threshold.ToString()
|
||||||
@@ -383,7 +407,7 @@ Public Class AlarmsPageUC
|
|||||||
If nWashing = -1 Then
|
If nWashing = -1 Then
|
||||||
WashingGpBx.Visibility = Visibility.Hidden
|
WashingGpBx.Visibility = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
WashingChBx.IsChecked = ( nWashing <> 0)
|
WashingChBx.IsChecked = (nWashing <> 0)
|
||||||
End If
|
End If
|
||||||
' Leggo parametri per variazione feed in tagli
|
' Leggo parametri per variazione feed in tagli
|
||||||
CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
|
CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3)
|
||||||
@@ -439,7 +463,7 @@ Public Class AlarmsPageUC
|
|||||||
CurrWaterJettingTxBx.Text = m_CurrentMachine.sCurrWaterJetting
|
CurrWaterJettingTxBx.Text = m_CurrentMachine.sCurrWaterJetting
|
||||||
CurrWaterJettingTxBl.Visibility = Windows.Visibility.Visible
|
CurrWaterJettingTxBl.Visibility = Windows.Visibility.Visible
|
||||||
CurrWaterJettingTxBx.Visibility = Windows.Visibility.Visible
|
CurrWaterJettingTxBx.Visibility = Windows.Visibility.Visible
|
||||||
If m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
If m_CurrentMachine.bFromDBWaterJet Then
|
||||||
CurrWaterJettingTxBx.SetValue(Grid.ColumnSpanProperty, 1)
|
CurrWaterJettingTxBx.SetValue(Grid.ColumnSpanProperty, 1)
|
||||||
CurrWaterJettingTxBx.SetValue(MarginProperty, New Thickness(CurrWaterJettingTxBx.Margin.Left,
|
CurrWaterJettingTxBx.SetValue(MarginProperty, New Thickness(CurrWaterJettingTxBx.Margin.Left,
|
||||||
CurrWaterJettingTxBx.Margin.Top,
|
CurrWaterJettingTxBx.Margin.Top,
|
||||||
@@ -920,6 +944,35 @@ Public Class AlarmsPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' -- INIZIO -- nuovi parametri per prefori WaterJet
|
||||||
|
Private Sub HolesDiameterWJTxBx_Click(sender As Object, e As EventArgs) Handles HolesDiameterWJTxBx.EgtClosed
|
||||||
|
Dim dVal As Double = 0
|
||||||
|
StringToLen(HolesDiameterWJTxBx.Text, dVal)
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_HOLES_DIAMITERWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub HolesOffsetWJTxBx_Click(sender As Object, e As EventArgs) Handles HolesOffsetWJTxBx.EgtClosed
|
||||||
|
Dim dVal As Double = 0
|
||||||
|
StringToLen(HolesOffsetWJTxBx.Text, dVal)
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_HOLES_OFFSETWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MinRadiusWJTxBx_Click(sender As Object, e As EventArgs) Handles MinRadiusWJTxBx.EgtClosed
|
||||||
|
Dim dVal As Double = 0
|
||||||
|
StringToLen(MinRadiusWJTxBx.Text, dVal)
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MIN_RADIUSWJ, DoubleToString(dVal, 2), m_MainWindow.GetMachIniFile())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OneHoleInCornerWJChBx_Click(sender As Object, e As EventArgs) Handles OneHoleInCornerWJChBx.Click
|
||||||
|
If OneHoleInCornerWJChBx.IsChecked() Then
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "1", m_MainWindow.GetMachIniFile())
|
||||||
|
Else
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' -- FINE -- nuovi parametri per prefori WaterJet
|
||||||
|
|
||||||
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
||||||
If TmEnableChBx.IsChecked() Then
|
If TmEnableChBx.IsChecked() Then
|
||||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
||||||
@@ -942,9 +995,9 @@ Public Class AlarmsPageUC
|
|||||||
|
|
||||||
Private Sub FinalHomeChBx_Click(sender As Object, e As RoutedEventArgs) Handles FinalHomeChBx.Click
|
Private Sub FinalHomeChBx_Click(sender As Object, e As RoutedEventArgs) Handles FinalHomeChBx.Click
|
||||||
If FinalHomeChBx.IsChecked() Then
|
If FinalHomeChBx.IsChecked() Then
|
||||||
m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome = True
|
m_CurrentMachine.bDirectCutsFinalHome = True
|
||||||
Else
|
Else
|
||||||
m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome = False
|
m_CurrentMachine.bDirectCutsFinalHome = False
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -986,7 +1039,7 @@ Public Class AlarmsPageUC
|
|||||||
Private Sub AdditionalTableTxBx_EgtClosed(sender As Object, e As EventArgs) Handles AdditionalTableTxBx.EgtClosed
|
Private Sub AdditionalTableTxBx_EgtClosed(sender As Object, e As EventArgs) Handles AdditionalTableTxBx.EgtClosed
|
||||||
Dim dVal As Double = 0
|
Dim dVal As Double = 0
|
||||||
StringToLen(AdditionalTableTxBx.Text, dVal)
|
StringToLen(AdditionalTableTxBx.Text, dVal)
|
||||||
m_MainWindow.m_CurrentMachine.dAdditionalTable = dVal
|
m_CurrentMachine.dAdditionalTable = dVal
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NewMatBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewMatBtn.Click
|
Private Sub NewMatBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewMatBtn.Click
|
||||||
@@ -1110,9 +1163,13 @@ Public Class AlarmsPageUC
|
|||||||
Case 3
|
Case 3
|
||||||
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
Case 4
|
||||||
|
' FANUC - Manual:7, Edit:1
|
||||||
|
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
|
||||||
End Select
|
End Select
|
||||||
' Recupero file LUA
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
||||||
' Recupero utensile da tastare
|
' Recupero utensile da tastare
|
||||||
Dim ToolForProbing As ToolPos = ChooseToolForProbing()
|
Dim ToolForProbing As ToolPos = ChooseToolForProbing()
|
||||||
If IsNothing(ToolForProbing) OrElse String.IsNullOrWhiteSpace(ToolForProbing.m_ToolName) Then Return
|
If IsNothing(ToolForProbing) OrElse String.IsNullOrWhiteSpace(ToolForProbing.m_ToolName) Then Return
|
||||||
@@ -1132,6 +1189,12 @@ Public Class AlarmsPageUC
|
|||||||
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
||||||
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
|
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
|
||||||
|
' Nuova varibile per gestione tastatura utensili Frankfurt (Polishing)
|
||||||
|
Dim nType As Integer
|
||||||
|
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||||
|
If m_CurrentMachine.bPolishingWheel AndAlso nType = MCH_TY.MILL_POLISHING Then
|
||||||
|
EgtLuaSetGlobStringVar("CMD.POLISHING", "1")
|
||||||
|
End If
|
||||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||||
EgtLuaCallFunction("CMD.CmdString")
|
EgtLuaCallFunction("CMD.CmdString")
|
||||||
' Leggo variabili
|
' Leggo variabili
|
||||||
@@ -1151,7 +1214,7 @@ Public Class AlarmsPageUC
|
|||||||
' Modifico stringa per inserire i newline
|
' Modifico stringa per inserire i newline
|
||||||
CmdString = CmdString.Replace("<br/>", Environment.NewLine)
|
CmdString = CmdString.Replace("<br/>", Environment.NewLine)
|
||||||
' Creo file...
|
' Creo file...
|
||||||
Dim FilePath As String = m_MainWindow.GetCncDir() & "\SawProbing" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
Dim FilePath As String = m_MainWindow.GetCncDir() & "\SawProbing" & m_CurrentMachine.sIsoFileExt
|
||||||
' ...e ci scrivo
|
' ...e ci scrivo
|
||||||
Dim Writer As New IO.StreamWriter(FilePath, False)
|
Dim Writer As New IO.StreamWriter(FilePath, False)
|
||||||
Writer.Write(CmdString)
|
Writer.Write(CmdString)
|
||||||
@@ -1175,6 +1238,11 @@ Public Class AlarmsPageUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
' Se fanuc passo in modalità AUTO e attivo
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
End If
|
||||||
' Aspetto e lo avvio
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
@@ -1224,6 +1292,10 @@ Public Class AlarmsPageUC
|
|||||||
Dim bRead As Boolean = False
|
Dim bRead As Boolean = False
|
||||||
Dim SawDiameterNameVar As String = String.Empty
|
Dim SawDiameterNameVar As String = String.Empty
|
||||||
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
||||||
|
' Se utensile non lama, allora la variabile in cui leggo il dato potrebbe essere differente
|
||||||
|
If Not ToolForProbing.m_IsSaw Then
|
||||||
|
GetPrivateProfileString(S_MACH_PROBING, K_TOOLLENGTH, SawDiameterNameVar, SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
||||||
|
End If
|
||||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
For I As Integer = 0 To 20
|
For I As Integer = 0 To 20
|
||||||
' Devo rileggere la variabile ad ogni ciclo
|
' Devo rileggere la variabile ad ogni ciclo
|
||||||
@@ -1232,7 +1304,10 @@ Public Class AlarmsPageUC
|
|||||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||||
bRead = True
|
bRead = True
|
||||||
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
||||||
|
' Se fanuc il dato è in mm (NON MICRON)
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType <> 4 Then
|
||||||
dVal = dVal / 1000
|
dVal = dVal / 1000
|
||||||
|
End If
|
||||||
MsgBoxStateInfo.LoadingPrBr_Value = 100
|
MsgBoxStateInfo.LoadingPrBr_Value = 100
|
||||||
' Tastatura conclusa con successo
|
' Tastatura conclusa con successo
|
||||||
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
||||||
@@ -1279,9 +1354,9 @@ Public Class AlarmsPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ChooseToolForProbing() As ToolPos
|
Private Function ChooseToolForProbing() As ToolPos
|
||||||
Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig
|
Select Case m_CurrentMachine.MountedToolConfig
|
||||||
Case CurrentMachine.MountedToolConfigs.SAW
|
Case CurrentMachine.MountedToolConfigs.SAW
|
||||||
Return New ToolPos(m_MainWindow.m_CurrentMachine.sCurrSaw, "T100", True)
|
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
|
||||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
||||||
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
||||||
If ChooseTool.ShowDialog Then
|
If ChooseTool.ShowDialog Then
|
||||||
@@ -1327,4 +1402,36 @@ Public Class AlarmsPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ExecLuaBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExecLuaBtn.Click
|
||||||
|
Dim sExecFile As String = GetExecLuaFile()
|
||||||
|
' Eseguo file LUA e recupero risultato
|
||||||
|
Dim nErr As Integer = 999
|
||||||
|
EgtLuaExecFile(sExecFile)
|
||||||
|
EgtLuaGetGlobIntVar("ELS.ERR", nErr)
|
||||||
|
' Reset lua
|
||||||
|
EgtLuaResetGlobVar("ELS")
|
||||||
|
' Verifico condizioni di errore
|
||||||
|
If nErr Then
|
||||||
|
' Errore...
|
||||||
|
EgtOutLog("Error executing file: " & sExecFile & ", ELS.ERR=" & nErr.ToString)
|
||||||
|
' Error executing script
|
||||||
|
Dim MsgBoxError As New EgtMsgBox(m_MainWindow, "", EgtMsg(90259), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Recupero il percorso del file lua da eseguire
|
||||||
|
Private Function GetExecLuaFile() As String
|
||||||
|
Dim sFile As String = String.Empty
|
||||||
|
If GetPrivateProfileString(S_EXECLUA, K_FILESCRIPT_LUA, "", sFile, m_MainWindow.GetMachIniFile()) <> 0 Then
|
||||||
|
' Sistemo nome file
|
||||||
|
sFile = sFile.Trim()
|
||||||
|
If Not sFile.EndsWith(".lua") Then sFile = sFile & ".lua"
|
||||||
|
' Creo path
|
||||||
|
Dim sPath As String = m_CurrentMachine.sMachDir() & "\Scripts\" & sFile
|
||||||
|
If File.Exists(sPath) Then Return sPath
|
||||||
|
End If
|
||||||
|
Return String.Empty
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ Public Class CurrentMachine
|
|||||||
Private m_bPolishingWheel As Boolean = False
|
Private m_bPolishingWheel As Boolean = False
|
||||||
Private m_bWaterJet As Boolean = False
|
Private m_bWaterJet As Boolean = False
|
||||||
|
|
||||||
|
' Flag che indica se gesire l'inversione del taglio nei tagli singoli
|
||||||
|
Private m_bEnableInvetrt As Boolean = True
|
||||||
|
|
||||||
' Abilitazione DB WaterJet
|
' Abilitazione DB WaterJet
|
||||||
Private m_bFromDBWaterJet As Boolean = False
|
Private m_bFromDBWaterJet As Boolean = False
|
||||||
|
|
||||||
@@ -752,6 +755,12 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property bEnableInvert As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bEnableInvetrt
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Property dAdditionalTable As Double
|
Friend Property dAdditionalTable As Double
|
||||||
Get
|
Get
|
||||||
Select Case GetCurrentTable()
|
Select Case GetCurrentTable()
|
||||||
@@ -1200,6 +1209,8 @@ Public Class CurrentMachine
|
|||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
||||||
' possibilità di definire attacco speciale per materiali ceramici
|
' possibilità di definire attacco speciale per materiali ceramici
|
||||||
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
||||||
|
' mantengo la direzione del taglio definita nel taglio diretto
|
||||||
|
m_bEnableInvetrt = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
|
||||||
|
|
||||||
' Leggo utensili correnti
|
' Leggo utensili correnti
|
||||||
' lama
|
' lama
|
||||||
@@ -1351,6 +1362,29 @@ Public Class CurrentMachine
|
|||||||
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
||||||
|
Public Sub InitFANUC(CN_Generic As CN_generico)
|
||||||
|
' Leggo ritardo tra reset e send per NUM
|
||||||
|
m_nResetSendDelay = GetPrivateProfileInt(S_NCFANUC, K_RESETSENDDELAY, 1000, sMachIniFile)
|
||||||
|
' Leggo ritardo tra reset e send per NUM
|
||||||
|
m_nThreadSleep = GetPrivateProfileInt(S_NCFANUC, K_THREADSLEEP, 150, sMachIniFile)
|
||||||
|
' Leggo i dati strettamente correlati alla comunicazione NC-PC
|
||||||
|
Dim CN As CN_generico = CN_Generic
|
||||||
|
' Leggo l'indirizzo in cui scrivere lo stato macchina
|
||||||
|
Dim dAddNcMode As String = CN.s_addr_set_nc_mode
|
||||||
|
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_set_nc_mode, CN.s_addr_set_nc_mode, sMachIniFile)
|
||||||
|
' Leggo primo indirizzo libero delle variabili di tipo intero
|
||||||
|
CN.n_Base_addr_int_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRINT, CN.n_Base_addr_int_vars, sMachIniFile)
|
||||||
|
' Leggo primo indirizzo libero delle variabili di tipo bit
|
||||||
|
CN.n_Base_addr_byte_for_bits_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRBIT, CN.n_Base_addr_byte_for_bits_vars, sMachIniFile)
|
||||||
|
' Leggo numero di variabili di tipo intero
|
||||||
|
CN.n_num_var_int_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARINT, CInt(CN.n_num_var_int_to_read), sMachIniFile))
|
||||||
|
' Leggo numero di varibili di tipo bit
|
||||||
|
CN.n_num_var_byte_for_bits_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARBIT, CInt(CN.n_num_var_byte_for_bits_to_read), sMachIniFile))
|
||||||
|
' Leggo variabile abilitata alla gestione di FeedHold
|
||||||
|
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_feedhold, CN.s_addr_feedhold, sMachIniFile)
|
||||||
|
End Sub
|
||||||
|
|
||||||
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
||||||
Dim TempCurrMat As Material = CurrMat
|
Dim TempCurrMat As Material = CurrMat
|
||||||
' Svuoto l'attuale lista di materiali
|
' Svuoto l'attuale lista di materiali
|
||||||
@@ -1414,7 +1448,10 @@ Public Class CurrentMachine
|
|||||||
If bFound Then Exit For
|
If bFound Then Exit For
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
Return dMaxThick
|
' il valore resituito è già nell'unità corrente del programma -> converto il dato in mm
|
||||||
|
Dim dValmm As Double = 0
|
||||||
|
StringToLen(DoubleToString(dMaxThick, 3), dValmm)
|
||||||
|
Return dValmm
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#Region "USERNOTE"
|
#Region "USERNOTE"
|
||||||
|
|||||||
@@ -34,16 +34,21 @@
|
|||||||
<ColumnDefinition Width="1.5*"/>
|
<ColumnDefinition Width="1.5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="AutoBtn" Grid.Column="0"
|
<ToggleButton Name="AutoBtn" Grid.Column="0"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
<Button Name="ManualBtn" Grid.Column="1"
|
Foreground="White"/>
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<ToggleButton Name="ManualBtn" Grid.Column="1"
|
||||||
<Button Name="MDIBtn" Grid.Column="2"
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Foreground="White"/>
|
||||||
<Button Name="SingleBtn" Grid.Column="3"
|
<ToggleButton Name="MDIBtn" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
<Button Name="HomeBtn" Grid.Column="4"
|
Foreground="White"/>
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
<ToggleButton Name="SingleBtn" Grid.Column="3"
|
||||||
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
|
Foreground="White"/>
|
||||||
|
<ToggleButton Name="HomeBtn" Grid.Column="4"
|
||||||
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
|
Foreground="White"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ Public Class MachineCNPageUC
|
|||||||
Private m_bFirst As Boolean = True
|
Private m_bFirst As Boolean = True
|
||||||
Private m_ButtonPower As New List(Of MachineButton)
|
Private m_ButtonPower As New List(Of MachineButton)
|
||||||
|
|
||||||
|
Private m_nCurrMode As Integer = 0
|
||||||
|
|
||||||
Private Sub TestingPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub TestingPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
StartBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 1)
|
StartBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 1)
|
||||||
StopBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 2)
|
StopBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 2)
|
||||||
@@ -51,6 +53,9 @@ Public Class MachineCNPageUC
|
|||||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden
|
PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' gestione visuliazzazione ToggleButton Auto/Sinlge/Mdi/Manula/Home
|
||||||
|
SetCncMode()
|
||||||
|
|
||||||
'------ NUOVI BOTTONI ----------
|
'------ NUOVI BOTTONI ----------
|
||||||
' Lettura configurazione bottoni (per impostare l'uso del Joystick) da Ini di macchina
|
' Lettura configurazione bottoni (per impostare l'uso del Joystick) da Ini di macchina
|
||||||
m_ButtonPower.Clear()
|
m_ButtonPower.Clear()
|
||||||
@@ -98,6 +103,53 @@ Public Class MachineCNPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SetCncMode()
|
||||||
|
Dim Mode As Integer = m_nCurrMode
|
||||||
|
Select Case Mode
|
||||||
|
Case 0
|
||||||
|
' Auoto
|
||||||
|
MDIConfirmBtn.IsEnabled = False
|
||||||
|
AutoBtn.IsChecked = True
|
||||||
|
SingleBtn.IsChecked = False
|
||||||
|
MDIBtn.IsChecked = False
|
||||||
|
ManualBtn.IsChecked = False
|
||||||
|
HomeBtn.IsChecked = False
|
||||||
|
Case 1
|
||||||
|
' Single
|
||||||
|
MDIConfirmBtn.IsEnabled = False
|
||||||
|
AutoBtn.IsChecked = False
|
||||||
|
SingleBtn.IsChecked = True
|
||||||
|
MDIBtn.IsChecked = False
|
||||||
|
ManualBtn.IsChecked = False
|
||||||
|
HomeBtn.IsChecked = False
|
||||||
|
Case 2
|
||||||
|
' Mdi
|
||||||
|
MDIConfirmBtn.IsEnabled = True
|
||||||
|
AutoBtn.IsChecked = False
|
||||||
|
SingleBtn.IsChecked = False
|
||||||
|
MDIBtn.IsChecked = True
|
||||||
|
ManualBtn.IsChecked = False
|
||||||
|
HomeBtn.IsChecked = False
|
||||||
|
Case 7
|
||||||
|
' Manual
|
||||||
|
MDIConfirmBtn.IsEnabled = False
|
||||||
|
AutoBtn.IsChecked = False
|
||||||
|
SingleBtn.IsChecked = False
|
||||||
|
MDIBtn.IsChecked = False
|
||||||
|
ManualBtn.IsChecked = True
|
||||||
|
HomeBtn.IsChecked = False
|
||||||
|
Case 8
|
||||||
|
' Home
|
||||||
|
MDIConfirmBtn.IsEnabled = False
|
||||||
|
AutoBtn.IsChecked = False
|
||||||
|
SingleBtn.IsChecked = False
|
||||||
|
MDIBtn.IsChecked = False
|
||||||
|
ManualBtn.IsChecked = False
|
||||||
|
HomeBtn.IsChecked = True
|
||||||
|
End Select
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub StartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StartBtn.Click
|
Private Sub StartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StartBtn.Click
|
||||||
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||||
Dim sDBVarPath As String = ""
|
Dim sDBVarPath As String = ""
|
||||||
@@ -278,4 +330,9 @@ Public Class MachineCNPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub CncModeChange(nMode As Integer)
|
||||||
|
m_nCurrMode = nMode
|
||||||
|
SetCncMode()
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -248,16 +248,16 @@ Public Class MachineStatusUC
|
|||||||
dL3 = ptTip.z
|
dL3 = ptTip.z
|
||||||
End If
|
End If
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
Axis1TxBx.Text = LenToString(dL1, -3)
|
Axis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
Axis2TxBx.Text = LenToString(dL2, -3)
|
Axis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
Axis3TxBx.Text = LenToString(dL3, -3)
|
Axis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayPositionDelta()
|
Sub DisplayPositionDelta()
|
||||||
@@ -265,22 +265,22 @@ Public Class MachineStatusUC
|
|||||||
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
DeltaAxis1TxBx.Text = LenToString(dL1, -3)
|
DeltaAxis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
DeltaAxis2TxBx.Text = LenToString(dL2, -3)
|
DeltaAxis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
DeltaAxis3TxBx.Text = LenToString(dL3, -3)
|
DeltaAxis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayFeed()
|
Sub DisplayFeed()
|
||||||
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||||
'Feed = DoubleToString(dRealFeed, 0)
|
'Feed = DoubleToString(dRealFeed, 0)
|
||||||
FeedTxBx.Text = LenToString(dRealFeed, 0)
|
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
|
||||||
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
||||||
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
||||||
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
|
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
|
||||||
@@ -304,6 +304,8 @@ Public Class MachineStatusUC
|
|||||||
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||||
dSpindlePower = m_CN.d_data(0)
|
dSpindlePower = m_CN.d_data(0)
|
||||||
dSpindleOvr = m_CN.d_data(1)
|
dSpindleOvr = m_CN.d_data(1)
|
||||||
|
ElseIf m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
dSpindlePower = m_CN.d_spindle_power / 1000
|
||||||
Else
|
Else
|
||||||
dSpindlePower = m_CN.d_spindle_power
|
dSpindlePower = m_CN.d_spindle_power
|
||||||
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
||||||
|
|||||||
@@ -246,7 +246,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="SideAngleTxBl" Grid.Column="2" Grid.Row="3" Grid.RowSpan="3"
|
<TextBlock Name="SideAngleTxBl" Grid.Column="2" Grid.Row="3" Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="3" Grid.Row="3" Grid.RowSpan="3" Margin="0,0,15,0"
|
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="3" Grid.Row="3" Grid.RowSpan="3" Margin="0,0,15,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<TextBlock Name="StepTypeTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
|
<TextBlock Name="StepTypeTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
|
||||||
@@ -576,7 +576,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="ForwardAngleTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
|
<TextBlock Name="ForwardAngleTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="ForwardAngleTxBx" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3"
|
<EgtWPFLib:EgtTextBox Name="ForwardAngleTxBx" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
||||||
|
|
||||||
<Border Name="LiHoleBrd" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="6"
|
<Border Name="LiHoleBrd" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="6"
|
||||||
@@ -605,12 +605,12 @@
|
|||||||
|
|
||||||
<TextBlock Name="LpTurnsTxBl" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2"
|
<TextBlock Name="LpTurnsTxBl" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="LpTurnsTxBx" Grid.Column="1" Grid.Row="1"
|
<EgtWPFLib:EgtTextBox Name="LpTurnsTxBx" Grid.Column="1" Grid.Row="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
||||||
|
|
||||||
<TextBlock Name="HpTurnsTxBl" Grid.Column="2" Grid.Row="1"
|
<TextBlock Name="HpTurnsTxBl" Grid.Column="2" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="HpTurnsTxBx" Grid.Column="3" Grid.Row="1"
|
<EgtWPFLib:EgtTextBox Name="HpTurnsTxBx" Grid.Column="3" Grid.Row="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -725,7 +725,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="SpeedTxBl" Grid.Column="0"
|
<TextBlock Name="SpeedTxBl" Grid.Column="0"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1"
|
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_MachToolCalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_MachToolCalculatorTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -899,11 +899,11 @@ Public Class MachiningDbPageUC
|
|||||||
For Each Material As MachiningMaterial In m_MaterialsList
|
For Each Material As MachiningMaterial In m_MaterialsList
|
||||||
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
If Material.bIsActive Then
|
If Material.bIsActive Then
|
||||||
sMaterialString += Material.nId.ToString & "." & Material.nSubId.ToString & "," & DoubleToString(Material.dMinThickness, 0) & "," & DoubleToString(Material.dMaxThickness, 0) & ";"
|
sMaterialString += Material.nId.ToString & "." & Material.nSubId.ToString & "," & DoubleToString(Material.dMinThickness, 3) & "," & DoubleToString(Material.dMaxThickness, 3) & ";"
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Material.bIsActive Then
|
If Material.bIsActive Then
|
||||||
sMaterialString += Material.nId.ToString & "," & DoubleToString(Material.dMinThickness, 0) & "," & DoubleToString(Material.dMaxThickness, 0) & ";"
|
sMaterialString += Material.nId.ToString & "," & DoubleToString(Material.dMinThickness, 3) & "," & DoubleToString(Material.dMaxThickness, 3) & ";"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
|
|||||||
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
||||||
StepTxBl.Text = EgtMsg(90787) ' Passo
|
StepTxBl.Text = EgtMsg(90787) ' Passo
|
||||||
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
||||||
RadiusTxBl.Text = "Raggio"
|
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
|
||||||
DistanceTxBl.Text = "Distanza"
|
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
|
||||||
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
||||||
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
||||||
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- Definizione del ToolHolderUc -->
|
<!-- Definizione del ToolHolderUc -->
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Source="/Resources/ToolChangerPos.png"/>
|
<Image Source="/Resources/ToolChangerPos.png"/>
|
||||||
<ToggleButton Name="Tool" Width="50" Height="50" Margin="22,40,26,8" Background="#7FB4B4B4">
|
<ToggleButton Name="Tool" Width="50" Height="50" Margin="62,10,16,10" Background="#7FB4B4B4">
|
||||||
<ToggleButton.Template>
|
<ToggleButton.Template>
|
||||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
</ToggleButton.Template>
|
</ToggleButton.Template>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<TextBlock Name="PositionNameTxBl" Height="22" Width="68" FontSize="16" Margin="12,16,41,61"/>
|
<TextBlock Name="PositionNameTxBl" Height="22" Width="50" FontSize="16" Margin="20,40,70,53"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -281,12 +281,12 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="SpeedTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
<TextBlock Name="SpeedTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1"
|
<EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
<TextBlock Name="MaxSpeedTxBl" Grid.Column="2"
|
<TextBlock Name="MaxSpeedTxBl" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="MaxSpeedTxBx" Grid.Column="3"
|
<EgtWPFLib:EgtTextBox Name="MaxSpeedTxBx" Grid.Column="3" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -384,7 +384,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="MaxAbsorptionTxBl" Grid.Column="0"
|
<TextBlock Name="MaxAbsorptionTxBl" Grid.Column="0"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="1" ScrollViewer.VerticalScrollBarVisibility="Disabled" TextWrapping="Wrap"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="1" ScrollViewer.VerticalScrollBarVisibility="Disabled" TextWrapping="Wrap"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="MaxAbsorptionTxBx" Grid.Column="1"
|
<EgtWPFLib:EgtTextBox Name="MaxAbsorptionTxBx" Grid.Column="1" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_LeftCalculatorTextBoxInBorder}" />
|
Style="{DynamicResource OmagCut_LeftCalculatorTextBoxInBorder}" />
|
||||||
|
|
||||||
<TextBlock Name="MinFeedTxBl" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
<TextBlock Name="MinFeedTxBl" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||||
|
|||||||
@@ -162,6 +162,7 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Text="{Binding Thickness_Msg}" Grid.Column="0" HorizontalAlignment="Center"
|
<TextBlock Text="{Binding Thickness_Msg}" Grid.Column="0" HorizontalAlignment="Center"
|
||||||
@@ -185,12 +186,19 @@
|
|||||||
<TextBlock Text="{Binding QExtra_Msg}" Grid.Column="6" HorizontalAlignment="Center"
|
<TextBlock Text="{Binding QExtra_Msg}" Grid.Column="6" HorizontalAlignment="Center"
|
||||||
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"
|
||||||
FontSize="{DynamicResource FontSize_GroupBoxHeader}"/>
|
FontSize="{DynamicResource FontSize_GroupBoxHeader}"/>
|
||||||
|
<TextBlock Text="{Binding AngComp_Msg}" Grid.Column="7" HorizontalAlignment="Center"
|
||||||
|
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"
|
||||||
|
FontSize="{DynamicResource FontSize_GroupBoxHeader}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox.Header>
|
</GroupBox.Header>
|
||||||
|
|
||||||
<!--Definizione della Grid dei parametri delle lavorazioni-->
|
<!--Definizione della Grid dei parametri delle lavorazioni-->
|
||||||
<Grid Grid.Column="2">
|
<Grid Grid.Column="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="308*"/>
|
||||||
|
<ColumnDefinition Width="73*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="7*"/>
|
<RowDefinition Height="7*"/>
|
||||||
<RowDefinition Height="1*"/>
|
<RowDefinition Height="1*"/>
|
||||||
@@ -201,7 +209,7 @@
|
|||||||
ItemsSource="{Binding Path=SelectedItem.ParamList , ElementName=SubMaterialsLstBx}"
|
ItemsSource="{Binding Path=SelectedItem.ParamList , ElementName=SubMaterialsLstBx}"
|
||||||
SelectedItem="{Binding Path=SelectedItem.SelWjParam , ElementName=SubMaterialsLstBx}"
|
SelectedItem="{Binding Path=SelectedItem.SelWjParam , ElementName=SubMaterialsLstBx}"
|
||||||
Margin="0,0,0,0"
|
Margin="0,0,0,0"
|
||||||
Grid.RowSpan="2">
|
Grid.RowSpan="2" Grid.ColumnSpan="2">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Width="700">
|
<Grid Width="700">
|
||||||
@@ -213,6 +221,7 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<EgtWPFLib:EgtTextBox Text="{Binding Thickness}" Grid.Column="0"
|
<EgtWPFLib:EgtTextBox Text="{Binding Thickness}" Grid.Column="0"
|
||||||
@@ -229,13 +238,14 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorParamWjTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorParamWjTextBox}" />
|
||||||
<EgtWPFLib:EgtTextBox Text="{Binding QExtra}" Grid.Column="6"
|
<EgtWPFLib:EgtTextBox Text="{Binding QExtra}" Grid.Column="6"
|
||||||
Style="{DynamicResource OmagCut_CalculatorParamWjTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorParamWjTextBox}" />
|
||||||
|
<EgtWPFLib:EgtTextBox Text="{Binding dAngComp}" Grid.Column="7" IsLength="False"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorParamWjTextBox}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<UniformGrid Grid.Row="2" Columns="9" Grid.ColumnSpan="3">
|
<UniformGrid Grid.Row="2" Columns="9" Grid.ColumnSpan="2">
|
||||||
<Button Name="NewParamBtn" Grid.Column="0"
|
<Button Name="NewParamBtn" Grid.Column="0"
|
||||||
Command="{Binding NewWjParamCommand}"
|
Command="{Binding NewWjParamCommand}"
|
||||||
Content="{Binding New_Msg}"
|
Content="{Binding New_Msg}"
|
||||||
|
|||||||
@@ -14,12 +14,20 @@ Public Class WaterJetPageUC
|
|||||||
|
|
||||||
Private Sub WaterJetPage_Initialized(sender As Object, e As EventArgs)
|
Private Sub WaterJetPage_Initialized(sender As Object, e As EventArgs)
|
||||||
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
|
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
|
||||||
|
'----------------------------------------------------------------------------------------
|
||||||
|
' TEMPORANEO - se dati in INCH e richiesta di frazioni eseguo la conversione in frazione!
|
||||||
|
ConvertParamListValueToFracrion()
|
||||||
|
'----------------------------------------------------------------------------------------
|
||||||
Me.DataContext = m_refWaterjetDbWindowVM
|
Me.DataContext = m_refWaterjetDbWindowVM
|
||||||
EgtWPFLib.Utility.MainWindow = m_MainWindow
|
EgtWPFLib.Utility.MainWindow = m_MainWindow
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub WaterJetPage_Reinitialize()
|
Public Sub WaterJetPage_Reinitialize()
|
||||||
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
|
m_refWaterjetDbWindowVM = New WaterjetDbWindowVM_OmagCUT(m_MainWindow.m_CurrentMachine.sMachDir)
|
||||||
|
'----------------------------------------------------------------------------------------
|
||||||
|
' TEMPORANEO - se dati in INCH e richiesta di frazioni eseguo la conversione in frazione!
|
||||||
|
ConvertParamListValueToFracrion()
|
||||||
|
'----------------------------------------------------------------------------------------
|
||||||
Me.DataContext = m_refWaterjetDbWindowVM
|
Me.DataContext = m_refWaterjetDbWindowVM
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -51,5 +59,48 @@ Public Class WaterJetPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ConvertParamListValueToFracrion()
|
||||||
|
' TEMPORANEO - se dati in INCH e richiesta di frazioni eseguo la conversione in frazione!
|
||||||
|
Dim Index1 As Integer = 0
|
||||||
|
For Index1 = 0 To m_refWaterjetDbWindowVM.MaterialList.Count - 1
|
||||||
|
Dim Index2 As Integer = 0
|
||||||
|
For Index2 = 0 To m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList.Count - 1
|
||||||
|
Dim Index3 As Integer = 0
|
||||||
|
For Index3 = 0 To m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList.Count - 1
|
||||||
|
Dim dThickness As Double
|
||||||
|
Dim dQ1 As Double
|
||||||
|
Dim dQ2 As Double
|
||||||
|
Dim dQ3 As Double
|
||||||
|
Dim dQ4 As Double
|
||||||
|
Dim dQ5 As Double
|
||||||
|
Dim dQExtra As Double
|
||||||
|
Dim dAngComp As Double
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Thickness, dThickness)
|
||||||
|
Dim sVal As String = LenToString(dThickness, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetThickness(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Q1, dQ1)
|
||||||
|
sVal = LenToString(dQ1, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQ1(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Q2, dQ2)
|
||||||
|
sVal = LenToString(dQ2, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQ2(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Q3, dQ3)
|
||||||
|
sVal = LenToString(dQ3, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQ3(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Q4, dQ4)
|
||||||
|
sVal = LenToString(dQ4, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQ4(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).Q5, dQ5)
|
||||||
|
sVal = LenToString(dQ5, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQ5(sVal)
|
||||||
|
StringToLen(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).QExtra, dQExtra)
|
||||||
|
sVal = LenToString(dQExtra, 3)
|
||||||
|
m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).SetQExtra(sVal)
|
||||||
|
StringToDouble(m_refWaterjetDbWindowVM.MaterialList(Index1).SubMaterialList(Index2).ParamList(Index3).dAngComp, dAngComp)
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -445,6 +445,12 @@ Public Class WaterjetDbWindowVM
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Public ReadOnly Property AngComp_Msg As String
|
||||||
|
Get
|
||||||
|
Return "Ang"
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property New_Msg As String
|
Public ReadOnly Property New_Msg As String
|
||||||
Get
|
Get
|
||||||
Return "Nuovo"
|
Return "Nuovo"
|
||||||
@@ -516,7 +522,14 @@ Public Class WaterjetDbWindowVM
|
|||||||
StringToDouble(sParams(4), dQ4)
|
StringToDouble(sParams(4), dQ4)
|
||||||
StringToDouble(sParams(5), dQ5)
|
StringToDouble(sParams(5), dQ5)
|
||||||
StringToDouble(sParams(6), dQExtra)
|
StringToDouble(sParams(6), dQExtra)
|
||||||
QParamList.Add(New WjParam(QInd, dThickness, dQ1, dQ2, dQ3, dQ4, dQ5, dQExtra, m_refWaterPageV))
|
Dim LocalWjParam As New WjParam(QInd, dThickness, dQ1, dQ2, dQ3, dQ4, dQ5, dQExtra, m_refWaterPageV)
|
||||||
|
QParamList.Add(LocalWjParam)
|
||||||
|
' leggo il nuovo parametro di correzione conicità (di default il parametro è 0)
|
||||||
|
If sParams.Length() >= 8 Then
|
||||||
|
Dim dAngCompo As Double
|
||||||
|
StringToDouble(sParams(7), dAngCompo)
|
||||||
|
LocalWjParam.dAngComp = dAngCompo
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
QInd += 1
|
QInd += 1
|
||||||
End While
|
End While
|
||||||
@@ -868,6 +881,17 @@ Public Class WjParam
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
' angolo di compensazione conicità getto: 01/02/2023 ver 2.5b1
|
||||||
|
Private m_dAngComp As Double = 0
|
||||||
|
Public Property dAngComp As Double
|
||||||
|
Get
|
||||||
|
Return m_dAngComp
|
||||||
|
End Get
|
||||||
|
Set(value As Double)
|
||||||
|
m_dAngComp = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property ParamLstBx_Width As Double
|
Public ReadOnly Property ParamLstBx_Width As Double
|
||||||
Get
|
Get
|
||||||
Return m_refWaterPageV.ParamsGpBx.ActualWidth - 20
|
Return m_refWaterPageV.ParamsGpBx.ActualWidth - 20
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ Class MainWindow
|
|||||||
Friend m_MachinePageUC As MachinePageUC
|
Friend m_MachinePageUC As MachinePageUC
|
||||||
Friend m_OptionsPageUC As OptionsPageUC
|
Friend m_OptionsPageUC As OptionsPageUC
|
||||||
|
|
||||||
|
Friend m_IsClosingApplication As Integer = 0
|
||||||
|
|
||||||
' Dichiarazione variabili direttori
|
' Dichiarazione variabili direttori
|
||||||
Private m_sExeRoot As String = String.Empty
|
Private m_sExeRoot As String = String.Empty
|
||||||
Private m_sDataRoot As String = String.Empty
|
Private m_sDataRoot As String = String.Empty
|
||||||
@@ -303,7 +305,7 @@ Class MainWindow
|
|||||||
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
|
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
|
||||||
' Impostazione path MachIni file
|
' Impostazione path MachIni file
|
||||||
m_sMachIniFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & m_sCurrMachine & ".ini"
|
m_sMachIniFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & m_sCurrMachine & ".ini"
|
||||||
' Impostazione path KitIni file
|
' Impostazione path Kit file
|
||||||
m_sKitsFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & MACHININGS_DIR & "\" & KITS_FILE
|
m_sKitsFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & MACHININGS_DIR & "\" & KITS_FILE
|
||||||
' Imposto tipo di chiave
|
' Imposto tipo di chiave
|
||||||
#If TRIAL Then
|
#If TRIAL Then
|
||||||
@@ -321,11 +323,13 @@ Class MainWindow
|
|||||||
Dim sNestKey As String = ""
|
Dim sNestKey As String = ""
|
||||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
|
||||||
EgtSetNestKey(sNestKey)
|
EgtSetNestKey(sNestKey)
|
||||||
|
Dim bNetHwKey As Boolean = ( GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||||
|
EgtSetNetHwKey( bNetHwKey)
|
||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2409, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2409, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
@@ -692,6 +696,8 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||||
m_ActivePage = Pages.WorkInProgress
|
m_ActivePage = Pages.WorkInProgress
|
||||||
|
Case Else
|
||||||
|
WorkInProgressBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -750,6 +756,8 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||||
m_ActivePage = Pages.DirectCut
|
m_ActivePage = Pages.DirectCut
|
||||||
|
Case Else
|
||||||
|
WorkInProgressBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -805,6 +813,8 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_CadCutPageUC)
|
||||||
m_ActivePage = Pages.CadCut
|
m_ActivePage = Pages.CadCut
|
||||||
|
Case Else
|
||||||
|
CadCutBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -861,6 +871,8 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
MainWindowGrid.Children.Add(m_CurrentProjectPageUC)
|
||||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||||
m_ActivePage = Pages.FrameCut
|
m_ActivePage = Pages.FrameCut
|
||||||
|
Case Else
|
||||||
|
If FrameCutBtn.IsEnabled Then FrameCutBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -912,6 +924,8 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
MainWindowGrid.Children.Remove(m_OptionsPageUC)
|
||||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||||
m_ActivePage = Pages.Machine
|
m_ActivePage = Pages.Machine
|
||||||
|
Case Else
|
||||||
|
MachineBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -968,7 +982,7 @@ Class MainWindow
|
|||||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||||
m_ActivePage = Pages.Options
|
m_ActivePage = Pages.Options
|
||||||
Case Pages.Options
|
Case Pages.Options
|
||||||
OptionsBtn.IsChecked = True
|
OptionsBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1073,6 +1087,19 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.SaveNamedProject()
|
m_CurrentProjectPageUC.SaveNamedProject()
|
||||||
m_CurrentProjectPageUC.SaveProject()
|
m_CurrentProjectPageUC.SaveProject()
|
||||||
End If
|
End If
|
||||||
|
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
|
||||||
|
EgtOutLog("Iniziato processo di chiusura programma")
|
||||||
|
m_IsClosingApplication = 1
|
||||||
|
Dim nCount As Integer = 0
|
||||||
|
While m_IsClosingApplication <> 2
|
||||||
|
If nCount > 5 Then
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' verifico che il processo DripFeed sia terminato
|
||||||
|
EgtOutLog("Stato chiusura programma: " & m_IsClosingApplication.ToString)
|
||||||
|
Thread.Sleep(100)
|
||||||
|
nCount += 1
|
||||||
|
End While
|
||||||
' Uscita
|
' Uscita
|
||||||
MainWindowExit()
|
MainWindowExit()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1114,19 +1141,21 @@ Class MainWindow
|
|||||||
' Se non sono in tagli diretti tutto ok
|
' Se non sono in tagli diretti tutto ok
|
||||||
If m_ActivePage <> Pages.DirectCut Then Return True
|
If m_ActivePage <> Pages.DirectCut Then Return True
|
||||||
' Concludo le attività in corso
|
' Concludo le attività in corso
|
||||||
Select Case m_DirectCutPageUC.m_ActiveDirectCutPage
|
Select Case m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage
|
||||||
Case DirectCutPageUC.DirectCutPages.SingleCut
|
Case ControlsDirectCutUC.DirectCutPages.SingleCut
|
||||||
m_DirectCutPageUC.m_SingleCut.SingleCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_SingleCut.SingleCut_Unloaded(sender, e)
|
||||||
Case DirectCutPageUC.DirectCutPages.MultipleCut
|
Case ControlsDirectCutUC.DirectCutPages.MultipleCut
|
||||||
m_DirectCutPageUC.m_MultipleCut.MultipleCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_MultipleCut.MultipleCut_Unloaded(sender, e)
|
||||||
Case DirectCutPageUC.DirectCutPages.GridCut
|
Case ControlsDirectCutUC.DirectCutPages.GridCut
|
||||||
m_DirectCutPageUC.m_GridCut.GridCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
|
||||||
Case DirectCutPageUC.DirectCutPages.CopyTemplate
|
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
|
||||||
m_DirectCutPageUC.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
|
||||||
Case DirectCutPageUC.DirectCutPages.FlatteningCut
|
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
|
||||||
m_DirectCutPageUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
|
||||||
Case DirectCutPageUC.DirectCutPages.SawTest
|
Case ControlsDirectCutUC.DirectCutPages.Polishing
|
||||||
m_DirectCutPageUC.m_SawTest.SawTest_Unloaded(sender, e)
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
|
||||||
|
Case ControlsDirectCutUC.DirectCutPages.SawTest
|
||||||
|
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
|
||||||
End Select
|
End Select
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ Imports System.Windows
|
|||||||
<Assembly: AssemblyTitle("OmagCUTR32.exe")>
|
<Assembly: AssemblyTitle("OmagCUTR32.exe")>
|
||||||
<Assembly: AssemblyDescription("OmagCUT 32 bit")>
|
<Assembly: AssemblyDescription("OmagCUT 32 bit")>
|
||||||
#End If
|
#End If
|
||||||
<Assembly: AssemblyCompany("EgalTech s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("OmagCUT")>
|
<Assembly: AssemblyProduct("OmagCUT")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2015-2022 by EgalTech s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2015-2023 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.9.4")>
|
<Assembly: AssemblyVersion("2.5.5.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.4.9.4")>
|
<Assembly: AssemblyFileVersion("2.5.5.1")>
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Text
|
||||||
|
|
||||||
Public Class CNCommunication
|
Public Class CNCommunication
|
||||||
|
|
||||||
@@ -31,6 +33,7 @@ Public Class CNCommunication
|
|||||||
Private m_bNewDeltaData As Boolean = True
|
Private m_bNewDeltaData As Boolean = True
|
||||||
Private m_bNewVarData As Boolean = False
|
Private m_bNewVarData As Boolean = False
|
||||||
Private m_bTimerBusy As Boolean = False
|
Private m_bTimerBusy As Boolean = False
|
||||||
|
Private m_bTimerAxesBusy As Boolean = False
|
||||||
|
|
||||||
Private m_IsNewConsole As Boolean = False
|
Private m_IsNewConsole As Boolean = False
|
||||||
|
|
||||||
@@ -39,6 +42,7 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
' Timer
|
' Timer
|
||||||
Private m_RefreshTimer As New DispatcherTimer
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
Private m_RefreshAxesFanuc As New DispatcherTimer
|
||||||
|
|
||||||
' Nomi e indici degli assi macchina
|
' Nomi e indici degli assi macchina
|
||||||
Private m_bAxesOk As Boolean = False
|
Private m_bAxesOk As Boolean = False
|
||||||
@@ -101,6 +105,12 @@ Public Class CNCommunication
|
|||||||
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(100)
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(100)
|
||||||
m_RefreshTimer.Start()
|
m_RefreshTimer.Start()
|
||||||
End If
|
End If
|
||||||
|
' solo per controllo FANUC creo un timer apposito solo per la lettura degli assi
|
||||||
|
If m_nNCType = 4 Then
|
||||||
|
AddHandler m_RefreshAxesFanuc.Tick, AddressOf RefreshAxesFanucTimer_tick
|
||||||
|
m_RefreshAxesFanuc.Interval = TimeSpan.FromMilliseconds(50)
|
||||||
|
m_RefreshAxesFanuc.Start()
|
||||||
|
End If
|
||||||
|
|
||||||
' Leggo dati sugli assi della macchina
|
' Leggo dati sugli assi della macchina
|
||||||
ReadAxesData()
|
ReadAxesData()
|
||||||
@@ -117,6 +127,8 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
If m_nNCType = 3 Then
|
If m_nNCType = 3 Then
|
||||||
RefreshNoEvents()
|
RefreshNoEvents()
|
||||||
|
ElseIf m_nNCType = 4 Then
|
||||||
|
RefreshFANUC()
|
||||||
Else
|
Else
|
||||||
Refresh()
|
Refresh()
|
||||||
End If
|
End If
|
||||||
@@ -129,8 +141,22 @@ Public Class CNCommunication
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshAxesFanucTimer_tick()
|
||||||
|
If Not m_bTimerAxesBusy Then
|
||||||
|
m_bTimerAxesBusy = True
|
||||||
|
m_RefreshAxesFanuc.Stop()
|
||||||
|
|
||||||
|
RefreshAxesFANUC()
|
||||||
|
|
||||||
|
m_bTimerAxesBusy = False
|
||||||
|
m_RefreshAxesFanuc.Start()
|
||||||
|
Else
|
||||||
|
Dim nDummy As Integer = 10
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub ReadAxesData()
|
Private Sub ReadAxesData()
|
||||||
' Nomi e indici degli assi macchina
|
' Nomi e indici degli assi macchina: definisco il nome degli assi da satampare nella pagina MachineStatusUC
|
||||||
m_bAxesOk = True
|
m_bAxesOk = True
|
||||||
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_AXES, K_L1NAME, "X", m_sA1, m_MainWindow.GetMachIniFile())
|
||||||
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
m_nA1 = GetPrivateProfileInt(S_AXES, K_L1ID, 0, m_MainWindow.GetMachIniFile())
|
||||||
@@ -222,6 +248,11 @@ Public Class CNCommunication
|
|||||||
m_CN = New Num.NumNC
|
m_CN = New Num.NumNC
|
||||||
Case 3
|
Case 3
|
||||||
m_CN = New CN_Siemens
|
m_CN = New CN_Siemens
|
||||||
|
Case 4
|
||||||
|
' Fanuc
|
||||||
|
m_CN = New Fanuc.Fanuc
|
||||||
|
' proveddo a sovrscrivere i datti di comunicazione PC-NC settati di default nella classe CN_Generico
|
||||||
|
m_MainWindow.m_CurrentMachine.InitFANUC(m_CN)
|
||||||
End Select
|
End Select
|
||||||
' Recupero la stringa di inizializzazione della comunicazione
|
' Recupero la stringa di inizializzazione della comunicazione
|
||||||
|
|
||||||
@@ -354,6 +385,11 @@ Public Class CNCommunication
|
|||||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Solo per controllo FANUNC
|
||||||
|
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
|
||||||
|
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
|
||||||
|
|
||||||
|
|
||||||
' Inizializzo la comunicazione
|
' Inizializzo la comunicazione
|
||||||
m_CN.Init()
|
m_CN.Init()
|
||||||
|
|
||||||
@@ -418,6 +454,17 @@ Public Class CNCommunication
|
|||||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
|
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
Case 4
|
||||||
|
If IsNothing(m_CN) OrElse m_CN.n_state < 2 Then
|
||||||
|
' Per evitare crash con azioni verso il controllo, avvio quello di debug
|
||||||
|
m_nNCType = 0
|
||||||
|
Me.m_CN = New CN_Debug
|
||||||
|
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
|
Else
|
||||||
|
' ATTENZIONE: durante l'inizializzazione della classe il vettore che contiene tutti gli indirizzi di memoria non è caricato
|
||||||
|
m_CN.b_axis_events_enable = True
|
||||||
|
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
' Assegno riferimento al CN alle diverse pagine
|
' Assegno riferimento al CN alle diverse pagine
|
||||||
@@ -464,6 +511,7 @@ Public Class CNCommunication
|
|||||||
m_MachineStatus.DisplayPositionDelta()
|
m_MachineStatus.DisplayPositionDelta()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
If m_CN.b_feed_changed Then
|
If m_CN.b_feed_changed Then
|
||||||
m_CN.b_feed_changed = False
|
m_CN.b_feed_changed = False
|
||||||
m_MachineStatus.DisplayFeed()
|
m_MachineStatus.DisplayFeed()
|
||||||
@@ -490,12 +538,14 @@ Public Class CNCommunication
|
|||||||
'FrmMain.LblToolRad.Text = cn.Tools(0).radius.ToString
|
'FrmMain.LblToolRad.Text = cn.Tools(0).radius.ToString
|
||||||
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
|
'FrmMain.LblToolComp.Text = cn.Tools(0).comp_num.ToString
|
||||||
End If
|
End If
|
||||||
|
' ----- FINE : lettura diretta di specifiche vaiabili -----
|
||||||
|
|
||||||
Select Case m_nNCType
|
Select Case m_nNCType
|
||||||
Case 1
|
Case 1
|
||||||
If m_CN.read_active_mode() <> m_nCurrMode Then
|
If m_CN.read_active_mode() <> m_nCurrMode Then
|
||||||
m_nCurrMode = m_CN.read_active_mode()
|
m_nCurrMode = m_CN.read_active_mode()
|
||||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||||
|
m_CN.nMachineMode = m_nCurrMode
|
||||||
End If
|
End If
|
||||||
Case 2
|
Case 2
|
||||||
If m_CN.nMachineMode <> m_nCurrMode Then
|
If m_CN.nMachineMode <> m_nCurrMode Then
|
||||||
@@ -530,6 +580,7 @@ Public Class CNCommunication
|
|||||||
'End If
|
'End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
|
||||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
' 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_ActivePage = MainWindow.Pages.DirectCut Then
|
||||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||||
@@ -568,8 +619,14 @@ Public Class CNCommunication
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
||||||
|
' in assenza della configurazione delle variabili Close123 e Close456
|
||||||
|
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(CN_generico.CnData.Close123State)) Then
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(Not m_CN.bOpen123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(Not m_CN.bOpen456State)
|
||||||
|
End If
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOffChanged(m_CN.bVacuumOff)
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOffChanged(m_CN.bVacuumOff)
|
||||||
@@ -581,6 +638,7 @@ Public Class CNCommunication
|
|||||||
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
|
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
|
||||||
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
|
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
|
||||||
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
|
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
@@ -607,6 +665,7 @@ Public Class CNCommunication
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
|
||||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -617,10 +676,188 @@ Public Class CNCommunication
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' Nuove bottoni (Power Macchina)
|
' Nuove bottoni (Power Macchina)
|
||||||
If m_IsNewConsole AndAlso m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
||||||
|
If m_IsNewConsole Then
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
||||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
End If
|
End If
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||||
|
If m_CN.Is_G24_active() Then
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(True)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ThreeAxisStateChanged(True)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.FiveAxisStateChanged(False)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshAxesFANUC()
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
|
' avvio lettura variabili da CN
|
||||||
|
m_CN.Geppo()
|
||||||
|
' notifico valori all'interfaccia
|
||||||
|
m_MachineStatus.DisplayPosition()
|
||||||
|
m_MachineStatus.DisplayPositionDelta()
|
||||||
|
m_MachineStatus.DisplayFeed()
|
||||||
|
m_MachineStatus.DisplaySpeed()
|
||||||
|
m_MachineStatus.DisplayPower()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshFANUC()
|
||||||
|
' Copia della funzione Refresh
|
||||||
|
|
||||||
|
' ----- INIZIO: lettura diretta di specifiche vaiabili -----
|
||||||
|
'' avvio lettura variabili da CN
|
||||||
|
'm_CN.Geppo()
|
||||||
|
'' notifico valori all'interfaccia
|
||||||
|
'm_MachineStatus.DisplayPosition()
|
||||||
|
'm_MachineStatus.DisplayPositionDelta()
|
||||||
|
'm_MachineStatus.DisplayFeed()
|
||||||
|
'm_MachineStatus.DisplaySpeed()
|
||||||
|
'm_MachineStatus.DisplayPower()
|
||||||
|
' eventualmente carico messaggi di errore
|
||||||
|
ErrorList.Clear()
|
||||||
|
If m_CN.b_NC_error Then
|
||||||
|
ErrorList.Clear()
|
||||||
|
SyncLock m_CN
|
||||||
|
For Each Item As String In m_CN.sz_NC_error_messages
|
||||||
|
ErrorList.Add(Item)
|
||||||
|
Next
|
||||||
|
End SyncLock
|
||||||
|
End If
|
||||||
|
m_AlarmsPage.NcError()
|
||||||
|
' ----- FINE : lettura diretta di specifiche vaiabili -----
|
||||||
|
|
||||||
|
If m_CN.read_active_mode() <> CShort(m_nCurrMode) Then
|
||||||
|
m_nCurrMode = CInt(m_CN.read_active_mode())
|
||||||
|
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||||
|
m_CN.nMachineMode = m_nCurrMode
|
||||||
|
End If
|
||||||
|
|
||||||
|
' QUESTE VARIABILI NON SONO LETTE IN QUANTO NON SONO STATE CARICATE → vedere come esempio il NUM che assegna queste variabili
|
||||||
|
' 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
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CoolantStateChanged(m_CN.bCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.InternalCoolantStateChanged(m_CN.bInternalCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ExternCoolantStateChanged(m_CN.bExternCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CBAxesStateChanged(m_CN.bCBAxesState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.AirBlowStateChanged(m_CN.bAirBlowState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.HomeStateChanged(m_CN.bHomeState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.DoorClosedChanged(m_CN.nDoorClosedState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.FiveAxisStateChanged(m_CN.Is_G24_active())
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumUpChanged(m_CN.bVacuumUp)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumDownChanged(m_CN.bVacuumDown)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2UpChanged(m_CN.bVacuum2Up)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2DownChanged(m_CN.bVacuum2Down)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum0Changed(m_CN.bVacuum0)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum90Changed(m_CN.bVacuum90)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum1Changed(m_CN.bVacuum1State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2Changed(m_CN.bVacuum2State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum3Changed(m_CN.bVacuum3State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum4Changed(m_CN.bVacuum4State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum5Changed(m_CN.bVacuum5State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum6Changed(m_CN.bVacuum6State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum135Changed(m_CN.bVacuum135State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum246Changed(m_CN.bVacuum246State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.OpenAllChanged(m_CN.bOpenAllState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open123Changed(m_CN.bOpen123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Open456Changed(m_CN.bOpen456State)
|
||||||
|
' in assenza della configurazione delle variabili Close123 e Close456
|
||||||
|
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(CN_generico.CnData.Close123State)) Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(m_CN.bClose123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(m_CN.bClose456State)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close123Changed(Not m_CN.bOpen123State)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Close456Changed(Not m_CN.bOpen456State)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOnChanged(m_CN.bVacuumOn)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumOffChanged(m_CN.bVacuumOff)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BypassChanged(m_CN.bBypassState)
|
||||||
|
|
||||||
|
' Nuovi bottoni (uso joystick)
|
||||||
|
If m_IsNewConsole Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.XYJogChanged(m_CN.bXYJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ZCJogChanged(m_CN.bZCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ZBJogChanged(m_CN.bZBCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.RemoteChanged(m_CN.bRemote)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState OrElse m_CN.bInternalCoolantState OrElse m_CN.bExternCoolantState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||||
|
If m_CN.Is_G24_active() Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(True)
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(True)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(False)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableDownChanged(m_CN.bTableDownState)
|
||||||
|
|
||||||
|
' Nuovi bottoni (uso joystick) per Area4
|
||||||
|
If m_IsNewConsole Then
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.XYJogChanged(m_CN.bXYJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ZJogChanged(m_CN.bZCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.BCJogChanged(m_CN.bZBCJog)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.RemoteChanged(m_CN.bRemote)
|
||||||
|
m_MainWindow.m_DirectCutPageUC.ParkingStateChanged(m_CN.bParkingState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.RawPart Then
|
||||||
|
m_MainWindow.m_RawPartPage.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Nuove bottoni (Power Macchina)
|
||||||
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
||||||
|
If m_IsNewConsole Then
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
|
End If
|
||||||
|
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.WorkInProgress Then
|
||||||
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
m_MainWindow.m_WorkInProgressPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||||
@@ -904,28 +1141,84 @@ Public Class CNCommunication
|
|||||||
End If
|
End If
|
||||||
' Se richiesta successiva attivazione, faccio reset
|
' Se richiesta successiva attivazione, faccio reset
|
||||||
If bActivate Then
|
If bActivate Then
|
||||||
|
EgtOutLog("Call function: DGeneralFunctions_Reset")
|
||||||
|
TimeSpanInit()
|
||||||
m_CN.DGeneralFunctions_Reset()
|
m_CN.DGeneralFunctions_Reset()
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
End If
|
End If
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nResetSendDelay)
|
||||||
If m_nNCType = 1 Then
|
If m_nNCType = 1 Then
|
||||||
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
' Cancellazione eventuale file già presente con lo stesso nome (ignoro eventuale errore)
|
||||||
|
EgtOutLog("Delete_NC_prog(sNumProg)")
|
||||||
|
TimeSpanInit()
|
||||||
m_CN.Delete_NC_prog(sNumProg)
|
m_CN.Delete_NC_prog(sNumProg)
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
|
ElseIf m_nNCType = 4 Then
|
||||||
|
' FANUC: imposto modalità EDIT
|
||||||
|
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(1) = 0)
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
End If
|
End If
|
||||||
|
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
|
||||||
|
' -------------- START DOWNLOAD --------------
|
||||||
|
TimeSpanInit()
|
||||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' FANUC: genero un file 901 vuoto da aspedire, attivare; poi rispedisco il file 900
|
||||||
|
If m_nNCType = 4 And Not bOk Then
|
||||||
|
bOk = True
|
||||||
|
Dim sCncPath1 As String = m_MainWindow.GetCncDir() & "\PlaceHolder" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||||
|
Dim fs As FileStream = File.Create(sCncPath1)
|
||||||
|
' Add text to the file.
|
||||||
|
Dim info As Byte() = New UTF8Encoding(True).GetBytes(vbLf & "(PlaceHolder)")
|
||||||
|
fs.Write(info, 0, info.Length)
|
||||||
|
fs.Close()
|
||||||
|
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath1, "901") = 0)
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
|
If bActivate Then
|
||||||
|
bOk = bOk AndAlso (m_CN.ActivateProgram("901") = 0)
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
|
End If
|
||||||
|
' riprovo ad eseguire il programma 900
|
||||||
|
bOk = True
|
||||||
|
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
|
End If
|
||||||
|
EgtOutLog("Nc Type : " & m_nNCType.ToString)
|
||||||
|
' AXIUM (NUM OLD): se DripFeed non esegluo attivazione programma)
|
||||||
|
If m_nNCType = 1 AndAlso m_CN.bIsDripFeed Then
|
||||||
|
' eventauli cambi di stato sono trattati all'interno della funzione DownLoad_NC_prog
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
|
' -------------- END DOWNLOAD --------------
|
||||||
|
' -------------- START ACTIVATE --------------
|
||||||
' Se richiesta attivazione
|
' Se richiesta attivazione
|
||||||
If bActivate Then
|
If bActivate Then
|
||||||
' Attivazione programma
|
' Attivazione programma
|
||||||
|
EgtOutLog("ActivateProgram(nNumProg)")
|
||||||
|
TimeSpanInit()
|
||||||
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
|
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' Attivo la modalità AUTO prima per preparar il cyclo start
|
||||||
|
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
||||||
' Attesa opportuna
|
' Attesa opportuna
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
' Modalità automatica
|
' Modalità automatica
|
||||||
bOk = bOk AndAlso (m_CN.DGeneralFunctions_WriteCncMode(0) = 0)
|
EgtOutLog("DGeneralFunctions_WriteCncMode(0)")
|
||||||
|
TimeSpanInit()
|
||||||
|
EgtOutLog(TimeSpanEnd())
|
||||||
End If
|
End If
|
||||||
|
' -------------- END ACTIVATE --------------
|
||||||
' Messaggio con risultato
|
' Messaggio con risultato
|
||||||
If bOk Then
|
If bOk Then
|
||||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
|
m_CurrProjPage.SetInfoMessage(EgtMsg(90317)) 'Programma CN trasmesso con successo
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
|||||||
Public Const MAX_VAR As Short = 100
|
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_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||||
Public Const MAX_TOOLS As Short = 100
|
Public Const MAX_TOOLS As Short = 100
|
||||||
Public Const NUM_DATA = 55 ' Numero di dati del CN (Speed,Feed,...)
|
Public Const NUM_DATA = 56 ' Numero di dati del CN (Speed,Feed,...)
|
||||||
|
|
||||||
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
||||||
|
|
||||||
@@ -70,8 +70,18 @@ Public MustInherit Class CN_generico
|
|||||||
Parking = 52
|
Parking = 52
|
||||||
EnableZone = 53
|
EnableZone = 53
|
||||||
EnablePC = 54
|
EnablePC = 54
|
||||||
|
|
||||||
|
nAxes = 55
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum Type As Short
|
||||||
|
TBoolean = 0
|
||||||
|
TInteger = 1
|
||||||
|
TLong = 2
|
||||||
|
TDouble = 3
|
||||||
|
TString = 4
|
||||||
|
|
||||||
|
End Enum
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Struct"
|
#Region " Struct"
|
||||||
@@ -218,10 +228,27 @@ Public MustInherit Class CN_generico
|
|||||||
Public bRemote As Boolean
|
Public bRemote As Boolean
|
||||||
' Nuovi di bottoni -------------------------------------------
|
' Nuovi di bottoni -------------------------------------------
|
||||||
|
|
||||||
|
' solo per NumOld
|
||||||
|
Public bIsDripFeed As Boolean = False
|
||||||
|
|
||||||
|
' usato nel FANUC per leggere lo stato macchina se 5 assi attivo
|
||||||
|
Public b5AxesActive As Boolean
|
||||||
|
|
||||||
Public nMachineMode As Integer
|
Public nMachineMode As Integer
|
||||||
|
|
||||||
Public m_szCnDataVar(NUM_DATA - 1) As String
|
Public m_szCnDataVar(NUM_DATA - 1) As String
|
||||||
|
'
|
||||||
|
' nuovi dal 29-III-2023 per Fanuc
|
||||||
|
'
|
||||||
|
Public n_Base_addr_int_vars As Integer = 59800
|
||||||
|
Public n_Base_addr_byte_for_bits_vars As Integer = 59820
|
||||||
|
Public n_num_var_int_to_read As Short = 10
|
||||||
|
Public n_num_var_byte_for_bits_to_read As Short = 30
|
||||||
|
Public s_addr_set_nc_mode As String = "D59825"
|
||||||
|
Public s_addr_feedhold As String = "D59850.6"
|
||||||
|
'
|
||||||
|
' Eventi
|
||||||
|
'
|
||||||
Public Event NewPositionData(ByVal sender As Object)
|
Public Event NewPositionData(ByVal sender As Object)
|
||||||
Public Event NewPosDeltaData(ByVal sender As Object)
|
Public Event NewPosDeltaData(ByVal sender As Object)
|
||||||
Public Event NewVarChanged(ByVal sender As Object)
|
Public Event NewVarChanged(ByVal sender As Object)
|
||||||
@@ -294,8 +321,8 @@ Public MustInherit Class CN_generico
|
|||||||
|
|
||||||
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
||||||
|
|
||||||
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double, _
|
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double,
|
||||||
DLength_X As Double, DTipRadius_Z As Double, _
|
DLength_X As Double, DTipRadius_Z As Double,
|
||||||
nDirection As Short, nType As Short, nH As Integer) As Short
|
nDirection As Short, nType As Short, nH As Integer) As Short
|
||||||
|
|
||||||
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
||||||
@@ -341,4 +368,36 @@ Public MustInherit Class CN_generico
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region " Nuovi metodi pubblici"
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_short(VarAddr As String, ByRef value As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_short_range(VarStartAddr As String, VarEndAddr As String, ByRef values() As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_write_var_short(VarAddr As String, ByRef value As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_write_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_pulse_bit(VarAddr As String) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
Public Overridable Function Geppo() As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -9,12 +9,50 @@ Imports System.Text
|
|||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Threading
|
||||||
|
Imports System.Windows.Threading
|
||||||
|
|
||||||
Namespace Num
|
Namespace Num
|
||||||
|
|
||||||
Public Class NumNCOld
|
Public Class NumNCOld
|
||||||
Inherits CN_generico
|
Inherits CN_generico
|
||||||
|
|
||||||
|
'Public bIsDripFeed As Boolean = False
|
||||||
|
' costruisco il riferimento alla pagina principale
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
' costruisco il riferimento alla barra ProjectMng
|
||||||
|
Private m_ProjectMng As ProjectMgrUC
|
||||||
|
|
||||||
|
' Messaggi ricevuti direttamente dal Thread che gestisce la comunicazione DripFeed
|
||||||
|
Private m_nMsg As Integer = 0
|
||||||
|
' Colore originale del bottone WorkBtn
|
||||||
|
Private m_BackgroundOrig As SolidColorBrush
|
||||||
|
' Timer per la lettura aggiornata dei messaggi in fase di comunicazione DriFeed
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
' funzione richiamata ad ogni clik
|
||||||
|
Private Sub RefreshTimer_tick()
|
||||||
|
' verifico se ci sono messaggi da stampare (Se n_Msg > 0 è una info, Se n_Msg < 0 è un errore)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(m_nMsg))
|
||||||
|
ElseIf m_nMsg < 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(Math.Abs(m_nMsg)))
|
||||||
|
End If
|
||||||
|
' dopo la stampa del messaggio resetto l'indice
|
||||||
|
m_nMsg = 0
|
||||||
|
' se ha terminato la trasmissione DripFeed fermo il timer
|
||||||
|
If Not bIsDripFeed Then
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
|
' reimposto il colore originale del bottone WorkBtn della pagina ProjectMng
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_ProjectMng.WorkBtn.Background = m_BackgroundOrig
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region " Classes"
|
#Region " Classes"
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -79,6 +117,10 @@ Public Class NumNCOld
|
|||||||
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
||||||
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
||||||
|
|
||||||
|
' Const DNC_MODE_FIRST = &H3A00, DNC_MODE_CONTINUE = &H3B00, DNC_MODE_ABORT = &H3C00
|
||||||
|
Const DNC_MODE_FIRST = 0, DNC_MODE_CONTINUE = 1, DNC_MODE_ABORT = 2
|
||||||
|
Const DNC_IN_PROGRES = &HC8, DNC_RING_BUFFER_FULL = &H7
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Structures"
|
#Region " Structures"
|
||||||
@@ -115,7 +157,7 @@ Public Class NumNCOld
|
|||||||
Dim Type As Long
|
Dim Type As Long
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
<StructLayout(LayoutKind.Explicit)> _
|
<StructLayout(LayoutKind.Explicit)>
|
||||||
Public Structure tDNC20_ObjectList
|
Public Structure tDNC20_ObjectList
|
||||||
<FieldOffset(0)> Public ElemNum As UInt16
|
<FieldOffset(0)> Public ElemNum As UInt16
|
||||||
<FieldOffset(2)> Public First As UInt16
|
<FieldOffset(2)> Public First As UInt16
|
||||||
@@ -123,7 +165,7 @@ Public Class NumNCOld
|
|||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
Public Structure My_data_struct
|
Public Structure My_data_struct
|
||||||
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> _
|
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)>
|
||||||
Public data As Byte()
|
Public data As Byte()
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
@@ -149,6 +191,7 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Private iFirstVar As UInt16
|
Private iFirstVar As UInt16
|
||||||
Private n_portNC As Int16
|
Private n_portNC As Int16
|
||||||
|
Private n_PPport As Int16
|
||||||
|
|
||||||
Private Vmminch As Long = 1000
|
Private Vmminch As Long = 1000
|
||||||
Private NumCifreDecP4 As Long = 1000
|
Private NumCifreDecP4 As Long = 1000
|
||||||
@@ -209,6 +252,9 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadFileAsyn Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
|
Declare Function DownLoadPPPFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadPPPFile2 Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Offset As Int16, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
||||||
|
|
||||||
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
||||||
@@ -316,6 +362,14 @@ Public Class NumNCOld
|
|||||||
EgtOutLog(msga)
|
EgtOutLog(msga)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
nret = Get_Port(n_PPport)
|
||||||
|
If nret <> 0 Then
|
||||||
|
msga = " PP Port not available (Get_Port) : " & nret.ToString
|
||||||
|
EgtOutLog(msga)
|
||||||
|
Else
|
||||||
|
EgtOutLog("PP Port available: " & n_PPport.ToString)
|
||||||
|
End If
|
||||||
|
|
||||||
' eventualmente aggiungere apertura porta per PPP
|
' eventualmente aggiungere apertura porta per PPP
|
||||||
'iport3 = 3
|
'iport3 = 3
|
||||||
'nret = Get_Port(iport3)
|
'nret = Get_Port(iport3)
|
||||||
@@ -333,6 +387,7 @@ Public Class NumNCOld
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim nret As Int16 = Free_Port(n_portNC)
|
Dim nret As Int16 = Free_Port(n_portNC)
|
||||||
|
nret = Free_Port(n_PPport)
|
||||||
|
|
||||||
global_state = eStateType.NOT_INIT
|
global_state = eStateType.NOT_INIT
|
||||||
|
|
||||||
@@ -481,6 +536,8 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
If nret <> 0 Then
|
If nret <> 0 Then
|
||||||
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
||||||
|
Else
|
||||||
|
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " → ok")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
@@ -693,7 +750,7 @@ Public Class NumNCOld
|
|||||||
' Set DPOsition Mode OP/OM
|
' Set DPOsition Mode OP/OM
|
||||||
'
|
'
|
||||||
Public Overrides Sub set_OP_OM(n As Short)
|
Public Overrides Sub set_OP_OM(n As Short)
|
||||||
b_OM_pos = ( n = 0)
|
b_OM_pos = (n = 0)
|
||||||
End Sub
|
End Sub
|
||||||
'
|
'
|
||||||
' Read Once position
|
' Read Once position
|
||||||
@@ -792,33 +849,133 @@ Public Class NumNCOld
|
|||||||
Return nret
|
Return nret
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da PC a CN
|
' da PC a CN (sincrono)
|
||||||
'
|
'
|
||||||
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
|
||||||
' Verifico accessibilità CN
|
' Verifico accessibilità CN
|
||||||
If VerifyBusy() <> eStateType.READY Then
|
If VerifyBusy() <> eStateType.READY Then
|
||||||
|
EgtOutLog("Stato CN " & global_state.ToString)
|
||||||
Return global_state
|
Return global_state
|
||||||
End If
|
End If
|
||||||
' Dichiaro CN occupato
|
|
||||||
global_state = eStateType.BUSY
|
|
||||||
|
|
||||||
' Determino numero programma ( %900.0 -> 9000)
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
' Trasmetto il programma
|
' verifico la dimensione del file
|
||||||
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
Dim myFile As New FileInfo(sz_PC_filename)
|
||||||
|
' determino dimensione file
|
||||||
|
Dim sizeInBytes As Long = myFile.Length
|
||||||
|
|
||||||
|
EgtOutLog(" --- Dimensione file CadCut " & sizeInBytes.ToString)
|
||||||
|
' Verifico se dimensione file è maggiore del Buffer
|
||||||
|
If sizeInBytes > 32000 Then
|
||||||
|
' Trasmetto il programma (PPPFile2)
|
||||||
|
EgtOutLog(" --- START DOWNLOAD PPP FILE --- ")
|
||||||
|
' Imposto la modalità AUTO
|
||||||
|
set_NC_mode(0)
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(1000)
|
||||||
|
' 90969=Drip feed has been started
|
||||||
|
m_nMsg = 90969
|
||||||
|
bIsDripFeed = True
|
||||||
|
' cambio lo sfondo del pulsante WorkBtn
|
||||||
|
If Not IsNothing(m_MainWindow.m_FrameCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_FrameCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_FrameCutPageUC.m_ProjectMgr
|
||||||
|
ElseIf Not IsNothing(m_MainWindow.m_CadCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_CadCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_CadCutPageUC.m_ProjectMgr
|
||||||
|
End If
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_BackgroundOrig = m_ProjectMng.WorkBtn.Background
|
||||||
|
Dim MyLinearGradientBrush As LinearGradientBrush = Application.Current.FindResource("OmagCut_GradientYellow")
|
||||||
|
m_ProjectMng.WorkBtn.Background = MyLinearGradientBrush
|
||||||
|
End If
|
||||||
|
' avvio il timer per la lettura dei messaggi, imposto il clock a 1s
|
||||||
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
Dim thread As New Thread(Sub()
|
||||||
|
Download_Drip_CN_prog(sz_PC_filename, sz_NC_filename)
|
||||||
|
End Sub)
|
||||||
|
thread.Start()
|
||||||
|
Return 1
|
||||||
|
Else
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Trasmetto il programma (interamente)
|
||||||
|
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
||||||
If nRet <> 0 Then
|
If nRet <> 0 Then
|
||||||
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Dichiaro CN libero
|
' Dichiaro CN libero
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
|
Return nRet
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
'
|
||||||
|
' da PC a CN (asincrono)
|
||||||
|
'
|
||||||
|
|
||||||
|
Private Function Download_Drip_CN_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
|
' Ultimo numero di segmento invaito
|
||||||
|
Dim i As UInt16
|
||||||
|
' Invia il primo segmento (dati comunicazione)
|
||||||
|
EgtOutLog(" -> Invia il primo segmento " & " → PPport: " & n_PPport & " → NC file name: " & sz_PC_filename & " → Dnc Mode: " & DNC_MODE_FIRST)
|
||||||
|
Dim nRet As Int16 = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_FIRST, i)
|
||||||
|
' Inserisco un tempo di attesa di sicurezza
|
||||||
|
Thread.Sleep(100)
|
||||||
|
' Verifico che il primo invio sia andato a buon fine (il CN deve esser in modalità IN_PROGRESS oppure RING_BUFFER_FULL)
|
||||||
|
If nRet <> DNC_IN_PROGRES And nRet <> DNC_RING_BUFFER_FULL And m_MainWindow.m_IsClosingApplication <> 1 Then
|
||||||
|
' 90970=Drip feed has been failed (Error)
|
||||||
|
m_nMsg = -90970
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString())
|
||||||
|
Else
|
||||||
|
' 90969=Drip feed has been started (Info)
|
||||||
|
m_nMsg = 90969
|
||||||
|
' Se il primo invio è andato a buon fine allora invio i segmenti seguenti
|
||||||
|
While (nRet = DNC_IN_PROGRES Or nRet = DNC_RING_BUFFER_FULL) And m_MainWindow.m_IsClosingApplication <> 1
|
||||||
|
nRet = DownLoadPPPFile2(n_portNC, l, 32768, sz_PC_filename, Nothing, DNC_MODE_CONTINUE, i)
|
||||||
|
Thread.Sleep(10)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Verifico che il processo sia terminato correttamente
|
||||||
|
If nRet <> 0 Then
|
||||||
|
' 90971=Drip feed hes been aborted (Error)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
' se in precedenza non è stato generato un messaggio di errore (m_nMsg = -90970) comunico che il processo è stato interrotto
|
||||||
|
m_nMsg = -90971
|
||||||
|
End If
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString() & ", DownLoadPPPFile is aborted")
|
||||||
|
Else
|
||||||
|
' 90972=Drip feed has been ended (Info)
|
||||||
|
m_nMsg = 90972
|
||||||
|
End If
|
||||||
|
|
||||||
|
' prima di terminare (a prescinere dall'esito della comunicazione) forzo la terminazione
|
||||||
|
nRet = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_ABORT, i)
|
||||||
|
' Dichiaro CN libero
|
||||||
|
global_state = eStateType.READY
|
||||||
|
bIsDripFeed = False
|
||||||
|
EgtOutLog("IsDripFeed : " & bIsDripFeed.ToString)
|
||||||
|
EgtOutLog(" --- END DOWNLOAD PPP FILE --- ")
|
||||||
|
' se richiesta chiusura del programma, notifico che è stata chiusa correttmanete la comunicazione DripFeed
|
||||||
|
If m_MainWindow.m_IsClosingApplication = 1 Then
|
||||||
|
m_MainWindow.m_IsClosingApplication = 2
|
||||||
|
End If
|
||||||
|
' chiudo il thread aperto
|
||||||
Return nRet
|
Return nRet
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da CN a pc
|
' da CN a pc
|
||||||
'
|
'
|
||||||
@@ -973,7 +1130,7 @@ Public Class NumNCOld
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function Is_G24_active() As Boolean
|
Public Overrides Function Is_G24_active() As Boolean
|
||||||
Return (( Var6003 And &H2) <> 0)
|
Return ((Var6003 And &H2) <> 0)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Function get_program_status() As Int16
|
Public Overrides Function get_program_status() As Int16
|
||||||
@@ -1154,6 +1311,6 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -122,12 +122,13 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib, Version=2.1.7.1, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="EgtWPFLib, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\EgtWPFLib5.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXLib">
|
<Reference Include="Interop.FXLib">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
||||||
@@ -177,6 +178,12 @@
|
|||||||
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="CAM\CamPolishing.vb" />
|
<Compile Include="CAM\CamPolishing.vb" />
|
||||||
|
<Compile Include="DirectCuts\ControlsDirectCutUC.xaml.vb">
|
||||||
|
<DependentUpon>ControlsDirectCutUC.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DirectCuts\ControlsDirectCutUC1.xaml.vb">
|
||||||
|
<DependentUpon>ControlsDirectCutUC1.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="DirectCuts\Polishing.xaml.vb">
|
<Compile Include="DirectCuts\Polishing.xaml.vb">
|
||||||
<DependentUpon>Polishing.xaml</DependentUpon>
|
<DependentUpon>Polishing.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -186,6 +193,9 @@
|
|||||||
<Compile Include="DirectCuts\SingleDrillUC.xaml.vb">
|
<Compile Include="DirectCuts\SingleDrillUC.xaml.vb">
|
||||||
<DependentUpon>SingleDrillUC.xaml</DependentUpon>
|
<DependentUpon>SingleDrillUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="DirectCuts\SquaringUC.xaml.vb">
|
||||||
|
<DependentUpon>SquaringUC.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="DrawImport\AlzFrontUC.xaml.vb">
|
<Compile Include="DrawImport\AlzFrontUC.xaml.vb">
|
||||||
<DependentUpon>AlzFrontUC.xaml</DependentUpon>
|
<DependentUpon>AlzFrontUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -217,6 +227,9 @@
|
|||||||
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
||||||
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="NcComm\fwlib32.vb" />
|
||||||
|
<Compile Include="NcComm\M_Fanuc.vb" />
|
||||||
|
<Compile Include="NcComm\M_Fanuc_hi.vb" />
|
||||||
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
|
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
|
||||||
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -232,6 +245,9 @@
|
|||||||
<Compile Include="Project\CicloStartWD.xaml.vb">
|
<Compile Include="Project\CicloStartWD.xaml.vb">
|
||||||
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="RawPhoto\OtherRefTabWD.xaml.vb">
|
||||||
|
<DependentUpon>OtherRefTabWD.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
||||||
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -429,6 +445,14 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="DirectCuts\ControlsDirectCutUC.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
<Page Include="DirectCuts\ControlsDirectCutUC1.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="DirectCuts\Polishing.xaml">
|
<Page Include="DirectCuts\Polishing.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -441,6 +465,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="DirectCuts\SquaringUC.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="DrawImport\AlzFrontUC.xaml">
|
<Page Include="DrawImport\AlzFrontUC.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -494,6 +522,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="RawPhoto\OtherRefTabWD.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="RawPhoto\SlabIdWD.xaml">
|
<Page Include="RawPhoto\SlabIdWD.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -876,7 +908,7 @@
|
|||||||
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\ToolChangerPos.png" />
|
<Resource Include="Resources\ToolChangerPos_OLD.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\Manual.png" />
|
<Resource Include="Resources\Manual.png" />
|
||||||
@@ -1296,6 +1328,18 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
|
<Resource Include="Resources\NewIcons\Ponticelli_delete.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\Parking.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\Quality.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ToolChangerPos.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\RefTab.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
|
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
|
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
|
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
|
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
|
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
|
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
||||||
@@ -208,6 +209,7 @@
|
|||||||
<BitmapImage x:Key="XYJogImg" UriSource="Resources/NewIcons/XYJog.png"></BitmapImage>
|
<BitmapImage x:Key="XYJogImg" UriSource="Resources/NewIcons/XYJog.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="ZCJogImg" UriSource="Resources/NewIcons/ZCJog.png"></BitmapImage>
|
<BitmapImage x:Key="ZCJogImg" UriSource="Resources/NewIcons/ZCJog.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="ZBJogImg" UriSource="Resources/NewIcons/ZBJog.png"></BitmapImage>
|
<BitmapImage x:Key="ZBJogImg" UriSource="Resources/NewIcons/ZBJog.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="ParkingImg" UriSource="Resources/NewIcons/Parking.png"></BitmapImage>
|
||||||
|
|
||||||
|
|
||||||
<!--Frame-->
|
<!--Frame-->
|
||||||
@@ -220,6 +222,7 @@
|
|||||||
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
|
<BitmapImage x:Key="Inizio-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Inizio-allunga-o-accorcia.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PonticelliWJImg" UriSource="Resources/NewIcons/Ponticelli.png"></BitmapImage>
|
<BitmapImage x:Key="PonticelliWJImg" UriSource="Resources/NewIcons/Ponticelli.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PonticelliDeleteWJImg" UriSource="Resources/NewIcons/Ponticelli_delete.png"></BitmapImage>
|
<BitmapImage x:Key="PonticelliDeleteWJImg" UriSource="Resources/NewIcons/Ponticelli_delete.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="QualityWJImg" UriSource="Resources/NewIcons/Quality.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
|
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
|
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
|
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
|
||||||
@@ -1208,6 +1211,7 @@
|
|||||||
|
|
||||||
<Style x:Key="OmagCut_CalculatorTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}">
|
<Style x:Key="OmagCut_CalculatorTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}">
|
||||||
<Setter Property="Keyboard" Value="Calculator"/>
|
<Setter Property="Keyboard" Value="Calculator"/>
|
||||||
|
<Setter Property="IsLength" Value="True"/>
|
||||||
<Setter Property="KeyboardDimension" Value="300"/>
|
<Setter Property="KeyboardDimension" Value="300"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|||||||
@@ -55,23 +55,43 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<!--UNITA' DI MISURA-->
|
||||||
<GroupBox Name="UnitsOfMeasureGpBx"
|
<GroupBox Name="UnitsOfMeasureGpBx"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.RowSpan="3"
|
Grid.RowSpan="3"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
<Grid >
|
<Grid Name ="UnitGrid">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.5*"/>
|
<ColumnDefinition Width="0.5*"/>
|
||||||
<ColumnDefinition Width="4*"/>
|
<ColumnDefinition Width="3.2*"/>
|
||||||
|
<ColumnDefinition Width="1.8*"/>
|
||||||
<ColumnDefinition Width="0.5*"/>
|
<ColumnDefinition Width="0.5*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="0.25*"/>
|
<RowDefinition Height="0.25*"/>
|
||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
<RowDefinition Height="0.25*"/>
|
<RowDefinition Height="0.25*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.25*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="UnitsOfMeasureCmBx" Grid.Column="1" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}">
|
<ComboBox Name="UnitsOfMeasureCmBx" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<ComboBox Name="FractionPatternCmBx" Grid.Column="1" Grid.Row="3" Style="{StaticResource OmagCut_ComboBox}">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<ComboBox Name="PrecisionCmBx" Grid.Column="2" Grid.Row="3" Style="{StaticResource OmagCut_ComboBox}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
@@ -80,9 +100,9 @@
|
|||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
|
||||||
<GroupBox Name="TextColorGpBx"
|
<GroupBox Name="TextColorGpBx"
|
||||||
Grid.Column="2" Grid.RowSpan="3" Grid.ColumnSpan="1"
|
Grid.Column="2" Grid.RowSpan="3" Grid.ColumnSpan="1"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
@@ -224,7 +244,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="ToleranceMsgTxBl" Grid.Column="3" Grid.Row="0"
|
<TextBlock Name="ToleranceMsgTxBl" Grid.Column="3" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="ToleranceMsgTxBx" Grid.Column="4" Grid.Row="0" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="ToleranceMsgTxBx" Grid.Column="4" Grid.Row="0" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -241,7 +261,7 @@
|
|||||||
Style="{StaticResource OmagCut_Button}" />
|
Style="{StaticResource OmagCut_Button}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA1TalloneTxBx" Grid.Column="5" Grid.Row="2" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA1TalloneTxBx" Grid.Column="5" Grid.Row="2" Margin="10,0,10,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA1InclinazioneTxBx" Grid.Column="3" Grid.Row="2" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA1InclinazioneTxBx" Grid.Column="3" Grid.Row="2" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA2EnableChBx" Grid.Column="0" Grid.Row="3"
|
<CheckBox Name="CTSA2EnableChBx" Grid.Column="0" Grid.Row="3"
|
||||||
@@ -250,7 +270,7 @@
|
|||||||
Style="{StaticResource OmagCut_Button}" />
|
Style="{StaticResource OmagCut_Button}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA2TalloneTxBx" Grid.Column="5" Grid.Row="3" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA2TalloneTxBx" Grid.Column="5" Grid.Row="3" Margin="10,0,10,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA2InclinazioneTxBx" Grid.Column="3" Grid.Row="3" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA2InclinazioneTxBx" Grid.Column="3" Grid.Row="3" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA3EnableChBx" Grid.Column="0" Grid.Row="4"
|
<CheckBox Name="CTSA3EnableChBx" Grid.Column="0" Grid.Row="4"
|
||||||
@@ -259,7 +279,7 @@
|
|||||||
Style="{StaticResource OmagCut_Button}" />
|
Style="{StaticResource OmagCut_Button}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA3TalloneTxBx" Grid.Column="5" Grid.Row="4" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA3TalloneTxBx" Grid.Column="5" Grid.Row="4" Margin="10,0,10,0"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA3InclinazioneTxBx" Grid.Column="3" Grid.Row="4" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA3InclinazioneTxBx" Grid.Column="3" Grid.Row="4" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA4EnableChBx" Grid.Column="0" Grid.Row="5"
|
<CheckBox Name="CTSA4EnableChBx" Grid.Column="0" Grid.Row="5"
|
||||||
@@ -272,7 +292,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA4InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="5"
|
<TextBlock Name="CTSA4InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="5"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA4InclinazioneTxBx" Grid.Column="3" Grid.Row="5" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA4InclinazioneTxBx" Grid.Column="3" Grid.Row="5" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA5EnableChBx" Grid.Column="0" Grid.Row="6"
|
<CheckBox Name="CTSA5EnableChBx" Grid.Column="0" Grid.Row="6"
|
||||||
@@ -285,7 +305,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA5InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="6"
|
<TextBlock Name="CTSA5InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="6"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA5InclinazioneTxBx" Grid.Column="3" Grid.Row="6" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA5InclinazioneTxBx" Grid.Column="3" Grid.Row="6" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA6EnableChBx" Grid.Column="0" Grid.Row="7"
|
<CheckBox Name="CTSA6EnableChBx" Grid.Column="0" Grid.Row="7"
|
||||||
@@ -298,7 +318,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA6InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="7"
|
<TextBlock Name="CTSA6InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="7"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA6InclinazioneTxBx" Grid.Column="3" Grid.Row="7" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA6InclinazioneTxBx" Grid.Column="3" Grid.Row="7" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA7EnableChBx" Grid.Column="0" Grid.Row="8"
|
<CheckBox Name="CTSA7EnableChBx" Grid.Column="0" Grid.Row="8"
|
||||||
@@ -311,7 +331,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA7InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="8"
|
<TextBlock Name="CTSA7InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="8"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA7InclinazioneTxBx" Grid.Column="3" Grid.Row="8" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA7InclinazioneTxBx" Grid.Column="3" Grid.Row="8" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA8EnableChBx" Grid.Column="0" Grid.Row="9"
|
<CheckBox Name="CTSA8EnableChBx" Grid.Column="0" Grid.Row="9"
|
||||||
@@ -324,7 +344,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA8InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="9"
|
<TextBlock Name="CTSA8InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="9"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA8InclinazioneTxBx" Grid.Column="3" Grid.Row="9" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA8InclinazioneTxBx" Grid.Column="3" Grid.Row="9" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA9EnableChBx" Grid.Column="0" Grid.Row="10"
|
<CheckBox Name="CTSA9EnableChBx" Grid.Column="0" Grid.Row="10"
|
||||||
@@ -337,7 +357,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA9InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="10"
|
<TextBlock Name="CTSA9InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="10"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA9InclinazioneTxBx" Grid.Column="3" Grid.Row="10" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA9InclinazioneTxBx" Grid.Column="3" Grid.Row="10" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
<CheckBox Name="CTSA10EnableChBx" Grid.Column="0" Grid.Row="11"
|
<CheckBox Name="CTSA10EnableChBx" Grid.Column="0" Grid.Row="11"
|
||||||
@@ -350,7 +370,7 @@
|
|||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
<TextBlock Name="CTSA10InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="11"
|
<TextBlock Name="CTSA10InclinazioneMsgTxBl" Grid.Column="4" Grid.Row="11"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="CTSA10InclinazioneTxBx" Grid.Column="3" Grid.Row="11" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="CTSA10InclinazioneTxBx" Grid.Column="3" Grid.Row="11" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -432,7 +452,7 @@
|
|||||||
|
|
||||||
<TextBlock Name="ToleranceEMsgTxBl" Grid.Column="3" Grid.Row="0"
|
<TextBlock Name="ToleranceEMsgTxBl" Grid.Column="3" Grid.Row="0"
|
||||||
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||||
<EgtWPFLib:EgtTextBox Name="ToleranceEMsgTxBx" Grid.Column="4" Grid.Row="0" Margin="10,0,10,0"
|
<EgtWPFLib:EgtTextBox Name="ToleranceEMsgTxBx" Grid.Column="4" Grid.Row="0" Margin="10,0,10,0" IsLength="False"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
Style="{DynamicResource OmagCut_CalculatorTextBox}" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ Public Class OptionsPageUC
|
|||||||
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
|
||||||
Private UnitsList() As String = {"inch", "mm"}
|
Private UnitsList() As String = {"inch", "mm"}
|
||||||
|
Private FractionPatternList() As String = {"Decimal", "Foot'Inch""", "Only Inch"}
|
||||||
|
Private PrecisionList() As Double = {2, 4, 8, 16, 32, 64, 128}
|
||||||
Private ThemesList() As String = {"Classic", "Dark"}
|
Private ThemesList() As String = {"Classic", "Dark"}
|
||||||
|
|
||||||
' "Last Project", "New Project", "Open Folder", "Show Window"
|
' "Last Project", "New Project", "Open Folder", "Show Window"
|
||||||
@@ -18,6 +20,10 @@ Public Class OptionsPageUC
|
|||||||
LanguageCmBx.ItemsSource = m_MainWindow.m_LanguagesList
|
LanguageCmBx.ItemsSource = m_MainWindow.m_LanguagesList
|
||||||
' Associazione della lista unità di misura alla combobox
|
' Associazione della lista unità di misura alla combobox
|
||||||
UnitsOfMeasureCmBx.ItemsSource = UnitsList
|
UnitsOfMeasureCmBx.ItemsSource = UnitsList
|
||||||
|
' Associazione della lista dei Pattern
|
||||||
|
FractionPatternCmBx.ItemsSource = FractionPatternList
|
||||||
|
' Associazione della lista della precisione
|
||||||
|
PrecisionCmBx.ItemsSource = PrecisionList
|
||||||
' Associazione della lista temi alla combobox
|
' Associazione della lista temi alla combobox
|
||||||
ThemesCmBx.ItemsSource = ThemesList
|
ThemesCmBx.ItemsSource = ThemesList
|
||||||
|
|
||||||
@@ -27,6 +33,16 @@ Public Class OptionsPageUC
|
|||||||
' Imposto l'unità di misura corrente
|
' Imposto l'unità di misura corrente
|
||||||
UnitsOfMeasureCmBx.SelectedIndex = If(EgtUiUnitsAreMM(), 1, 0)
|
UnitsOfMeasureCmBx.SelectedIndex = If(EgtUiUnitsAreMM(), 1, 0)
|
||||||
|
|
||||||
|
' Imposto il pattern della per la rappresentazione frazionaria
|
||||||
|
nCurrFractionPattern = GetPrivateProfileInt(S_GENERAL, K_FRACTIONPATTERN, 0, m_MainWindow.GetIniFile())
|
||||||
|
FractionPatternCmBx.SelectedIndex = nCurrFractionPattern
|
||||||
|
EgtWPFLib.FractionStringConverter.SetCurrFractionPattern(nCurrFractionPattern)
|
||||||
|
|
||||||
|
' Imposto la preciosne della rappresentazione frazionaria
|
||||||
|
dPrecision = CDbl(GetPrivateProfileInt(S_GENERAL, K_PRECISION, 64, m_MainWindow.GetIniFile()))
|
||||||
|
Dim Index As Integer = PrecisionCmBx.Items.IndexOf(dPrecision)
|
||||||
|
PrecisionCmBx.SelectedIndex = Index
|
||||||
|
|
||||||
' Imposto il tema corrente
|
' Imposto il tema corrente
|
||||||
ThemesCmBx.SelectedIndex = GetPrivateProfileInt(S_GENERAL, K_THEME, 0, m_MainWindow.GetIniFile())
|
ThemesCmBx.SelectedIndex = GetPrivateProfileInt(S_GENERAL, K_THEME, 0, m_MainWindow.GetIniFile())
|
||||||
Themes_StartUp()
|
Themes_StartUp()
|
||||||
@@ -322,9 +338,60 @@ Public Class OptionsPageUC
|
|||||||
EgtSetUiUnits(bMM)
|
EgtSetUiUnits(bMM)
|
||||||
m_MainWindow.m_CurrentProjectPageUC.UpdateHeightTxBx()
|
m_MainWindow.m_CurrentProjectPageUC.UpdateHeightTxBx()
|
||||||
WritePrivateProfileString(S_GENERAL, K_MMUNITS, If(bMM, "1", "0"), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_GENERAL, K_MMUNITS, If(bMM, "1", "0"), m_MainWindow.GetIniFile())
|
||||||
|
|
||||||
|
If bMM Then
|
||||||
|
' se selezione MILLIMETRI nascondo la combobox che permette di inserie il tipo di pattern per la definizione delle frazioni
|
||||||
|
FractionPatternCmBx.Visibility = Visibility.Hidden
|
||||||
|
PrecisionCmBx.Visibility = Visibility.Hidden
|
||||||
|
Dim RowNum As Integer = UnitGrid.RowDefinitions.Count
|
||||||
|
If RowNum > 3 Then
|
||||||
|
UnitsOfMeasureCmBx.SetValue(Grid.RowSpanProperty, 3)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' se selezione POLLICI mostro la combobox che permette di inserie il tipo di pattern per la definizione delle frazioni
|
||||||
|
FractionPatternCmBx.Visibility = Visibility.Visible
|
||||||
|
PrecisionCmBx.Visibility = Visibility.Visible
|
||||||
|
UnitsOfMeasureCmBx.SetValue(Grid.RowSpanProperty, 1)
|
||||||
|
End If
|
||||||
|
|
||||||
' Aggiorno dati nella pagina dipendenti da unità di misura
|
' Aggiorno dati nella pagina dipendenti da unità di misura
|
||||||
UpdateSlabDxf()
|
UpdateSlabDxf()
|
||||||
UpdateAllCSTA()
|
UpdateAllCSTA()
|
||||||
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
|
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
|
||||||
|
If Not IsNothing(m_MainWindow.m_MachinePageUC.m_WaterJetPageUC) Then
|
||||||
|
m_MainWindow.m_MachinePageUC.m_WaterJetPageUC.WaterJetPage_Reinitialize()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub FractionPatternCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles FractionPatternCmBx.SelectionChanged
|
||||||
|
nCurrFractionPattern = FractionPatternCmBx.SelectedIndex
|
||||||
|
EgtWPFLib.FractionStringConverter.SetCurrFractionPattern(nCurrFractionPattern)
|
||||||
|
WritePrivateProfileString(S_GENERAL, K_FRACTIONPATTERN, nCurrFractionPattern, m_MainWindow.GetIniFile())
|
||||||
|
' Aggiorno dati nella pagina dipendenti da unità di misura
|
||||||
|
UpdateSlabDxf()
|
||||||
|
UpdateAllCSTA()
|
||||||
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
|
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
|
||||||
|
If Not IsNothing(m_MainWindow.m_MachinePageUC.m_WaterJetPageUC) Then
|
||||||
|
m_MainWindow.m_MachinePageUC.m_WaterJetPageUC.WaterJetPage_Reinitialize()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub PrecisionCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles PrecisionCmBx.SelectionChanged
|
||||||
|
dPrecision = PrecisionCmBx.SelectedValue
|
||||||
|
WritePrivateProfileString(S_GENERAL, K_PRECISION, dPrecision, m_MainWindow.GetIniFile())
|
||||||
|
' Aggiorno dati nella pagina dipendenti da unità di misura
|
||||||
|
UpdateSlabDxf()
|
||||||
|
UpdateAllCSTA()
|
||||||
|
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
|
||||||
|
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
|
||||||
|
If Not IsNothing(m_MainWindow.m_MachinePageUC.m_WaterJetPageUC) Then
|
||||||
|
m_MainWindow.m_MachinePageUC.m_WaterJetPageUC.WaterJetPage_Reinitialize()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ThemesCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ThemesCmBx.SelectionChanged
|
Private Sub ThemesCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ThemesCmBx.SelectionChanged
|
||||||
@@ -648,70 +715,70 @@ Public Class OptionsPageUC
|
|||||||
|
|
||||||
Private Sub CTSA1InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA1InclinazioneTxBx.TextChanged
|
Private Sub CTSA1InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA1InclinazioneTxBx.TextChanged
|
||||||
If CTSA1InclinazioneTxBx.Text <> "-" Then
|
If CTSA1InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA1InclinazioneTxBx.Text, dAng) Then CTSA1InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA1InclinazioneTxBx.Text, dAng) Then CTSA1InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA1EnableChBx_Click(sender, e)
|
CTSA1EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA2InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA2InclinazioneTxBx.TextChanged
|
Private Sub CTSA2InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA2InclinazioneTxBx.TextChanged
|
||||||
If CTSA2InclinazioneTxBx.Text <> "-" Then
|
If CTSA2InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA2InclinazioneTxBx.Text, dAng) Then CTSA2InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA2InclinazioneTxBx.Text, dAng) Then CTSA2InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA2EnableChBx_Click(sender, e)
|
CTSA2EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA3InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA3InclinazioneTxBx.TextChanged
|
Private Sub CTSA3InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA3InclinazioneTxBx.TextChanged
|
||||||
If CTSA3InclinazioneTxBx.Text <> "-" Then
|
If CTSA3InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA3InclinazioneTxBx.Text, dAng) Then CTSA3InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA3InclinazioneTxBx.Text, dAng) Then CTSA3InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA3EnableChBx_Click(sender, e)
|
CTSA3EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA4InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA4InclinazioneTxBx.TextChanged
|
Private Sub CTSA4InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA4InclinazioneTxBx.TextChanged
|
||||||
If CTSA4InclinazioneTxBx.Text <> "-" Then
|
If CTSA4InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA4InclinazioneTxBx.Text, dAng) Then CTSA4InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA4InclinazioneTxBx.Text, dAng) Then CTSA4InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA4EnableChBx_Click(sender, e)
|
CTSA4EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA5InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA5InclinazioneTxBx.TextChanged
|
Private Sub CTSA5InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA5InclinazioneTxBx.TextChanged
|
||||||
If CTSA5InclinazioneTxBx.Text <> "-" Then
|
If CTSA5InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA5InclinazioneTxBx.Text, dAng) Then CTSA5InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA5InclinazioneTxBx.Text, dAng) Then CTSA5InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA5EnableChBx_Click(sender, e)
|
CTSA5EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA6InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA6InclinazioneTxBx.TextChanged
|
Private Sub CTSA6InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA6InclinazioneTxBx.TextChanged
|
||||||
If CTSA6InclinazioneTxBx.Text <> "-" Then
|
If CTSA6InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA6InclinazioneTxBx.Text, dAng) Then CTSA6InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA6InclinazioneTxBx.Text, dAng) Then CTSA6InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA6EnableChBx_Click(sender, e)
|
CTSA6EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA7InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA7InclinazioneTxBx.TextChanged
|
Private Sub CTSA7InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA7InclinazioneTxBx.TextChanged
|
||||||
If CTSA7InclinazioneTxBx.Text <> "-" Then
|
If CTSA7InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA7InclinazioneTxBx.Text, dAng) Then CTSA7InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA7InclinazioneTxBx.Text, dAng) Then CTSA7InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA7EnableChBx_Click(sender, e)
|
CTSA7EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA8InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA8InclinazioneTxBx.TextChanged
|
Private Sub CTSA8InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA8InclinazioneTxBx.TextChanged
|
||||||
If CTSA8InclinazioneTxBx.Text <> "-" Then
|
If CTSA8InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA8InclinazioneTxBx.Text, dAng) Then CTSA8InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA8InclinazioneTxBx.Text, dAng) Then CTSA8InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA8EnableChBx_Click(sender, e)
|
CTSA8EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA9InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA9InclinazioneTxBx.TextChanged
|
Private Sub CTSA9InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA9InclinazioneTxBx.TextChanged
|
||||||
If CTSA9InclinazioneTxBx.Text <> "-" Then
|
If CTSA9InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA9InclinazioneTxBx.Text, dAng) Then CTSA9InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA9InclinazioneTxBx.Text, dAng) Then CTSA9InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA9EnableChBx_Click(sender, e)
|
CTSA9EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CTSA10InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA10InclinazioneTxBx.TextChanged
|
Private Sub CTSA10InclinazioneTxBx_TextChanged(sender As Object, e As TextChangedEventArgs) Handles CTSA10InclinazioneTxBx.TextChanged
|
||||||
If CTSA10InclinazioneTxBx.Text <> "-" Then
|
If CTSA10InclinazioneTxBx.Text <> "-" Then
|
||||||
Dim dAng As Double : If Not StringToLen(CTSA10InclinazioneTxBx.Text, dAng) Then CTSA10InclinazioneTxBx.Text = ""
|
Dim dAng As Double : If Not StringToDouble(CTSA10InclinazioneTxBx.Text, dAng) Then CTSA10InclinazioneTxBx.Text = ""
|
||||||
End If
|
End If
|
||||||
CTSA10EnableChBx_Click(sender, e)
|
CTSA10EnableChBx_Click(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ Public Class CurrentProjectPageUC
|
|||||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||||
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||||
If Not CurrentProjectScene.Init() Then
|
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
|
||||||
|
If Not CurrentProjectScene.Init() Or Not bProd Then
|
||||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||||
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
||||||
' Flag per riavvio programma
|
' Flag per riavvio programma
|
||||||
@@ -158,6 +159,7 @@ Public Class CurrentProjectPageUC
|
|||||||
#End If
|
#End If
|
||||||
m_MainWindow.Close()
|
m_MainWindow.Close()
|
||||||
If bRestart Then Process.Start(Application.ResourceAssembly.Location)
|
If bRestart Then Process.Start(Application.ResourceAssembly.Location)
|
||||||
|
Return
|
||||||
End If
|
End If
|
||||||
' visualizzazione avanzata dei triangoli costituenti le superfici
|
' visualizzazione avanzata dei triangoli costituenti le superfici
|
||||||
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_MainWindow.GetIniFile()) <> 0)
|
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||||
@@ -168,11 +170,6 @@ Public Class CurrentProjectPageUC
|
|||||||
' dimensione lineare max in pixel delle textures
|
' dimensione lineare max in pixel delle textures
|
||||||
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
||||||
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
||||||
' Verifico abilitazione prodotto
|
|
||||||
If Not m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE) Then
|
|
||||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 5), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 1)
|
|
||||||
m_MainWindow.Close()
|
|
||||||
End If
|
|
||||||
' Recupero e imposto handle finestra principale
|
' Recupero e imposto handle finestra principale
|
||||||
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
|
Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
|
||||||
EgtSetMainWindowHandle(hMainWnd)
|
EgtSetMainWindowHandle(hMainWnd)
|
||||||
@@ -399,6 +396,8 @@ Public Class CurrentProjectPageUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||||
m_dRawHeight = 0
|
m_dRawHeight = 0
|
||||||
UpdateHeightTxBx()
|
UpdateHeightTxBx()
|
||||||
|
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
|
||||||
' Parcheggio correttamente i pezzi precedentemente salvati
|
' Parcheggio correttamente i pezzi precedentemente salvati
|
||||||
Dim nId2 As Integer = EgtGetFirstPart()
|
Dim nId2 As Integer = EgtGetFirstPart()
|
||||||
While nId2 <> GDB_ID.NULL
|
While nId2 <> GDB_ID.NULL
|
||||||
@@ -410,9 +409,14 @@ Public Class CurrentProjectPageUC
|
|||||||
nId2 = EgtGetNextPart(nId2)
|
nId2 = EgtGetNextPart(nId2)
|
||||||
End While
|
End While
|
||||||
' Aggiorno Aree totale e da lavorare dei pezzi
|
' Aggiorno Aree totale e da lavorare dei pezzi
|
||||||
SetTotalArea( dTotArea)
|
SetTotalArea(dTotArea)
|
||||||
UpdateToProduceArea()
|
UpdateToProduceArea()
|
||||||
ShowAreas()
|
ShowAreas()
|
||||||
|
' Salvo info di C home
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
|
||||||
|
EgtZoom(ZM.ALL)
|
||||||
' Dichiaro progetto non modificato
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
@@ -523,7 +527,21 @@ Public Class CurrentProjectPageUC
|
|||||||
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
m_MainWindow.m_CurrentMachine.dAdditionalTable = dValue
|
||||||
End If
|
End If
|
||||||
' forzo visualizzazione eventuali dati su aree
|
' forzo visualizzazione eventuali dati su aree
|
||||||
SetAreasStatus( True)
|
SetAreasStatus(True)
|
||||||
|
' Recupero info C Home
|
||||||
|
Dim dCHomeCurrMach As Double
|
||||||
|
Dim dCHomeCurrproj As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHomeCurrMach)
|
||||||
|
' Verifico che esista l'info del progetto
|
||||||
|
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
|
||||||
|
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
|
||||||
|
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
|
||||||
|
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||||
|
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||||
|
End If
|
||||||
' Dichiaro progetto non modificato
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Public Class OmagPhotoWD
|
|||||||
Dim m_refImagePrevieV As New EgtPHOTOLib.ImagePreviewV()
|
Dim m_refImagePrevieV As New EgtPHOTOLib.ImagePreviewV()
|
||||||
' modifico l'immagine e salvo
|
' modifico l'immagine e salvo
|
||||||
m_refImagePrevieV.SetContourScraps(m_ContornScrap)
|
m_refImagePrevieV.SetContourScraps(m_ContornScrap)
|
||||||
|
m_refImagePrevieV.Hide()
|
||||||
m_refImagePrevieV.Show()
|
m_refImagePrevieV.Show()
|
||||||
m_refImagePrevieV.SaveImage()
|
m_refImagePrevieV.SaveImage()
|
||||||
m_refImagePrevieV.Close()
|
m_refImagePrevieV.Close()
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Imports System.IO
|
Imports System.ComponentModel
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports System.IO
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
@@ -99,7 +101,6 @@ Public Class ProjectMgrUC
|
|||||||
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||||
' Gestione stato FastGrid
|
' Gestione stato FastGrid
|
||||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||||
EgtZoom(ZM.ALL)
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function ChooseTable() As Integer
|
Friend Function ChooseTable() As Integer
|
||||||
@@ -262,6 +263,10 @@ Public Class ProjectMgrUC
|
|||||||
Dim nWarn As Integer = 0
|
Dim nWarn As Integer = 0
|
||||||
ResetAllMachinings(nWarn)
|
ResetAllMachinings(nWarn)
|
||||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
||||||
|
' Aggiorno Info C Home
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -478,7 +483,6 @@ Public Class ProjectMgrUC
|
|||||||
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||||
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
||||||
' copio il progetto corrente come progetto in lavorazione
|
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<Window x:Class="OtherRefTabWD"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
FontFamily="{DynamicResource OmagCut_Font}"
|
||||||
|
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||||
|
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False">
|
||||||
|
|
||||||
|
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
|
||||||
|
<Border Style="{DynamicResource OmagCut_Border}">
|
||||||
|
<Grid x:Name="SaveNameGrid">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="0.2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<!--<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>-->
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1.5*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
|
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
|
MaxDropDownHeight="300" Margin="0,0,0,0">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<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>
|
||||||
|
<Button Name="ExitBtn" Grid.Column="3"
|
||||||
|
IsCancel="True"
|
||||||
|
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||||
|
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib
|
||||||
|
|
||||||
|
Public Class OtherRefTabWD
|
||||||
|
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
Dim m_RawPartPage As RawPartPageUC
|
||||||
|
|
||||||
|
Private m_sPosX As String = "0"
|
||||||
|
Private m_sPosY As String = "0"
|
||||||
|
|
||||||
|
Private m_dPrevOffsetX As Double = 0
|
||||||
|
Private m_dPrevOffsetY As Double = 0
|
||||||
|
|
||||||
|
Private m_SelIndex As Integer = 0
|
||||||
|
|
||||||
|
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer)
|
||||||
|
Me.Owner = Owner
|
||||||
|
' La chiamata è richiesta dalla finestra di progettazione.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||||
|
m_sPosX = PosX
|
||||||
|
m_sPosY = PosY
|
||||||
|
m_dPrevOffsetX = OffsetX
|
||||||
|
m_dPrevOffsetY = OffsetY
|
||||||
|
m_SelIndex = OtherRefMode
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
' costruisco il riferimento alla pagina Raw
|
||||||
|
m_RawPartPage = m_MainWindow.m_RawPartPage
|
||||||
|
' posiziono la finestra
|
||||||
|
Me.Top = Owner.Top + Owner.Height / 4 - Me.Height / 2
|
||||||
|
Me.Left = Owner.Left + Owner.Width / 6 - Me.Width / 2
|
||||||
|
RefRawTxbl.Text = "Raw reference"
|
||||||
|
RefTabXTxbl.Text = "Position X"
|
||||||
|
RefTabYTxbl.Text = "Position Y"
|
||||||
|
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
|
||||||
|
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||||
|
RefTabXTxBx.Text = m_sPosX
|
||||||
|
RefTabYTxBx.Text = m_sPosY
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged
|
||||||
|
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefTabXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabXTxBx.EgtClosed
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim dX As Double = 0
|
||||||
|
StringToLen(RefTabXTxBx.Text, dX)
|
||||||
|
If Not (dX > 0 And dX < ptMax.x - ptMin.x) Then
|
||||||
|
If dX > 0 Then
|
||||||
|
dX = ptMax.x - ptMin.x
|
||||||
|
Else
|
||||||
|
dX = 0
|
||||||
|
End If
|
||||||
|
RefTabXTxBx.Text = LenToString(dX, 2)
|
||||||
|
' errore, posizione fuori dalla tavola
|
||||||
|
End If
|
||||||
|
m_RawPartPage.m_OtherRefTabX = dX
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefTabYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabYTxBx.EgtClosed
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim dY As Double = 0
|
||||||
|
StringToLen(RefTabYTxBx.Text, dY)
|
||||||
|
If Not (dY > 0 And dY < ptMax.y - ptMin.y) Then
|
||||||
|
If dY > 0 Then
|
||||||
|
dY = ptMax.y - ptMin.y
|
||||||
|
Else
|
||||||
|
dY = 0
|
||||||
|
End If
|
||||||
|
RefTabYTxBx.Text = LenToString(dY, 2)
|
||||||
|
' errore, posizione fuori dalla tavola
|
||||||
|
End If
|
||||||
|
m_RawPartPage.m_OtherRefTabY = dY
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OkBtn_Click() Handles OkBtn.Click
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile())
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile())
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ExitBtn_Click() Handles ExitBtn.Click
|
||||||
|
' riposiziono l'origine
|
||||||
|
m_RawPartPage.m_OtherRefTabX = m_sPosX
|
||||||
|
m_RawPartPage.m_OtherRefTabY = m_sPosY
|
||||||
|
' ripristino il valore della combobox
|
||||||
|
m_RawPartPage.m_OtherRefTabPos = m_SelIndex
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -157,6 +157,10 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<TextBlock Name="OtherRefTabTxBl" Grid.Row="5" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<CheckBox Name="OtherRefTabChBx" Grid.Row="5" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox}"
|
||||||
|
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||||
|
|
||||||
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
|
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
@@ -169,7 +173,8 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -186,7 +191,11 @@
|
|||||||
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
<Button Name="OtherRefTabBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||||
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Windows.Media.Animation
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports Microsoft.VisualBasic.Devices
|
||||||
|
|
||||||
Public Class RawPartPageUC
|
Public Class RawPartPageUC
|
||||||
|
|
||||||
@@ -78,6 +81,16 @@ Public Class RawPartPageUC
|
|||||||
' Costante raggio cerchietto
|
' Costante raggio cerchietto
|
||||||
Private Const RAD_CIRCLE As Double = 30
|
Private Const RAD_CIRCLE As Double = 30
|
||||||
|
|
||||||
|
' Riferimento grezzo
|
||||||
|
Private m_bEnableOtherRefTab As Boolean = False
|
||||||
|
Private m_bOtherRefTab As Boolean
|
||||||
|
Public m_OtherRefTabX As Double = 0
|
||||||
|
Public m_OtherRefTabY As Double = 0
|
||||||
|
Public m_OtherRefTabList(3) As String
|
||||||
|
Public m_OtherRefTabPos As Integer = 0
|
||||||
|
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
|
||||||
|
Private m_OtherRefTabPoint As Point3d
|
||||||
|
|
||||||
' mostra la pagina delle lavorazioni
|
' mostra la pagina delle lavorazioni
|
||||||
Private m_SmartMachiningPage As Boolean = False
|
Private m_SmartMachiningPage As Boolean = False
|
||||||
|
|
||||||
@@ -105,6 +118,13 @@ Public Class RawPartPageUC
|
|||||||
FROM_SAW = 7
|
FROM_SAW = 7
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Private Enum OTHERREFMODE As Integer
|
||||||
|
BL = 0
|
||||||
|
BR = 1
|
||||||
|
TR = 2
|
||||||
|
TL = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
'Creazione della Page UserControl e relative impostazioni
|
'Creazione della Page UserControl e relative impostazioni
|
||||||
@@ -145,6 +165,13 @@ Public Class RawPartPageUC
|
|||||||
ReDim Preserve m_RawModeListEx(3)
|
ReDim Preserve m_RawModeListEx(3)
|
||||||
End If
|
End If
|
||||||
RawModeCmBx.ItemsSource = m_RawModeList
|
RawModeCmBx.ItemsSource = m_RawModeList
|
||||||
|
|
||||||
|
' Creo la lista dei riferimenti tavola
|
||||||
|
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left"
|
||||||
|
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right"
|
||||||
|
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right"
|
||||||
|
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left"
|
||||||
|
|
||||||
' lista per selezione RawModeDamaged
|
' lista per selezione RawModeDamaged
|
||||||
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
||||||
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
||||||
@@ -184,6 +211,8 @@ Public Class RawPartPageUC
|
|||||||
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
||||||
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
||||||
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
||||||
|
|
||||||
|
OtherRefTabTxBl.Text = "New Ref On Tab"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
@@ -277,6 +306,12 @@ Public Class RawPartPageUC
|
|||||||
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Carico le info del riferimento alternativo della tavola
|
||||||
|
m_nOtherRefTabLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||||
|
LoadOtherRefTab()
|
||||||
|
|
||||||
' Assegno dati grezzo rettangolare ai textbox
|
' Assegno dati grezzo rettangolare ai textbox
|
||||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
@@ -320,6 +355,36 @@ Public Class RawPartPageUC
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadOtherRefTab()
|
||||||
|
m_bEnableOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_ENABLEOTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
|
If Not m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Collapsed
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Collapsed
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Collapsed
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
|
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
|
||||||
|
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
|
||||||
|
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
|
||||||
|
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
|
||||||
|
OtherRefTabChBx.IsChecked = m_bOtherRefTab
|
||||||
|
' se riferimento tavola differente da quello atteso
|
||||||
|
If m_bOtherRefTab Then
|
||||||
|
' dasibilito la modifica dei parametri di Offset
|
||||||
|
OffsetXTxBx.IsEnabled = False
|
||||||
|
OffsetYTxBx.IsEnabled = False
|
||||||
|
UpdateOffsetText()
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
' EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo
|
' Verifico di essere il gestore attivo
|
||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
@@ -930,6 +995,13 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate
|
' Disattivo bottoni zone rovinate
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = True
|
||||||
|
OtherRefTabBtn.IsEnabled = True
|
||||||
|
' disegno il riferimento
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
End If
|
||||||
Case RAWMODE.BY_POINTS
|
Case RAWMODE.BY_POINTS
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -946,6 +1018,12 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' disettivo la possibilità di modificare il riferimento
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_LASER
|
Case RAWMODE.FROM_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -962,6 +1040,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED
|
Case RAWMODE.DAMAGED
|
||||||
RawModeCmBx.IsEnabled = False
|
RawModeCmBx.IsEnabled = False
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -980,6 +1063,11 @@ Public Class RawPartPageUC
|
|||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni foto
|
' Disattivo bottoni foto
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_PHOTO
|
Case RAWMODE.FROM_PHOTO
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -992,6 +1080,11 @@ Public Class RawPartPageUC
|
|||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
' Visualizzo bottoni foto
|
' Visualizzo bottoni foto
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED_BY_LASER
|
Case RAWMODE.DAMAGED_BY_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1008,6 +1101,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED_BY_SAW
|
Case RAWMODE.DAMAGED_BY_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1024,6 +1122,11 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_SAW
|
Case RAWMODE.FROM_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -1040,11 +1143,26 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
|
' se abilitato nuovo riferimento del grezzo disabilito le text per offset
|
||||||
|
If OtherRefTabChBx.IsChecked Then
|
||||||
|
OffsetXTxBx.IsEnabled = False
|
||||||
|
OffsetYTxBx.IsEnabled = False
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
|
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
|
||||||
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
|
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Visible
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Visible
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Visible
|
||||||
|
End If
|
||||||
' m_ActiveRawMode = RAWMODE.BY_POINTS
|
' m_ActiveRawMode = RAWMODE.BY_POINTS
|
||||||
m_ActiveRawMode = m_PrecActiveRawMode
|
m_ActiveRawMode = m_PrecActiveRawMode
|
||||||
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
||||||
@@ -1055,6 +1173,12 @@ Public Class RawPartPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
|
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
m_PrecActiveRawMode = m_ActiveRawMode
|
m_PrecActiveRawMode = m_ActiveRawMode
|
||||||
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
||||||
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
||||||
@@ -1843,6 +1967,7 @@ Public Class RawPartPageUC
|
|||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
|
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
|
||||||
@@ -1872,6 +1997,7 @@ Public Class RawPartPageUC
|
|||||||
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
||||||
@@ -1918,6 +2044,108 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "OTHERREFTAB"
|
||||||
|
|
||||||
|
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
|
||||||
|
If OtherRefTabChBx.IsChecked Then
|
||||||
|
m_bOtherRefTab = True
|
||||||
|
MoveRawToOtherRefTab()
|
||||||
|
Else
|
||||||
|
m_bOtherRefTab = False
|
||||||
|
'MoveRawToMaiRefTab()
|
||||||
|
End If
|
||||||
|
UpdateOffsetText()
|
||||||
|
RawModeView()
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTAB, If(m_bOtherRefTab, "1", "0"), m_MainWindow.GetIniFile())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub RefTabModeChange()
|
||||||
|
MoveRawToMaiRefTab()
|
||||||
|
MoveRawToOtherRefTab()
|
||||||
|
UpdateRefTabDraw()
|
||||||
|
UpdateOffsetText()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub UpdateRefTabDraw()
|
||||||
|
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub UpdateOffsetText()
|
||||||
|
Dim ptRawMin, ptRawMax As Point3d
|
||||||
|
Dim dInvertKerf As Double = 1
|
||||||
|
If GetRawBox(ptRawMin, ptRawMax) Then
|
||||||
|
' kerf
|
||||||
|
EgtGetInfo(EgtGetFirstRawPart(), KEY_KERF, m_RawKerf)
|
||||||
|
' verifico se il kerf è negativo
|
||||||
|
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
|
||||||
|
' aggiorno dati grezzo
|
||||||
|
If dInvertKerf < 0 Then
|
||||||
|
m_RawOffsX = ptRawMin.x - m_ptTableMin.x
|
||||||
|
m_RawOffsY = ptRawMin.y - m_ptTableMin.y
|
||||||
|
Else
|
||||||
|
m_RawOffsX = ptRawMin.x - m_ptTableMin.x + m_RawKerf * dInvertKerf
|
||||||
|
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf * dInvertKerf
|
||||||
|
End If
|
||||||
|
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||||
|
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MoveRawToOtherRefTab()
|
||||||
|
Dim dKerf As Double = 0
|
||||||
|
StringToLen(KerfTxBx.Text, dKerf)
|
||||||
|
Select Case m_OtherRefTabPos
|
||||||
|
Case OTHERREFMODE.BL
|
||||||
|
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.BR
|
||||||
|
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.TR
|
||||||
|
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.TL
|
||||||
|
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case Else
|
||||||
|
End Select
|
||||||
|
UpdateRawPart()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MoveRawToMaiRefTab()
|
||||||
|
Dim dKerf As Double = 0
|
||||||
|
StringToLen(KerfTxBx.Text, dKerf)
|
||||||
|
Select Case m_OtherRefTabPos
|
||||||
|
Case OTHERREFMODE.BR
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.BL
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.TL
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.TR
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case Else
|
||||||
|
End Select
|
||||||
|
UpdateRawPart()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
|
||||||
|
' apro la finestra per gestire il riferimento
|
||||||
|
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos)
|
||||||
|
OthWD.ShowDialog()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' OtherRefTab
|
||||||
|
|
||||||
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
||||||
Dim dKerf As Double
|
Dim dKerf As Double
|
||||||
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
||||||
@@ -1960,6 +2188,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
||||||
@@ -2022,6 +2252,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf < dMinKerf Then
|
ElseIf dKerf < dMinKerf Then
|
||||||
@@ -2052,6 +2284,18 @@ Public Class RawPartPageUC
|
|||||||
' Recupero origine tavola rispetto allo 0 macchina
|
' Recupero origine tavola rispetto allo 0 macchina
|
||||||
Dim TableRef As Point3d
|
Dim TableRef As Point3d
|
||||||
EgtGetTableRef(1, TableRef)
|
EgtGetTableRef(1, TableRef)
|
||||||
|
' imposto modo automatico
|
||||||
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
|
Case 1, 2
|
||||||
|
' in attesa di verifica
|
||||||
|
Case 3
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
Case 4
|
||||||
|
' FANUC - Manual:7, Edit:1
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
|
||||||
|
End Select
|
||||||
' Recupero file LUA
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
||||||
' Imposto parametri
|
' Imposto parametri
|
||||||
@@ -2089,6 +2333,11 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
EgtOutLog("RawProbing : sent NC program")
|
EgtOutLog("RawProbing : sent NC program")
|
||||||
|
' Se fanuc passo in modalità AUTO e attivo
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
End If
|
||||||
' Aspetto e lo avvio
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
@@ -2154,6 +2403,10 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
RawThickness *= ONEMM / 1000
|
RawThickness *= ONEMM / 1000
|
||||||
End If
|
End If
|
||||||
|
' Se fanuc il dato è in mm (NON MICRON)
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
RawThickness *= 1000
|
||||||
|
End If
|
||||||
' Sottraggo eventuale spessore sovratavola
|
' Sottraggo eventuale spessore sovratavola
|
||||||
RawThickness -= m_CurrentMachine.dAdditionalTable
|
RawThickness -= m_CurrentMachine.dAdditionalTable
|
||||||
' Imposto spessore misurato come altezza grezzo
|
' Imposto spessore misurato come altezza grezzo
|
||||||
@@ -2246,6 +2499,7 @@ Public Class RawPartPageUC
|
|||||||
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
|
EgtErase(m_nOtherRefTabLay)
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2561,4 +2815,44 @@ Public Class RawPartPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function CreateOtherRefTab(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
If Not m_bOtherRefTab Or Not OtherRefTabChBx.IsEnabled Then
|
||||||
|
EgtDraw()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If File.Exists(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge") Then
|
||||||
|
' Aggiungo disegno staffa fermo pezzo
|
||||||
|
EgtInsertFile(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge")
|
||||||
|
Dim nLastPart As Integer = EgtGetLastPart()
|
||||||
|
Dim Lay As Integer = EgtGetFirstInGroup(nLastPart)
|
||||||
|
Dim Ent As Integer = EgtGetFirstInGroup(Lay)
|
||||||
|
While Ent <> -1
|
||||||
|
Dim NextEnt As Integer = EgtGetNext(Ent)
|
||||||
|
EgtRelocate(Ent, nLayerId)
|
||||||
|
EgtMove(Ent, ptP - Point3d.ORIG)
|
||||||
|
EgtRotate(Ent, ptP, Vector3d.Z_AX, 90 * m_OtherRefTabPos)
|
||||||
|
Ent = NextEnt
|
||||||
|
End While
|
||||||
|
EgtErase(nLastPart)
|
||||||
|
Else
|
||||||
|
' Aggiungo crocette
|
||||||
|
ptP += New Vector3d(0, 0, 0.15)
|
||||||
|
Dim vtCrossX As New Vector3d(100, 0, 0)
|
||||||
|
Dim vtCrossY As New Vector3d(0, 100, 0)
|
||||||
|
Dim vtCrossZ As New Vector3d(0, 0, 100)
|
||||||
|
Dim nCrossId1 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossX)
|
||||||
|
EgtSetColor(nCrossId1, New Color3d(245, 0, 0))
|
||||||
|
Dim nCrossId2 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossY)
|
||||||
|
EgtSetColor(nCrossId2, New Color3d(0, 245, 0))
|
||||||
|
Dim nCrossId3 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossZ)
|
||||||
|
EgtSetColor(nCrossId3, New Color3d(0, 0, 245))
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtDraw()
|
||||||
|
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyTest.nge", NGE.BIN)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
|
After Width: | Height: | Size: 610 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 857 B After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 857 B |
@@ -567,6 +567,55 @@ Public Class SimulationPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
||||||
|
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
||||||
|
Dim IsPressedShiftKey As Boolean = False
|
||||||
|
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||||
|
IsPressedShiftKey = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Se nella pagina di tagli diretti
|
||||||
|
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
|
||||||
|
' Genero file CNC (lancio anche se errore in precedenza)
|
||||||
|
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||||
|
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
|
||||||
|
|
||||||
|
' Costringo ad aggiornare UI
|
||||||
|
UpdateUI()
|
||||||
|
' Ripristino come fase corrente quella iniziale
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
If bOkDirect Then
|
||||||
|
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
|
||||||
|
Else
|
||||||
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
|
End If
|
||||||
|
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
|
||||||
|
If bOkDirect And IsPressedShiftKey Then
|
||||||
|
Try
|
||||||
|
Process.Start("Notepad.exe", sCncPathDirect)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.ToString)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
' ricarico la pagina di simulazione
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
' nascondo i pezzi in parcheggio
|
||||||
|
HideParkedParts(True)
|
||||||
|
' Avvio ambiente di simulazione
|
||||||
|
EgtSimInit()
|
||||||
|
EgtSimStart()
|
||||||
|
' Imposto stato corrente
|
||||||
|
SetStatus(MCH_SIM_ST.UI_STOP)
|
||||||
|
m_bPlay = True
|
||||||
|
' Costringo ad aggiornare UI
|
||||||
|
UpdateUI()
|
||||||
|
' esco
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
' eventualmente fermo la simulazione
|
||||||
|
m_nStatus = MCH_SIM_ST.UI_STOP
|
||||||
|
m_bPlay = False
|
||||||
|
PlayPauseBtn_Click(Nothing, Nothing)
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
' Elimino eventuale attrezzaggio da OmagOFFICE
|
||||||
@@ -669,6 +718,26 @@ Public Class SimulationPageUC
|
|||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
End If
|
End If
|
||||||
|
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
|
||||||
|
If bOk And IsPressedShiftKey Then
|
||||||
|
Try
|
||||||
|
Process.Start("Notepad.exe", sCncPath)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.ToString)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
' ricarico la pagina di simulazione
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
' nascondo i pezzi in parcheggio
|
||||||
|
HideParkedParts(True)
|
||||||
|
' Avvio ambiente di simulazione
|
||||||
|
EgtSimInit()
|
||||||
|
EgtSimStart()
|
||||||
|
' Imposto stato corrente
|
||||||
|
SetStatus(MCH_SIM_ST.UI_STOP)
|
||||||
|
m_bPlay = True
|
||||||
|
' Costringo ad aggiornare UI
|
||||||
|
UpdateUI()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
||||||
|
|||||||
@@ -1,8 +1,41 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Diagnostics
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
|
Imports System.Text.RegularExpressions
|
||||||
|
Imports EgtWPFLib
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
|
||||||
Module Utility
|
Module Utility
|
||||||
|
|
||||||
|
'--------------------------------------------------------------------------------------------------
|
||||||
|
#Region "COMPO SOLID3d"
|
||||||
|
|
||||||
|
Friend Function CreateSolid3D(sIniFile As String) As Boolean
|
||||||
|
EgtSaveFile("C:\EgtData\OmagCUT\Temp\Ribasso.nge", NGE.TEXT)
|
||||||
|
Dim bOk As Boolean = False
|
||||||
|
Dim dRawHeight As Double = GetPrivateProfileDouble(S_RAWPART, K_RAWHEIGHT, 30, sIniFile)
|
||||||
|
' se abilitato e dimensione solido da sotto: creo il solido
|
||||||
|
Dim sPathSOLID As String = String.Empty
|
||||||
|
If GetPrivateProfileString(S_SIDES, "CreateSOLID", "", sPathSOLID, sIniFile) <> 0 And
|
||||||
|
GetPrivateProfileInt(S_SIDES, K_SIZEALWAYSONTOP, 0, sIniFile) = 0 Then
|
||||||
|
' Recupero file LUA
|
||||||
|
EgtLuaExecFile(sPathSOLID)
|
||||||
|
Dim dThick As Double = dRawHeight
|
||||||
|
EgtLuaSetGlobNumVar("CMP.THICK", dThick)
|
||||||
|
bOk = EgtLuaExecLine("CMP_Draw(false)")
|
||||||
|
Dim nErr As Integer = 0
|
||||||
|
EgtLuaGetGlobIntVar("CMP.ERR", nErr)
|
||||||
|
' Reset lua
|
||||||
|
EgtLuaResetGlobVar("CMP")
|
||||||
|
Else
|
||||||
|
EgtOutLog("CreateSolid3d Failed: file '" & sPathSOLID & "' not found or parameter 'SizeAlwaysOnTop' is TRUE")
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region ' Compo Solid3d
|
||||||
|
'--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Friend Function CompoColor(sIniFile As String) As Color3d
|
Friend Function CompoColor(sIniFile As String) As Color3d
|
||||||
Dim InsertColor As New Color3d(89, 210, 210, 25)
|
Dim InsertColor As New Color3d(89, 210, 210, 25)
|
||||||
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
|
Dim IndexColor As Integer = GetPrivateProfileInt(S_COMPO, K_LASTCOLOR, 1, sIniFile)
|
||||||
@@ -15,15 +48,170 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Friend StopWatch As Stopwatch
|
||||||
|
|
||||||
|
Friend Sub TimeSpanInit()
|
||||||
|
StopWatch = New Stopwatch
|
||||||
|
StopWatch.Start()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend Function TimeSpanEnd()
|
||||||
|
Dim sTime As String = ""
|
||||||
|
If Not IsNothing(StopWatch) Then
|
||||||
|
StopWatch.Stop()
|
||||||
|
Dim ts As TimeSpan = StopWatch.Elapsed
|
||||||
|
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
|
||||||
|
End If
|
||||||
|
Return sTime
|
||||||
|
End Function
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------------------------
|
||||||
Friend Sub UpdateUI()
|
Friend Sub UpdateUI()
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
Dim nDummy As Integer
|
Dim nDummy As Integer
|
||||||
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
|
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background,
|
||||||
New Action(Function() nDummy = 0))
|
New Action(Function() nDummy = 0))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------------------------
|
||||||
|
#Region "INCHES FRACTIONS"
|
||||||
|
'Enum FractionPattern
|
||||||
|
' None
|
||||||
|
' Feet_Inches
|
||||||
|
' Inches
|
||||||
|
'End Enum
|
||||||
|
|
||||||
|
'' seleziona il tipo di Pattern con cui stamoare i dati
|
||||||
|
Friend nCurrFractionPattern As FractionStringConverter.FractionPattern = FractionPattern.Feet_Inches
|
||||||
|
Friend dPrecision As Double = 64
|
||||||
|
|
||||||
|
'Friend Function StringFractionToStringDecimal(dVal As Double, dBase As Double) As String
|
||||||
|
' Dim sSign As String = String.Empty
|
||||||
|
' If dVal < 0 Then
|
||||||
|
' sSign = "-"
|
||||||
|
' dVal = Math.Abs(dVal)
|
||||||
|
' End If
|
||||||
|
' Dim sFraction As String = String.Empty
|
||||||
|
' ' integer and decima part of the value
|
||||||
|
' Dim dInteger As Double = Math.Floor(dVal)
|
||||||
|
' Dim dFraction As Double = dVal - dInteger
|
||||||
|
' ' the nearest decimal numerator
|
||||||
|
' Dim dNumeretor As Double = dFraction * dBase
|
||||||
|
' Dim dRound As Double = Math.Round(dNumeretor)
|
||||||
|
' ' estimates the irreducible fraction
|
||||||
|
' If dRound = 0 Then
|
||||||
|
' ' no decimal part
|
||||||
|
' ElseIf dRound = dBase Then
|
||||||
|
' ' no decimal part
|
||||||
|
' dInteger = dInteger + 1
|
||||||
|
' Else
|
||||||
|
' ' simplify fraction
|
||||||
|
' While dRound Mod 2 = 0
|
||||||
|
' dRound = dRound / 2
|
||||||
|
' dBase = dBase / 2
|
||||||
|
' End While
|
||||||
|
' sFraction = DoubleToString(dRound, 0) & "/" & DoubleToString(dBase, 0)
|
||||||
|
' End If
|
||||||
|
' ' sVal: dFeet'dInteger"sFraction --- dInteger sFraction
|
||||||
|
' Return WriteFraction(dInteger, sFraction)
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'' trasforma il valore da pollici a piedi
|
||||||
|
'Private Sub ConvertInchesToFeet(ByRef dFeet As Double, ByRef dInches As Double)
|
||||||
|
' If dInches = 0 Then Return
|
||||||
|
' While dInches - 12 >= 0
|
||||||
|
' dFeet = dFeet + 1
|
||||||
|
' dInches = dInches - 12
|
||||||
|
' End While
|
||||||
|
'End Sub
|
||||||
|
|
||||||
|
'' stampa dati in funzione del pattern dichiarato
|
||||||
|
'Private Function WriteFraction(ByVal dInches As Double, sFraction As String) As String
|
||||||
|
' Dim sVal As String = String.Empty
|
||||||
|
' Select Case nCurrFractionPattern
|
||||||
|
' Case FractionPattern.Feet_Inches
|
||||||
|
' Dim dFeet As Double = 0
|
||||||
|
' ConvertInchesToFeet(dFeet, dInches)
|
||||||
|
' If dFeet > 0 Then
|
||||||
|
' sVal = String.Format("{0}'{1}""{2}", DoubleToString(dFeet, 0), DoubleToString(dInches, 0), sFraction).Trim
|
||||||
|
' Else
|
||||||
|
' sVal = String.Format("{0}""{1}", DoubleToString(dInches, 0), sFraction).Trim
|
||||||
|
' End If
|
||||||
|
' Case FractionPattern.Inches
|
||||||
|
' sVal = DoubleToString(dInches, 0) & " " & sFraction
|
||||||
|
' sVal = String.Format("{0}""{1}", DoubleToString(dInches, 0), sFraction).Trim
|
||||||
|
' End Select
|
||||||
|
' Return sVal
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
'' riceve la stringa sorgente e restituisce la nuova strunga in formato decimale (senza eseguire conversioni di unità)
|
||||||
|
'Friend Function StringFractionToDouble(sVal As String, ByRef sValConverted As String) As Boolean
|
||||||
|
' Dim dVal As Double = 0
|
||||||
|
' ' dato in ingresso: sVal = 2'3"23/32
|
||||||
|
' Dim sFeet As String = String.Empty
|
||||||
|
' Dim sFeetPattern As String = "^.*?(?=')"
|
||||||
|
' Dim dFeet As Double = 0
|
||||||
|
' Dim bOkFeet As Boolean = True
|
||||||
|
' Dim bFeetExists As Boolean = False
|
||||||
|
' Dim sInch As String = String.Empty
|
||||||
|
' Dim sInchPattern As String = "(?<=')(.*?)(?="")" ' se la stringa contiene l'apice singolo
|
||||||
|
' Dim sInchPattern1 As String = "(.*?)(?="")" ' se la stringa NON contiene l'apice singolo
|
||||||
|
' Dim dInch As Double = 0
|
||||||
|
' Dim bOkInch As Boolean = True
|
||||||
|
' Dim bInchExists As Boolean = False
|
||||||
|
' Dim sFraction As String = String.Empty
|
||||||
|
' Dim sFractionPattern As String = "(?<="")(.*)" ' se la stringa contiene l'apice doppio
|
||||||
|
' Dim sFractionPattern1 As String = "(?<=')(.*)" ' se la stringa NON contiene l'apice doppio ma solo quello singolo
|
||||||
|
' Dim dFraction As Double = 0
|
||||||
|
' Dim bOkFraction As Boolean = True
|
||||||
|
' Dim bFractionExists As Boolean = False
|
||||||
|
|
||||||
|
' ' recupero il valore di Feet (2')
|
||||||
|
' Dim sMyMatch As String = Regex.Match(sVal, sFeetPattern).Groups(1).Value
|
||||||
|
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||||
|
' sFeet = sMyMatch.Trim
|
||||||
|
' bOkFeet = StringToDouble(sFeet, dFeet)
|
||||||
|
' bFeetExists = True
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ' recupero il valore di Inch (3") dopo i Feet - oppure direttamente i pollici
|
||||||
|
' If bFeetExists Then
|
||||||
|
' sMyMatch = Regex.Match(sVal, sInchPattern).Groups(1).Value
|
||||||
|
' Else
|
||||||
|
' sMyMatch = Regex.Match(sVal, sInchPattern1).Groups(1).Value
|
||||||
|
' End If
|
||||||
|
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||||
|
' sInch = sMyMatch.Trim
|
||||||
|
' bOkInch = StringToDouble(sInch, dInch)
|
||||||
|
' bInchExists = True
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ' recupero il valore frazionario (23/32) dopo i pollici - oppure dopo i feet - oppure direttamente i valore inteso come pollici
|
||||||
|
' If bInchExists Then
|
||||||
|
' sMyMatch = Regex.Match(sVal, sFractionPattern).Groups(1).Value
|
||||||
|
' ElseIf bFeetExists And Not bInchExists Then
|
||||||
|
' sMyMatch = Regex.Match(sVal, sFractionPattern1).Groups(1).Value
|
||||||
|
' ElseIf Not bFeetExists And Not bInchExists Then
|
||||||
|
' sMyMatch = sVal
|
||||||
|
' End If
|
||||||
|
' If Not String.IsNullOrEmpty(sMyMatch) Or Not String.IsNullOrWhiteSpace(sMyMatch) Then
|
||||||
|
' sFraction = sMyMatch
|
||||||
|
' bOkFraction = StringToDouble(sFraction, dFraction)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ' calcolo il valore decimale dell'espressione
|
||||||
|
' If bOkFeet And bOkInch And bOkFraction Then
|
||||||
|
' dVal = dFeet / 12 + dInch + dFraction
|
||||||
|
' sValConverted = DoubleToString(dVal, 4)
|
||||||
|
' Return True
|
||||||
|
' Else
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
#End Region ' Inches Fraction
|
||||||
|
'--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Friend Function DoubleToString(dVal As Double, nNumDec As Integer) As String
|
Friend Function DoubleToString(dVal As Double, nNumDec As Integer) As String
|
||||||
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
|
Dim sFormat As String = "F" + Math.Abs(nNumDec).ToString()
|
||||||
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
|
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
|
||||||
@@ -46,12 +234,28 @@ Module Utility
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function LenToString(dVal As Double, nNumDec As Integer) As String
|
' conerte il dato (in mm) in stringa nell'unità corrente
|
||||||
Return DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
Friend Function LenToString(dVal As Double, nNumDec As Integer, Optional ByVal bForceToDecimal As Boolean = False) As String
|
||||||
|
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||||
|
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
|
||||||
|
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
|
||||||
|
' conevrto il dato corrente in decimale
|
||||||
|
Dim dCurrVal As Double = dVal
|
||||||
|
StringToDouble(sVal, dCurrVal)
|
||||||
|
Return DoubleToStringFraction(dCurrVal, dPrecision)
|
||||||
|
End If
|
||||||
|
Return sVal
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function StringToLen(sVal As String, ByRef dVal As Double) As Boolean
|
Friend Function StringToLen(sVal As String, ByRef dVal As Double, Optional ByVal bForceToDecimal As Boolean = False) As Boolean
|
||||||
If String.IsNullOrEmpty(sVal) Then Return False
|
If String.IsNullOrEmpty(sVal) Then Return False
|
||||||
|
|
||||||
|
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
|
||||||
|
Dim sValSource As String = sVal
|
||||||
|
' conevrto la stringa in formato decimale (sempre in stringa)
|
||||||
|
StringFractionToStringDecimal(sValSource, sVal)
|
||||||
|
End If
|
||||||
|
|
||||||
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
If EgtLuaEvalNumExpr(sVal, dVal) Then
|
||||||
dVal = EgtFromUiUnits(dVal)
|
dVal = EgtFromUiUnits(dVal)
|
||||||
Return True
|
Return True
|
||||||
@@ -192,20 +396,20 @@ Module Utility
|
|||||||
If bOldEnMod Then EgtEnableModified()
|
If bOldEnMod Then EgtEnableModified()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function SetTextColor( nGroup As Integer) As Boolean
|
Friend Function SetTextColor(nGroup As Integer) As Boolean
|
||||||
' Recupero il colore da assegnare ai testi
|
' Recupero il colore da assegnare ai testi
|
||||||
Dim colText As New Color3d( 0, 0, 0)
|
Dim colText As New Color3d(0, 0, 0)
|
||||||
Dim sTextColor As String = " "
|
Dim sTextColor As String = " "
|
||||||
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Dim MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
|
If GetPrivateProfileString(S_NEST, K_TEXTCOLOR, " ", sTextColor, MainWindow.GetIniFile()) <> 0 Then
|
||||||
Dim sTextColorArray() As String = sTextColor.Split(",")
|
Dim sTextColorArray() As String = sTextColor.Split(",")
|
||||||
Dim nRed As Integer = 0 : Integer.TryParse( sTextColorArray(0), nRed)
|
Dim nRed As Integer = 0 : Integer.TryParse(sTextColorArray(0), nRed)
|
||||||
Dim nGreen As Integer = 0 : Integer.TryParse( sTextColorArray(1), nGreen)
|
Dim nGreen As Integer = 0 : Integer.TryParse(sTextColorArray(1), nGreen)
|
||||||
Dim nBlue As Integer = 0 : Integer.TryParse( sTextColorArray(2), nBlue)
|
Dim nBlue As Integer = 0 : Integer.TryParse(sTextColorArray(2), nBlue)
|
||||||
colText.Setup( nRed, nGreen, nBlue)
|
colText.Setup(nRed, nGreen, nBlue)
|
||||||
End If
|
End If
|
||||||
' Assegno questo colore ai testi del layer indicato
|
' Assegno questo colore ai testi del layer indicato
|
||||||
Dim nId As Integer = EgtGetFirstInGroup( nGroup)
|
Dim nId As Integer = EgtGetFirstInGroup(nGroup)
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
|
If EgtGetType(nId) = GDB_TY.EXT_TEXT Then
|
||||||
EgtSetColor(nId, colText)
|
EgtSetColor(nId, colText)
|
||||||
@@ -215,62 +419,62 @@ Module Utility
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function AddTopToPartRegion( nRegId As Integer) As Boolean
|
Friend Function AddTopToPartRegion(nRegId As Integer) As Boolean
|
||||||
Dim frReg As New Frame3d : EgtGetGroupGlobFrame( nRegId, frReg)
|
Dim frReg As New Frame3d : EgtGetGroupGlobFrame(nRegId, frReg)
|
||||||
Dim b3Reg As New BBox3d : EgtGetBBoxGlob( nRegId, GDB_BB.STANDARD, b3Reg)
|
Dim b3Reg As New BBox3d : EgtGetBBoxGlob(nRegId, GDB_BB.STANDARD, b3Reg)
|
||||||
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30)
|
Dim dH As Double = Math.Min(0.1 * b3Reg.DimY(), 30)
|
||||||
Dim ptIns As New Point3d( b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
Dim ptIns As New Point3d(b3Reg.Center().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
||||||
ptIns.ToLoc( frReg)
|
ptIns.ToLoc(frReg)
|
||||||
Dim nSfrId As Integer = EgtGetFirstInGroup( nRegId)
|
Dim nSfrId As Integer = EgtGetFirstInGroup(nRegId)
|
||||||
While nSfrId <> GDB_ID.NULL
|
While nSfrId <> GDB_ID.NULL
|
||||||
If EgtGetType( nSfrId) = GDB_TY.SRF_FRGN Then Exit While
|
If EgtGetType(nSfrId) = GDB_TY.SRF_FRGN Then Exit While
|
||||||
nSfrId = EgtGetNext( nSfrId)
|
nSfrId = EgtGetNext(nSfrId)
|
||||||
End While
|
End While
|
||||||
If nSfrId <> GDB_ID.NULL Then
|
If nSfrId <> GDB_ID.NULL Then
|
||||||
Dim ptStart As New Point3d ( b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
Dim ptStart As New Point3d(b3Reg.Min().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
||||||
ptStart.ToLoc( frReg)
|
ptStart.ToLoc(frReg)
|
||||||
Dim ptEnd As New Point3d ( b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
Dim ptEnd As New Point3d(b3Reg.Max().x, b3Reg.Max().y - dH, b3Reg.Max().z)
|
||||||
ptEnd.ToLoc( frReg)
|
ptEnd.ToLoc(frReg)
|
||||||
Dim nLineId As Integer = EgtCreateLine( nRegId, ptStart, ptEnd)
|
Dim nLineId As Integer = EgtCreateLine(nRegId, ptStart, ptEnd)
|
||||||
Dim nCount As Integer = 0
|
Dim nCount As Integer = 0
|
||||||
Dim nNewId As Integer = EgtTrimCurveWithRegion( nLineId, nSfrId, True, False, nCount)
|
Dim nNewId As Integer = EgtTrimCurveWithRegion(nLineId, nSfrId, True, False, nCount)
|
||||||
If nNewId <> GDB_ID.NULL Then
|
If nNewId <> GDB_ID.NULL Then
|
||||||
If nCount > 0 Then EgtMidPoint( nNewId, ptIns)
|
If nCount > 0 Then EgtMidPoint(nNewId, ptIns)
|
||||||
For nTmpId As Integer = nNewId To nNewId + nCount - 1
|
For nTmpId As Integer = nNewId To nNewId + nCount - 1
|
||||||
EgtErase( nTmpId)
|
EgtErase(nTmpId)
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
EgtErase( nLineId)
|
EgtErase(nLineId)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Dim vtDir As New Vector3d( 1, 0, 0)
|
Dim vtDir As New Vector3d(1, 0, 0)
|
||||||
vtDir.ToLoc( frReg)
|
vtDir.ToLoc(frReg)
|
||||||
Dim dLen, dAngV, dAngH As Double
|
Dim dLen, dAngV, dAngH As Double
|
||||||
vtDir.ToSpherical( dLen, dAngV, dAngH)
|
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
||||||
Dim nText As Integer = EgtCreateTextAdv(nRegId, ptIns, dAngH, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
Dim nText As Integer = EgtCreateTextAdv(nRegId, ptIns, dAngH, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
||||||
Return ( nText <> GDB_ID.NULL)
|
Return (nText <> GDB_ID.NULL)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function SetBlockAndSlabNbr( sBlock As String, sSlabNbr As String) As Boolean
|
Friend Function SetBlockAndSlabNbr(sBlock As String, sSlabNbr As String) As Boolean
|
||||||
Dim nRawId As Integer = GetCurrentRaw()
|
Dim nRawId As Integer = GetCurrentRaw()
|
||||||
If nRawId = GDB_ID.NULL Then Return False
|
If nRawId = GDB_ID.NULL Then Return False
|
||||||
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
|
If String.IsNullOrWhiteSpace(sBlock) Then sSlabNbr = ""
|
||||||
' Assegno info
|
' Assegno info
|
||||||
EgtSetInfo( nRawId, INFO_RAW_BLOCK, sBlock)
|
EgtSetInfo(nRawId, INFO_RAW_BLOCK, sBlock)
|
||||||
EgtSetInfo( nRawId, INFO_RAW_SLABNBR, sSlabNbr)
|
EgtSetInfo(nRawId, INFO_RAW_SLABNBR, sSlabNbr)
|
||||||
' Cancello eventuale vecchio BarCode
|
' Cancello eventuale vecchio BarCode
|
||||||
EgtErase( EgtGetFirstNameInGroup( nRawId, NAME_BARCODE))
|
EgtErase(EgtGetFirstNameInGroup(nRawId, NAME_BARCODE))
|
||||||
' Se definito, inserisco nuovo BarCode
|
' Se definito, inserisco nuovo BarCode
|
||||||
Dim sBarCode As String = sBlock & " - " & sSlabNbr
|
Dim sBarCode As String = sBlock & " - " & sSlabNbr
|
||||||
If sBarCode <> " - " Then
|
If sBarCode <> " - " Then
|
||||||
Dim ptRawCen As Point3d
|
Dim ptRawCen As Point3d
|
||||||
GetRawCenter( ptRawCen)
|
GetRawCenter(ptRawCen)
|
||||||
Dim ptRawMin, ptRawMax As Point3d
|
Dim ptRawMin, ptRawMax As Point3d
|
||||||
GetRawBox( ptRawMin, ptRawMax)
|
GetRawBox(ptRawMin, ptRawMax)
|
||||||
Dim ptText As New Point3d( ptRawCen.x, ptRawCen.y, ptRawMax.z)
|
Dim ptText As New Point3d(ptRawCen.x, ptRawCen.y, ptRawMax.z)
|
||||||
Dim nText As Integer = EgtCreateTextAdv( nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
|
Dim nText As Integer = EgtCreateTextAdv(nRawId, ptText, 0, sBarCode, "", 500, False, 50.0, 1, 0, INS_POS.MC, GDB_RT.GLOB)
|
||||||
EgtSetName( nText, NAME_BARCODE)
|
EgtSetName(nText, NAME_BARCODE)
|
||||||
EgtSetColor( nText, New Color3d(255, 0, 0))
|
EgtSetColor(nText, New Color3d(255, 0, 0))
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
@@ -306,7 +510,7 @@ Module Utility
|
|||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Function GetPrivateProfileLanguage( lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||||
Dim sVal As String = String.Empty
|
Dim sVal As String = String.Empty
|
||||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||||
@@ -373,4 +577,40 @@ Module Utility
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub GetMillFromMilling(ByRef sCurrMill As String, ByVal sCurrMilling As String)
|
||||||
|
If String.IsNullOrEmpty(sCurrMill) Or String.IsNullOrWhiteSpace(sCurrMill) Then
|
||||||
|
' creo l'elenco degli utensili di foratura
|
||||||
|
Dim sToolName As String = String.Empty
|
||||||
|
Dim nType As Integer = MCH_TY.NONE
|
||||||
|
Dim MillToolList As New ObservableCollection(Of String)
|
||||||
|
MillToolList.Clear()
|
||||||
|
If EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType) Then
|
||||||
|
MillToolList.Add(sToolName)
|
||||||
|
While EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
|
||||||
|
MillToolList.Add(sToolName)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
' recupero l'utensile associato alla lavorazione
|
||||||
|
'Dim sCurrDrilling As String = m_MainWindow.m_CurrentMachine.sCurrDrilling
|
||||||
|
Dim ToolString As String = String.Empty
|
||||||
|
EgtMdbSetCurrMachining(sCurrMilling)
|
||||||
|
' Recupero nome utensile tramite TUUID
|
||||||
|
Dim sTuuid As String = String.Empty
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||||
|
EgtTdbGetToolFromUUID(sTuuid, ToolString)
|
||||||
|
Dim bToolExist As Boolean = False
|
||||||
|
For Each CurrTool As IEnumerable In MillToolList
|
||||||
|
If CurrTool.ToString() = ToolString Then
|
||||||
|
bToolExist = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If bToolExist Then
|
||||||
|
sCurrMill = ToolString
|
||||||
|
Else
|
||||||
|
sCurrMill = String.Empty
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
|
|||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports OmagCUT.VeinMatchingWindow
|
||||||
|
|
||||||
Public Class VeinMatchingWindow
|
Public Class VeinMatchingWindow
|
||||||
|
|
||||||
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
|
|||||||
Private m_nIdToSel As Integer = GDB_ID.NULL
|
Private m_nIdToSel As Integer = GDB_ID.NULL
|
||||||
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
Enum ALETTE
|
||||||
|
F = 2
|
||||||
|
A = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||||
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||||
VeinMatchingSceneHost.Child = VeinMatchingScene
|
VeinMatchingSceneHost.Child = VeinMatchingScene
|
||||||
@@ -364,19 +370,21 @@ Friend Module VeinMatching
|
|||||||
' Imposto il contesto del progetto
|
' Imposto il contesto del progetto
|
||||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
' Riattivo il gruppo di lavoro
|
' Riattivo il gruppo di lavoro
|
||||||
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
|
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
|
||||||
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
|
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
|
||||||
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
|
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
' Dichiaro pezzo nel grezzo per VM
|
' Dichiaro pezzo nel grezzo per VM
|
||||||
VeinMatching.OnInsertPartInRaw( nId)
|
VeinMatching.OnInsertPartInRaw(nId)
|
||||||
' Passo al pezzo successivo
|
' Passo al pezzo successivo
|
||||||
nId = EgtGetNextPartInRawPart(nId)
|
nId = EgtGetNextPartInRawPart(nId)
|
||||||
End While
|
End While
|
||||||
' Ripristino visualizzazione di eventuali pezzi in parcheggio
|
' Ripristino visualizzazione di eventuali pezzi in parcheggio
|
||||||
ShowParkedParts()
|
ShowParkedParts()
|
||||||
' Ripristino il contesto corrente
|
' Ripristino il contesto corrente
|
||||||
EgtSetCurrentContext( nCurrCtx)
|
EgtSetCurrentContext(nCurrCtx)
|
||||||
|
|
||||||
|
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -422,11 +430,11 @@ Friend Module VeinMatching
|
|||||||
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
|
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
|
||||||
EgtSetStatus(nCurrId, GDB_ST.OFF)
|
EgtSetStatus(nCurrId, GDB_ST.OFF)
|
||||||
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
|
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
|
||||||
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig")
|
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
|
||||||
If nOutLoopOrig <> GDB_ID.NULL Then
|
If nOutLoopOrig <> GDB_ID.NULL Then
|
||||||
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
|
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
|
||||||
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
|
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
|
||||||
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
|
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
|
||||||
End If
|
End If
|
||||||
' Se necessario, ripristino il contesto originale
|
' Se necessario, ripristino il contesto originale
|
||||||
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
|
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
|
||||||
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||||
|
' A: alzatina, F: frontalino
|
||||||
Dim nType As Integer
|
Dim nType As Integer
|
||||||
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
||||||
|
|
||||||
Dim ptSRef, ptERef, ptE As Point3d
|
Dim ptSRef, ptERef, ptS, ptE As Point3d
|
||||||
|
' Piano cucina
|
||||||
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
||||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||||
|
' AlzFront
|
||||||
|
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
|
||||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||||
|
|
||||||
|
' vettore lato cucina
|
||||||
|
Dim vtRotRef As Vector3d = ptERef - ptSRef
|
||||||
|
' vettore lato AlzFront
|
||||||
|
Dim vtRot As Vector3d = ptE - ptS
|
||||||
|
|
||||||
' ruoto il solido intorno al lato di riferimento
|
' ruoto il solido intorno al lato di riferimento
|
||||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
If nType = ALETTE.A Then
|
||||||
If nType = 1 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
|
||||||
ElseIf nType = 2 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
||||||
|
ElseIf nType = ALETTE.F Then
|
||||||
|
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' punto di riferimento per la traslazione sul solido
|
' punto di riferimento per la traslazione sul solido
|
||||||
Dim ptSolid As Point3d
|
Dim ptSolid As Point3d
|
||||||
If nType = 1 Then
|
If nType = ALETTE.A Then
|
||||||
' cerco id della curva che definisce la front face
|
' cerco id della curva che definisce la front face
|
||||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
||||||
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
||||||
EgtStartPoint(nFrontCrvId, ptSolid)
|
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
|
||||||
ElseIf nType = 2 Then
|
ElseIf nType = ALETTE.F Then
|
||||||
EgtStartPoint(Item.SideId, ptSolid)
|
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ItemFrame As New Frame3d
|
' Dim ItemFrame As New Frame3d
|
||||||
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
||||||
ptSolid.ToGlob(ItemFrame)
|
' ptSolid.ToGlob(ItemFrame)
|
||||||
|
|
||||||
'punto di riferimento per la traslazione sul piano cucina
|
'punto di riferimento per la traslazione sul piano cucina
|
||||||
Dim ptKitchen As Point3d = ptERef
|
Dim ptKitchen As Point3d = ptERef
|
||||||
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
|
|||||||
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
||||||
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
||||||
|
|
||||||
|
' eventualmente ruoto per allineare l'alzatina al piano cucina
|
||||||
|
Dim dLRef, dAngVRef, dAngHRef As Double
|
||||||
|
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
|
||||||
|
Dim dL, dAngV, dAngH As Double
|
||||||
|
vtRot.Rotate(Vector3d.Z_AX, 180)
|
||||||
|
vtRot.ToSpherical(dL, dAngV, dAngH)
|
||||||
|
Dim dDelta As Double = dAngHRef - dAngH
|
||||||
|
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
|
||||||
|
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
|
|||||||
' Se necessario, cambio contesto
|
' Se necessario, cambio contesto
|
||||||
If m_nVeinCtx <> nCurrCtx Then
|
If m_nVeinCtx <> nCurrCtx Then
|
||||||
If EgtSetCurrentContext(m_nVeinCtx) Then
|
If EgtSetCurrentContext(m_nVeinCtx) Then
|
||||||
Return If( nCurrCtx > 0, nCurrCtx, -2)
|
Return If(nCurrCtx > 0, nCurrCtx, -2)
|
||||||
Else
|
Else
|
||||||
Return 0
|
Return 0
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -309,7 +309,8 @@ Public Class WorkInProgressPageUC
|
|||||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||||
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||||
If Not WorkInProgressScene.Init() Then
|
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
|
||||||
|
If Not WorkInProgressScene.Init() Or Not bProd Then
|
||||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||||
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
||||||
' Flag per riavvio programma
|
' Flag per riavvio programma
|
||||||
@@ -360,6 +361,7 @@ Public Class WorkInProgressPageUC
|
|||||||
#End If
|
#End If
|
||||||
m_MainWindow.Close()
|
m_MainWindow.Close()
|
||||||
If bRestart Then Process.Start( Application.ResourceAssembly.Location)
|
If bRestart Then Process.Start( Application.ResourceAssembly.Location)
|
||||||
|
Return True
|
||||||
End If
|
End If
|
||||||
' dimensione lineare max in pixel delle textures
|
' dimensione lineare max in pixel delle textures
|
||||||
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
||||||
|
|||||||