diff --git a/MainWindow/MainWindowViewModel.vb b/MainWindow/MainWindowViewModel.vb
index 91ef606..a9bb623 100644
--- a/MainWindow/MainWindowViewModel.vb
+++ b/MainWindow/MainWindowViewModel.vb
@@ -29,7 +29,7 @@ Namespace EgtCAM5
' Event commands
' MainWindow ContentRendered Event
- Private m_Title As String
+ Private m_Title As String = String.Empty
Public Property Title As String
Get
Return m_Title
diff --git a/ProjectPage/DoorsPanel/DoorsPanelView.xaml b/ProjectPage/DoorsPanel/DoorsPanelView.xaml
index d9b4c47..c1f308a 100644
--- a/ProjectPage/DoorsPanel/DoorsPanelView.xaml
+++ b/ProjectPage/DoorsPanel/DoorsPanelView.xaml
@@ -13,7 +13,7 @@
-
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
index 96dd6a2..f9ff49e 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderView.xaml
@@ -36,7 +36,7 @@
-
+
diff --git a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
index 599fc6a..9c9a648 100644
--- a/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/DrawOptionPanel/ManageLayerExpander/ManageLayerExpanderViewModel.vb
@@ -343,7 +343,7 @@ Namespace EgtCAM5
Public ReadOnly Property TreeViewMouseUpCommand As ICommand
Get
If m_cmdTreeViewMouseUp Is Nothing Then
- m_cmdTreeViewMouseUp = New RelayCommand(AddressOf TreeViewMouseUp, AddressOf CanTreeViewMouseUp)
+ m_cmdTreeViewMouseUp = New RelayCommand(AddressOf TreeViewMouseUp)
End If
Return m_cmdTreeViewMouseUp
End Get
@@ -384,13 +384,6 @@ Namespace EgtCAM5
'End If
End Sub
- '''
- ''' Returns always true.
- '''
- Private Function CanTreeViewMouseUp(ByVal param As Object) As Boolean
- Return True
- End Function
-
#End Region ' TreeViewMouseUpCommand
#Region "SelectCommand"
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionParameterExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionParameterExpanderViewModel.vb
index f8b8987..a5acefe 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionParameterExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/DispositionParameterExpander/DispositionParameterExpanderViewModel.vb
@@ -251,6 +251,12 @@ Namespace EgtCAM5
End Get
End Property
+ Public ReadOnly Property OkMsg As String
+ Get
+ Return ""
+ End Get
+ End Property
+
#End Region ' Messages
' Definizione comandi
@@ -518,7 +524,7 @@ Namespace EgtCAM5
End If
End Sub
- Public Shared Function MoveRawPartPartAndFixture(nMoveId As Integer, vtMove As Vector3d) As Boolean
+ Public Shared Function MoveRawPartPartAndFixture(nMoveId As Integer, vtMove As Vector3d, Optional nCount As Integer = 1) As Boolean
Dim bErrorMoving As Boolean = False
' Muovo gli oggetti selezionati se consentito
If nMoveId = GDB_ID.SEL Then
@@ -586,12 +592,18 @@ Namespace EgtCAM5
If Not DispositionParameterExpanderViewModel.VerifyRawPartFixturePos(nMoveId, vtMove, vtRefMove) Then
bErrorVerify = True
End If
+ 'Dim sOut As String = "VerifyRaw : Count=" & nCount & " Err=" & If(bErrorVerify, "1", "0") &
+ ' " Move=" & LenToString(vtMove.x, 3) & "," & LenToString(vtMove.y, 3) &
+ ' " RefMove=" & LenToString(vtRefMove.x, 3) & "," & LenToString(vtRefMove.y, 3)
+ 'EgtOutLog(sOut)
End If
End If
- ' se non c'è errore ma c'è spostamento per correzione riferimento
- If Not bErrorVerify AndAlso Not vtRefMove.IsSmall Then
- ' provo a spostare
- bErrorVerify = Not MoveRawPartPartAndFixture(nMoveId, vtRefMove)
+ ' Se non c'è errore ma necessaria correzione riferimento
+ If Not bErrorVerify AndAlso Not vtRefMove.IsSmall() Then
+ ' provo a correggere (max 1 prova)
+ If nCount < 2 Then
+ bErrorVerify = Not MoveRawPartPartAndFixture(nMoveId, vtRefMove, nCount + 1)
+ End If
End If
' Se c'è almeno uno spostamento non valido
If bErrorVerify Then
@@ -859,40 +871,36 @@ Namespace EgtCAM5
EgtOffsetCurve(ccompoRawPartOutlineOffsetId, dArcRadius, OFF_TYPE.FILLET)
' recupero centro dell'arco di riferimento
Dim ptArcCenter As Point3d
- EgtCenterPoint(arcRefId, ccompoRawPartOutlineOffsetId, ptArcCenter)
+ EgtCenterPoint(arcRefId, ccompoRawPartOutlineId, ptArcCenter)
' Creo un segmento avente origine nel centro dell'arco e direzione opposta a quella del movimento
- Dim nDistLine As Integer = EgtCreateLinePVL(EgtGetParent(ccompoRawPartOutlineId), ptArcCenter, -vtOrigMove.Loc(ccompoRawPartOutlineId), 10000)
+ Dim nDistLine As Integer = EgtCreateLinePVL(EgtGetParent(ccompoRawPartOutlineId), ptArcCenter, vtOrigMove.Loc(ccompoRawPartOutlineId), 10000)
' cerco punto di intersezione tra il segmento e l'offset
Dim ptDist As Point3d
If EgtIntersectionPoint(nDistLine, ccompoRawPartOutlineOffsetId, ptArcCenter, ptDist) Then
' calcolo il vettore di spostamento necessario ad allinearli
- Dim vtDelta As Vector3d = ptDist - ptArcCenter
+ Dim vtDelta As Vector3d = -(ptDist - ptArcCenter)
vtDelta.z = 0
' se il vettore non è nullo
If Not vtDelta.IsSmall() Then
+ vtDelta = vtDelta.Glob(ccompoRawPartOutlineId)
' il vettore da restituire è nullo, quindi lo inizializzo
If vtRefMove.IsSmall() Then
- vtRefMove = vtDelta.Glob(ccompoRawPartOutlineId)
+ vtRefMove = vtDelta
' altrimenti lo confronto
Else
' per ogni coordinata devo prendere il massimo in direzione opposta allo spostamento originale
' calcolo il versore nella direzione del movimento
Dim vtMoveVers As New Vector3d(vtOrigMove)
vtMoveVers.Normalize()
- If (vtDelta * vtMoveVers) > (vtRefMove * vtMoveVers) Then
+ If (vtDelta * vtMoveVers) < (vtRefMove * vtMoveVers) Then
vtRefMove = vtDelta
End If
End If
End If
End If
- '' verifico quale è il punto dell'offset vicino al centro dell'arco di riferimento
- 'Dim dDist As Double
- 'Dim ptMin As Point3d
- 'Dim nSide As Integer
- 'EgtGetMinDistPntSidePointCurve(ptArcCenter, ccompoRawPartOutlineOffsetId, Vector3d.Z_AX, dDist, ptMin, nSide)
- ' cancello offset e segmento
- EgtErase(ccompoRawPartOutlineOffsetId)
+ ' cancello segmento e offset
EgtErase(nDistLine)
+ EgtErase(ccompoRawPartOutlineOffsetId)
End Select
End If
nFixtureId = EgtGetNextFixture(nFixtureId)
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderViewModel.vb
index a668e47..3cbdfb1 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/MachiningParameterExpander/MachiningParameterExpanderViewModel.vb
@@ -2,9 +2,13 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
+Namespace EgtCAM5
+
Public Class MachiningParameterExpanderViewModel
Implements INotifyPropertyChanged
+ Private m_bUpdating As Boolean = True
+
Friend m_Type As Integer
Public ReadOnly Property Type As Integer
Get
@@ -28,6 +32,7 @@ Public Class MachiningParameterExpanderViewModel
Return bInvert
End Get
Set(value As Boolean)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.INVERT, value)
End Set
End Property
@@ -39,6 +44,7 @@ Public Class MachiningParameterExpanderViewModel
Return sDepth
End Get
Set(value As String)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.DEPTH_STR, value)
End Set
End Property
@@ -58,6 +64,7 @@ Public Class MachiningParameterExpanderViewModel
Return IdNameStruct.SearchToId(nHeadSide, HeadSideList)
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.HEADSIDE, IdNameStruct.SearchFromId(value, HeadSideList))
End Set
End Property
@@ -77,6 +84,7 @@ Public Class MachiningParameterExpanderViewModel
Return IdNameStruct.SearchToId(nWorkSide, WorkSideList)
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.WORKSIDE, IdNameStruct.SearchFromId(value, WorkSideList))
End Set
End Property
@@ -88,6 +96,7 @@ Public Class MachiningParameterExpanderViewModel
Return sUserNotes
End Get
Set(value As String)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.USERNOTES, value)
End Set
End Property
@@ -99,6 +108,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStartPos, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStartPos As Double = 0
StringToLen(value, dStartPos)
EgtSetMachiningParam(MCH_MP.STARTPOS, dStartPos)
@@ -112,6 +122,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dReturnPos, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dReturnPos As Double = 0
StringToLen(value, dReturnPos)
EgtSetMachiningParam(MCH_MP.RETURNPOS, dReturnPos)
@@ -125,6 +136,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dOverLap, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dOverLap As Double = 0
StringToLen(value, dOverLap)
EgtSetMachiningParam(MCH_MP.OVERL, dOverLap)
@@ -138,6 +150,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dThrouAddLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dThrouAddLen As Double = 0
StringToLen(value, dThrouAddLen)
EgtSetMachiningParam(MCH_MP.THROUADDLEN, dThrouAddLen)
@@ -178,6 +191,7 @@ Public Class MachiningParameterExpanderViewModel
End If
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
If Not IsNothing(m_StepTypeList) Then
If m_StepTypeGetError Then
EgtSetMachiningParam(MCH_MP.STEPTYPE, IdNameStruct.SearchFromId(value, m_StepTypeList))
@@ -193,6 +207,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStepPar, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStepPar As Double = 0
StringToLen(value, dStepPar)
EgtSetMachiningParam(MCH_MP.STEP_, dStepPar)
@@ -206,6 +221,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStartSlowLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStartSlowLen As Double = 0
StringToLen(value, dStartSlowLen)
EgtSetMachiningParam(MCH_MP.STARTSLOWLEN, dStartSlowLen)
@@ -219,6 +235,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dEndSlowLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dEndSlowLen As Double = 0
StringToLen(value, dEndSlowLen)
EgtSetMachiningParam(MCH_MP.ENDSLOWLEN, dEndSlowLen)
@@ -232,6 +249,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dSideAngle, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dSideAngle As Double = 0
StringToLen(value, dSideAngle)
EgtSetMachiningParam(MCH_MP.SIDEANGLE, dSideAngle)
@@ -245,6 +263,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dOffsetSr, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dOffsetSr As Double = 0
StringToLen(value, dOffsetSr)
EgtSetMachiningParam(MCH_MP.OFFSR, dOffsetSr)
@@ -258,6 +277,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dOffsetSl, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dOffsetSl As Double = 0
StringToLen(value, dOffsetSl)
EgtSetMachiningParam(MCH_MP.OFFSL, dOffsetSl)
@@ -271,6 +291,7 @@ Public Class MachiningParameterExpanderViewModel
Return bLeaveTab
End Get
Set(value As Boolean)
+ If m_bUpdating Then Return
EgtSetMachiningParam(MCH_MP.LEAVETAB, value)
End Set
End Property
@@ -282,6 +303,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dTabLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dTabLen As Double = 0
StringToLen(value, dTabLen)
EgtSetMachiningParam(MCH_MP.TABLEN, dTabLen)
@@ -295,6 +317,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dTabHeight, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dTabHeight As Double = 0
StringToLen(value, dTabHeight)
EgtSetMachiningParam(MCH_MP.TABHEIGHT, dTabHeight)
@@ -308,6 +331,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dTabAngle, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dTabAngle As Double = 0
StringToLen(value, dTabAngle)
EgtSetMachiningParam(MCH_MP.TABANGLE, dTabAngle)
@@ -321,6 +345,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dTabDist, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dTabDist As Double = 0
StringToLen(value, dTabDist)
EgtSetMachiningParam(MCH_MP.TABDIST, dTabDist)
@@ -359,6 +384,7 @@ Public Class MachiningParameterExpanderViewModel
End If
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
If Not IsNothing(m_LeadInTypeList) Then
If m_LeadInTypeGetError Then
EgtSetMachiningParam(MCH_MP.LEADINTYPE, IdNameStruct.SearchFromId(value, m_LeadInTypeList))
@@ -374,6 +400,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStartAddLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStartAddLen As Double = 0
StringToLen(value, dStartAddLen)
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen)
@@ -387,6 +414,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLiTang, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLiTang As Double = 0
StringToLen(value, dLiTang)
EgtSetMachiningParam(MCH_MP.LITANG, dLiTang)
@@ -400,6 +428,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLiPerp, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLiPerp As Double = 0
StringToLen(value, dLiPerp)
EgtSetMachiningParam(MCH_MP.LIPERP, dLiPerp)
@@ -413,6 +442,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLiElev, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLiElev As Double = 0
StringToLen(value, dLiElev)
EgtSetMachiningParam(MCH_MP.LIELEV, dLiElev)
@@ -426,6 +456,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLiCompLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLiCompLen As Double = 0
StringToLen(value, dLiCompLen)
EgtSetMachiningParam(MCH_MP.LICOMPLEN, dLiCompLen)
@@ -464,6 +495,7 @@ Public Class MachiningParameterExpanderViewModel
End If
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
If Not IsNothing(m_LeadOutTypeList) Then
If m_LeadOutTypeGetError Then
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, IdNameStruct.SearchFromId(value, m_LeadOutTypeList))
@@ -479,6 +511,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dEndAddLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dEndAddLen As Double = 0
StringToLen(value, dEndAddLen)
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen)
@@ -492,6 +525,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLoTang, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLoTang As Double = 0
StringToLen(value, dLoTang)
EgtSetMachiningParam(MCH_MP.LOTANG, dLoTang)
@@ -505,6 +539,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLoPerp, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLoPerp As Double = 0
StringToLen(value, dLoPerp)
EgtSetMachiningParam(MCH_MP.LOPERP, dLoPerp)
@@ -518,6 +553,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLoElev, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLoElev As Double = 0
StringToLen(value, dLoElev)
EgtSetMachiningParam(MCH_MP.LOELEV, dLoElev)
@@ -531,6 +567,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dLoCompLen, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dLoCompLen As Double = 0
StringToLen(value, dLoCompLen)
EgtSetMachiningParam(MCH_MP.LOCOMPLEN, dLoCompLen)
@@ -561,6 +598,7 @@ Public Class MachiningParameterExpanderViewModel
End If
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
If Not IsNothing(m_ExtLinkTypeList) Then
If m_ExtLinkTypeGetError Then
EgtSetMachiningParam(MCH_MP.EXTLINKTYPE, IdNameStruct.SearchFromId(value, m_ExtLinkTypeList))
@@ -598,6 +636,7 @@ Public Class MachiningParameterExpanderViewModel
End If
End Get
Set(value As Integer)
+ If m_bUpdating Then Return
If Not IsNothing(m_CurveUseList) Then
If m_CurveUseGetError Then
EgtSetMachiningParam(MCH_MP.CURVEUSE, IdNameStruct.SearchFromId(value, m_CurveUseList))
@@ -613,6 +652,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dApprox, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dApprox As Double = 0
StringToLen(value, dApprox)
EgtSetMachiningParam(MCH_MP.APPROX, dApprox)
@@ -626,6 +666,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStepExtArc, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStepExtArc As Double = 0
StringToLen(value, dStepExtArc)
EgtSetMachiningParam(MCH_MP.STEPEXTARC, dStepExtArc)
@@ -639,6 +680,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStepIntArc, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStepIntArc As Double = 0
StringToLen(value, dStepIntArc)
EgtSetMachiningParam(MCH_MP.STEPINTARC, dStepIntArc)
@@ -652,6 +694,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dSpeed, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dSpeed As Double = 0
StringToLen(value, dSpeed)
EgtSetMachiningParam(MCH_MP.SPEED, dSpeed)
@@ -665,6 +708,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dFeed, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dFeed As Double = 0
StringToLen(value, dFeed)
EgtSetMachiningParam(MCH_MP.FEED, dFeed)
@@ -678,6 +722,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dTipFeed, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dTipFeed As Double = 0
StringToLen(value, dTipFeed)
EgtSetMachiningParam(MCH_MP.TIPFEED, dTipFeed)
@@ -691,6 +736,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dStartFeed, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dStartFeed As Double = 0
StringToLen(value, dStartFeed)
EgtSetMachiningParam(MCH_MP.STARTFEED, dStartFeed)
@@ -704,6 +750,7 @@ Public Class MachiningParameterExpanderViewModel
Return LenToString(dEndFeed, 4)
End Get
Set(value As String)
+ If m_bUpdating Then Return
Dim dEndFeed As Double = 0
StringToLen(value, dEndFeed)
EgtSetMachiningParam(MCH_MP.ENDFEED, dEndFeed)
@@ -971,7 +1018,7 @@ Public Class MachiningParameterExpanderViewModel
End Get
End Property
- Public ReadOnly Property EndFeedTxBl As String
+ Public ReadOnly Property EndFeedMsg As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 66)
End Get
@@ -1004,6 +1051,7 @@ Public Class MachiningParameterExpanderViewModel
#End Region
Private Sub UpdateParamValues()
+ m_bUpdating = True
NotifyPropertyChanged("Type")
NotifyPropertyChanged("Tool")
NotifyPropertyChanged("Invert")
@@ -1053,8 +1101,12 @@ Public Class MachiningParameterExpanderViewModel
NotifyPropertyChanged("TipFeed")
NotifyPropertyChanged("StartFeed")
NotifyPropertyChanged("EndFeed")
+ m_bUpdating = False
End Sub
+ ' Definizione comando
+ Private m_cmdReloadMachining As ICommand
+
Sub New(ByRef m_UpdateParamValues As Action)
m_UpdateParamValues = AddressOf UpdateParamValues
End Sub
@@ -1082,6 +1134,69 @@ Public Class MachiningParameterExpanderViewModel
End Select
End Function
+#Region "ReloadMachiningCommand"
+
+ '''
+ ''' Restituisce funzione per ricalcolo lavorazione.
+ '''
+ Public ReadOnly Property ReloadMachiningCommand As ICommand
+ Get
+ If m_cmdReloadMachining Is Nothing Then
+ m_cmdReloadMachining = New RelayCommand(AddressOf ReloadMachining, AddressOf CanReloadMachining)
+ End If
+ Return m_cmdReloadMachining
+ End Get
+ End Property
+
+ '''
+ ''' Ricalcola una lavorazione.
+ '''
+ Public Sub ReloadMachining(ByVal param As Object)
+ ' Aggiorno valore depth
+ NotifyPropertyChanged("Depth")
+ ' Carico tutta la geometria selezionata in una lista
+ Dim SelectedGeometry As New List(Of Integer)
+ Dim EntityIndex As Integer = EgtGetFirstSelectedObj()
+ While EntityIndex <> GDB_ID.NULL
+ SelectedGeometry.Add(EntityIndex)
+ EntityIndex = EgtGetNextSelectedObj()
+ End While
+ ' Verifico se la geometria è cambiata, confrontando selezione attuale con geometria di lavorazione
+ Dim ModifiedGeometry As Boolean = False
+ Dim CountIndex As Integer = 0
+ EntityIndex = 0
+ Dim SubEntityIndex As Integer = 0 ' Sottocomponente, per ora non usato ma necessario
+ While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
+ If SubEntityIndex = GDB_ID.NULL And CountIndex < SelectedGeometry.Count() Then
+ If SelectedGeometry(CountIndex) <> EntityIndex Then
+ ModifiedGeometry = True
+ Exit While
+ End If
+ Else
+ ModifiedGeometry = True
+ Exit While
+ End If
+ CountIndex += 1
+ End While
+ If SelectedGeometry.Count <> CountIndex Then
+ ModifiedGeometry = True
+ End If
+ ' Imposto geometria selezionata come geometria di lavorazione
+ If ModifiedGeometry Then EgtSetMachiningGeometry(SelectedGeometry.ToArray)
+ ' Se necessario ricalcolo la lavorazione
+ EgtApplyMachining(ModifiedGeometry)
+ EgtDraw()
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanReloadMachining(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ReloadMachiningCommand
+
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
@@ -1090,6 +1205,9 @@ Public Class MachiningParameterExpanderViewModel
End Class
+End Namespace
+
+
'''
''' Class that represent a Converter that use machining type and param type, to set the visibility state of the param type.
'''
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
index 1462bf2..c8100b7 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderViewModel.vb
@@ -110,70 +110,65 @@ Namespace EgtCAM5
End If
ParametersExpanderName = m_SelectedOperation.Name
m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS
- Select Case SelectedOperation.m_Type
- Case MCH_OY.DISP
- ' Abilito la selezione di tutti i tipi di geometria
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, SceneSelModeOpt.ALL)
- ' Verifico se c'è un grezzo nella disposizione corrente
- Dim bFirstRaw As Boolean = True
- Dim nCurrPhase As Integer = EgtGetCurrPhase()
- Dim nRawPartId As Integer = EgtGetFirstRawPart()
- While nRawPartId <> GDB_ID.NULL
- If EgtVerifyRawPartPhase(nRawPartId, nCurrPhase) Then
- bFirstRaw = False
- Exit While
- End If
- nRawPartId = EgtGetNextRawPart(nRawPartId)
- End While
- ' Lancio funzione che inizializza la disposizione
- m_OpenDispositionFunction(bFirstRaw)
- ' Nascondo tutte le lavorazioni
- Dim nOpId As Integer = EgtGetFirstOperation()
- While nOpId <> GDB_ID.NULL
- Dim nOpType As Integer = EgtGetOperationType(nOpId)
- If nOpType = MCH_OY.DRILLING OrElse nOpType = MCH_OY.SAWING OrElse nOpType = MCH_OY.MILLING OrElse nOpType = MCH_OY.POCKETING OrElse nOpType = MCH_OY.MORTISING _
- OrElse nOpType = MCH_OY.SAWROUGHING OrElse nOpType = MCH_OY.SAWFINISHING Then
- EgtSetStatus(nOpId, GDB_ST.OFF)
- End If
- nOpId = EgtGetNextOperation(nOpId)
- End While
- EgtDraw()
- Case MCH_OY.DRILLING, MCH_OY.SAWING, MCH_OY.MILLING, MCH_OY.MORTISING, MCH_OY.POCKETING, MCH_OY.SAWROUGHING, MCH_OY.SAWFINISHING
- ' Leggo il tipo di operazione per impostare il tipo di selezione
- Dim OperationType As Integer = -1
- EgtGetMachiningParam(MCH_MP.TYPE, OperationType)
- ' Abilito la selezione delle lavorazioni
- Application.Msn.NotifyColleagues(Application.SETSCENESELTYPE, SceneSelTypeOpt.MACHINING)
- ' Abilito la selezione dei giusti tipi di geometria
- Select Case OperationType
- Case MCH_OY.SAWING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawing)
- Case MCH_OY.DRILLING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomDrilling)
- Case MCH_OY.MILLING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomMilling)
- Case MCH_OY.POCKETING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomPocketing)
- Case MCH_OY.MORTISING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomMortising)
- Case MCH_OY.SAWROUGHING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawRoughing)
- Case MCH_OY.SAWFINISHING
- Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawFinishing)
- End Select
- End Select
+ If IsValidDispositionType(SelectedOperation.m_Type) Then
+ ' Abilito la selezione di tutti i tipi di geometria
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, SceneSelModeOpt.ALL)
+ ' Verifico se c'è un grezzo nella disposizione corrente
+ Dim bFirstRaw As Boolean = True
+ Dim nRawPartId As Integer = EgtGetFirstRawPart()
+ While nRawPartId <> GDB_ID.NULL
+ If EgtVerifyRawPartCurrPhase(nRawPartId) Then
+ bFirstRaw = False
+ Exit While
+ End If
+ nRawPartId = EgtGetNextRawPart(nRawPartId)
+ End While
+ ' Lancio funzione che inizializza la disposizione
+ m_OpenDispositionFunction(bFirstRaw)
+ ' Nascondo tutte le lavorazioni
+ Dim nOpId As Integer = EgtGetFirstOperation()
+ While nOpId <> GDB_ID.NULL
+ If IsValidMachiningType(EgtGetOperationType(nOpId)) Then
+ EgtSetOperationStatus(nOpId, False)
+ End If
+ nOpId = EgtGetNextOperation(nOpId)
+ End While
+ EgtDraw()
+ ElseIf IsValidMachiningType(SelectedOperation.m_Type) Then
+ ' Leggo il tipo di operazione per impostare il tipo di selezione
+ Dim OperationType As Integer = -1
+ EgtGetMachiningParam(MCH_MP.TYPE, OperationType)
+ ' Abilito la selezione delle lavorazioni
+ Application.Msn.NotifyColleagues(Application.SETSCENESELTYPE, SceneSelTypeOpt.MACHINING)
+ ' Abilito la selezione dei giusti tipi di geometria
+ Select Case OperationType
+ Case MCH_OY.SAWING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawing)
+ Case MCH_OY.DRILLING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomDrilling)
+ Case MCH_OY.MILLING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomMilling)
+ Case MCH_OY.POCKETING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomPocketing)
+ Case MCH_OY.MORTISING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomMortising)
+ Case MCH_OY.SAWROUGHING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawRoughing)
+ Case MCH_OY.SAWFINISHING
+ Application.Msn.NotifyColleagues(Application.SETSCENESELMODE, m_SelGeomSawFinishing)
+ End Select
+ End If
Else
If m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONLIST Then
ListIsExpanded = True
End If
If SelectedOperation.m_Type = MCH_OY.DISP Then
- ' Riattivo tutte le lavorazioni
+ ' Visualizzo tutte le lavorazioni della fase corrente
+ Dim nCurrPhase = EgtGetCurrPhase()
Dim nOpId As Integer = EgtGetFirstOperation()
While nOpId <> GDB_ID.NULL
- Dim nOpType As Integer = EgtGetOperationType(nOpId)
- If nOpType = MCH_OY.DRILLING OrElse nOpType = MCH_OY.SAWING OrElse nOpType = MCH_OY.MILLING OrElse nOpType = MCH_OY.POCKETING OrElse nOpType = MCH_OY.MORTISING _
- OrElse nOpType = MCH_OY.SAWROUGHING OrElse nOpType = MCH_OY.SAWFINISHING Then
- EgtSetStatus(nOpId, GDB_ST.ON_)
+ If IsValidMachiningType(EgtGetOperationType(nOpId)) Then
+ EgtSetOperationStatus(nOpId, (EgtGetOperationPhase(nOpId) = nCurrPhase))
End If
nOpId = EgtGetNextOperation(nOpId)
End While
@@ -372,7 +367,6 @@ Namespace EgtCAM5
Private m_cmdMoveUp As ICommand
Private m_cmdMoveDown As ICommand
Private m_cmdUpdate As ICommand
- Private m_cmdReloadMachining As ICommand
Sub New()
Dim Temp As Integer = 0
@@ -713,69 +707,6 @@ Namespace EgtCAM5
#End Region ' UpdateCommand
-#Region "ReloadMachiningCommand"
-
- '''
- ''' Restituisce funzione per ricalcolo lavorazione.
- '''
- Public ReadOnly Property ReloadMachiningCommand As ICommand
- Get
- If m_cmdReloadMachining Is Nothing Then
- m_cmdReloadMachining = New RelayCommand(AddressOf ReloadMachining, AddressOf CanReloadMachining)
- End If
- Return m_cmdReloadMachining
- End Get
- End Property
-
- '''
- ''' Ricalcola una lavorazione.
- '''
- Public Sub ReloadMachining(ByVal param As Object)
- ' Aggiorno valore depth
- SelectedOperation.NotifyPropertyChanged("Depth")
- ' Carico tutta la geometria selezionata in una lista
- Dim SelectedGeometry As New List(Of Integer)
- Dim EntityIndex As Integer = EgtGetFirstSelectedObj()
- While EntityIndex <> GDB_ID.NULL
- SelectedGeometry.Add(EntityIndex)
- EntityIndex = EgtGetNextSelectedObj()
- End While
- ' Verifico se la geometria è cambiata, confrontando selezione attuale con geometria di lavorazione
- Dim ModifiedGeometry As Boolean = False
- Dim CountIndex As Integer = 0
- EntityIndex = 0
- Dim SubEntityIndex As Integer = 0 ' Sottocomponente, per ora non usato ma necessario
- While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
- If SubEntityIndex = GDB_ID.NULL And CountIndex < SelectedGeometry.Count() Then
- If SelectedGeometry(CountIndex) <> EntityIndex Then
- ModifiedGeometry = True
- Exit While
- End If
- Else
- ModifiedGeometry = True
- Exit While
- End If
- CountIndex += 1
- End While
- If SelectedGeometry.Count <> CountIndex Then
- ModifiedGeometry = True
- End If
- ' Imposto geometria selezionata come geometria di lavorazione
- If ModifiedGeometry Then EgtSetMachiningGeometry(SelectedGeometry.ToArray)
- ' Se necessario ricalcolo la lavorazione
- EgtApplyMachining(ModifiedGeometry)
- EgtDraw()
- End Sub
-
- '''
- ''' Returns always true.
- '''
- Private Function CanReloadMachining(ByVal param As Object) As Boolean
- Return True
- End Function
-
-#End Region ' ReloadMachiningCommand
-
#End Region ' Commands
#Region "METHODS"
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/DispositionOpListBoxItem.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/DispositionOpListBoxItem.vb
index 6684db5..7600408 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/DispositionOpListBoxItem.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/OperationExpander/OperationListBoxItem/DispositionOpListBoxItem.vb
@@ -1,7 +1,7 @@
Public Class DispositionOpListBoxItem
Inherits OperationListBoxItem
- Private m_Image As String
+ Private m_Image As String = String.Empty
Public Property Image As String
Get
Return m_Image
diff --git a/ProjectPage/ProjectView.xaml b/ProjectPage/ProjectView.xaml
index 1ac5016..d5546d1 100644
--- a/ProjectPage/ProjectView.xaml
+++ b/ProjectPage/ProjectView.xaml
@@ -10,9 +10,6 @@
-
-
-