OmagCut :
- Miglioramento selezione utensili attivi in combobox.
This commit is contained in:
+34
-5
@@ -1,4 +1,5 @@
|
||||
Imports System.Windows.Threading
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
@@ -17,8 +18,8 @@ Public Class AlarmsPageUC
|
||||
|
||||
'Lista che contiene le lame disponibili (per Combobox pagina Alarms)
|
||||
Private m_SawList As New List(Of String)
|
||||
Private m_DrillList As New List(Of String)
|
||||
Private m_MillList As New List(Of String)
|
||||
Private m_DrillList As New ObservableCollection(Of String)
|
||||
Private m_MillList As New ObservableCollection(Of String)
|
||||
Private m_AuxToolTypeList As New List(Of StringIdCmBx)
|
||||
|
||||
Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs)
|
||||
@@ -114,12 +115,22 @@ Public Class AlarmsPageUC
|
||||
CurrMillCmBx.Visibility = Windows.Visibility.Hidden
|
||||
|
||||
If m_CurrentMachine.sCurrDrill <> String.Empty Then
|
||||
Dim sTempCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
|
||||
m_DrillList.Add("Nessuno")
|
||||
m_CurrentMachine.sCurrDrill = sTempCurrDrill
|
||||
CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill
|
||||
AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(1, m_AuxToolTypeList)
|
||||
CurrDrillTxBl.SetValue(Grid.RowProperty, 4)
|
||||
CurrDrillCmBx.SetValue(Grid.RowProperty, 5)
|
||||
CurrDrillTxBl.Visibility = Windows.Visibility.Visible
|
||||
CurrDrillCmBx.Visibility = Windows.Visibility.Visible
|
||||
ElseIf m_CurrentMachine.sCurrMill <> String.Empty Then
|
||||
Dim sTempCurrMill = m_CurrentMachine.sCurrMill
|
||||
CreateToolList(MCH_TF.MILL, m_MillList)
|
||||
m_MillList.Add("Nessuno")
|
||||
m_CurrentMachine.sCurrMill = sTempCurrMill
|
||||
CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill
|
||||
AuxiliaryToolCmBx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(2, m_AuxToolTypeList)
|
||||
CurrMillTxBl.Visibility = Windows.Visibility.Visible
|
||||
CurrMillCmBx.Visibility = Windows.Visibility.Visible
|
||||
@@ -177,8 +188,11 @@ Public Class AlarmsPageUC
|
||||
m_CurrentMachine.sCurrDrill = String.Empty
|
||||
m_CurrentMachine.sCurrMill = String.Empty
|
||||
Case 1
|
||||
Dim sTempCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
|
||||
m_DrillList.Add("Nessuno")
|
||||
m_CurrentMachine.sCurrDrill = sTempCurrDrill
|
||||
CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill
|
||||
CurrDrillTxBl.SetValue(Grid.RowProperty, 4)
|
||||
CurrDrillCmBx.SetValue(Grid.RowProperty, 5)
|
||||
If m_CurrentMachine.sCurrDrill = String.Empty Then
|
||||
@@ -192,8 +206,11 @@ Public Class AlarmsPageUC
|
||||
CurrMillTxBl.Visibility = Windows.Visibility.Hidden
|
||||
CurrMillCmBx.Visibility = Windows.Visibility.Hidden
|
||||
Case 2
|
||||
Dim sTempCurrMill = m_CurrentMachine.sCurrMill
|
||||
CreateToolList(MCH_TF.MILL, m_MillList)
|
||||
m_MillList.Add("Nessuna")
|
||||
m_MillList.Add("Nessuno")
|
||||
m_CurrentMachine.sCurrMill = sTempCurrMill
|
||||
CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill
|
||||
If m_CurrentMachine.sCurrMill = String.Empty Then
|
||||
CurrMillCmBx.SelectedItem = "Nessuna"
|
||||
Else
|
||||
@@ -237,8 +254,20 @@ Public Class AlarmsPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CreateToolList(ToolType As Integer, ToolList As List(Of String))
|
||||
'SawList.Clear()
|
||||
Private Overloads Sub CreateToolList(ToolType As Integer, ToolList As ObservableCollection(Of String))
|
||||
ToolList.Clear()
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
If EgtTdbGetFirstTool(ToolType, ToolName, nType) Then
|
||||
ToolList.Add(ToolName)
|
||||
While EgtTdbGetNextTool(ToolType, ToolName, nType)
|
||||
ToolList.Add(ToolName)
|
||||
End While
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Overloads Sub CreateToolList(ToolType As Integer, ToolList As List(Of String))
|
||||
ToolList.Clear()
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim nType As Integer = MCH_TY.NONE
|
||||
If EgtTdbGetFirstTool(ToolType, ToolName, nType) Then
|
||||
|
||||
+12
-2
@@ -1,4 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ChooseMachining
|
||||
|
||||
@@ -349,7 +350,16 @@ Class StringIdCmBx
|
||||
Private m_nId As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Friend Shared Function FromIdToStringIdCmBx(nId As Integer, List As List(Of StringIdCmBx)) As StringIdCmBx
|
||||
Friend Overloads Shared Function FromIdToStringIdCmBx(nId As Integer, List As List(Of StringIdCmBx)) As StringIdCmBx
|
||||
For Each Item In List
|
||||
If Item.nId = nId Then
|
||||
Return Item
|
||||
End If
|
||||
Next
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Friend Overloads Shared Function FromIdToStringIdCmBx(nId As Integer, List As ObservableCollection(Of StringIdCmBx)) As StringIdCmBx
|
||||
For Each Item In List
|
||||
If Item.nId = nId Then
|
||||
Return Item
|
||||
|
||||
@@ -67,6 +67,8 @@ Module ConstGen
|
||||
Public Const NAME_OUTKERF As String = "SheetOut"
|
||||
' Chiave per definizione del grezzo per punti
|
||||
Public Const KEY_RAWBYPOINTS As String = "Rbp"
|
||||
' Nome del contorno di dell'area rovinata
|
||||
Public Const NAME_DAMAGED As String = "Damaged"
|
||||
|
||||
' Contrassegno di progetto OmagCut
|
||||
Public Const NAME_PROJMARK As String = "OmagCut"
|
||||
|
||||
@@ -26,6 +26,12 @@ Public Class MachineCNPageUC
|
||||
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
||||
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
|
||||
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, "0", m_MainWindow.GetIniFile()) = 1 Then
|
||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
+2
-2
@@ -113,8 +113,8 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="NewBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="DeleteBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<ToggleButton Name="NewBtn" Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
<ToggleButton Name="DeleteBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
+61
-19
@@ -13,8 +13,10 @@ Public Class RawPartPageUC
|
||||
Private m_bActive As Boolean = False
|
||||
' Tipo definizione rettangolo/per punti
|
||||
Private m_bRectangle As Boolean = False
|
||||
' Modalità operazione su punti
|
||||
' Modalità operazione su punti grezzo
|
||||
Private m_nPtMode As PTMODE = PTMODE.MOVE
|
||||
' Modalità operazione su punti aree danneggiate
|
||||
Private m_nPtDmgArMode As PTMODE = PTMODE.MOVE
|
||||
' Dati per Drag
|
||||
Private m_bDrag As Boolean = False
|
||||
Private m_ptPrev As Point3d
|
||||
@@ -36,7 +38,9 @@ Public Class RawPartPageUC
|
||||
Private m_RawKerf As Double = 0
|
||||
|
||||
' Costante minima dimensione del grezzo
|
||||
Private MIN_RAW_DIM As Double = 10
|
||||
Private Const MIN_RAW_DIM As Double = 10
|
||||
' Distanza di sicurezza del grezzo dal bordo
|
||||
Private Const SAFE_RAW_DIST As Double = 5
|
||||
' Costanti modo operazione punti
|
||||
Private Enum PTMODE
|
||||
MOVE = 0
|
||||
@@ -199,13 +203,25 @@ Public Class RawPartPageUC
|
||||
EgtSetObjFilterForSelect(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, 2 * Scene.DIM_SEL, 2 * Scene.DIM_SEL, nSel)
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
If nSolidId <> GDB_ID.NULL And nId = nSolidId Then
|
||||
' Ricavo nome dell'entità selezionata
|
||||
Dim sName As String = String.Empty
|
||||
EgtGetName(EgtGetFirstObjInSelWin(), sName)
|
||||
While sName <> String.Empty
|
||||
If sName = NAME_RAW_SOLID Then
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||
m_nDragEnt = -1
|
||||
m_dDragPar = -1
|
||||
ElseIf nKerfId <> GDB_ID.NULL And nId = nKerfId Then
|
||||
ElseIf sName = NAME_KERF Then
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||
Dim dDist, dU As Double
|
||||
If Not EgtGetMinDistPointCurve(m_ptPrev.Loc(nKerfId), nKerfId, dDist, dU) Then
|
||||
m_bDrag = False
|
||||
End If
|
||||
m_nDragEnt = Math.Ceiling(dU)
|
||||
m_dDragPar = dU
|
||||
' Privilegio il kerf, pertanto esco
|
||||
Exit While
|
||||
ElseIf sName = NAME_DAMAGED Then
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||
Dim dDist, dU As Double
|
||||
If Not EgtGetMinDistPointCurve(m_ptPrev.Loc(nKerfId), nKerfId, dDist, dU) Then
|
||||
@@ -216,7 +232,7 @@ Public Class RawPartPageUC
|
||||
' Privilegio il kerf, pertanto esco
|
||||
Exit While
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
EgtGetName(EgtGetNextObjInSelWin(), sName)
|
||||
End While
|
||||
' se drag e modalità punti
|
||||
If m_bDrag And Not m_bRectangle Then
|
||||
@@ -342,10 +358,10 @@ Public Class RawPartPageUC
|
||||
' Se non selezionata entità del kerf, esco
|
||||
If m_nDragEnt = -1 Then Return
|
||||
' Limito il punto a stare nella tavola con franco pari al kerf
|
||||
If ptCurr.x < m_ptTableMin.x + m_RawKerf Then ptCurr.x = m_ptTableMin.x + m_RawKerf
|
||||
If ptCurr.y < m_ptTableMin.y + m_RawKerf Then ptCurr.y = m_ptTableMin.y + m_RawKerf
|
||||
If ptCurr.x > m_ptTableMin.x + m_dTableLength - m_RawKerf Then ptCurr.x = m_ptTableMin.x + m_dTableLength - m_RawKerf
|
||||
If ptCurr.y > m_ptTableMin.y + m_dTableWidth - m_RawKerf Then ptCurr.y = m_ptTableMin.y + m_dTableWidth - m_RawKerf
|
||||
If ptCurr.x < m_ptTableMin.x + m_RawKerf Then ptCurr.x = m_ptTableMin.x + m_RawKerf + SAFE_RAW_DIST
|
||||
If ptCurr.y < m_ptTableMin.y + m_RawKerf Then ptCurr.y = m_ptTableMin.y + m_RawKerf + SAFE_RAW_DIST
|
||||
If ptCurr.x > m_ptTableMin.x + m_dTableLength - m_RawKerf Then ptCurr.x = m_ptTableMin.x + m_dTableLength - m_RawKerf - SAFE_RAW_DIST
|
||||
If ptCurr.y > m_ptTableMin.y + m_dTableWidth - m_RawKerf Then ptCurr.y = m_ptTableMin.y + m_dTableWidth - m_RawKerf - SAFE_RAW_DIST
|
||||
' Identificativo curva di kerf
|
||||
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
' Identifico il punto
|
||||
@@ -450,9 +466,20 @@ Public Class RawPartPageUC
|
||||
m_nPtMode = If(AddBtn.IsChecked, PTMODE.ADD, PTMODE.MOVE)
|
||||
Else
|
||||
Dim ptAcquired As Point3d
|
||||
AcquireLaserPoint(ptAcquired)
|
||||
If Not AcquireLaserPoint(ptAcquired) Then
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 32))
|
||||
End If
|
||||
' Limito il punto a stare nella tavola con franco pari al kerf
|
||||
If ptAcquired.x < m_RawKerf Then ptAcquired.x = m_RawKerf + SAFE_RAW_DIST
|
||||
If ptAcquired.y < m_RawKerf Then ptAcquired.y = m_RawKerf + SAFE_RAW_DIST
|
||||
If ptAcquired.x > m_dTableLength - m_RawKerf Then ptAcquired.x = m_dTableLength - m_RawKerf - SAFE_RAW_DIST
|
||||
If ptAcquired.y > m_dTableWidth - m_RawKerf Then ptAcquired.y = m_dTableWidth - m_RawKerf - SAFE_RAW_DIST
|
||||
' Aggiusto Z punto movimentato (è in locale al tavolo)
|
||||
ptAcquired.z = m_CurrProjPage.m_dAddTable + m_RawHeight
|
||||
'Porto il punto nel riferimento del grezzo
|
||||
Dim frRaw As New Frame3d
|
||||
EgtGetGroupGlobFrame(m_CurrProjPage.m_nRawId, frRaw)
|
||||
ptAcquired.LocToLoc(New Frame3d(m_ptTableMin), frRaw)
|
||||
If m_bptLast Then
|
||||
If Point3d.SameApprox(ptAcquired, m_ptLast) Then
|
||||
AddBtn.IsChecked = False
|
||||
@@ -474,32 +501,33 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AcquireLaserPoint(ByRef ptAcquired As Point3d)
|
||||
Private Function AcquireLaserPoint(ByRef ptAcquired As Point3d) As Boolean
|
||||
Dim ptTipP1 As Point3d
|
||||
' 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
|
||||
Return False
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = String.Empty
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, "", sSaw, m_MainWindow.GetMachIniFile())
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
Return False
|
||||
End If
|
||||
' Porto il tip nell'origine tavola
|
||||
ptAcquired = ptTipP1
|
||||
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
||||
End Sub
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub RemoveBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveBtn.Click
|
||||
If m_bRectangle Then
|
||||
@@ -906,7 +934,7 @@ Public Class RawPartPageUC
|
||||
If bProbingOk Then
|
||||
' Leggo spessore misurato
|
||||
Dim RawThicknessNameVar As String = String.Empty
|
||||
GetPrivateProfileString(S_MACH_PROBING, K_PROBINGSTATEVAR, "", RawThicknessNameVar, m_MainWindow.GetMachIniFile())
|
||||
GetPrivateProfileString(S_MACH_PROBING, K_RAWTHICKNESS, "", RawThicknessNameVar, m_MainWindow.GetMachIniFile())
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(RawThicknessNameVar, 1)
|
||||
Dim RawThickness As Double = 0
|
||||
@@ -1062,6 +1090,20 @@ Public Class RawPartPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click
|
||||
If m_bPointsFromDraw Then
|
||||
DeleteBtn.IsChecked = False
|
||||
m_nPtDmgArMode = If(NewBtn.IsChecked, PTMODE.ADD, PTMODE.MOVE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteBtn_Click(sender As Object, e As RoutedEventArgs) Handles DeleteBtn.Click
|
||||
If m_bPointsFromDraw Then
|
||||
NewBtn.IsChecked = False
|
||||
m_nPtDmgArMode = If(DeleteBtn.IsChecked, PTMODE.REMOVE, PTMODE.MOVE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user