EgtCAM5 :

- Migliorie varie.
This commit is contained in:
Emmanuele Sassi
2016-07-09 10:44:36 +00:00
parent f77e074d23
commit bca8754b82
18 changed files with 653 additions and 267 deletions
+7
View File
@@ -124,6 +124,9 @@ Class Application
Friend Const SELECTIDINOBJTREE As String = "SelectIdInObjTree"
Friend Const CLEAROBJTREE As String = "ClearObjTree"
Friend Const UPDATEOBJTREE As String = "UpdateObjTree"
Friend Const UPDATEHEADERNAME As String = "UpdateHeaderName"
Friend Const UPDATEHEADERCOLOR As String = "UpdateHeaderColor"
Friend Const UPDATEOBJTREEOLDID As String = "UpdateObjTreeOldId"
' StatusBar messages
Friend Const STATUSGRIDCOMMAND As String = "StatusGridCommand"
@@ -148,6 +151,10 @@ Class Application
Friend Const OPENPROJECT As String = "OpenProject"
Friend Const SAVEPROJECT As String = "SaveProject"
Friend Const SAVEASPROJECT As String = "SaveAsProject"
Friend Const INSERTPROJECT As String = "InsertProject"
Friend Const IMPORTPROJECT As String = "ImportProject"
Friend Const EXPORTPROJECT As String = "ExportProject"
Friend Const EXECPROJECT As String = "ExecProject"
Shared ReadOnly _messenger As New Messenger()
+31
View File
@@ -74,6 +74,37 @@
<Setter Property="Width" Value="30"/>
</Style>
<Style x:Key="EgtCAM5_LampToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
<Setter Property="Height" Value="30"/>
<Setter Property="Width" Value="30"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<StackPanel Orientation="Horizontal">
<Image>
<Image.Style>
<Style>
<Setter Property="Image.Source"
Value="c:\EgtDev\EgtCAM5\Resources\TreeView\LampOff.png" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked,
RelativeSource={RelativeSource AncestorType=
{x:Type ToggleButton}}}" Value="True">
<Setter Property="Image.Source"
Value="c:\EgtDev\EgtCAM5\Resources\TreeView\LampOn.png" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
<ContentPresenter Content="{TemplateBinding Content}"
Margin="5,0,0,0" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="EgtCAM5_RadioButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource EgtCAM5_ToggleButton}">
</Style>
+117 -53
View File
@@ -70,8 +70,9 @@ Public Class MachiningTreeViewItem
Return m_LeadLinkTypeList
End Get
End Property
Private m_LeadLinkTypeGetError As Boolean = False
' Proprietà che indica il WorkSide (MCH_SAW_WS)
' Proprietà che indica il LeadLinkType
Public Property SelectedLeadLinkType As Integer
Get
If Not IsNothing(m_LeadLinkTypeList) Then
@@ -153,7 +154,6 @@ Public Class MachiningTreeViewItem
NotifyPropertyChanged("SelectedLeadOutType")
NotifyPropertyChanged("SelectedCurveUse")
NotifyPropertyChanged("SelectedStepType")
NotifyPropertyChanged("SelectedLeadLinkType")
NotifyPropertyChanged("Speed")
NotifyPropertyChanged("Feed")
@@ -286,15 +286,28 @@ Public Class MachiningTreeViewItem
Return m_LeadInTypeList
End Get
End Property
' Proprietà che indica il LeadInType (MCH_SAW_LI)
Private m_LeadInTypeGetError As Boolean = False
' Proprietà che indica il LeadInType
Public Property SelectedLeadInType As Integer
Get
Dim nLeadInType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.LEADINTYPE, nLeadInType)
Return IdNameStruct.SearchToId(nLeadInType, LeadInTypeList)
If Not IsNothing(m_LeadInTypeList) Then
Dim nLeadInType As Integer = 0
If EgtMdbGetCurrMachiningParam(MCH_MP.LEADINTYPE, nLeadInType) Then
m_LeadInTypeGetError = True
Else
m_LeadInTypeGetError = False
End If
Return IdNameStruct.SearchToId(nLeadInType, m_LeadInTypeList)
Else
Return 0
End If
End Get
Set(value As Integer)
EgtMdbSetCurrMachiningParam(MCH_MP.LEADINTYPE, IdNameStruct.SearchFromId(value, LeadInTypeList))
If Not IsNothing(m_LeadInTypeList) Then
If m_LeadInTypeGetError Then
EgtMdbSetCurrMachiningParam(MCH_MP.LEADINTYPE, IdNameStruct.SearchFromId(value, m_LeadInTypeList))
End If
End If
End Set
End Property
@@ -332,15 +345,28 @@ Public Class MachiningTreeViewItem
Return m_LeadOutTypeList
End Get
End Property
' Proprietà che indica il LeadOutType (MCH_SAW_LO)
Private m_LeadOutTypeGetError As Boolean = False
' Proprietà che indica il LeadOutType
Public Property SelectedLeadOutType As Integer
Get
Dim nLeadOutType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.LEADOUTTYPE, nLeadOutType)
Return IdNameStruct.SearchToId(nLeadOutType, LeadOutTypeList)
If Not IsNothing(m_LeadOutTypeList) Then
Dim nLeadOutType As Integer = 0
If EgtMdbGetCurrMachiningParam(MCH_MP.LEADOUTTYPE, nLeadOutType) Then
m_LeadOutTypeGetError = True
Else
m_LeadOutTypeGetError = False
End If
Return IdNameStruct.SearchToId(nLeadOutType, m_LeadOutTypeList)
Else
Return 0
End If
End Get
Set(value As Integer)
EgtMdbSetCurrMachiningParam(MCH_MP.LEADOUTTYPE, IdNameStruct.SearchFromId(value, LeadOutTypeList))
If Not IsNothing(m_LeadOutTypeList) Then
If m_LeadOutTypeGetError Then
EgtMdbSetCurrMachiningParam(MCH_MP.LEADOUTTYPE, IdNameStruct.SearchFromId(value, m_LeadOutTypeList))
End If
End If
End Set
End Property
@@ -380,34 +406,31 @@ Public Class MachiningTreeViewItem
Return m_StepTypeList
End Get
End Property
' Proprietà che indica il LeadOutType (MCH_SAW_LO)
Private m_StepTypeGetError As Boolean = False
' Proprietà che indica il StepType
Public Property SelectedStepType As Integer
Get
Dim nStepType As Integer = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STEPTYPE, nStepType)
Return IdNameStruct.SearchToId(nStepType, StepTypeList)
If Not IsNothing(m_StepTypeList) Then
Dim nStepType As Integer = 0
If EgtMdbGetCurrMachiningParam(MCH_MP.STEPTYPE, nStepType) Then
m_StepTypeGetError = True
Else
m_StepTypeGetError = False
End If
Return IdNameStruct.SearchToId(nStepType, m_StepTypeList)
Else
Return 0
End If
End Get
Set(value As Integer)
EgtMdbSetCurrMachiningParam(MCH_MP.STEPTYPE, IdNameStruct.SearchFromId(value, StepTypeList))
If Not IsNothing(m_StepTypeList) Then
If m_StepTypeGetError Then
EgtMdbSetCurrMachiningParam(MCH_MP.STEPTYPE, IdNameStruct.SearchFromId(value, m_StepTypeList))
End If
End If
End Set
End Property
' ''' <summary>
' ''' Property that read and write to the Machining's database the Lead Link Type
' ''' </summary>
'Public Property LeadLinkType As Integer
' Get
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
' Dim nLeadLinkType As Integer = 0
' EgtMdbGetCurrMachiningParam(MCH_MP.LEADLINKTYPE, nLeadLinkType)
' Return nLeadLinkType
' End Get
' Set(value As Integer)
' 'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
' EgtMdbSetCurrMachiningParam(MCH_MP.LEADLINKTYPE, value)
' End Set
'End Property
Dim m_Speed As Double
''' <summary>
''' Property that read and write to the Machining's database the Speed
@@ -1054,26 +1077,26 @@ Public Class MachiningTreeViewItem
End If
End Sub
''' <summary>
''' Property that read and write to the Machining's database the Tool
''' </summary>
Public Property SelectedTool As Integer
Get
Dim nUUID As String = String.Empty
Dim sName As String = String.Empty
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, nUUID)
EgtTdbGetToolFromUUID(nUUID, sName)
For i = 0 To ToolList.Count - 1
If ToolList(i) = sName Then
Return i
End If
Next
Return 0
End Get
Set(value As Integer)
EgtMdbSetCurrMachiningParam(MCH_MP.TOOL, ToolList(value))
End Set
End Property
' ''' <summary>
' ''' Property that read and write to the Machining's database the Tool
' ''' </summary>
'Public Property SelectedTool As Integer
' Get
' Dim nUUID As String = String.Empty
' Dim sName As String = String.Empty
' EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, nUUID)
' EgtTdbGetToolFromUUID(nUUID, sName)
' For i = 0 To ToolList.Count - 1
' If ToolList(i) = sName Then
' Return i
' End If
' Next
' Return 0
' End Get
' Set(value As Integer)
' EgtMdbSetCurrMachiningParam(MCH_MP.TOOL, ToolList(value))
' End Set
'End Property
''' <summary>
''' Property that read and write to the Machining's database the Depth Str
@@ -1139,6 +1162,47 @@ Public Class MachiningTreeViewItem
End Set
End Property
'ObservableCollection che contiene le variabili per il combobox SubType
Private m_SubTypeList As ObservableCollection(Of IdNameStruct)
Public ReadOnly Property SubTypeList As ObservableCollection(Of IdNameStruct)
Get
Select Case m_Type
Case MCH_MY.SAWFINISHING
m_SubTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAWFIN_SUB.ALONG, EgtMsg(MSG_MACHININGSDBPAGE + 146)), New IdNameStruct(MCH_SAWFIN_SUB.ACROSS, EgtMsg(MSG_MACHININGSDBPAGE + 147))})
Case MCH_MY.DRILLING
m_SubTypeList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(0, "Prova 1"), New IdNameStruct(1, "Prova 2")})
Case Else
m_SubTypeList = Nothing
End Select
Return m_SubTypeList
End Get
End Property
Private m_SubTypeGetError As Boolean = False
' Proprietà che indica il SubType
Public Property SelectedSubType As Integer
Get
If Not IsNothing(m_SubTypeList) Then
Dim nSubType As Integer = 0
If EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, nSubType) Then
m_SubTypeGetError = True
Else
m_SubTypeGetError = False
End If
Return IdNameStruct.SearchToId(nSubType, m_SubTypeList)
Else
Return 0
End If
End Get
Set(value As Integer)
If Not IsNothing(m_SubTypeList) Then
If m_SubTypeGetError Then
EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, IdNameStruct.SearchFromId(value, m_SubTypeList))
End If
End If
End Set
End Property
#End Region ' Machining Property
#Region "Constructors"
+28
View File
@@ -61,6 +61,7 @@
<sys:Int32 x:Key="UserNotes">47</sys:Int32>
<sys:Int32 x:Key="OverLapStr">48</sys:Int32>
<sys:Int32 x:Key="OffsetStr">49</sys:Int32>
<sys:Int32 x:Key="SubType">50</sys:Int32>
</UserControl.Resources>
@@ -176,6 +177,7 @@
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.Resources>
@@ -1308,6 +1310,32 @@
</Grid>
<Grid Grid.Column="1" Grid.Row="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding SubTypeTxBl}"
Visibility="{Binding Path=SelectedItem.Type, ElementName=MachiningsTreeView,
Converter={StaticResource MachiningParamVisibilityConverter},
ConverterParameter={StaticResource SubType}}"/>
<ComboBox Grid.Column="1" ItemsSource="{Binding Path=SelectedItem.SubTypeList,
ElementName=MachiningsTreeView, Mode=OneWay}"
SelectedIndex="{Binding Path=SelectedItem.SelectedSubType,
ElementName=MachiningsTreeView}"
IsSynchronizedWithCurrentItem="True"
Visibility="{Binding Path=SelectedItem.Type,
ElementName=MachiningsTreeView,
Converter={StaticResource MachiningParamVisibilityConverter},
ConverterParameter={StaticResource SubType}}"/>
</Grid>
</Grid>
<Grid Grid.Column="2">
+30 -24
View File
@@ -207,145 +207,151 @@ Namespace EgtCAM5
Public ReadOnly Property TabLenTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 80)
Return EgtMsg(MSG_MACHININGSDBPAGE + 79)
End Get
End Property
Public ReadOnly Property TabDistTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 81)
Return EgtMsg(MSG_MACHININGSDBPAGE + 80)
End Get
End Property
Public ReadOnly Property TabHeightTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 82)
Return EgtMsg(MSG_MACHININGSDBPAGE + 81)
End Get
End Property
Public ReadOnly Property TabAngleTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 83)
Return EgtMsg(MSG_MACHININGSDBPAGE + 82)
End Get
End Property
Public ReadOnly Property LiTangTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 84)
Return EgtMsg(MSG_MACHININGSDBPAGE + 83)
End Get
End Property
Public ReadOnly Property LiPerpTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 85)
Return EgtMsg(MSG_MACHININGSDBPAGE + 84)
End Get
End Property
Public ReadOnly Property LiElevTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 86)
Return EgtMsg(MSG_MACHININGSDBPAGE + 85)
End Get
End Property
Public ReadOnly Property LiCompLenTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 87)
Return EgtMsg(MSG_MACHININGSDBPAGE + 86)
End Get
End Property
Public ReadOnly Property LoTangTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 88)
Return EgtMsg(MSG_MACHININGSDBPAGE + 87)
End Get
End Property
Public ReadOnly Property LoPerpTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 89)
Return EgtMsg(MSG_MACHININGSDBPAGE + 88)
End Get
End Property
Public ReadOnly Property LoElevTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 90)
Return EgtMsg(MSG_MACHININGSDBPAGE + 89)
End Get
End Property
Public ReadOnly Property LoCompLenTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 91)
Return EgtMsg(MSG_MACHININGSDBPAGE + 90)
End Get
End Property
Public ReadOnly Property StartAddLenTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 92)
Return EgtMsg(MSG_MACHININGSDBPAGE + 91)
End Get
End Property
Public ReadOnly Property EndAddLenTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 93)
Return EgtMsg(MSG_MACHININGSDBPAGE + 92)
End Get
End Property
Public ReadOnly Property StepExtArcTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 95)
Return EgtMsg(MSG_MACHININGSDBPAGE + 93)
End Get
End Property
Public ReadOnly Property StepIntArcTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 96)
Return EgtMsg(MSG_MACHININGSDBPAGE + 94)
End Get
End Property
Public ReadOnly Property SideStepTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 97)
Return EgtMsg(MSG_MACHININGSDBPAGE + 95)
End Get
End Property
Public ReadOnly Property VertFeedTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 98)
Return EgtMsg(MSG_MACHININGSDBPAGE + 96)
End Get
End Property
Public ReadOnly Property NameParTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 99)
Return EgtMsg(MSG_MACHININGSDBPAGE + 97)
End Get
End Property
Public ReadOnly Property ToolTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 100)
Return EgtMsg(MSG_MACHININGSDBPAGE + 98)
End Get
End Property
Public ReadOnly Property DepthStrTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 101)
Return EgtMsg(MSG_MACHININGSDBPAGE + 99)
End Get
End Property
Public ReadOnly Property UserNotesTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 104)
Return EgtMsg(MSG_MACHININGSDBPAGE + 100)
End Get
End Property
Public ReadOnly Property OverLapStrTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 105)
Return EgtMsg(MSG_MACHININGSDBPAGE + 101)
End Get
End Property
Public ReadOnly Property OffsetStrTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 106)
Return EgtMsg(MSG_MACHININGSDBPAGE + 102)
End Get
End Property
Public ReadOnly Property SubTypeTxBl As String
Get
Return EgtMsg(MSG_MACHININGSDBPAGE + 103)
End Get
End Property
-25
View File
@@ -365,29 +365,6 @@ Namespace EgtCAM5
Dim WinPos As New WinPos
GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
WinPosToWindow(Application.Current.MainWindow, WinPos)
'If ModifierKeys <> Keys.Shift Then
' Dim nFlag As Integer
' Dim nLeft As Integer
' Dim nTop As Integer
' Dim nWidth As Integer
' Dim nHeight As Integer
' GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, nFlag, nLeft, nTop, nWidth, nHeight, m_sIniFile)
' Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
' Me.Location = New Point(nLeft, nTop)
' Me.Size = New Size(nWidth, nHeight)
' WindowState = If(nFlag = 1, FormWindowState.Maximized, FormWindowState.Normal)
'End If
'' Impostazioni controller
'm_Controller.SetScene(Scene1)
'Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0, m_sIniFile) <> 0)
'Dim sCmdLogFile As String = CMDLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
'If Not m_Controller.SetCommandLog(bLuaReg, m_sTempDir, sCmdLogFile) Then
' EgtOutLog("Command log not started")
' If My.Application.CommandLineArgs.Count() = 0 Then
' MessageBox.Show("Command log not started", "TestEIn Warning",
' MessageBoxButtons.OK, MessageBoxIcon.Warning)
' End If
'End If
'If m_Controller.GetCommandLog() Then
' tsStatusReg.BackColor = Color.Lime
'ElseIf bLuaReg Then
@@ -396,8 +373,6 @@ Namespace EgtCAM5
'' Impostazioni MruLists
'm_MruFiles.Init(m_sIniFile, S_MRUFILES, 8)
'm_MruScripts.Init(m_sIniFile, S_MRUSCRIPTS, 8)
'' Apro progetto vuoto
'm_Controller.NewProject(True)
'' Impostazione Testi e ToolTips
'SetMessages()
'' Installo funzione gestione eventi per lua
+21 -19
View File
@@ -1,4 +1,6 @@
Namespace EgtCAM5
Imports EgtUILib
Namespace EgtCAM5
Public Class DrawPanelViewModel
Inherits ViewModelBase
@@ -182,7 +184,7 @@
''' Execute the ArcCSE. This method is invoked by the ArcCSECommand.
''' </summary>
Public Sub ArcCSE(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.ARCCSE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ARCCSE)
End Sub
''' <summary>
@@ -212,7 +214,7 @@
''' Execute the Arc3P. This method is invoked by the Arc3PCommand.
''' </summary>
Public Sub Arc3P(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.ARC3P)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.ARC3P)
End Sub
''' <summary>
@@ -302,7 +304,7 @@
''' Execute the Rectangle2P. This method is invoked by the Rectangle2PCommand.
''' </summary>
Public Sub Rectangle2P(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.RECTANGLE2P)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RECTANGLE2P)
End Sub
''' <summary>
@@ -422,7 +424,7 @@
''' Execute the Extrude. This method is invoked by the ExtrudeCommand.
''' </summary>
Public Sub Extrude(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXTRUDE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXTRUDE)
End Sub
''' <summary>
@@ -452,7 +454,7 @@
''' Execute the Revolve. This method is invoked by the RevolveCommand.
''' </summary>
Public Sub Revolve(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.REVOLVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.REVOLVE)
End Sub
''' <summary>
@@ -482,7 +484,7 @@
''' Execute the Screw. This method is invoked by the ScrewCommand.
''' </summary>
Public Sub Screw(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.SCREW)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SCREW)
End Sub
''' <summary>
@@ -512,7 +514,7 @@
''' Execute the Ruled. This method is invoked by the RuledCommand.
''' </summary>
Public Sub Ruled(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.RULED)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.RULED)
End Sub
''' <summary>
@@ -542,7 +544,7 @@
''' Execute the MergeSurf. This method is invoked by the MergeSurfCommand.
''' </summary>
Public Sub MergeSurf(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.MERGESURF)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MERGESURF)
End Sub
''' <summary>
@@ -572,7 +574,7 @@
''' Execute the ExplodeSurf. This method is invoked by the ExplodeSurfCommand.
''' </summary>
Public Sub ExplodeSurf(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.MERGESURF)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXPLODESURF)
End Sub
''' <summary>
@@ -602,7 +604,7 @@
''' Execute the InvertSurf. This method is invoked by the InvertSurfCommand.
''' </summary>
Public Sub InvertSurf(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.INVERTSURF)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.INVERTSURF)
End Sub
''' <summary>
@@ -662,7 +664,7 @@
''' Execute the ChangeLayer. This method is invoked by the ChangeLayerCommand.
''' </summary>
Public Sub ChangeLayer(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.CHANGELAYER)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGELAYER)
End Sub
''' <summary>
@@ -722,7 +724,7 @@
''' Execute the InvertCurve. This method is invoked by the InvertCurveCommand.
''' </summary>
Public Sub InvertCurve(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.INVERTCURVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.INVERTCURVE)
End Sub
''' <summary>
@@ -752,7 +754,7 @@
''' Execute the ChangeStartCurve. This method is invoked by the InvertCurveCommand.
''' </summary>
Public Sub ChangeStartCurve(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.CHANGESTARTCURVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.CHANGESTARTCURVE)
End Sub
''' <summary>
@@ -782,7 +784,7 @@
''' Execute the ExtendCurve. This method is invoked by the ExtendCurveCommand.
''' </summary>
Public Sub ExtendCurve(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXTENDCURVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.TRIMEXTENDCURVE)
End Sub
''' <summary>
@@ -872,7 +874,7 @@
''' Execute the ExplodeCurve. This method is invoked by the ExplodeCurveCommand.
''' </summary>
Public Sub ExplodeCurve(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.JOINCURVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.EXPLODECURVE)
End Sub
''' <summary>
@@ -902,7 +904,7 @@
''' Execute the SetCurveTh. This method is invoked by the SetCurveThCommand.
''' </summary>
Public Sub SetCurveTh(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.SETCURVETH)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETCURVETHICKNESS)
End Sub
''' <summary>
@@ -932,7 +934,7 @@
''' Execute the Move. This method is invoked by the MoveCommand.
''' </summary>
Public Sub Move(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.MOVE)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.MOVE)
End Sub
''' <summary>
@@ -1052,7 +1054,7 @@
''' Execute the Offset. This method is invoked by the OffsetCommand.
''' </summary>
Public Sub Offset(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.OFFSET)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.OFFSET)
End Sub
''' <summary>
@@ -1,9 +1,12 @@
<UserControl x:Class="InfoExpanderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Expander Header="Properties">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EgtCAM5.EgtCAM5">
<Expander Header="Properties" IsExpanded="{Binding IsEnabled}">
<UniformGrid>
<TextBox/>
<TextBox Text="{Binding InfoBox}"/>
</UniformGrid>
</Expander>
</UserControl>
@@ -1,6 +1,61 @@
Namespace EgtCAM5
Imports EgtUILib
Namespace EgtCAM5
Public Class InfoExpanderViewModel
Inherits ViewModelBase
Private m_IsExpanded As Boolean
Public Property IsEnabled As Boolean
Get
Return m_IsExpanded
End Get
Set(value As Boolean)
If value <> m_IsExpanded Then
m_IsExpanded = value
OnPropertyChanged("IsEnabled")
End If
End Set
End Property
Private m_InfoBox As String
Public Property InfoBox As String
Get
Return m_InfoBox
End Get
Set(value As String)
If value <> m_InfoBox Then
m_InfoBox = value
OnPropertyChanged("InfoBox")
End If
End Set
End Property
Private Sub UpdateObjDataInObjTree(ByVal nId As Integer)
' recupero il tipo del nuovo oggetto
Dim nType As Integer = EgtGetType(nId)
' stampa dei dati dell'oggetto
Dim sDump As String = String.Empty
If nType = GDB_TY.NONE Then
InfoBox = String.Empty
ElseIf nType = GDB_TY.GROUP Then
If EgtGroupDump(nId, sDump) Then
InfoBox = sDump
IsEnabled = True
Else
InfoBox = String.Empty
IsEnabled = False
End If
Else
If EgtGeoObjDump(nId, sDump) Then
InfoBox = sDump
IsEnabled = True
Else
InfoBox = String.Empty
IsEnabled = False
End If
End If
End Sub
End Class
@@ -15,10 +15,13 @@
</StackPanel.Style>
<TextBlock Text="{Binding TextBlock}"/>
<TextBox Text="{Binding TextBox}"/>
<CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"/>
<CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"
Visibility="{Binding CheckVisibility}"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding ComboVisibility}"/>
<UniformGrid>
<Button Command="{Binding}" Visibility="{Binding ShowVisibility}" Content="Show" Style="{StaticResource EgtCAM5_Button}"/>
<Button Command="{Binding}" Visibility="{Binding ShowVisibility}" Content="Show"
Style="{StaticResource EgtCAM5_Button}"/>
<Button Command="{Binding DoneCommand}" Content="Done" Style="{StaticResource EgtCAM5_Button}"/>
</UniformGrid>
</StackPanel>
@@ -102,6 +102,19 @@ Namespace EgtCAM5
End Set
End Property
Private m_CheckVisibility As Visibility
Public Property CheckVisibility As Visibility
Get
Return m_CheckVisibility
End Get
Set(value As Visibility)
If value <> m_CheckVisibility Then
m_CheckVisibility = value
OnPropertyChanged("CheckVisibility")
End If
End Set
End Property
' ComboBox fields
Private m_ComboItemsList As ObservableCollection(Of String)
Public Property ComboItemsList As ObservableCollection(Of String)
@@ -128,13 +141,26 @@ Namespace EgtCAM5
End Set
End Property
Private m_ComboVisibility As Visibility
Public Property ComboVisibility As Visibility
Get
Return m_ComboVisibility
End Get
Set(value As Visibility)
If value <> m_ComboVisibility Then
m_ComboVisibility = value
OnPropertyChanged("ComboVisibility")
End If
End Set
End Property
' Buttons fields
Private m_ShowBtnVisibility As Boolean
Public Property ShowBtnVisibility As Boolean
Private m_ShowBtnVisibility As Visibility
Public Property ShowBtnVisibility As Visibility
Get
Return m_ShowBtnVisibility
End Get
Set(value As Boolean)
Set(value As Visibility)
m_ShowBtnVisibility = value
OnPropertyChanged("ShowBtnVisibility")
End Set
@@ -248,12 +274,14 @@ Namespace EgtCAM5
TextBox = ""
If PrepareInputBoxParam.sCheckLabel <> "" Then
CheckBoxText = PrepareInputBoxParam.sCheckLabel
CheckVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowCombo Then
ComboItemsList.Clear()
ComboVisibility = Visibility.Visible
End If
If PrepareInputBoxParam.bShowBtn Then
ShowBtnVisibility = True
ShowBtnVisibility = Visibility.Visible
End If
FocusTextBox = True
End Sub
@@ -261,6 +289,9 @@ Namespace EgtCAM5
Private Sub ResetInputBox()
Title = "Drawing Parameters"
CheckVisibility = Visibility.Hidden
ComboVisibility = Visibility.Hidden
ShowBtnVisibility = Visibility.Hidden
IsExpanded = False
IsEnabled = False
End Sub
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Public Class LayerTreeViewItem
Inherits TreeViewItemBase
@@ -26,7 +27,16 @@ Public Class LayerTreeViewItem
Return m_OnOff
End Get
Set(value As Boolean)
m_OnOff = value
If m_OnOff <> value Then
m_OnOff = value
' eseguo operazione
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, Id)
If value Then
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SHOW)
Else
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.HIDE)
End If
End If
End Set
End Property
@@ -53,7 +63,7 @@ Public Class LayerTreeViewItem
End Set
End Property
Sub New(Id As Integer, Name As String, Image As String, CurrColor As System.Drawing.Color)
Sub New(Id As Integer, Name As String, Image As String, CurrColor As Color3d)
MyBase.New(Name)
Me.m_Id = Id
Me.PictureString = Image
@@ -1,8 +1,15 @@
<UserControl x:Class="ManageLayerExpanderView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:local="clr-namespace:EgtCAM5">
<Expander Header="Layers">
<Expander>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding HeaderName}" Margin="0,0,5,0"/>
<Ellipse Height="10" Width="10" Fill="{Binding HeaderColor}" />
</StackPanel>
</Expander.Header>
<StackPanel>
<TextBox/>
@@ -14,6 +21,11 @@
</UniformGrid>
<TreeView Name="LayerTreeView" MaxHeight="600"
ItemsSource="{Binding Path=LayerList}">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="MouseDoubleClick">
<interactivity:InvokeCommandAction Command="{Binding TreeViewDoubleClickCommand}"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<TreeView.Resources>
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
<HierarchicalDataTemplate DataType="{x:Type local:LayerTreeViewItem}" ItemsSource="{Binding Items}">
@@ -25,9 +37,9 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox Grid.Column="0" IsChecked="{Binding OnOff}" Height="15" Width="15" Margin="0,0,5,0"/>
<ToggleButton Style="{StaticResource EgtCAM5_LampToggleButton}" Grid.Column="0" IsChecked="{Binding OnOff}" Height="15" Width="15" Margin="0,0,5,0"/>
<Image Grid.Column="1" Source="{Binding PictureString}" Height="15" Margin="0,0,5,0"/>
<TextBlock Grid.Column="2" Text="{Binding Name}"/>
<TextBlock Grid.Column="2" Text="{Binding Name}" Margin="0,0,5,0"/>
<Ellipse Grid.Column="3" Height="10" Width="10" Fill="{Binding LayerColor}" />
</Grid>
@@ -5,13 +5,38 @@ Imports EgtCAM5.IniFile
Namespace EgtCAM5
Public Class ManageLayerExpanderViewModel
Inherits ViewModelBase
#Region "Fields & Properties"
#Region "FIELDS & PROPERTIES"
' Expander Header Properties
Private m_HeaderName As String
Public Property HeaderName As String
Get
Return m_HeaderName
End Get
Set(value As String)
m_HeaderName = value
OnPropertyChanged("HeaderName")
End Set
End Property
Private m_HeaderColor As SolidColorBrush
Public Property HeaderColor As SolidColorBrush
Get
Return m_HeaderColor
End Get
Set(value As SolidColorBrush)
m_HeaderColor = value
OnPropertyChanged("HeaderColor")
End Set
End Property
' Definizione comandi
Private m_cmdNewPart As ICommand
Private m_cmdNewLayer As ICommand
Private m_cmdLayerColor As ICommand
Private m_cmdTreeViewDoubleClick As ICommand
' Lista dei layer
Private m_LayerList As New ObservableCollection(Of LayerTreeViewItem)
@@ -26,6 +51,8 @@ Namespace EgtCAM5
#End Region
#Region "CONSTRUCTOR"
Sub New()
Application.Msn.Register(Application.LOADOBJTREE, Sub()
LoadObjTree()
@@ -42,7 +69,19 @@ Namespace EgtCAM5
Application.Msn.Register(Application.UPDATEOBJTREE, Sub()
UpdateObjTree()
End Sub)
Application.Msn.Register(Application.UPDATEHEADERNAME, Sub(HeaderName As String)
Me.HeaderName = HeaderName
End Sub)
Application.Msn.Register(Application.UPDATEHEADERCOLOR, Sub(HeaderColor As Color3d)
Me.HeaderColor = New SolidColorBrush(Color.FromArgb(HeaderColor.A, HeaderColor.R, HeaderColor.G, HeaderColor.B))
End Sub)
Application.Msn.Register(Application.UPDATEOBJTREEOLDID, Sub(ObjTreeOldId As Integer)
Me.m_nObjTreeOldId = ObjTreeOldId
End Sub)
End Sub
#End Region ' Constructor
#Region "COMMANDS"
#Region "NewPartCommand"
@@ -133,11 +172,44 @@ Namespace EgtCAM5
Return True
End Function
#End Region ' NewLayerCommand
#End Region ' LayerColorCommand
#Region "TreeViewDoubleClickCommand"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property TreeViewDoubleClickCommand As ICommand
Get
If m_cmdTreeViewDoubleClick Is Nothing Then
m_cmdTreeViewDoubleClick = New RelayCommand(AddressOf TreeViewDoubleClick, AddressOf CanTreeViewDoubleClick)
End If
Return m_cmdTreeViewDoubleClick
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub TreeViewDoubleClick(ByVal param As Object)
If m_nObjTreeOldId <> GDB_ID.NULL Then
Application.Msn.NotifyColleagues(Application.SETLASTINTEGER, m_nObjTreeOldId)
Application.Msn.NotifyColleagues(Application.EXECUTECOMMAND, Controller.CMD.SETCURRPARTLAYER)
End If
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanTreeViewDoubleClick(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' TreeViewDoubleClickCommand
#End Region ' Commands
#Region "Methods"
#Region "METHODS"
Private WithEvents ObjTreeTimer As New System.Windows.Threading.DispatcherTimer
Private m_nObjTreeOldId As Integer = GDB_ID.NULL
@@ -214,9 +286,9 @@ Namespace EgtCAM5
End If
' inserisco il nodo nell'albero
Dim CurrColor As Color3d
EgtGetColor(nGroupId, CurrColor)
EgtGetCalcColor(nGroupId, CurrColor)
Dim sImage As String = TypeToImageInObjTree(GDB_TY.GROUP, nGroupType)
Dim CurrNod As LayerTreeViewItem = New LayerTreeViewItem(nGroupId, sText, sImage, CurrColor.ToColor())
Dim CurrNod As LayerTreeViewItem = New LayerTreeViewItem(nGroupId, sText, sImage, CurrColor)
PrevNodColl.Add(CurrNod)
CurrNodColl = CurrNod.Items
Dim nStat As Integer = GDB_ST.ON_
@@ -250,9 +322,9 @@ Namespace EgtCAM5
sText = sTitle + " " + nId.ToString
End If
Dim CurrColor As Color3d
EgtGetColor(nGroupId, CurrColor)
EgtGetCalcColor(nGroupId, CurrColor)
Dim sImage As String = TypeToImageInObjTree(nType, nDepth)
Dim CurrNod As LayerTreeViewItem = New LayerTreeViewItem(nId, sText, sImage, CurrColor.ToColor())
Dim CurrNod As LayerTreeViewItem = New LayerTreeViewItem(nId, sText, sImage, CurrColor)
CurrNodColl.Add(CurrNod)
Dim nStat As Integer = GDB_ST.ON_
EgtGetStatus(nId, nStat)
@@ -306,25 +378,6 @@ Namespace EgtCAM5
End If
End Sub
'Private Sub ObjTree_AfterCheck(ByVal sender As Object, ByVal e As TreeViewEventArgs) Handles TreeView1.AfterCheck
' ' verifico che il check derivi da azione utente
' If e.Action = TreeViewAction.Unknown Then
' Return
' End If
' ' recupero l'Id del nuovo oggetto
' Dim nId As Integer
' If Not Int32.TryParse(e.Node.Name, nId) Then
' Return
' End If
' ' eseguo operazione
' m_Controller.SetLastInteger(nId)
' If e.Node.Checked Then
' m_Controller.ExecuteCommand(CMD.SHOW)
' Else
' m_Controller.ExecuteCommand(CMD.HIDE)
' End If
'End Sub
'Private Sub ObjTree_AfterSelect(ByVal sender As Object, ByVal e As TreeViewEventArgs) Handles TreeView1.AfterSelect
' ' verifico che il select derivi da azione utente
' If e.Action = TreeViewAction.Unknown Then
@@ -372,13 +425,6 @@ Namespace EgtCAM5
' End If
'End Sub
'Private Sub ObjTree_MouseDoubleClick(ByVal sender As Object, e As MouseEventArgs) Handles TreeView1.MouseDoubleClick
' If m_nObjTreeOldId <> GDB_ID.NULL Then
' m_Controller.SetLastInteger(m_nObjTreeOldId)
' m_Controller.ExecuteCommand(CMD.SETCURRPARTLAYER)
' End If
'End Sub
Private Sub UpdateObjInObjTree(ByVal nId As Integer)
' ripristino eventuale vecchio oggetto selezionato
RevertOldIdInObjTree()
@@ -394,28 +440,6 @@ Namespace EgtCAM5
ObjTreeTimer.Start()
End Sub
'Private Sub UpdateObjDataInObjTree(ByVal nId As Integer)
' ' recupero il tipo del nuovo oggetto
' Dim nType As Integer = EgtGetType(nId)
' ' stampa dei dati dell'oggetto
' Dim sDump As String = String.Empty
' If nType = GDB_TY.NONE Then
' tBoxInfo.Text = String.Empty
' ElseIf nType = GDB_TY.GROUP Then
' If EgtGroupDump(nId, sDump) Then
' tBoxInfo.Text = sDump
' Else
' tBoxInfo.Text = String.Empty
' End If
' Else
' If EgtGeoObjDump(nId, sDump) Then
' tBoxInfo.Text = sDump
' Else
' tBoxInfo.Text = String.Empty
' End If
' End If
'End Sub
Private Function RevertOldIdInObjTree() As Integer
' salvo il vecchio Id
Dim nOldId As Integer = m_nObjTreeOldId
@@ -484,7 +508,7 @@ Namespace EgtCAM5
' End If
'End Sub
#End Region
#End Region ' Methods
End Class
+52 -61
View File
@@ -143,10 +143,12 @@ Namespace EgtCAM5
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
'' ObjTree non selezionato
'm_nObjTreeOldId = GDB_ID.NULL
' ObjTree non selezionato
Application.Msn.NotifyColleagues(Application.UPDATEOBJTREEOLDID, GDB_ID.NULL)
' nascondo input box
Application.Msn.NotifyColleagues(Application.RESETINPUTBOX)
' Apro progetto vuoto
m_Controller.NewProject(True)
End Sub
@@ -319,12 +321,6 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.CIRCLECD)
End If
End Sub)
Application.Msn.Register(Application.ARCCSE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.ARCCSE)
End Sub)
Application.Msn.Register(Application.ARC3P, Sub()
m_Controller.ExecuteCommand(Controller.CMD.ARC3P)
End Sub)
Application.Msn.Register(Application.ARCPDP, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
@@ -343,9 +339,6 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.CHAMFER)
End If
End Sub)
Application.Msn.Register(Application.RECTANGLE2P, Sub()
m_Controller.ExecuteCommand(Controller.CMD.RECTANGLE2P)
End Sub)
Application.Msn.Register(Application.POLYGON, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.ExecuteCommand(Controller.CMD.POLYGON)
@@ -367,35 +360,11 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.PLANE)
End If
End Sub)
Application.Msn.Register(Application.EXTRUDE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.EXTRUDE)
End Sub)
Application.Msn.Register(Application.REVOLVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.REVOLVE)
End Sub)
Application.Msn.Register(Application.SCREW, Sub()
m_Controller.ExecuteCommand(Controller.CMD.SCREW)
End Sub)
Application.Msn.Register(Application.RULED, Sub()
m_Controller.ExecuteCommand(Controller.CMD.RULED)
End Sub)
Application.Msn.Register(Application.MERGESURF, Sub()
m_Controller.ExecuteCommand(Controller.CMD.MERGESURF)
End Sub)
Application.Msn.Register(Application.EXPLODESURF, Sub()
m_Controller.ExecuteCommand(Controller.CMD.EXPLODESURF)
End Sub)
Application.Msn.Register(Application.INVERTSURF, Sub()
m_Controller.ExecuteCommand(Controller.CMD.INVERTSURF)
End Sub)
Application.Msn.Register(Application.DELETE, Sub()
Application.Msn.Register(Application.DELETE, Sub()
m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
End Sub)
Application.Msn.Register(Application.CHANGELAYER, Sub()
m_Controller.ExecuteCommand(Controller.CMD.CHANGELAYER)
End Sub)
Application.Msn.Register(Application.CHANGECOLOR, Sub()
Application.Msn.Register(Application.CHANGECOLOR, Sub()
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
m_Controller.ExecuteCommand(Controller.CMD.CHANGEALPHA)
ElseIf (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
@@ -404,16 +373,7 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.CHANGECOLOR)
End If
End Sub)
Application.Msn.Register(Application.INVERTCURVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.INVERTCURVE)
End Sub)
Application.Msn.Register(Application.CHANGESTARTCURVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.CHANGESTARTCURVE)
End Sub)
Application.Msn.Register(Application.EXTENDCURVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.TRIMEXTENDCURVE)
End Sub)
Application.Msn.Register(Application.BREAKCURVE, Sub()
Application.Msn.Register(Application.BREAKCURVE, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.ExecuteCommand(Controller.CMD.BREAKCURVE)
Else
@@ -428,15 +388,6 @@ Namespace EgtCAM5
End If
m_Controller.ExecuteCommand(Controller.CMD.JOINCURVE)
End Sub)
Application.Msn.Register(Application.EXPLODECURVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.EXPLODECURVE)
End Sub)
Application.Msn.Register(Application.SETCURVETH, Sub()
m_Controller.ExecuteCommand(Controller.CMD.SETCURVETHICKNESS)
End Sub)
Application.Msn.Register(Application.MOVE, Sub()
m_Controller.ExecuteCommand(Controller.CMD.MOVE)
End Sub)
Application.Msn.Register(Application.ROTATE, Sub()
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
m_Controller.ExecuteCommand(Controller.CMD.ROTATE)
@@ -458,10 +409,6 @@ Namespace EgtCAM5
m_Controller.ExecuteCommand(Controller.CMD.SCALE3D)
End If
End Sub)
Application.Msn.Register(Application.OFFSET, Sub()
m_Controller.ExecuteCommand(Controller.CMD.OFFSET)
End Sub)
End Sub
Sub RegisterDrawOptionPanelCommands()
@@ -557,6 +504,18 @@ Namespace EgtCAM5
m_Controller.SaveAsProject(sFile, nType)
End Sub)
Application.Msn.Register(Application.INSERTPROJECT, Sub()
End Sub)
Application.Msn.Register(Application.IMPORTPROJECT, Sub()
End Sub)
Application.Msn.Register(Application.EXPORTPROJECT, Sub()
End Sub)
Application.Msn.Register(Application.EXECPROJECT, Sub()
End Sub)
End Sub
@@ -796,7 +755,7 @@ Namespace EgtCAM5
End If
' aggiorno dati correnti
'EmitTitle()
'EmitCurrPartLayer()
EmitCurrPartLayer()
If bReloadUI Then
Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
Else
@@ -848,6 +807,38 @@ Namespace EgtCAM5
#End Region ' StatusBar events
#Region "DrawOptionPanel"
Private Sub EmitCurrPartLayer()
Dim sText As String = " "
Dim sName As String = String.Empty
Dim colObj As Color3d
EgtGetColor(GDB_ID.ROOT, colObj)
Dim nCurrPart As Integer = m_Controller.GetCurrPart()
If nCurrPart <> GDB_ID.NULL Then
If EgtGetName(nCurrPart, sName) Then
sText = sName
Else
sText = "Part " + nCurrPart.ToString()
End If
EgtGetCalcColor(nCurrPart, colObj)
Dim nCurrLayer As Integer = m_Controller.GetCurrLayer()
If nCurrLayer <> GDB_ID.NULL And EgtExistsObj(nCurrLayer) Then
If EgtGetName(nCurrLayer, sName) Then
sText += " --> " + sName
Else
sText += " --> Layer " + nCurrLayer.ToString()
End If
EgtGetCalcColor(nCurrLayer, colObj)
End If
End If
Application.Msn.NotifyColleagues(Application.UPDATEHEADERNAME, sText)
colObj.A = 100
Application.Msn.NotifyColleagues(Application.UPDATEHEADERCOLOR, colObj)
End Sub
#End Region 'DrawOptionPanel
End Class
End Namespace
+30 -10
View File
@@ -11,13 +11,13 @@
Friend Compo(26) As Visibility
' Array che contiene il valore della proprietà visibility per ogni campo della lavorazione
Friend Milling(49) As Visibility
Friend Drilling(49) As Visibility
Friend Sawing(49) As Visibility
Friend Pocketing(49) As Visibility
Friend Mortising(49) As Visibility
Friend Sawroughing(49) As Visibility
Friend Sawfinishing(49) As Visibility
Friend Milling(50) As Visibility
Friend Drilling(50) As Visibility
Friend Sawing(50) As Visibility
Friend Pocketing(50) As Visibility
Friend Mortising(50) As Visibility
Friend Sawroughing(50) As Visibility
Friend Sawfinishing(50) As Visibility
Sub New()
' Parametri drill standard
@@ -48,6 +48,7 @@
Drill_Std(24) = Visibility.Visible ' NamePar
Drill_Std(25) = Visibility.Visible ' UserNotes
Drill_Std(26) = Visibility.Visible ' TcPOs
' Parametri drill long
Drill_Long(0) = Visibility.Visible ' Corrector
Drill_Long(1) = Visibility.Visible ' ExitPar
@@ -76,6 +77,7 @@
Drill_Long(24) = Visibility.Visible ' NamePar
Drill_Long(25) = Visibility.Visible ' UserNotes
Drill_Long(26) = Visibility.Visible ' TcPOs
'Parametri Saw Standard
Saw_Std(0) = Visibility.Visible ' Corrector
Saw_Std(1) = Visibility.Visible ' ExitPar
@@ -104,6 +106,7 @@
Saw_Std(24) = Visibility.Visible ' NamePar
Saw_Std(25) = Visibility.Visible ' UserNotes
Saw_Std(26) = Visibility.Visible ' TcPOs
'Parametri Saw Flat
Saw_Flat(0) = Visibility.Visible ' Corrector
Saw_Flat(1) = Visibility.Visible ' ExitPar
@@ -132,6 +135,7 @@
Saw_Flat(24) = Visibility.Visible ' NamePar
Saw_Flat(25) = Visibility.Visible ' UserNotes
Saw_Flat(26) = Visibility.Visible ' TcPOs
'Parametri Mill standard
Mill_Std(0) = Visibility.Visible ' Corrector
Mill_Std(1) = Visibility.Visible ' ExitPar
@@ -160,6 +164,7 @@
Mill_Std(24) = Visibility.Visible ' NamePar
Mill_Std(25) = Visibility.Visible ' UserNotes
Mill_Std(26) = Visibility.Visible ' TcPOs
'Parametri Mill NoTip
Mill_NoTip(0) = Visibility.Visible ' Corrector
Mill_NoTip(1) = Visibility.Visible ' ExitPar
@@ -188,6 +193,7 @@
Mill_NoTip(24) = Visibility.Visible ' NamePar
Mill_NoTip(25) = Visibility.Visible ' UserNotes
Mill_NoTip(26) = Visibility.Visible ' TcPOs
'Parametri Mortise Standard
Mortise_Std(0) = Visibility.Hidden ' Corrector
Mortise_Std(1) = Visibility.Visible ' ExitPar
@@ -216,6 +222,7 @@
Mortise_Std(24) = Visibility.Visible ' NamePar
Mortise_Std(25) = Visibility.Visible ' UserNotes
Mortise_Std(26) = Visibility.Visible ' TcPOs
'Parametri Compo
Compo(0) = Visibility.Hidden ' Corrector
Compo(1) = Visibility.Visible ' ExitPar
@@ -296,6 +303,8 @@
Milling(47) = Visibility.Visible ' UserNotes
Milling(48) = Visibility.Visible ' OverLapStr
Milling(49) = Visibility.Hidden ' OffsetStr
Milling(50) = Visibility.Hidden ' SubType
' Parametri Drilling
Drilling(0) = Visibility.Visible ' Invert
Drilling(1) = Visibility.Hidden ' LeaveTab
@@ -306,7 +315,7 @@
Drilling(6) = Visibility.Hidden ' ExtLinkType
Drilling(7) = Visibility.Hidden ' LeadOutType
Drilling(8) = Visibility.Hidden ' CurveUse
Drilling(9) = Visibility.Visible ' StepType
Drilling(9) = Visibility.Hidden ' StepType
Drilling(10) = Visibility.Hidden ' LeadLinkType
Drilling(11) = Visibility.Visible ' Speed
Drilling(12) = Visibility.Visible ' Feed
@@ -347,6 +356,8 @@
Drilling(47) = Visibility.Visible ' UserNotes
Drilling(48) = Visibility.Hidden ' OverLapStr
Drilling(49) = Visibility.Visible ' OffsetStr
Drilling(50) = Visibility.Visible ' SubType
' Parametri Sawing
Sawing(0) = Visibility.Visible ' Invert
Sawing(1) = Visibility.Hidden ' LeaveTab
@@ -355,7 +366,7 @@
Sawing(4) = Visibility.Visible ' HeadSide
Sawing(5) = Visibility.Visible ' LeadInType
Sawing(6) = Visibility.Visible ' ExtLinkType
Sawing(7) = Visibility.Hidden ' LeadOutType
Sawing(7) = Visibility.Visible ' LeadOutType
Sawing(8) = Visibility.Visible ' CurveUse
Sawing(9) = Visibility.Visible ' StepType
Sawing(10) = Visibility.Hidden ' LeadLinkType
@@ -370,7 +381,7 @@
Sawing(19) = Visibility.Visible ' Approx
Sawing(20) = Visibility.Visible ' StartPos
Sawing(21) = Visibility.Hidden ' StartSlowLen
Sawing(22) = Visibility.Hidden ' EndSlowLen
Sawing(22) = Visibility.Hidden ' EndSlowLen
Sawing(23) = Visibility.Hidden ' ThroughAddlen
Sawing(24) = Visibility.Visible ' StepPar
Sawing(25) = Visibility.Visible ' ReturnPos
@@ -398,6 +409,8 @@
Sawing(47) = Visibility.Visible ' UserNotes
Sawing(48) = Visibility.Hidden ' OverLapStr
Sawing(49) = Visibility.Hidden ' OffsetStr
Sawing(50) = Visibility.Hidden ' SubType
' Parametri Pocketing
Pocketing(0) = Visibility.Visible ' Invert
Pocketing(1) = Visibility.Hidden ' LeaveTab
@@ -449,6 +462,8 @@
Pocketing(47) = Visibility.Visible ' UserNotes
Pocketing(48) = Visibility.Hidden ' OverLapStr
Pocketing(49) = Visibility.Hidden ' OffsetStr
Pocketing(50) = Visibility.Hidden ' SubType
' Parametri Mortising
Mortising(0) = Visibility.Visible ' Invert
Mortising(1) = Visibility.Hidden ' LeaveTab
@@ -500,6 +515,8 @@
Mortising(47) = Visibility.Visible ' UserNotes
Mortising(48) = Visibility.Hidden ' OverLapStr
Mortising(49) = Visibility.Hidden ' OffsetStr
Mortising(50) = Visibility.Hidden ' SubType
' Parametri Sawroughing
Sawroughing(0) = Visibility.Visible ' Invert
Sawroughing(1) = Visibility.Hidden ' LeaveTab
@@ -551,6 +568,8 @@
Sawroughing(47) = Visibility.Visible ' UserNotes
Sawroughing(48) = Visibility.Hidden ' OverLapStr
Sawroughing(49) = Visibility.Hidden ' OffsetStr
Sawroughing(50) = Visibility.Hidden ' SubType
' Parametri Sawfinishing
Sawfinishing(0) = Visibility.Visible ' Invert
Sawfinishing(1) = Visibility.Hidden ' LeaveTab
@@ -602,6 +621,7 @@
Sawfinishing(47) = Visibility.Visible ' UserNotes
Sawfinishing(48) = Visibility.Hidden ' OverLapStr
Sawfinishing(49) = Visibility.Hidden ' OffsetStr
Sawfinishing(50) = Visibility.Visible ' SubType
End Sub
+4 -3
View File
@@ -8,9 +8,10 @@
<Button Content="Open" Command="{Binding OpenCommand}"/>
<Button Content="Save" Command="{Binding SaveCommand}"/>
<Button Content="Save as..." Command="{Binding SaveAsCommand}"/>
<Button Content="Import" />
<Button Content="Export" />
<Button Content="Execute" />
<Button Content="Insert" Command="{Binding InsertCommand}"/>
<Button Content="Import" Command="{Binding ImportCommand}"/>
<Button Content="Export" Command="{Binding ExportCommand}"/>
<Button Content="Execute" Command="{Binding ExecCommand}"/>
</StackPanel>
</UserControl>
+123
View File
@@ -9,6 +9,10 @@
Private m_cmdOpen As ICommand
Private m_cmdSave As ICommand
Private m_cmdSaveAs As ICommand
Private m_cmdInsert As ICommand
Private m_cmdImport As ICommand
Private m_cmdExport As ICommand
Private m_cmdExec As ICommand
#End Region ' Fields & Properties
@@ -134,6 +138,125 @@
#End Region ' SaveAsCommand
#Region "InsertCommand"
''' <summary>
''' Returns a command that do Insert.
''' </summary>
Public ReadOnly Property InsertCommand As ICommand
Get
If m_cmdInsert Is Nothing Then
m_cmdInsert = New RelayCommand(AddressOf Insert, AddressOf CanInsert)
End If
Return m_cmdInsert
End Get
End Property
''' <summary>
''' Execute the Insert. This method is invoked by the InsertCommand.
''' </summary>
Public Sub Insert(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.INSERTPROJECT)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanInsert(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' InsertCommand
#Region "ImportCommand"
''' <summary>
''' Returns a command that do Import.
''' </summary>
Public ReadOnly Property ImportCommand As ICommand
Get
If m_cmdImport Is Nothing Then
m_cmdImport = New RelayCommand(AddressOf Import, AddressOf CanImport)
End If
Return m_cmdImport
End Get
End Property
''' <summary>
''' Execute the Import. This method is invoked by the ImportCommand.
''' </summary>
Public Sub Import(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.IMPORTPROJECT)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanImport(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' ImportCommand
#Region "ExportCommand"
''' <summary>
''' Returns a command that do Export.
''' </summary>
Public ReadOnly Property ExportCommand As ICommand
Get
If m_cmdExport Is Nothing Then
m_cmdExport = New RelayCommand(AddressOf Export, AddressOf CanExport)
End If
Return m_cmdExport
End Get
End Property
''' <summary>
''' Execute the Export. This method is invoked by the ExportCommand.
''' </summary>
Public Sub Export(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXPORTPROJECT)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanExport(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' ExportCommand
#Region "ExecCommand"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property ExecCommand As ICommand
Get
If m_cmdExec Is Nothing Then
m_cmdExec = New RelayCommand(AddressOf Exec, AddressOf CanExec)
End If
Return m_cmdExec
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Exec(ByVal param As Object)
Application.Msn.NotifyColleagues(Application.EXECPROJECT)
End Sub
''' <summary>
''' Returns always true.
''' </summary>
Private Function CanExec(ByVal param As Object) As Boolean
Return True
End Function
#End Region ' ExecCommand
#End Region ' Commands