diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb index 40c303d..163f2db 100644 --- a/Icarus/Constants/Const3dPrint.vb +++ b/Icarus/Constants/Const3dPrint.vb @@ -5,6 +5,7 @@ Public Const PART = "Part" Public Const PRINT_SOLID = "PrintSolid" Public Const LAY_MACH_START = "MachStart" + Public Const LAY_PARTREFERENCE = "PartFrame" Public Const LAY_REFERENCE = "Frame" Public Const LAY_OTHERS = "Aux" Public Const LAY_RIBS = "Ribs" @@ -117,6 +118,7 @@ Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting" Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe" Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir" + Public Const MAC_RIBSLIMITUNBOUNDEDWITHSOLID = "LimitUnboundedRibsWithSolid" Public Const MAC_SHELLNBRDIFFERENCE = "ShellNbrDifference" Public Const MAC_SHELLNBRCOASTING = "ShellNbrCoasting" Public Const MAC_SHELLNBRWIPE = "ShellNbrWipe" diff --git a/Icarus/CurrMachiningPanel/CurrMachining.vb b/Icarus/CurrMachiningPanel/CurrMachining.vb index 3b463c8..afe57de 100644 --- a/Icarus/CurrMachiningPanel/CurrMachining.vb +++ b/Icarus/CurrMachiningPanel/CurrMachining.vb @@ -248,7 +248,8 @@ Public Class CurrMachiningCathegory New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb), New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb), - New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb)}) + New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb), + New CurrCheckMachiningParam(MachiningParam.Params.RIBSLIMITUNBOUNDEDWITHSOLID, nPartId, nIndex, bForceFromDb)}) Case Cathegories.SHELL_NUMBER m_sName = "Reduce Shell Number" m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb), @@ -922,6 +923,8 @@ Public Class CurrCheckMachiningParam bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue) Case Params.RIBSLEADOUTINVERT bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bValue) + Case Params.RIBSLIMITUNBOUNDEDWITHSOLID + bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, m_bValue) End Select m_bOrigValue = m_bValue If nIndex > 0 Then @@ -929,7 +932,7 @@ Public Class CurrCheckMachiningParam Select Case Type Case Params.SPIRALVASE m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) - Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT + Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT, Params.RIBSLIMITUNBOUNDEDWITHSOLID m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type) End Select If bForceFromDb OrElse Not bReadFromPart Then @@ -955,6 +958,8 @@ Public Class CurrCheckMachiningParam EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0)) Case Params.RIBSLEADOUTINVERT EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0)) + Case Params.RIBSLIMITUNBOUNDEDWITHSOLID + EgtSetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, If(m_bValue, 1, 0)) End Select End Sub diff --git a/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml b/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml index 9edef53..3da9b78 100644 --- a/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml +++ b/Icarus/CurrMachiningPanel/CurrMachiningPanelV.xaml @@ -210,8 +210,8 @@ - + diff --git a/Icarus/SliceManager/SliceManagerVM.vb b/Icarus/SliceManager/SliceManagerVM.vb index 1fe7722..01db0c6 100644 --- a/Icarus/SliceManager/SliceManagerVM.vb +++ b/Icarus/SliceManager/SliceManagerVM.vb @@ -32,6 +32,9 @@ Public Class SliceManagerVM ' Funzioni di callback per output in interfaccia da LUA Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents) + Private m_bStopScript As Boolean = False + Private m_bStopScriptToManage As Boolean = False + Private m_bSlice As Boolean = False Private m_bCalcTFS As Boolean = False Private m_bGenerate As Boolean = False @@ -132,6 +135,7 @@ Public Class SliceManagerVM Dim b3Print As BBox3d = Map.refDispositionPanelVM.GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) Return "[ " & DoubleToString(b3Print.DimX, 1) & " x " & DoubleToString(b3Print.DimY, 1) & " x " & DoubleToString(b3Print.DimZ, 1) & " ]" End If + Return "" End Get End Property Friend Sub UpdateDimensions() @@ -177,6 +181,7 @@ Public Class SliceManagerVM ' Definizione comandi Private m_cmdSlice As ICommand + Private m_cmdStopCalculation As ICommand Private m_cmdSimulate As ICommand Private m_cmdUpdate As ICommand Private m_cmdGenerate As ICommand @@ -289,13 +294,14 @@ Public Class SliceManagerVM UpdateUI() ' Eventuale attesa Threading.Thread.Sleep(nPause) - '' Ritorno eventuale stop - 'If m_bStopScript Then - ' m_bStopScript = False - ' Return 1 - 'Else - ' Return 0 - 'End If + ' Ritorno eventuale stop + If m_bStopScript Then + m_bStopScript = False + m_bStopScriptToManage = True + Return 1 + Else + Return 0 + End If Return 0 End Function @@ -369,8 +375,8 @@ Public Class SliceManagerVM Dim nCurrPartId As Integer = EgtGetFirstPart() While nCurrPartId <> GDB_ID.NULL ' eseguo rimozione flag - If m_bSlice Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_SLICE) - If m_bCalcTFS Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_TFS) + If m_bSlice AndAlso Not m_bStopScriptToManage Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_SLICE) + If m_bCalcTFS AndAlso Not m_bStopScriptToManage Then EgtRemoveInfo(nCurrPartId, MAC_TORECALC_TFS) nCurrPartId = EgtGetNextPart(nCurrPartId) End While ' aggiorno massa @@ -537,19 +543,52 @@ Public Class SliceManagerVM m_bCalculating = False Return End If - ' esco da altre pagine - Map.refTopPanelVM.SelPage = Pages.NULL + '' esco da altre pagine + 'Dim PreviousPage As Pages = Map.refTopPanelVM.SelPage ' eseguo calcoli CalcSlice(False) - Map.refTopPanelVM.SelPage = Pages.SLICE - Map.refSliderManagerVM.SetLayerIndexToMax() - NotifyPropertyChanged(NameOf(Time_Visibility)) - NotifyPropertyChanged(NameOf(Mass_Visibility)) + ' se non ho interrotto calcoli + If Not m_bStopScriptToManage Then + Map.refTopPanelVM.SelPage = Pages.NULL + Map.refTopPanelVM.SelPage = Pages.SLICE + Map.refSliderManagerVM.SetLayerIndexToMax() + NotifyPropertyChanged(NameOf(Time_Visibility)) + NotifyPropertyChanged(NameOf(Mass_Visibility)) + 'Else + ' Map.refTopPanelVM.SelPage = PreviousPage + Else + m_bStopScriptToManage = False + End If m_bCalculating = False End Sub #End Region ' Slice +#Region "StopCalculation" + + ''' + ''' Returns a command that do CPlaneTop. + ''' + Public ReadOnly Property StopCalculation_Command As ICommand + Get + If m_cmdStopCalculation Is Nothing Then + m_cmdStopCalculation = New Command(AddressOf StopCalculation) + End If + Return m_cmdStopCalculation + End Get + End Property + + ''' + ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand. + ''' + Public Sub StopCalculation() + If Not m_bCalculating Then Return + m_bStopScript = True + m_bCalculating = False + End Sub + +#End Region ' StopCalculation + #Region "Update" ''' @@ -572,8 +611,13 @@ Public Class SliceManagerVM m_bCalculating = True ' eseguo calcoli CalcSlice(False) - NotifyPropertyChanged(NameOf(Time_Visibility)) - NotifyPropertyChanged(NameOf(Mass_Visibility)) + ' se non ho interrotto calcoli + If Not m_bStopScriptToManage Then + NotifyPropertyChanged(NameOf(Time_Visibility)) + NotifyPropertyChanged(NameOf(Mass_Visibility)) + Else + m_bStopScriptToManage = False + End If m_bCalculating = False End Sub @@ -646,17 +690,22 @@ Public Class SliceManagerVM End If ' eseguo calcoli CalcSlice(True, True) - If bShiftPressed Then - ' Se esiste ne lancio l'editing - If File.Exists(sIsoFilePath) Then - Process.Start("Notepad.exe", sIsoFilePath) - ' altrimenti lo segnalo - Else - MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")") + ' se non ho interrotto calcoli + If Not m_bStopScriptToManage Then + If bShiftPressed Then + ' Se esiste ne lancio l'editing + If File.Exists(sIsoFilePath) Then + Process.Start("Notepad.exe", sIsoFilePath) + ' altrimenti lo segnalo + Else + MessageBox.Show("Edit failed, missing part program file" & " (" & sIsoFilePath & ")") + End If End If + NotifyPropertyChanged(NameOf(Time_Visibility)) + NotifyPropertyChanged(NameOf(Mass_Visibility)) + Else + m_bStopScriptToManage = False End If - NotifyPropertyChanged(NameOf(Time_Visibility)) - NotifyPropertyChanged(NameOf(Mass_Visibility)) m_bCalculating = False End Sub @@ -684,10 +733,15 @@ Public Class SliceManagerVM ' eseguo calcoli CalcSlice(True) m_bCalculating = False - ' verifico esistenza e correttezza machgroup - InitMachGroup(False) - ' apro simulazione - Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SIMULATION) + ' se non ho interrotto calcoli + If Not m_bStopScriptToManage Then + ' verifico esistenza e correttezza machgroup + InitMachGroup(False) + ' apro simulazione + Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SIMULATION) + Else + m_bStopScriptToManage = False + End If End Sub #End Region ' Simulate diff --git a/Icarus/StartMachPanel/StartMachPanelV.xaml b/Icarus/StartMachPanel/StartMachPanelV.xaml index afdb55c..eec58a9 100644 --- a/Icarus/StartMachPanel/StartMachPanelV.xaml +++ b/Icarus/StartMachPanel/StartMachPanelV.xaml @@ -153,7 +153,7 @@ - Public ReadOnly Property IsoViewSECommand As ICommand Get @@ -243,7 +255,7 @@ Public Class ViewPanelVM End Property ''' - ''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand. + ''' Execute the IsoViewSW. This method is invoked by the IsoViewSECommand. ''' Public Sub IsoViewSE(ByVal param As Object) Map.refSceneHostVM.MainScene.IsoViewSE() @@ -251,28 +263,28 @@ Public Class ViewPanelVM #End Region ' IsoViewSECommand -#Region "ViewToCPlaneCommand" +#Region "ViewFromCPlaneCommand" ''' - ''' Returns a command that do GetDist. + ''' Returns a command that do ViewFromCPlane. ''' - Public ReadOnly Property ViewToCPlaneCommand As ICommand + Public ReadOnly Property ViewFromCPlaneCommand As ICommand Get - If m_cmdViewToCPlane Is Nothing Then - m_cmdViewToCPlane = New Command(AddressOf ViewToCPlane) + If m_cmdViewFromCPlane Is Nothing Then + m_cmdViewFromCPlane = New Command(AddressOf ViewFromCPlane) End If - Return m_cmdViewToCPlane + Return m_cmdViewFromCPlane End Get End Property ''' - ''' Execute the GetDist. This method is invoked by the GetDistCommand. + ''' Execute the ViewFromCPlane. This method is invoked by the ViewFromCPlaneCommand. ''' - Public Sub ViewToCPlane(ByVal param As Object) + Public Sub ViewFromCPlane(ByVal param As Object) Map.refSceneHostVM.MainScene.CPlaneView() End Sub -#End Region ' ViewToCPlaneCommand +#End Region ' ViewFromCPlaneCommand #End Region ' COMMANDS