- gestione dei punti di inizio lavorazione
- introduzione soglia su tabella TFS in modalita' differenza lunghezze - migliorie e correzioni
This commit is contained in:
@@ -96,6 +96,8 @@
|
||||
Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir"
|
||||
Public Const MAC_MATERIALS = "Materials"
|
||||
|
||||
' parametri StartMach
|
||||
Public Const LAY_NEWSTART = "NewStart"
|
||||
|
||||
Public Const FILE_PATH = "FilePath"
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ Public Module ConstGen
|
||||
' MOdalita' di modifica
|
||||
Public Enum ModifyModes As Integer
|
||||
NULL = 0
|
||||
SELECT_ = 1
|
||||
DISPOSITION = 2
|
||||
REFERENCE = 3
|
||||
STARTMACH = 4
|
||||
|
||||
@@ -223,6 +223,7 @@ Public Class ControllerInputPanelVM
|
||||
|
||||
Friend Sub PrepareInputBox(sTitle As String, sLabel As String, sCheckLabel As String,
|
||||
bShowCombo As Boolean, bShowBtn As Boolean)
|
||||
If Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Return
|
||||
Title = sTitle
|
||||
If sLabel <> "" Then
|
||||
Message = sLabel
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -59,6 +60,12 @@
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
@@ -76,6 +83,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<UniformGrid Columns="3">
|
||||
<RadioButton Content="X"
|
||||
@@ -94,6 +102,12 @@
|
||||
<EgtWPFLib5:EgtTextBox Grid.Row="1"
|
||||
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
|
||||
Margin="0,5,0,0"/>
|
||||
<Grid Grid.Row="2"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragRotate_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
|
||||
@@ -152,6 +152,14 @@ Public Class DispositionPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' riferimento griglia prima della rotazione
|
||||
Private m_PrevGridOrigin As New Frame3d
|
||||
Private m_bRotating As Boolean
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdDragMove As ICommand
|
||||
Private m_cmdDragRotate As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefDispositionPanelVM(Me)
|
||||
@@ -167,6 +175,94 @@ Public Class DispositionPanelVM
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
End Sub
|
||||
|
||||
Private Sub InitCommand()
|
||||
' attivo modifiche su scena
|
||||
Map.refSceneHostVM.MainScene.ResetStatus()
|
||||
' seleziono percorso corrente
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj(Map.refTopPanelVM.SelPart.nPartId)
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateUi()
|
||||
RefreshPos()
|
||||
If m_bRotating Then
|
||||
m_bRotating = False
|
||||
' ripristino griglia
|
||||
EgtSetGridFrame(m_PrevGridOrigin)
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub OnKeyDown(Key As Forms.Keys)
|
||||
If Key = Forms.Keys.Escape Then
|
||||
If m_bRotating Then
|
||||
m_bRotating = False
|
||||
' ripristino griglia
|
||||
EgtSetGridFrame(m_PrevGridOrigin)
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "DragMove"
|
||||
|
||||
Public ReadOnly Property DragMove_Command As ICommand
|
||||
Get
|
||||
If m_cmdDragMove Is Nothing Then
|
||||
m_cmdDragMove = New Command(AddressOf DragMove)
|
||||
End If
|
||||
Return m_cmdDragMove
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DragMove()
|
||||
InitCommand()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MOVE)
|
||||
End Sub
|
||||
|
||||
#End Region ' DragMove
|
||||
|
||||
#Region "DragRotate"
|
||||
|
||||
Public ReadOnly Property DragRotate_Command As ICommand
|
||||
Get
|
||||
If m_cmdDragRotate Is Nothing Then
|
||||
m_cmdDragRotate = New Command(AddressOf DragRotate)
|
||||
End If
|
||||
Return m_cmdDragRotate
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DragRotate()
|
||||
m_bRotating = True
|
||||
m_PrevGridOrigin = EgtGetGridFrame()
|
||||
InitCommand()
|
||||
If AreSameVectorApprox(vtSelRotAxes, Vector3d.X_AX) Then
|
||||
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.RIGHT)
|
||||
ElseIf AreSameVectorApprox(vtSelRotAxes, Vector3d.Y_AX) Then
|
||||
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.FRONT)
|
||||
ElseIf AreSameVectorApprox(vtSelRotAxes, Vector3d.Z_AX) Then
|
||||
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.TOP)
|
||||
End If
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
|
||||
' recupero il piano di griglia corrente
|
||||
Dim frCurr As New Frame3d(EgtGetGridFrame())
|
||||
' ne modifico l'origine per portarla sullo stesso piano del punto( o punto inizio della curva)
|
||||
Dim StartPoint As Point3d
|
||||
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartId, StartPoint)
|
||||
frCurr.Move(StartPoint - frCurr.Orig())
|
||||
' imposto nuova griglia
|
||||
EgtSetGridFrame(frCurr)
|
||||
EgtDraw()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.ROTATE)
|
||||
End Sub
|
||||
|
||||
#End Region ' DragMove
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class CenterToolTipConverter
|
||||
|
||||
@@ -26,6 +26,15 @@ Public Class LeftPanelVM
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelPanel(Panel As Panels)
|
||||
' esco da modalita' precedente
|
||||
Select Case m_SelPanel
|
||||
Case Panels.IMPORT
|
||||
|
||||
Case Panels.DISPOSITION
|
||||
|
||||
Case Panels.STARTMACH
|
||||
Map.refStartMachPanelVM.Dispose()
|
||||
End Select
|
||||
m_SelPanel = Panel
|
||||
Select Case Panel
|
||||
Case Panels.IMPORT
|
||||
|
||||
@@ -1273,11 +1273,10 @@ Public Class CurrStringMachiningParam
|
||||
m_sOrigValue = m_sValue
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nIndex As Integer)
|
||||
Dim sMacIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini"
|
||||
Friend Overrides Sub WriteParamInPart(nIndex As Integer)
|
||||
Select Case Type
|
||||
Case Params.STRANDH
|
||||
'EgtSetInfo(nPartId, MAC_STRANDH, sWriteValue)
|
||||
'Case Params.STRANDH
|
||||
'EgtSetInfo(nPartId, MAC_STRANDH, sWriteValue)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -1400,8 +1399,7 @@ Public Class CurrComboMachiningParam
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nPartId As Integer)
|
||||
Dim sMacIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini"
|
||||
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||
Select Case Type
|
||||
Case Params.STRANDORDER
|
||||
EgtSetInfo(nPartId, MAC_STRANDORDER, m_SelValue.Id)
|
||||
@@ -1500,8 +1498,7 @@ Public Class CurrCheckMachiningParam
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Overrides Sub WriteParamOnDb(nPartId As Integer)
|
||||
Dim sMacIniFilePath As String = Map.refMainWindowVM.MainWindowM.sMachiningsDir & "/Machinings.ini"
|
||||
Friend Overrides Sub WriteParamInPart(nPartId As Integer)
|
||||
Select Case Type
|
||||
Case Params.SLICING45
|
||||
EgtSetInfo(nPartId, MAC_SLICING45, If(m_bValue, 1, 0))
|
||||
|
||||
@@ -124,6 +124,7 @@ Public Class MySceneHostVM
|
||||
AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
|
||||
AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
|
||||
AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
|
||||
AddHandler MainScene.OnMouseSelectingObj, AddressOf OnMouseSelectingObj
|
||||
AddHandler MainScene.OnMouseSelectedObj, AddressOf OnMouseSelectedObj
|
||||
AddHandler MainScene.OnMouseSelectedPart, AddressOf OnMouseSelectedPart
|
||||
AddHandler MainScene.OnMouseSelectedLayer, AddressOf OnMouseSelectedLayer
|
||||
@@ -333,18 +334,43 @@ Public Class MySceneHostVM
|
||||
|
||||
Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
|
||||
bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseSetObjFilterForSelect(bZeroDim, bCurve, bSurf, bVolume, bExtra)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseSelectedAll(bOnlyVisble)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDeselectedAll(ByVal sender As Object)
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseDeselectedAll()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
If Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Basic_OnMouseDownScene(sender, e)
|
||||
' Se in modalità modifica
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
Case ModifyModes.SELECT_
|
||||
Part_OnMouseDownScene(sender, e)
|
||||
Case ModifyModes.STARTMACH
|
||||
StartMach_OnMouseDownScene(sender, e)
|
||||
End Select
|
||||
End If
|
||||
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
@@ -371,7 +397,16 @@ Public Class MySceneHostVM
|
||||
Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
If Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Basic_OnMouseMoveScene(sender, e)
|
||||
' Se in modalità modifica
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
Case ModifyModes.SELECT_
|
||||
Part_OnMouseMoveScene(sender, e)
|
||||
Case ModifyModes.STARTMACH
|
||||
StartMach_OnMouseMoveScene(sender, e)
|
||||
End Select
|
||||
End If
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
@@ -398,7 +433,16 @@ Public Class MySceneHostVM
|
||||
Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
If e.Button = Forms.MouseButtons.Middle Then Return
|
||||
If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
|
||||
If Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.DISPOSITION Then Basic_OnMouseUpScene(sender, e)
|
||||
' Se in modalità modifica
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
Case ModifyModes.SELECT_
|
||||
Part_OnMouseUpScene(sender, e)
|
||||
Case ModifyModes.STARTMACH
|
||||
StartMach_OnMouseUpScene(sender, e)
|
||||
End Select
|
||||
End If
|
||||
'Select Case Map.refMainMenuVM.SelPage
|
||||
' Case Pages.VIEW
|
||||
' If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
@@ -422,73 +466,106 @@ Public Class MySceneHostVM
|
||||
'End Select
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectingObj(ByVal sender As Object, ByVal nId As Integer, ByRef bOk As Boolean)
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
'Case ModifyModes.SELECT_
|
||||
Case ModifyModes.DISPOSITION
|
||||
'bOk = Map.refDispositionPanelVM.OnMouseSelectingObj(nId)
|
||||
Case ModifyModes.REFERENCE
|
||||
Case ModifyModes.STARTMACH
|
||||
bOk = Map.refStartMachPanelVM.OnMouseSelectingObj(nId)
|
||||
Case ModifyModes.RIBS
|
||||
Case ModifyModes.SHELLNUMBER
|
||||
Case ModifyModes.AUXSOLIDS
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' ' se sto editando testo angoli
|
||||
' If Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
|
||||
' ' passo testo selezionato
|
||||
' Map.refFreeContourManagerVM.TextAngleSelected(nId)
|
||||
' End If
|
||||
' MainController.MouseSelectedObj(nId, bLast)
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
' Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
' 'Case ModifyModes.SELECT_
|
||||
' Case ModifyModes.DISPOSITION
|
||||
' 'bOk = Map.refDispositionPanelVM.OnMouseSelectingObj(nId)
|
||||
' Case ModifyModes.REFERENCE
|
||||
' Case ModifyModes.STARTMACH
|
||||
' Map.refStartMachPanelVM.OnMouseSelectedObj(nId)
|
||||
' Case ModifyModes.RIBS
|
||||
' Case ModifyModes.SHELLNUMBER
|
||||
' Case ModifyModes.AUXSOLIDS
|
||||
' End Select
|
||||
'End If
|
||||
MainController.MouseSelectedObj(nId, bLast)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedPart(nId)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseSelectedPart(nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedLayer(nId)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseSelectedLayer(nId)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseSelectedPath(nId, bHaltOnFork)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseSelectedPath(nId, bHaltOnFork)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.SetPointFromSelection(nId, PtP, nAux)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.SetPointFromSelection(nId, PtP, nAux)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDone(ByVal sender As Object)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.Done(Map.refFreeContourInputVM.Text)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.Done(Map.refControllerInputPanelVM.Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
' MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
|
||||
MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.SetLastVector3d(VtDir)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.SetLastVector3d(VtDir)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' MainController.MouseMoveInSelectionPoint(PtP)
|
||||
'End If
|
||||
' Se in modalità modifica e non seleziona pezzo
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
|
||||
Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
|
||||
MainController.MouseMoveInSelectionPoint(PtP)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String)
|
||||
@@ -496,6 +573,18 @@ Public Class MySceneHostVM
|
||||
End Sub
|
||||
|
||||
Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
'Case ModifyModes.SELECT_
|
||||
Case ModifyModes.DISPOSITION
|
||||
Map.refDispositionPanelVM.OnKeyDown(e.KeyData)
|
||||
Case ModifyModes.REFERENCE
|
||||
Case ModifyModes.STARTMACH
|
||||
Case ModifyModes.RIBS
|
||||
Case ModifyModes.SHELLNUMBER
|
||||
Case ModifyModes.AUXSOLIDS
|
||||
End Select
|
||||
End If
|
||||
'' Se in modalità edit L250
|
||||
'If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refFreeContourManagerVM.bIsActive Then
|
||||
' ' Con DEL eseguo cancellazione delle entità selezionate
|
||||
@@ -673,13 +762,28 @@ Public Class MySceneHostVM
|
||||
Else
|
||||
Map.refMyStatusBarVM.ClearOutputMessage()
|
||||
End If
|
||||
If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
|
||||
Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
|
||||
'Case ModifyModes.SELECT_
|
||||
Case ModifyModes.DISPOSITION
|
||||
Map.refDispositionPanelVM.UpdateUi()
|
||||
Case ModifyModes.REFERENCE
|
||||
Case ModifyModes.STARTMACH
|
||||
Map.refStartMachPanelVM.UpdateUi()
|
||||
Case ModifyModes.RIBS
|
||||
Case ModifyModes.SHELLNUMBER
|
||||
Case ModifyModes.AUXSOLIDS
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' CONTROLLER EVENTS
|
||||
|
||||
#Region "VIEW EVENTS"
|
||||
|
||||
#Region "Part"
|
||||
|
||||
Friend Sub Basic_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
Friend Sub Part_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
@@ -711,7 +815,7 @@ Public Class MySceneHostVM
|
||||
m_bDragToStart = True
|
||||
End Sub
|
||||
|
||||
Friend Sub Basic_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Sub Part_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se drag non abilitato o già in esecuzione, esco
|
||||
If Not m_bDragToStart Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
@@ -724,7 +828,7 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Basic_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Sub Part_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se selezione da eseguire
|
||||
@@ -758,4 +862,89 @@ Public Class MySceneHostVM
|
||||
|
||||
#End Region ' Part
|
||||
|
||||
|
||||
|
||||
#Region "StartMach"
|
||||
|
||||
Friend Sub StartMach_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||
Dim nSel As Integer
|
||||
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
|
||||
Dim nId As Integer = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero l'identificativo del pezzo cui appartiene
|
||||
Dim nPartId As Integer = EgtGetParent(nId)
|
||||
Dim bFound As Boolean = False
|
||||
If nPartId = Map.refStartMachPanelVM.nStartMachLayerId Then bFound = True
|
||||
If Not bFound Then
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
Continue While
|
||||
End If
|
||||
'Dim nStat As Integer = GDB_ST.ON_
|
||||
'EgtGetStatus(nId, nStat)
|
||||
'' Se già selezionato
|
||||
'If nStat = GDB_ST.SEL Then
|
||||
' ' Memorizzo Id da deselezionare
|
||||
' m_nIdToDesel = nId
|
||||
'Else
|
||||
' Memorizzo Id da selezionare
|
||||
m_nIdToSel = nId
|
||||
'End If
|
||||
Exit While
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
' Dati per drag
|
||||
m_bDragToStart = True
|
||||
End Sub
|
||||
|
||||
Friend Sub StartMach_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se drag non abilitato o già in esecuzione, esco
|
||||
If Not m_bDragToStart Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
If m_bDragToStart Then
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
||||
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return
|
||||
End If
|
||||
m_bDragToStart = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub StartMach_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se selezione da eseguire
|
||||
ElseIf m_nIdToSel <> GDB_ID.NULL Then
|
||||
' Se pezzo da selezionare non è già selezionato
|
||||
'If EgtIsSelectedObj(m_nIdToSel) Then
|
||||
' Eseguo la selezione
|
||||
Map.refStartMachPanelVM.SelStartFromId(m_nIdToSel)
|
||||
'EgtDeselectAll()
|
||||
'EgtSelectPartObjs(m_nIdToSel)
|
||||
'EgtSelectObj(m_nIdToSel)
|
||||
'EgtSetMark(m_nIdToSel)
|
||||
'End If
|
||||
'If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId <> m_nIdToSel Then
|
||||
' ' Eseguo la selezione
|
||||
' For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
' If BTLPart.nPartId = m_nIdToSel Then
|
||||
' BTLPart.SetIsSelected(True)
|
||||
' ElseIf BTLPart.IsSelected Then
|
||||
' BTLPart.SetIsSelected(False)
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
End If
|
||||
' Reset
|
||||
m_bDrag = False
|
||||
m_nIdToSel = GDB_ID.NULL
|
||||
m_nIdToDesel = GDB_ID.NULL
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' StartMach
|
||||
|
||||
#End Region ' VIEW EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -13,9 +13,6 @@ Public Class SliderManagerVM
|
||||
End Get
|
||||
Set(value As Double)
|
||||
m_nLayerIndex = value
|
||||
If value = 1 Then
|
||||
Dim x = 3
|
||||
End If
|
||||
' ciclo tutti i layer per nasconderli/mostrarli
|
||||
If IsNothing(Map.refTopPanelVM.SelPart) OrElse IsNothing(Map.refTopPanelVM.SelPart.LayerList) Then Return
|
||||
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
|
||||
|
||||
@@ -7,13 +7,16 @@
|
||||
<StackPanel.Resources>
|
||||
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
|
||||
</StackPanel.Resources>
|
||||
<ComboBox ItemsSource="{Binding StartList}"
|
||||
SelectedItem="{Binding SelStart}"
|
||||
DisplayMemberPath="ghName"/>
|
||||
<!-- Type Button -->
|
||||
<ToggleButton x:Name="TypeBtn"
|
||||
Content="Type"
|
||||
IsChecked="{Binding bType_IsChecked}"
|
||||
<ToggleButton x:Name="AddBtn"
|
||||
Content="Add"
|
||||
IsChecked="{Binding bAdd_IsChecked}"
|
||||
Style="{StaticResource ToolBar_TextToggleButton}"/>
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=TypeBtn}"
|
||||
PlacementTarget="{Binding ElementName=TypeBtn}"
|
||||
<Popup IsOpen="{Binding IsChecked, ElementName=AddBtn}"
|
||||
PlacementTarget="{Binding ElementName=AddBtn}"
|
||||
Style="{StaticResource LeftPanel_Popup}">
|
||||
<Border Style="{StaticResource LeftPanelPopup_Border}">
|
||||
<Grid>
|
||||
@@ -21,15 +24,18 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton IsChecked="{Binding TypeList[0]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}">
|
||||
<Image Source="/Resources/DrawPanel/Point.png"/>
|
||||
</RadioButton >
|
||||
<RadioButton Grid.Column="1"
|
||||
IsChecked="{Binding TypeList[1]}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png"/>
|
||||
</RadioButton>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Point_Command}"
|
||||
ToolTip="{Binding Point_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Point.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding Line2P_Command}"
|
||||
ToolTip="{Binding Line2P_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
@@ -54,48 +60,32 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding Line2P_Command}"
|
||||
ToolTip="{Binding Line2P_ToolTip}"
|
||||
IsEnabled="{Binding Line2P_IsEnabled}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding Delete_Command}"
|
||||
ToolTip="{Binding Delete_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Delete.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="2"
|
||||
<Button Grid.Column="1"
|
||||
Command="{Binding ModifyCurve_Command}"
|
||||
ToolTip="{Binding ModifyCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/ModifyCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="3"
|
||||
<Button Grid.Column="2"
|
||||
Command="{Binding AddPointCurve_Command}"
|
||||
ToolTip="{Binding AddPointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/AddPointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="4"
|
||||
<Button Grid.Column="3"
|
||||
Command="{Binding RemovePointCurve_Command}"
|
||||
ToolTip="{Binding RemovePointCurve_ToolTip}"
|
||||
Visibility="{Binding Compo_Visibility}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/RemovePointCurve.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="5"
|
||||
Command="{Binding Move_Command}"
|
||||
ToolTip="{Binding Move_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Move.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Grid.Column="6"
|
||||
Command="{Binding Rotate_Command}"
|
||||
ToolTip="{Binding Rotate_ToolTip}"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/DrawPanel/Rotate.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
@@ -183,6 +173,7 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Margin="0,0,0,2.5">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -222,6 +213,12 @@
|
||||
Margin="5,0,0,0"
|
||||
Style="{StaticResource LeftPanel_TextBox}"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,2.5,0,0">
|
||||
<Button Content="Drag"
|
||||
Command="{Binding DragMove_Command}"
|
||||
Style="{StaticResource LeftPanel_TextButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Popup>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports System.Globalization
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Globalization
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -15,45 +17,56 @@ Public Class StartMachPanelVM
|
||||
|
||||
Private m_nPartId As Integer = GDB_ID.NULL
|
||||
Private m_nStartMachLayerId As Integer = GDB_ID.NULL
|
||||
Private m_nStartMachId As Integer = GDB_ID.NULL
|
||||
|
||||
Private m_TypeList() As Boolean = {True, False}
|
||||
Public ReadOnly Property TypeList As Boolean()
|
||||
Friend ReadOnly Property nStartMachLayerId As Integer
|
||||
Get
|
||||
Return m_TypeList
|
||||
Return m_nStartMachLayerId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property SelType As StartMachTypes
|
||||
Private m_StartList As New ObservableCollection(Of StartEntity)
|
||||
Public ReadOnly Property StartList As ObservableCollection(Of StartEntity)
|
||||
Get
|
||||
Dim Index As Integer = m_TypeList.FirstOrDefault(Function(x) x)
|
||||
Select Case Index
|
||||
Case -1
|
||||
Return StartMachTypes.NULL
|
||||
Case 0
|
||||
Return StartMachTypes.POINT
|
||||
Case 1
|
||||
Return StartMachTypes.COMPO
|
||||
End Select
|
||||
Return m_StartList
|
||||
End Get
|
||||
Set(value As StartMachTypes)
|
||||
m_TypeList(value - 1) = True
|
||||
End Property
|
||||
Private m_SelStart As StartEntity
|
||||
Public Property SelStart As StartEntity
|
||||
Get
|
||||
Return m_SelStart
|
||||
End Get
|
||||
Set(value As StartEntity)
|
||||
m_SelStart = value
|
||||
EgtDeselectLayerObjs(m_nStartMachLayerId)
|
||||
If Not IsNothing(value) Then
|
||||
EgtSelectObj(value.nId)
|
||||
' aggiorno visibilita' bottoni edit
|
||||
NotifyPropertyChanged(NameOf(Compo_Visibility))
|
||||
' aggiorno campi di testo posizione
|
||||
NotifyPropertyChanged(NameOf(sXPos))
|
||||
NotifyPropertyChanged(NameOf(sYPos))
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
End If
|
||||
EgtDraw()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property sXPos As String
|
||||
Get
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.x, 1)
|
||||
If Not IsNothing(m_SelStart) Then
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.x, 1)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewXPos As Double = ptReference.x
|
||||
StringToLen(value, dNewXPos)
|
||||
If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
|
||||
EgtMove(m_nStartMachId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
|
||||
EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sXPos))
|
||||
@@ -63,17 +76,21 @@ Public Class StartMachPanelVM
|
||||
|
||||
Public Property sYPos As String
|
||||
Get
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.y, 1)
|
||||
If Not IsNothing(m_SelStart) Then
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.y, 1)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewYPos As Double = ptReference.y
|
||||
StringToLen(value, dNewYPos)
|
||||
If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
|
||||
EgtMove(m_nStartMachId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
|
||||
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sYPos))
|
||||
@@ -83,17 +100,21 @@ Public Class StartMachPanelVM
|
||||
|
||||
Public Property sZPos As String
|
||||
Get
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.z, 1)
|
||||
If Not IsNothing(m_SelStart) Then
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Return LenToString(ptReference.z, 1)
|
||||
Else
|
||||
Return ""
|
||||
End If
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim ptReference As New Point3d
|
||||
EgtStartPoint(m_nStartMachId, GDB_ID.ROOT, ptReference)
|
||||
EgtStartPoint(m_SelStart.nId, GDB_ID.ROOT, ptReference)
|
||||
Dim dNewZPos As Double = ptReference.z
|
||||
StringToLen(value, dNewZPos)
|
||||
If dNewZPos >= 0 Then
|
||||
EgtMove(m_nStartMachId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
|
||||
EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference)
|
||||
EgtDraw()
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
@@ -148,13 +169,13 @@ Public Class StartMachPanelVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_bType_IsChecked As Boolean
|
||||
Public Property bType_IsChecked As Boolean
|
||||
Private m_bAdd_IsChecked As Boolean
|
||||
Public Property bAdd_IsChecked As Boolean
|
||||
Get
|
||||
Return m_bType_IsChecked
|
||||
Return m_bAdd_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bType_IsChecked = value
|
||||
m_bAdd_IsChecked = value
|
||||
If value Then
|
||||
m_bEdit_IsChecked = False
|
||||
m_bGrid_IsChecked = False
|
||||
@@ -172,14 +193,18 @@ Public Class StartMachPanelVM
|
||||
Return m_bEdit_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bEdit_IsChecked = value
|
||||
If value Then
|
||||
m_bType_IsChecked = False
|
||||
m_bGrid_IsChecked = False
|
||||
m_bMove_IsChecked = False
|
||||
NotifyPropertyChanged(NameOf(bType_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bGrid_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bMove_IsChecked))
|
||||
If Not IsNothing(m_SelStart) Then
|
||||
m_bEdit_IsChecked = value
|
||||
If value Then
|
||||
m_bAdd_IsChecked = False
|
||||
m_bGrid_IsChecked = False
|
||||
m_bMove_IsChecked = False
|
||||
NotifyPropertyChanged(NameOf(bAdd_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bGrid_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bMove_IsChecked))
|
||||
End If
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(bEdit_IsChecked))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -192,10 +217,10 @@ Public Class StartMachPanelVM
|
||||
Set(value As Boolean)
|
||||
m_bGrid_IsChecked = value
|
||||
If value Then
|
||||
m_bType_IsChecked = False
|
||||
m_bAdd_IsChecked = False
|
||||
m_bEdit_IsChecked = False
|
||||
m_bMove_IsChecked = False
|
||||
NotifyPropertyChanged(NameOf(bType_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bAdd_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bEdit_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bMove_IsChecked))
|
||||
End If
|
||||
@@ -208,19 +233,45 @@ Public Class StartMachPanelVM
|
||||
Return m_bMove_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bMove_IsChecked = value
|
||||
If value Then
|
||||
m_bType_IsChecked = False
|
||||
m_bEdit_IsChecked = False
|
||||
m_bGrid_IsChecked = False
|
||||
NotifyPropertyChanged(NameOf(bType_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bEdit_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bGrid_IsChecked))
|
||||
If Not IsNothing(m_SelStart) Then
|
||||
m_bMove_IsChecked = value
|
||||
If value Then
|
||||
m_bAdd_IsChecked = False
|
||||
m_bEdit_IsChecked = False
|
||||
m_bGrid_IsChecked = False
|
||||
NotifyPropertyChanged(NameOf(bAdd_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bEdit_IsChecked))
|
||||
NotifyPropertyChanged(NameOf(bGrid_IsChecked))
|
||||
End If
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(bMove_IsChecked))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Compo_Visibility As Visibility
|
||||
Get
|
||||
Return If(Not IsNothing(m_SelStart) AndAlso m_SelStart.Type = StartMachTypes.COMPO, Visibility.Visible, Visibility.Collapsed)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' riferimento griglia all'ingresso in questa pagina
|
||||
Private m_OriginalGridFrame As New Frame3d
|
||||
|
||||
' parametro che indica se e' in corso il disegno di un percorso
|
||||
Private m_bIsCreatingPath As Boolean = False
|
||||
Public ReadOnly Property bIsCreatingPath As Boolean
|
||||
Get
|
||||
Return m_bIsCreatingPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdPoint As ICommand
|
||||
Private m_cmdLine2P As ICommand
|
||||
Private m_cmdModifyCurve As ICommand
|
||||
Private m_cmdAddPointCurve As ICommand
|
||||
Private m_cmdRemovePointCurve As ICommand
|
||||
Private m_cmdCPlaneTop As ICommand
|
||||
Private m_cmdCPlaneFront As ICommand
|
||||
Private m_cmdCPlaneRight As ICommand
|
||||
@@ -234,6 +285,8 @@ Public Class StartMachPanelVM
|
||||
Private m_cmdCPlane3P As ICommand
|
||||
Private m_cmdCPlanePerpObj As ICommand
|
||||
Private m_cmdCPlaneObj As ICommand
|
||||
Private m_cmdDragMove As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
@@ -249,23 +302,38 @@ Public Class StartMachPanelVM
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init()
|
||||
' azzero indice
|
||||
StartEntity.ResetSharedIndex()
|
||||
' fisso frame originale
|
||||
m_OriginalGridFrame = EgtGetGridFrame()
|
||||
' recupero dati pezzo selezionato layer ed entita'
|
||||
m_nPartId = Map.refTopPanelVM.SelPart.nPartId
|
||||
m_nStartMachLayerId = Map.refTopPanelVM.SelPart.nMachStartLayerId
|
||||
m_nStartMachId = Map.refTopPanelVM.SelPart.nMachStartId
|
||||
' verifico se punto o curva
|
||||
Dim StartMachType As GDB_TY = EgtGetType(m_nStartMachId)
|
||||
Select Case StartMachType
|
||||
Case GDB_TY.GEO_POINT
|
||||
SelType = StartMachTypes.POINT
|
||||
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_COMPO
|
||||
SelType = StartMachTypes.COMPO
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(TypeList))
|
||||
' aggiorno campi di testo posizione
|
||||
NotifyPropertyChanged(NameOf(sXPos))
|
||||
NotifyPropertyChanged(NameOf(sYPos))
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
'recupero tutte le entita' di partenza
|
||||
m_StartList.Clear()
|
||||
Dim nStartMachId As Integer = EgtGetFirstInGroup(m_nStartMachLayerId)
|
||||
While nStartMachId <> GDB_ID.NULL
|
||||
Dim StartMachType As GDB_TY = EgtGetType(nStartMachId)
|
||||
Select Case StartMachType
|
||||
Case GDB_TY.GEO_POINT
|
||||
m_StartList.Add(New StartEntity(nStartMachId, StartMachTypes.POINT))
|
||||
Case GDB_TY.CRV_COMPO
|
||||
m_StartList.Add(New StartEntity(nStartMachId, StartMachTypes.COMPO))
|
||||
End Select
|
||||
nStartMachId = EgtGetNext(nStartMachId)
|
||||
End While
|
||||
If m_StartList.Count > 0 Then
|
||||
SelStart = m_StartList(0)
|
||||
NotifyPropertyChanged(NameOf(SelStart))
|
||||
End If
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Friend Sub Dispose()
|
||||
' ripristino frame originale
|
||||
EgtSetGridFrame(m_OriginalGridFrame)
|
||||
EgtDraw()
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Friend Sub RefreshPos()
|
||||
@@ -274,10 +342,219 @@ Public Class StartMachPanelVM
|
||||
NotifyPropertyChanged(NameOf(sZPos))
|
||||
End Sub
|
||||
|
||||
Private Function InitCommand() As Boolean
|
||||
' attivo modifiche su scena
|
||||
Map.refSceneHostVM.MainScene.ResetStatus()
|
||||
' seleziono percorso corrente
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj(m_SelStart.nId)
|
||||
End Function
|
||||
|
||||
Friend Sub UpdateUi()
|
||||
' se attiva operazione in piu' passaggi, esco
|
||||
If Map.refSceneHostVM.MainController.GetContinue() Then Return
|
||||
Dim NewEntity As StartEntity = Nothing
|
||||
' se finita creazione curva (è stata chiusa)
|
||||
If bIsCreatingPath Then
|
||||
m_bIsCreatingPath = False
|
||||
Dim nNewStartLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWSTART)
|
||||
Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewStartLayerId)
|
||||
Dim NewGeomType As GDB_TY = EgtGetType(nNewEntityId)
|
||||
If NewGeomType = GDB_TY.GEO_POINT OrElse NewGeomType = GDB_TY.CRV_COMPO Then
|
||||
Dim NewEntityType As StartMachTypes
|
||||
Select Case NewGeomType
|
||||
Case GDB_TY.GEO_POINT
|
||||
NewEntityType = StartMachTypes.POINT
|
||||
Case GDB_TY.CRV_COMPO
|
||||
NewEntityType = StartMachTypes.COMPO
|
||||
End Select
|
||||
EgtSetName(nNewEntityId, START_GEOM)
|
||||
' coloro l'entita' di rosso
|
||||
Dim c3Red As Color3d
|
||||
c3Red.FromColor(System.Drawing.Color.Red)
|
||||
EgtSetColor(nNewEntityId, c3Red)
|
||||
' lo sposto nel layer degli start
|
||||
EgtRelocateGlob(nNewEntityId, m_nStartMachLayerId, GDB_POS.LAST_SON)
|
||||
' lo aggiungo alla lista
|
||||
NewEntity = New StartEntity(nNewEntityId, NewEntityType)
|
||||
m_StartList.Add(NewEntity)
|
||||
' cancello layer di disegno
|
||||
EgtErase(nNewStartLayerId)
|
||||
End If
|
||||
End If
|
||||
' aggiorno posizione
|
||||
RefreshPos()
|
||||
' se aggiunta entita'
|
||||
If Not IsNothing(NewEntity) Then
|
||||
SelStart = NewEntity
|
||||
NotifyPropertyChanged(NameOf(SelStart))
|
||||
End If
|
||||
' rimetto la selezione scena a null
|
||||
Map.refSceneHostVM.MainScene.SetStatusNull()
|
||||
End Sub
|
||||
|
||||
Friend Sub OnKeyDown(Key As Forms.Keys)
|
||||
If Key = Forms.Keys.Escape Then
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function OnMouseSelectingObj(nId As Integer) As Boolean
|
||||
Return EgtGetParent(nId) = m_nStartMachLayerId
|
||||
End Function
|
||||
|
||||
Friend Sub SelStartFromId(nId)
|
||||
Dim SelStartEntity As StartEntity = m_StartList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(SelStartEntity) Then
|
||||
SelStart = SelStartEntity
|
||||
NotifyPropertyChanged(NameOf(SelStart))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Point"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do CPlaneTop.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Point_Command As ICommand
|
||||
Get
|
||||
If m_cmdPoint Is Nothing Then
|
||||
m_cmdPoint = New Command(AddressOf Point)
|
||||
End If
|
||||
Return m_cmdPoint
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
|
||||
''' </summary>
|
||||
Public Sub Point(ByVal param As Object)
|
||||
Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
|
||||
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
|
||||
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
|
||||
'InitCommand(True)
|
||||
If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.POINT) Then
|
||||
m_bIsCreatingPath = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Point
|
||||
|
||||
#Region "Line2P"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do CPlaneTop.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Line2P_Command As ICommand
|
||||
Get
|
||||
If m_cmdLine2P Is Nothing Then
|
||||
m_cmdLine2P = New Command(AddressOf Line2P)
|
||||
End If
|
||||
Return m_cmdLine2P
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
|
||||
''' </summary>
|
||||
Public Sub Line2P(ByVal param As Object)
|
||||
Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
|
||||
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
|
||||
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
|
||||
Map.refSceneHostVM.MainController.SetContinue()
|
||||
If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.LINE2P) Then
|
||||
m_bIsCreatingPath = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Line2P
|
||||
|
||||
#Region "ModifyCurve"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Linear Dimension.
|
||||
''' </summary>
|
||||
Public ReadOnly Property ModifyCurve_Command As ICommand
|
||||
Get
|
||||
If m_cmdModifyCurve Is Nothing Then
|
||||
m_cmdModifyCurve = New Command(AddressOf ModifyCurve)
|
||||
End If
|
||||
Return m_cmdModifyCurve
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
|
||||
''' </summary>
|
||||
Public Sub ModifyCurve(ByVal param As Object)
|
||||
InitCommand()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MODIFYCURVE)
|
||||
End Sub
|
||||
|
||||
#End Region ' ModifyCurve
|
||||
|
||||
#Region "AddPointCurve"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Linear Dimension.
|
||||
''' </summary>
|
||||
Public ReadOnly Property AddPointCurve_Command As ICommand
|
||||
Get
|
||||
If m_cmdAddPointCurve Is Nothing Then
|
||||
m_cmdAddPointCurve = New Command(AddressOf AddPointCurve)
|
||||
End If
|
||||
Return m_cmdAddPointCurve
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
|
||||
''' </summary>
|
||||
Public Sub AddPointCurve(ByVal param As Object)
|
||||
InitCommand()
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.CURVETOARC)
|
||||
Else
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.ADDPOINTCURVE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' AddPointCurve
|
||||
|
||||
#Region "RemovePointCurve"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Linear Dimension.
|
||||
''' </summary>
|
||||
Public ReadOnly Property RemovePointCurve_Command As ICommand
|
||||
Get
|
||||
If m_cmdRemovePointCurve Is Nothing Then
|
||||
m_cmdRemovePointCurve = New Command(AddressOf RemovePointCurve)
|
||||
End If
|
||||
Return m_cmdRemovePointCurve
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
|
||||
''' </summary>
|
||||
Public Sub RemovePointCurve(ByVal param As Object)
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
InitCommand()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.CURVETOLINE)
|
||||
Else
|
||||
InitCommand()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.REMOVEPOINTCURVE)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' RemovePointCurve
|
||||
|
||||
|
||||
#Region "CPlaneTop"
|
||||
|
||||
''' <summary>
|
||||
@@ -468,6 +745,109 @@ Public Class StartMachPanelVM
|
||||
|
||||
#End Region ' CPlaneOrigin
|
||||
|
||||
#Region "DragMove"
|
||||
|
||||
Public ReadOnly Property DragMove_Command As ICommand
|
||||
Get
|
||||
If m_cmdDragMove Is Nothing Then
|
||||
m_cmdDragMove = New Command(AddressOf DragMove)
|
||||
End If
|
||||
Return m_cmdDragMove
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub DragMove()
|
||||
InitCommand()
|
||||
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MOVE)
|
||||
End Sub
|
||||
|
||||
#End Region ' DragMove
|
||||
|
||||
#Region "Delete"
|
||||
|
||||
Public ReadOnly Property Delete_Command As ICommand
|
||||
Get
|
||||
If m_cmdDelete Is Nothing Then
|
||||
m_cmdDelete = New Command(AddressOf Delete)
|
||||
End If
|
||||
Return m_cmdDelete
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Delete()
|
||||
If IsNothing(SelStart) Then Return
|
||||
If EgtErase(m_SelStart.nId) Then
|
||||
Dim nSelStartIndex As Integer = m_StartList.IndexOf(SelStart)
|
||||
m_StartList.Remove(SelStart)
|
||||
If nSelStartIndex < m_StartList.Count Then
|
||||
SelStart = m_StartList(nSelStartIndex)
|
||||
ElseIf m_StartList.Count > 0 Then
|
||||
SelStart = m_StartList(m_StartList.Count - 1)
|
||||
Else
|
||||
SelStart = Nothing
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(SelStart))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
Public Class StartEntity
|
||||
Inherits VMBase
|
||||
|
||||
Private Shared m_nSharedIndex As Integer = 0
|
||||
Private ReadOnly Property nSharedIndex As Integer
|
||||
Get
|
||||
m_nSharedIndex += 1
|
||||
Return m_nSharedIndex
|
||||
End Get
|
||||
End Property
|
||||
Friend Shared Sub ResetSharedIndex()
|
||||
m_nSharedIndex = 0
|
||||
End Sub
|
||||
|
||||
Private m_nId As Integer
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Type As StartMachPanelVM.StartMachTypes
|
||||
Public ReadOnly Property Type As StartMachPanelVM.StartMachTypes
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_nIndex As Integer
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Dim sType As String = ""
|
||||
Select Case m_Type
|
||||
Case StartMachPanelVM.StartMachTypes.POINT
|
||||
sType = "Point"
|
||||
Case StartMachPanelVM.StartMachTypes.COMPO
|
||||
sType = "Path"
|
||||
End Select
|
||||
Return String.Format("[{0}] {1}", {m_nIndex, sType})
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nId As Integer, Type As StartMachPanelVM.StartMachTypes)
|
||||
m_nId = nId
|
||||
m_Type = Type
|
||||
m_nIndex = nSharedIndex
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -22,6 +22,13 @@
|
||||
Width="50"
|
||||
Visibility="{Binding MediaHeight_Visibility}"
|
||||
Style="{StaticResource ControllerInputPanel_TextBox}"/>
|
||||
<TextBlock Text="Difference:"
|
||||
Visibility="{Binding Difference_Visibility}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
<TextBox Text="{Binding sDifference}"
|
||||
Width="50"
|
||||
Visibility="{Binding Difference_Visibility}"
|
||||
Style="{StaticResource ControllerInputPanel_TextBox}"/>
|
||||
<TextBlock Text="F:"
|
||||
Visibility="{Binding FCurr_Visibility}"
|
||||
Style="{StaticResource OptionTextBlock}"/>
|
||||
|
||||
@@ -49,12 +49,15 @@ Public Class TFSEditorVM
|
||||
Case MediaTypes.HEIGHT
|
||||
SetMediaHeightVisibility(True)
|
||||
SetFCurrVisibility(False)
|
||||
SetDifference_Visibility(False)
|
||||
Case MediaTypes.SECTIONCHANGE
|
||||
SetMediaHeightVisibility(False)
|
||||
SetFCurrVisibility(False)
|
||||
SetDifference_Visibility(True)
|
||||
Case MediaTypes.SELECTION
|
||||
SetMediaHeightVisibility(False)
|
||||
SetFCurrVisibility(True)
|
||||
SetDifference_Visibility(False)
|
||||
End Select
|
||||
End Set
|
||||
End Property
|
||||
@@ -85,6 +88,32 @@ Public Class TFSEditorVM
|
||||
NotifyPropertyChanged(NameOf(MediaHeight_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_nDifference As Integer
|
||||
Public Property sDifference As String
|
||||
Get
|
||||
Return m_nDifference
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim nNewValue As Integer = 0
|
||||
If Integer.TryParse(value, nNewValue) Then
|
||||
m_nDifference = nNewValue
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(sDifference))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Difference_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property Difference_Visibility As Visibility
|
||||
Get
|
||||
Return m_Difference_Visibility
|
||||
End Get
|
||||
End Property
|
||||
Private Sub SetDifference_Visibility(bValue As Boolean)
|
||||
m_Difference_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(Difference_Visibility))
|
||||
End Sub
|
||||
|
||||
Private m_dFCurr As Double
|
||||
Public Property sFCurr As String
|
||||
Get
|
||||
@@ -254,7 +283,7 @@ Public Class TFSEditorVM
|
||||
' recupero punti di rottura
|
||||
For Index = 1 To m_LayerList.Count() - 1
|
||||
Dim dCurrLength = m_LayerList(Index)
|
||||
If dPrevLength < m_LayerList(Index).dLength * 0.9 OrElse dPrevLength > m_LayerList(Index).dLength * 1.1 Then
|
||||
If dPrevLength < m_LayerList(Index).dLength * (1 - (m_nDifference / 100)) OrElse dPrevLength > m_LayerList(Index).dLength * (1 + (m_nDifference / 100)) Then
|
||||
ChangeIndexList.Add(Index)
|
||||
End If
|
||||
dPrevLength = m_LayerList(Index).dLength
|
||||
|
||||
@@ -65,7 +65,8 @@ Public Class TopPanelVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private m_ModifyModeList As New List(Of ModifyModeButton)({New ModifyModeButton("Disposition", ModifyModes.DISPOSITION),
|
||||
Private m_ModifyModeList As New List(Of ModifyModeButton)({New ModifyModeButton("Select Part", ModifyModes.SELECT_),
|
||||
New ModifyModeButton("Disposition", ModifyModes.DISPOSITION),
|
||||
New ModifyModeButton("Reference", ModifyModes.REFERENCE),
|
||||
New ModifyModeButton("StartMachining", ModifyModes.STARTMACH),
|
||||
New ModifyModeButton("Ribs", ModifyModes.RIBS),
|
||||
|
||||
Reference in New Issue
Block a user