EgtCAM5 :

- modifiche varie.
This commit is contained in:
Emmanuele Sassi
2016-07-06 18:33:16 +00:00
parent d868196708
commit 550057bf06
16 changed files with 675 additions and 317 deletions
+129 -42
View File
@@ -31,6 +31,7 @@ Namespace EgtCAM5
Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATION)
End If
IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
InitializeEgtProject()
' inizializzo gestore lavorazioni
EgtInitMachMgr(IniFile.m_sMachinesRoot)
EgtOpenFile("c:\EgtData\Varie\Temp\Fiera02.Nge")
@@ -47,7 +48,17 @@ Namespace EgtCAM5
#Region "EGTUILIB FIELDS"
Private m_bShowGrid As Boolean
Private m_bShowGridFrame As Boolean
'Private m_bCPlaneTypePos As Boolean
Private m_bMmUnits As Boolean
'Private WithEvents m_Controller As New Controller
'Private m_MruFiles As New MruList
'Private m_MruScripts As New MruList
Private m_bScriptRunning As Boolean = False
'Private m_bStopExec As Boolean = False
'Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
'Private m_OutTextCallback As New OutTextCallback(AddressOf OutText)
' Variabile per implementazione eventi
Private m_InputText As String
@@ -66,8 +77,23 @@ Namespace EgtCAM5
m_DrawOptionPanel = New BaseWindowView
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
m_DrawOptionPanel.Show()
' Funzione che contiene la registrazione alle funzioni che permettono di visualizzare e nascondere le finestre di disegno
ManagePanelVisibility()
' Inizializza i parametri della scena
'InitializeEgtProject()
' Funzione che contiene la registrazione di tutti le funzioni del DrawPanel
RegisterDrawPanelCommands()
' Funzione che contiene la registrazione di tutti i comandi del DrawOptionPanel
RegisterDrawOptionPanelCommands()
' Funzione che contiene la registrazione di tutti i comandi della StatusBar
RegisterStatusBarCommands()
End Sub
#End Region
#Region "METHODS"
Private Sub InitializeEgtProject()
'Impostazioni Controller
m_Controller.SetScene(m_ProjectScene)
'Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0, m_sIniFile) <> 0)
@@ -79,18 +105,56 @@ Namespace EgtCAM5
' ' MessageBoxButtons.OK, MessageBoxIcon.Warning)
' 'End If
'End If
' MESSAGGI PER IL CONTROLLER
Application.Msn.Register(Application.NOTIFYINPUTTEXT, Sub(sInputText As String)
m_InputText = sInputText
End Sub)
'' imposto unità di misura per interfaccia utente
'm_bMmUnits = (GetPrivateProfileInt(S_SCENE, K_MMUNITS, 1, m_sIniFile) <> 0)
'UpdateStatusUnits()
'' imposto visualizzazione riferimento globale
'Dim bShowGlobFrame As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWGFRAME, 1, m_sIniFile) <> 0)
'EgtSetGlobFrameShow(bShowGlobFrame)
' imposto i dati della griglia
LoadGridData()
' imposto stato di visualizzazione della griglia
m_bShowGrid = (GetPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
m_bShowGridFrame = (GetPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0)
Application.Msn.NotifyColleagues(Application.UPDATESTATUSGRID, New UpdateStatusGridParam(m_bShowGrid, m_bShowGridFrame))
'' imposto tipo coordinate
'm_bCPlaneTypePos = True
'Scene1.SetGridCursorPos(m_bCPlaneTypePos)
'' modo di visualizzazione
'Dim nShowMode As Integer = GetPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING, m_sIniFile)
'If nShowMode = SM.WIREFRAME Then
' btnWireFrame.Checked = True
'ElseIf nShowMode = SM.HIDDENLINE Then
' btnHiddenLine.Checked = True
'Else
' btnShading.Checked = True
'End If
'' visualizzazione direzione curve
'Dim nShowCurveDir As Integer = GetPrivateProfileInt(S_SCENE, K_CURVEDIR, 0, m_sIniFile)
'chkCurveDir.Checked = (nShowCurveDir <> 0)
'' visualizzazione avanzata dei triangoli costituenti le superfici
'Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1, m_sIniFile) <> 0)
'EgtSetShowTriaAdv(bShowTriaAdv)
'' ObjTree non selezionato
'm_nObjTreeOldId = GDB_ID.NULL
'' nascondo input box
'ResetInputBox()
End Sub
#End Region
#Region "METHODS"
Private Sub LoadGridData()
Dim dSnapStep As Double = GetPrivateProfileDouble(S_GRID, If(m_bMmUnits, K_SNAPSTEP, K_SNAPSTEPINCH), 10)
Dim nMinLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
Dim nMajLineSStep As Integer = GetPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
Dim nExtSStep As Integer = GetPrivateProfileInt(S_GRID, K_EXTSSTEP, 50)
Dim MinLnColor As New Color3d(160, 160, 160)
GetPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor)
Dim MajLnColor As New Color3d(160, 160, 160)
GetPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor)
EgtSetGridFrame(Frame3d.GLOB)
EgtSetGridGeo(dSnapStep, nMinLineSStep, nMajLineSStep, nExtSStep)
EgtSetGridColor(MinLnColor, MajLnColor)
End Sub
''' <summary>
''' Method that manage the visibility of the ProjectPage's Panels
@@ -392,12 +456,35 @@ Namespace EgtCAM5
End Sub
Sub RegisterDrawOptionPanelCommands()
Application.Msn.Register(Application.NOTIFYINPUTTEXT, Sub(sInputText As String)
m_InputText = sInputText
End Sub)
Application.Msn.Register(Application.SETLASTBOOLEAN, Sub(bBoolean As Boolean)
m_Controller.SetLastBoolean(bBoolean)
End Sub)
Application.Msn.Register(Application.SHOW, Sub(sString As String)
m_Controller.Show(sString)
End Sub)
Application.Msn.Register(Application.DONE, Sub(sString As String)
m_Controller.Done(sString)
End Sub)
End Sub
Sub RegisterStatusBarCommands()
Application.Msn.Register(Application.STATUSGRIDCOMMAND, Sub()
m_bShowGrid = Not m_bShowGrid
Application.Msn.NotifyColleagues(Application.UPDATESTATUSGRID, New UpdateStatusGridParam(m_bShowGrid, m_bShowGridFrame))
EgtDraw()
End Sub)
End Sub
#End Region
#Region "SCENE EVENTS"
Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String) Handles m_ProjectScene.OnCursorPos
Application.Msn.NotifyColleagues(Application.NOTIFYCURRPOSCHANGED, sCursorPos)
Application.Msn.NotifyColleagues(Application.NOTIFYCURRPOS, sCursorPos)
End Sub
Private Sub OnMouseSelectedAll(ByVal sender As Object) Handles m_ProjectScene.OnMouseSelectedAll
@@ -538,7 +625,7 @@ Namespace EgtCAM5
'ClearObjTree()
'Abilito progress e bottone stop
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSPROGRESS, 0)
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP_ISENABLED, True)
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP, True)
' Dichiaro script in esecuzione
m_bScriptRunning = True
End Sub
@@ -554,49 +641,49 @@ Namespace EgtCAM5
'End If
' Disabilito progress e bottone stop
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSPROGRESS, 0)
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP_ISENABLED, False)
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSSTOP, False)
'' Dichiaro terminata esecuzione script
m_bScriptRunning = False
End Sub
Private Sub OnPrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean) Handles m_Controller.PrepareInputBox
'PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
Application.Msn.NotifyColleagues(Application.PREPAREINPUTBOX, New PrepareInputBoxParam(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn))
End Sub
' Private Sub OnSetInputBoxText(ByVal sText As String) Handles m_Controller.SetInputBoxText
' SetInputBoxText(sText)
' End Sub
Private Sub OnSetInputBoxText(ByVal sText As String) Handles m_Controller.SetInputBoxText
Application.Msn.NotifyColleagues(Application.SETINPUTBOXTEXT, sText)
End Sub
' Private Sub OnSetInputBoxCheck(ByVal bCheck As Boolean) Handles m_Controller.SetInputBoxCheck
' SetInputBoxCheck(bCheck)
' End Sub
Private Sub OnSetInputBoxCheck(ByVal bCheck As Boolean) Handles m_Controller.SetInputBoxCheck
Application.Msn.NotifyColleagues(Application.SETINPUTBOXCHECK, bCheck)
End Sub
' Private Sub OnAddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) Handles m_Controller.AddInputBoxCombo
' AddInputBoxCombo(sText, bSelected)
' End Sub
Private Sub OnAddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean) Handles m_Controller.AddInputBoxCombo
Application.Msn.NotifyColleagues(Application.ADDINPUTBOXCOMBO, New AddInputBoxComboParam(sText, bSelected))
End Sub
' Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
' ' pulisco input e relativi messaggi
' ResetInputBox()
' If m_Controller.GetContinue() Then
' EmitStripStatusOutput(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
' Else
' EmitStripStatusOutput("")
' End If
' ' aggiorno dati correnti
' EmitTitle()
' EmitCurrPartLayer()
' If bReloadUI Then
' LoadObjTree()
' Else
' UpdateObjTree()
' End If
' End Sub
Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
' pulisco input e relativi messaggi
Application.Msn.NotifyColleagues(Application.RESETINPUTBOX)
If m_Controller.GetContinue() Then
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, (EgtMsg(399))) ' Continue : 'L' with line, 'A' with arc
Else
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, (""))
End If
' aggiorno dati correnti
'EmitTitle()
'EmitCurrPartLayer()
'If bReloadUI Then
' LoadObjTree()
'Else
' UpdateObjTree()
'End If
End Sub
' Private Sub OutputInfo(ByVal sender As Object, ByVal sText As String) Handles m_Controller.OutputInfo
' EmitStripStatusOutput(sText)
' End Sub
Private Sub OutputInfo(ByVal sender As Object, ByVal sText As String) Handles m_Controller.OutputInfo
Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, sText)
End Sub
#End Region