- introdotta simulazione

- migliorato SliceManager
- introdotto calcolo tempo e massa materiale
This commit is contained in:
Emmanuele Sassi
2022-09-09 21:06:35 +02:00
parent 0532c0c486
commit cbe9efacbb
27 changed files with 1108 additions and 145 deletions
+2
View File
@@ -1,6 +1,7 @@
Public Module Const3dPrint
Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline"
Public Const PART = "Part"
Public Const ORIGINAL_SOLID = "OriginalSolid"
Public Const PRINT_SOLID = "PrintSolid"
@@ -31,6 +32,7 @@
Public Const KEY_LENGTH = "Length"
Public Const KEY_SPEED = "Speed"
Public Const KEY_SLICEID = "SliceId"
Public Const KEY_MASS = "PrintMass"
' parametri Materiali
+4
View File
@@ -24,6 +24,10 @@
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
Public Const S_MACHINING As String = "Machining"
Public Const K_MACH_INITSCRIPT As String = "InitScript"
Public Const K_MACH_EXITSCRIPT As String = "ExitScript"
' Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax"
+26
View File
@@ -176,6 +176,12 @@
<Compile Include="ShowPanel\ShowPanelV.xaml.vb">
<DependentUpon>ShowPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SimulationPanel\MachineAxis.vb" />
<Compile Include="SimulationPanel\MySimulation.vb" />
<Compile Include="SimulationPanel\SimulationPanelV.xaml.vb">
<DependentUpon>SimulationPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SimulationPanel\SimulationPanelVM.vb" />
<Compile Include="SliceManager\SliceManagerV.xaml.vb">
<DependentUpon>SliceManagerV.xaml</DependentUpon>
</Compile>
@@ -319,6 +325,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SimulationPanel\SimulationPanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="SliceManager\SliceManagerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -512,6 +522,22 @@
<ItemGroup>
<Resource Include="Resources\DrawPanel\Extrude.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\Play.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\Pause.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\PlayStep.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\Stop.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulTab\Pause.png" />
<Resource Include="Resources\SimulTab\Play.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+3
View File
@@ -35,6 +35,9 @@
<TabItem Header="TFSEDITOR">
<PrintApp:TFSEditorV DataContext="{StaticResource TFSEditorVM}"/>
</TabItem>
<TabItem Header="SIMULATION">
<PrintApp:SimulationPanelV DataContext="{StaticResource SimulationPanelVM}"/>
</TabItem>
</TabControl>
</UserControl>
+17
View File
@@ -14,6 +14,7 @@ Public Class RightPanelVM
SHELLNUMBER = 5
AUXSOLIDPARAM = 6
TFSEDITOR = 7
SIMULATION = 8
End Enum
Private m_SelPanel As Panels
@@ -27,6 +28,20 @@ Public Class RightPanelVM
End Property
Friend Sub SetSelPanel(Panel As Panels)
If Panel = m_SelPanel Then Return
Select Case m_SelPanel
Case Panels.NULL
Case Panels.MATERIALDB
Case Panels.PRINTPARAMDB
Case Panels.RIBPARAM
Case Panels.TFSEDITOR
Case Panels.SIMULATION
Map.refSimulationPanelVM.ExitSimulation()
End Select
m_SelPanel = Panel
Select Case Panel
Case Panels.NULL
@@ -40,6 +55,8 @@ Public Class RightPanelVM
Case Panels.TFSEDITOR
'Map.refTFSEditorVM.Refresh()
Case Panels.SIMULATION
Map.refSimulationPanelVM.InitSimulation()
End Select
NotifyPropertyChanged(NameOf(SelPanel))
End Sub
+116
View File
@@ -0,0 +1,116 @@
Imports System.ComponentModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachineAxis
Inherits VMBase
Private m_IsReadOnlyAxesValue As Boolean
Public Property IsReadOnlyAxesValue As Boolean
Get
Return m_IsReadOnlyAxesValue
End Get
Set(value As Boolean)
If value <> m_IsReadOnlyAxesValue Then
m_IsReadOnlyAxesValue = value
NotifyPropertyChanged("IsReadOnlyAxesValue")
NotifyPropertyChanged("IsEnabledAxesValue")
End If
End Set
End Property
Public ReadOnly Property IsEnabledAxesValue As Boolean
Get
Return Not m_IsReadOnlyAxesValue
End Get
End Property
' Definizione comandi
Private m_cmdManualAxisModify As ICommand
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Token As String
Public Property Token As String
Get
Return m_Token
End Get
Set(value As String)
If value <> m_Token Then
m_Token = value
NotifyPropertyChanged("Token")
End If
End Set
End Property
Private m_Linear As Boolean
Public WriteOnly Property Linear As Boolean
Set(value As Boolean)
m_Linear = value
End Set
End Property
Private m_Value As String
Public Property Value As String
Get
Return m_Value
End Get
Set(value As String)
m_Value = value
NotifyPropertyChanged("Value")
End Set
End Property
Sub New()
IsReadOnlyAxesValue = True
End Sub
#Region "COMMANDS"
#Region "ManualAxisModifyCommand"
''' <summary>
''' Returns a command that create a new tool.
''' </summary>
Public ReadOnly Property ManualAxisModifyCommand As ICommand
Get
If m_cmdManualAxisModify Is Nothing Then
m_cmdManualAxisModify = New Command(AddressOf ManualAxisModify)
End If
Return m_cmdManualAxisModify
End Get
End Property
''' <summary>
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub ManualAxisModify(ByVal param As Object)
Dim dVal As Double
If m_Linear Then
StringToLen(m_Value, dVal)
Else
StringToDouble(m_Value, dVal)
End If
EgtSetAxisPos(m_Name, dVal)
EgtGetAxisPos(m_Name, dVal)
If m_Linear Then
Value = LenToString(dVal, 3)
Else
Value = DoubleToString(dVal, 3)
End If
EgtDraw()
End Sub
#End Region ' ManualAxisModifyCommand
#End Region
End Class
+97
View File
@@ -0,0 +1,97 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class MyEstimations
Inherits EstimationsVM
#Region "FIELDS & PROPERTIES"
Private m_Estimation_IsEnabled As Boolean = False
Public Property Estimation_IsEnabled As Boolean
Get
Return m_Estimation_IsEnabled
End Get
Set(value As Boolean)
m_Estimation_IsEnabled = value
NotifyPropertyChanged("Estimation_IsEnabled")
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Overrides Function GetEstimationFileName(bAskSave As Boolean, ByRef sEstFile As String, ByRef sInfo As String) As Boolean
Dim bOk As Boolean = True
' Recupero e verifico la path del progetto corrente
Dim sCurrFilePath As String = String.Empty
EgtGetCurrFilePath(sCurrFilePath)
If bAskSave Then
If String.IsNullOrEmpty(sCurrFilePath) OrElse EgtGetModified() Then
' Il progetto deve essere salvato prima di poter essere generato. Vuoi farlo ?
If MessageBox.Show(EgtMsg(MSG_SIMULATION + 31), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
' Abbandono
bOk = False
Else
' Lancio salvataggio
'OmagOFFICEMap.refSceneHostVM.SaveProject()
EgtGetCurrFilePath(sCurrFilePath)
' Se non salvato, abbandono
If EgtGetModified() Then bOk = False
End If
End If
Else
If String.IsNullOrEmpty(sCurrFilePath) Then
' File delle stime non trovato
MessageBox.Show(EgtMsg(MSG_SIMULATION + 18), EgtMsg(MSG_SIMULATION + 15), MessageBoxButton.OK, MessageBoxImage.Warning)
bOk = False
End If
End If
' Creo la path del file di stima e relativo info (con nome gruppo se gestiti)
If Not String.IsNullOrEmpty(sCurrFilePath) Then
sEstFile = Path.ChangeExtension(sCurrFilePath, Nothing)
sInfo = "EgtCAM5 - " & sCurrFilePath
Dim sMGrpName As String = String.Empty
If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then
sEstFile &= "_" & sMGrpName & ".html"
sInfo &= "-" & sMGrpName
Else
sEstFile &= ".html"
End If
End If
Return bOk
End Function
#Region "Details"
Public Overrides Sub Details(ByVal param As Object)
'' Determino il nome del file contenente le stime
'Dim sEstFile As String = OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\MachProj.html"
'Dim sInfo As String = ""
''GetEstimationFileName(False, sEstFile, sInfo)
'' Verifico che il file esista
'If Not File.Exists(sEstFile) Then
' ' File delle stime non trovato
' MessageBox.Show(EgtMsg(MSG_SIMULATION + 15), EgtMsg(MSG_SIMULATION + 14), MessageBoxButton.OK, MessageBoxImage.Warning)
' Return
'End If
'' Visualizzazione
'Dim EstimationsWnd As New EstimationsDetailsWndV(Application.Current.MainWindow, New EstimationsDetailsWndVM(sEstFile, CurrentMachine.sMachIniFile))
'EstimationsWnd.ShowDialog()
End Sub
#End Region ' Details
#End Region ' METHODS
End Class
+111
View File
@@ -0,0 +1,111 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class MySimulation
Inherits SimulationVM
#Region "FIELDS & PROPERTIES"
Public Overrides Property SliderValue As Double
Get
Return m_SliderValue
End Get
Set(value As Double)
If Math.Abs(value - m_SliderValue) > EPS_SMALL Then
m_SliderValue = value
EgtSimSetStep(m_SliderValue * GetSliderX())
NotifyPropertyChanged("SliderValue")
End If
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
SetPlayImagePath("/Resources/SimulTab/Play.png")
SetPauseImagePath("/Resources/SimulTab/Pause.png")
SetPauseMsg(EgtMsg(90561)) ' Pausa
SetStopMsg(EgtMsg(90562)) ' Simulazione interrotta
SetHomeMsg(EgtMsg(90564)) ' Home
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Overrides Sub ExecSim()
EgtSimStart(False)
EgtSimSetStep(SliderValue * GetSliderX())
Dim nShowDataCounter As Integer = 0
While GetStatus() <> MCH_SIM_ST.UI_STOP
' Se simulazione in svolgimento
If GetStatus() = MCH_SIM_ST.UI_PLAY Or GetStatus() = MCH_SIM_ST.UI_STEP Then
' Eseguo movimento
Dim nMove As Integer
Dim bMove As Boolean = EgtSimMove(nMove)
' Se arrivato a fine step e sono in step
If bMove Then
If GetStatus() = MCH_SIM_ST.UI_STEP And nMove = MCH_SIM.END_STEP Then
' Imposto stato Pausa
SetSimulationStatus(MCH_SIM_ST.UI_PAUSE)
StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 11) ' Pausa
' Aggiornamenti per bottone Play/Pause
SetShowPlay(True)
NotifyPropertyChanged("PlayPauseImage")
End If
' Se movimento non riuscito
Else
SetSimulationStatus(MCH_SIM_ST.UI_STOP)
' Aggiornamenti per bottone Play/Pause
SetShowPlay(True)
NotifyPropertyChanged("PlayPauseImage")
Select Case nMove
Case MCH_SIM.END_
StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 1) 'Simulazione completata
Case MCH_SIM.STOP_
' Simulazione fermata dall'utente (non necessita messaggio)
Case MCH_SIM.OUTSTROKE
Dim sInfo As String = String.Empty
EgtGetOutstrokeInfo(sInfo)
MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo, EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Extracorsa ...
Case MCH_SIM.DIR_ERR
MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 3), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Direzione utensile irraggiungibile
Case Else
MessageBox.Show(EgtMsg(MSG_SIMULATIONPAGEUC + 4), EgtMsg(MSG_SIMULATIONPAGEUC + 5), MessageBoxButton.OK, MessageBoxImage.Stop) 'Errore
End Select
End If
' Aggiorno stato visualizzazione macchina (dipende anche da utensile)
UpdateMachView()
' Aggiorno visualizzazione
EgtDraw()
' Aggiorno dati CNC
ShowCncData()
Else
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(1)
End If
' Costringo ad aggiornare UI
UpdateUI()
End While
End Sub
Public Overrides Sub OnPostSetSimulationStatus(value As MCH_SIM_ST)
'If OmagOFFICE.refMainWindowVM.MainWindowM.nUserLevel >= 10 AndAlso
' (GetStatus() = MCH_SIM_ST.UI_PAUSE OrElse GetStatus() = MCH_SIM_ST.UI_STOP) Then
' For Index = 0 To MachineAxisList.Count - 1
' MachineAxisList(Index).IsReadOnlyAxesValue = False
' Next
'Else
' For Index = 0 To MachineAxisList.Count - 1
' MachineAxisList(Index).IsReadOnlyAxesValue = True
' Next
'End If
End Sub
#End Region ' METHODS
End Class
@@ -0,0 +1,128 @@
<UserControl x:Class="SimulationPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Border VerticalAlignment="Center"
Style="{StaticResource RightPanel_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<GroupBox Header="{Binding MachViewMsg}" Margin="0,0,0,5">
<ComboBox ItemsSource="{Binding MachViewList}"
SelectedIndex="{Binding nSelMachView}"/>
<!--<UniformGrid Columns="3">
<Button Command="{Binding ToolModeCommand}"
Style="{StaticResource OptionPanel_NestingButton}">
<Image Source="/Resources/SimulTab/ToolMode.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding HeadModeCommand}"
Style="{StaticResource OptionPanel_NestingButton}">
<Image Source="/Resources/SimulTab/HeadMode.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding MachModeCommand}"
Style="{StaticResource OptionPanel_NestingButton}">
<Image Source="/Resources/SimulTab/MachMode.png" Stretch="Uniform"/>
</Button>
</UniformGrid>-->
</GroupBox>
<GroupBox Grid.Row="1"
BorderThickness="0">
<StackPanel DataContext="{Binding MySimul}">
<UniformGrid Columns="3" Margin="0,10,0,5">
<Button Command="{Binding StepCommand}" Grid.Column="0" Grid.Row="3"
Style="{StaticResource OptionPanel_NestingButton}"
ToolTip="{Binding OneStepToolTip}" Margin="0,0,2.5,0">
<Image Source="/Resources/SimulationPanel/PlayStep.png"
HorizontalAlignment="Center" VerticalAlignment="Center"
Height="50" Width="50"/>
</Button>
<Button Command="{Binding PlayPauseCommand}" Grid.Column="1" Grid.Row="3"
Style="{StaticResource OptionPanel_NestingButton}"
ToolTip="{Binding PlayPauseToolTip}" Margin="2.5,0,2.5,0">
<Image Source="{Binding PlayPauseImage}" HorizontalAlignment="Center"
VerticalAlignment="Center" Height="50" Width="50"/>
</Button>
<Button Command="{Binding StopCommand}" Grid.Column="2" Grid.Row="3"
Style="{StaticResource OptionPanel_NestingButton}"
ToolTip="{Binding StopHomeToolTip}" Margin="2.5,0,0,0">
<Image Source="/Resources/SimulationPanel/Stop.png"
HorizontalAlignment="Center" VerticalAlignment="Center"
Height="50" Width="50"/>
</Button>
</UniformGrid>
<TextBlock Text="{Binding StatusMsg}" FontSize="15" TextAlignment="Center" Margin="10,5,10,0"/>
<Slider Name="SpeedSlider" Grid.Row="5" Grid.ColumnSpan="3" Height="30"
Minimum="1" Maximum="100" TickPlacement="BottomRight" TickFrequency="10"
Margin="0,5,0,0" Value="{Binding SliderValue}"/>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding TName}" Grid.Row="0" FontSize="15" HorizontalAlignment="Center"
VerticalAlignment="Center" TextAlignment="Center" Margin="5,5,5,0" Grid.ColumnSpan="2" />
<TextBlock Text="{Binding SValue}" Grid.Row="0" Grid.Column="2" FontSize="15" HorizontalAlignment="Center"
VerticalAlignment="Center" TextAlignment="Right" Margin="0,5,5,5" />
<TextBlock Text="{Binding GCode}" Grid.Row="1" FontSize="15" HorizontalAlignment="Center"
VerticalAlignment="Center" TextAlignment="Center" Margin="5,5,5,0" Grid.ColumnSpan="2" />
<TextBlock Text="{Binding FValue}" Grid.Row="1" Grid.Column="2" FontSize="15" HorizontalAlignment="Center"
VerticalAlignment="Center" TextAlignment="Right" Margin="0,5,5,5" />
</Grid>
<ItemsControl ItemsSource="{Binding MachineAxisList}" Margin="0,0,0,5">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Token}" FontSize="15"
HorizontalAlignment="Center" VerticalAlignment="Center"
TextWrapping="Wrap" TextAlignment="Center"/>
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1"
IsReadOnly="{Binding IsReadOnlyAxesValue}"
IsEnabled="{Binding IsEnabledAxesValue}"
TextAlignment="Right">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding ManualAxisModifyCommand}"/>
</TextBox.InputBindings>
</TextBox>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</GroupBox>
<UniformGrid Grid.Row="3"
Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
</Grid>
</Border>
</UserControl>
@@ -0,0 +1,3 @@
Public Class SimulationPanelV
End Class
+358
View File
@@ -0,0 +1,358 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class SimulationPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum MachViews As Integer
TOOL = 0
HEAD = 1
MACHINE = 2
End Enum
Private m_dPrevAngVertDegView As Double
Private m_dPrevAngHorizDegView As Double
Private m_MySimul As MySimulation
Public Property MySimul As MySimulation
Get
Return m_MySimul
End Get
Set(value As MySimulation)
m_MySimul = value
NotifyPropertyChanged("MySimul")
End Set
End Property
Private m_MachViewList As New List(Of String)({"Tool", "Head", "Machine"})
Public ReadOnly Property MachViewList As List(Of String)
Get
Return m_MachViewList
End Get
End Property
Private m_nSelMachView As MachViews
Public Property nSelMachView As Integer
Get
Return m_nSelMachView
End Get
Set(value As Integer)
m_nSelMachView = value
Select Case m_nSelMachView
Case MachViews.TOOL
ToolMode()
Case MachViews.HEAD
HeadMode()
Case MachViews.MACHINE
MachMode()
End Select
End Set
End Property
Friend Sub SetSelMachView(value As MachViews)
nSelMachView = value
NotifyPropertyChanged(NameOf(nSelMachView))
End Sub
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdToolMode As ICommand
Private m_cmdHeadMode As ICommand
Private m_cmdMachMode As ICommand
#Region "Messages"
Public ReadOnly Property MachViewMsg As String
Get
Return "View"
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
Public ReadOnly Property OneStepToolTip As String
Get
Return EgtMsg(MSG_SIMULATION + 8)
End Get
End Property
Public ReadOnly Property PlayPauseToolTip As String
Get
Return EgtMsg(MSG_SIMULATION + 9)
End Get
End Property
Public ReadOnly Property StopHomeToolTip As String
Get
Return EgtMsg(MSG_SIMULATION + 10)
End Get
End Property
#End Region ' ToolTip
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in OmagOFFICEMap
Map.SetRefSimulationPanelVM(Me)
MySimul = New MySimulation
' leggo vista macchina da ini e la imposto
SetSelMachView(MachViews.MACHINE)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub Refresh(PrevMeasureUnit As MeasureUnitOpt)
End Sub
Friend Sub InitSimulation()
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
' Disabilito Machine Panel (utensili, lavoraz...)
'OmagOFFICEMap.refMachinePanelVM.MachPanel_IsEnabled = False
' Deseleziono pezzi
EgtDeselectAll()
' L'attrezzaggio utensili è verificato all'avvio simulazione (con attrezzaggio salvato)
' Costringo ad aggiornare UI
UpdateUI()
'' Se non c'è ordine delle lavorazioni, ne faccio uno automatico
'Dim bOk As Boolean = True
'If Not EstCalc.GetOrderMachiningFlag() Then
' ResetAllMachinings()
' bOk = SortAllMachinings()
' If bOk Then EstCalc.SetOrderMachiningFlag()
' Dim bModif As Boolean = TestAllMachiningsForStrict()
' If bModif Then
' ' Ridotte alcune lavorazioni per evitare interferenze
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90321), 3, MSG_TYPE.WARNING)
' Else
' ' Aggiornate tutte le lavorazioni
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90399), 3, MSG_TYPE.INFO)
' End If
'End If
'' Costringo ad aggiornare UI
'UpdateUI()
' Disabilito impostazione modificato
EgtDisableModified()
'' Aggiorno le lavorazioni
'bOk = UpdateAllMachiningsToolpaths() And bOk
'' Se errore in generazione, segnalo l'errore
'If Not bOk Then
' ' Errore nella generazione del programma CN
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90314), MSG_TYPE.ERROR_)
'End If
'' Eseguo la stima di tempi, lunghezze ...
'Dim bEstim As Boolean = (GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, CurrentMachine.sMachIniFile) <> 0)
'If bEstim Then
' MyEstim.Estimation_IsEnabled = True
' EgtSetCurrPhase(1)
' EgtEstimate(OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\MachProj.html", "OmagCut ver." & OmagOFFICEMap.refMainWindowVM.MainWindowM.sVersion)
'Else
' MyEstim.Estimation_IsEnabled = False
'End If
'' Impostazioni box stime
'NotifyPropertyChanged("Time")
'NotifyPropertyChanged("CutLen")
'NotifyPropertyChanged("NetArea")
'NotifyPropertyChanged("Usage")
'' Nascondo eventuali pezzi in parcheggio
'HideParkedParts()
'' Nascondo eventuale contorno da foto
'EstPhoto.ShowContour(False)
' Imposto prima fase
EgtSetCurrPhase(1)
'ShowAllCurrPhaseMachinings()
' Costringo ad aggiornare UI
UpdateUI()
'Cambio la vista della scena
EgtGetGenericView(m_dPrevAngVertDegView, m_dPrevAngHorizDegView)
EgtSetView(VT.ISO_SE, False)
MySimul.SetMachLook(MCH_LOOK.ALL)
EgtSetMachineLook(MySimul.GetMachLook())
EgtZoom(ZM.ALL)
' Avvio ambiente di simulazione
If Not EgtSimInit() OrElse Not EgtSimStart() Then
If EgtGetLastMachMgrErrorId() <> 0 Then
Dim sErr As String = EgtGetLastMachMgrErrorString()
MessageBox.Show(sErr, EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
MessageBox.Show(EgtMsg(MSG_MESSAGEBOX + 10), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error)
End If
End If
' Imposto stato corrente
MySimul.SetSimulationStatus(MCH_SIM_ST.UI_STOP)
MySimul.SetShowPlay(True)
MySimul.SetSliderX(GetMainPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1))
Dim SliderVal As Double = GetMainPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
MySimul.SliderValue = SliderVal
' Carico utensili specializzato
' LoadCurrTools()
EgtDraw()
MySimul.ShowCncData()
MySimul.StatusMsg = EgtMsg(MSG_SIMULATIONPAGEUC + 14) ' Home
End Sub
Private Function LoadCurrTools() As Boolean
'' Se macchina con cambio utensile non devo fare alcunché
'If CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
' Return True
'End If
'' Imposto la lama corrente
'Dim sSaw As String = CurrentMachine.sCurrSaw
'If Not EgtLoadTool("H1", 1, sSaw) Then
' Return False
'End If
'' Imposto eventuale secondo utensile montato
'If CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
' Dim sTool As String = CurrentMachine.sCurrDrill
' If String.IsNullOrEmpty(sTool) Then sTool = CurrentMachine.sCurrMill
' If Not String.IsNullOrEmpty(sTool) AndAlso Not EgtLoadTool("H1", 2, sTool) Then
' Return False
' End If
'End If
'Return True
End Function
Friend Sub ExitSimulation()
Map.refMyStatusBarVM.ClearOutputMessage()
' Mi assicuro di terminare la simulazione
MySimul.ResetSimulation()
' Ripristino visibilità standard
MySimul.SetMachLook(MCH_LOOK.TAB)
EgtSetMachineLook(MySimul.GetMachLook())
'' Nascondo tutte le lavorazioni
'CamAuto.HideAllMachinings()
' Abilito impostazione modificato
EgtEnableModified()
' Cambio la vista della scena
EgtSetGenericView(m_dPrevAngVertDegView, m_dPrevAngHorizDegView, False)
EgtZoom(ZM.ALL)
'' Riabilito Machine Panel (utensili, lavoraz...)
'OmagOFFICEMap.refMachinePanelVM.MachPanel_IsEnabled = True
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
' reset gruppo
EgtResetCurrMachGroup()
' eseguo script di uscita da gruppo corrente
Map.refSliceManagerVM.ExecExitMachScript()
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.SLICE
End Sub
#End Region ' Ok
#Region "ToolModeCommand"
''' <summary>
''' Returns a command that create a new tool.
''' </summary>
Public ReadOnly Property ToolModeCommand As ICommand
Get
If m_cmdToolMode Is Nothing Then
m_cmdToolMode = New Command(AddressOf ToolMode)
End If
Return m_cmdToolMode
End Get
End Property
''' <summary>
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub ToolMode()
' aggiorno lo stato
If MySimul.GetMachLook() <> MCH_LOOK.TAB_TOOL Then
MySimul.SetMachLook(MCH_LOOK.TAB_TOOL)
End If
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(MySimul.GetMachLook())
EgtDraw()
End Sub
#End Region ' ToolModeCommand
#Region "HeadModeCommand"
''' <summary>
''' Returns a command that create a new tool.
''' </summary>
Public ReadOnly Property HeadModeCommand As ICommand
Get
If m_cmdHeadMode Is Nothing Then
m_cmdHeadMode = New Command(AddressOf HeadMode)
End If
Return m_cmdHeadMode
End Get
End Property
''' <summary>
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub HeadMode()
' aggiorno lo stato
If MySimul.GetMachLook() <> MCH_LOOK.TAB_HEAD Then
MySimul.SetMachLook(MCH_LOOK.TAB_HEAD)
End If
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(MySimul.GetMachLook())
EgtDraw()
End Sub
#End Region ' HeadModeCommand
#Region "MachModeCommand"
''' <summary>
''' Returns a command that create a new tool.
''' </summary>
Public ReadOnly Property MachModeCommand As ICommand
Get
If m_cmdMachMode Is Nothing Then
m_cmdMachMode = New Command(AddressOf MachMode)
End If
Return m_cmdMachMode
End Get
End Property
''' <summary>
''' Creata the new tool. This method is invoked by the NewCommand.
''' </summary>
Public Sub MachMode()
' aggiorno lo stato
If MySimul.GetMachLook() <> MCH_LOOK.ALL Then
MySimul.SetMachLook(MCH_LOOK.ALL)
End If
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(MySimul.GetMachLook())
EgtDraw()
End Sub
#End Region ' MachModeCommand
#End Region ' COMMANDS
End Class
+20 -33
View File
@@ -2,58 +2,45 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="260">
<Border Style="{StaticResource LeftPanelPopup_Border}">
<Border VerticalAlignment="Bottom"
Style="{StaticResource LeftPanelPopup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="12 hours 43 minutes"/>
<TextBlock Text="{Binding ghTime}"
Visibility="{Binding SliceMode_Visibility}"/>
<TextBlock Grid.Row="1"
Text="32.6kg"/>
Text="{Binding ghMass}"
Visibility="{Binding SliceMode_Visibility}"/>
<ProgressBar Grid.Row="2"
Value="{Binding Loading_Value}"
Height="20"
Minimum="0"
Maximum="100"
Visibility="{Binding Loading_Visibility}"/>
<Grid Grid.Row="3"
Visibility="{Binding SimGen_Visibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="Simulate"
Command="{Binding Simulate_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Grid.Column="1"
Content="Generate"
Command="{Binding Generate_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
</Grid>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Grid.ColumnSpan="2"
Content="Slice"
Command="{Binding Slice_Command}"
Style="{StaticResource ToolBar_TextButton}"
Visibility="{Binding Slice_Visibility}"/>
<UniformGrid Grid.Row="3"
Rows="1">
<Button Content="Slice"
Command="{Binding Slice_Command}"
Style="{StaticResource ToolBar_TextButton}"
Visibility="{Binding SliceExit_Visibility}"/>
<Button Grid.Column="1"
Content="Exit"
Visibility="{Binding ModifyMode_Visibility}"/>
<Button Content="Generate"
Command="{Binding Generate_Command}"
Style="{StaticResource ToolBar_TextButton}"
Visibility="{Binding SliceMode_Visibility}"/>
<Button Content="Simulate"
Command="{Binding Simulate_Command}"
Style="{StaticResource ToolBar_TextButton}"
Visibility="{Binding SliceMode_Visibility}"/>
<Button Content="Exit"
Command="{Binding Exit_Command}"
Style="{StaticResource ToolBar_TextButton}"
Visibility="{Binding SliceExit_Visibility}"/>
</Grid>
Visibility="{Binding SliceMode_Visibility}"/>
</UniformGrid>
</Grid>
</Border>
</UserControl>
+170 -83
View File
@@ -9,6 +9,21 @@ Public Class SliceManagerVM
Private m_SliceManagerState As CalcStates
Private m_dMass As Double = 0
Public ReadOnly Property ghMass As String
Get
Return DoubleToString(m_dMass, 1) & " kg"
End Get
End Property
Private m_dTime As Double = 0
Public ReadOnly Property ghTime As String
Get
Dim dtTime As TimeSpan = TimeSpan.FromSeconds(m_dTime)
Return Math.Floor(dtTime.TotalHours) & "hours " & Math.Floor(dtTime.Minutes) & "min " & Math.Ceiling(dtTime.Seconds) & "sec"
End Get
End Property
Private m_Loading_Value As Integer = 0
Public Property Loading_Value As Integer
Get
@@ -37,34 +52,18 @@ Public Class SliceManagerVM
NotifyPropertyChanged(NameOf(Loading_Visibility))
End Sub
Private m_SimGen_Visibility As Visibility = Visibility.Collapsed
Public Property SimGen_Visibility As Visibility
Private m_ModifyMode_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property ModifyMode_Visibility As Visibility
Get
Return m_SimGen_Visibility
Return m_ModifyMode_Visibility
End Get
Set(value As Visibility)
m_SimGen_Visibility = value
End Set
End Property
Private m_Slice_Visibility As Visibility = Visibility.Collapsed
Public Property Slice_Visibility As Visibility
Private m_SliceMode_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property SliceMode_Visibility As Visibility
Get
Return m_Slice_Visibility
Return m_SliceMode_Visibility
End Get
Set(value As Visibility)
m_Slice_Visibility = value
End Set
End Property
Private m_SliceExit_Visibility As Visibility = Visibility.Collapsed
Public Property SliceExit_Visibility As Visibility
Get
Return m_SliceExit_Visibility
End Get
Set(value As Visibility)
m_SliceExit_Visibility = value
End Set
End Property
' Definizione comandi
@@ -89,17 +88,14 @@ Public Class SliceManagerVM
Friend Sub UpdateState(bState As Boolean)
If bState Then
m_Slice_Visibility = Visibility.Collapsed
m_SliceExit_Visibility = Visibility.Visible
m_SimGen_Visibility = Visibility.Visible
m_ModifyMode_Visibility = Visibility.Collapsed
m_SliceMode_Visibility = Visibility.Visible
Else
m_Slice_Visibility = Visibility.Visible
m_SliceExit_Visibility = Visibility.Hidden
m_SimGen_Visibility = Visibility.Collapsed
m_ModifyMode_Visibility = Visibility.Visible
m_SliceMode_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged(NameOf(Slice_Visibility))
NotifyPropertyChanged(NameOf(SliceExit_Visibility))
NotifyPropertyChanged(NameOf(SimGen_Visibility))
NotifyPropertyChanged(NameOf(ModifyMode_Visibility))
NotifyPropertyChanged(NameOf(SliceMode_Visibility))
End Sub
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
@@ -124,16 +120,99 @@ Public Class SliceManagerVM
'End If
End Function
Friend Sub CalcSlice(bSlice As Boolean, bCalcTFS As Boolean)
Friend Function CalcSlice(bSlice As Boolean, bCalcTFS As Boolean, bGenerate As Boolean) As Boolean
Dim bok As Boolean = True
If bCalcTFS Then Map.refTFSEditorVM.UpdateSpeedMinMax()
' eseguo file Lua
SetLoadingVisibility(True)
ExecSlice(bSlice, bCalcTFS)
bok = ExecSlice(bSlice, bCalcTFS)
SetLoadingVisibility(False)
If bSlice Then
' aggiorno massa
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
EgtGetInfo(nLayTFSCalcId, KEY_MASS, m_dMass)
NotifyPropertyChanged(NameOf(ghMass))
End If
Map.refTFSEditorVM.Refresh()
Map.refTopPanelVM.SelPart.RefreshPrintLayers()
If bGenerate Then
' verifico esistenza e correttezza machgroup
InitMachGroup(True)
' eseguo file Lua
bok = bok AndAlso ExecGenerate()
EgtGetInfo(EgtGetFirstMachGroup(), "Ttot", m_dTime)
NotifyPropertyChanged(NameOf(ghTime))
' eseguo script di uscita da gruppo corrente
ExecExitMachScript()
End If
Return bok
End Function
Friend Sub InitMachGroup(bGenerate As Boolean)
' esecuzione script prima di inizio Mach
ExecInitMachScript()
If bGenerate Then
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
While nMachGroupId <> GDB_ID.NULL
EgtRemoveMachGroup(nMachGroupId)
nMachGroupId = EgtGetFirstMachGroup()
End While
' Definisco e posiziono il grezzo sulla tavola
EgtAddMachGroup("3dPrint")
EgtSetTable("Tab")
For Each CurrPart In Map.refTopPanelVM.PartList
Dim b3Part As New BBox3d
Dim b3PrintSolid As New BBox3d
EgtGetBBoxGlob(CurrPart.nPartId, GDB_BB.STANDARD, b3Part)
EgtGetBBoxGlob(CurrPart.nPrintSolidId, GDB_BB.STANDARD, b3PrintSolid)
Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
EgtAddPartToRawPart(CurrPart.nPartId, Point3d.ORIG() + (b3Part.Min - b3PrintSolid.Min), nRawId)
EgtMoveToCornerRawPart(nRawId, b3PrintSolid.Min, MCH_CR.BL)
Next
EgtResetCurrMachGroup()
Else
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
End If
End Sub
Private Function ExecInitMachScript() As Boolean
' Recupero il nome dello script e verifico esista
Dim sInitMachScriptPath As String = ""
If EgtUILib.GetPrivateProfileString(S_MACHINING, K_MACH_INITSCRIPT, "", sInitMachScriptPath, CurrentMachine.sMachIniFile) = 0 Then Return True
sInitMachScriptPath = (CurrentMachine.sMachScriptDir & "\" & sInitMachScriptPath).TrimEnd({"\"c})
If Not My.Computer.FileSystem.FileExists(sInitMachScriptPath) Then Return True
' Eseguo lo script
EgtLuaCreateGlobTable("MACH")
If Not EgtLuaExecFile(sInitMachScriptPath) Then
EgtOutLog("Error executing Machining init script " & sInitMachScriptPath)
MessageBox.Show(EgtMsg(5463) & " " & sInitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("MACH.ERR", nErr)
EgtLuaResetGlobVar("MACH")
Return nErr = 0
End Function
Friend Function ExecExitMachScript() As Boolean
' Recupero il nome dello script e verifico esista
Dim sExitMachScriptPath As String = ""
If EgtUILib.GetPrivateProfileString(S_MACHINING, K_MACH_EXITSCRIPT, "", sExitMachScriptPath, CurrentMachine.sMachIniFile) = 0 Then Return True
sExitMachScriptPath = CurrentMachine.sMachScriptDir & "\" & sExitMachScriptPath
If Not My.Computer.FileSystem.FileExists(sExitMachScriptPath) Then Return True
' Eseguo lo script
EgtLuaCreateGlobTable("MACH")
If Not EgtLuaExecFile(sExitMachScriptPath) Then
EgtOutLog("Error executing Machining exit script " & sExitMachScriptPath)
MessageBox.Show(EgtMsg(5464) & " " & sExitMachScriptPath, EgtMsg(5461), MessageBoxButton.OK, MessageBoxImage.Error)
Return False
End If
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("MACH.ERR", nErr)
EgtLuaResetGlobVar("MACH")
Return nErr = 0
End Function
#End Region ' METHODS
#Region "COMMANDS"
@@ -167,60 +246,14 @@ Public Class SliceManagerVM
If Map.refTopPanelVM.SelPage <> Pages.SLICE Then
End If
' eseguo file Lua
CalcSlice(True, True)
' eseguo calcoli
CalcSlice(True, True, True)
Map.refTopPanelVM.SelPage = Pages.SLICE
Map.refSliderManagerVM.SetLayerIndexToMax()
End Sub
#End Region ' Slice
#Region "Exit"
''' <summary>
''' Returns a command that do CPlaneTop.
''' </summary>
Public ReadOnly Property Exit_Command As ICommand
Get
If m_cmdExit Is Nothing Then
m_cmdExit = New Command(AddressOf ExitCmd)
End If
Return m_cmdExit
End Get
End Property
''' <summary>
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub ExitCmd()
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
#End Region ' Exit
#Region "Simulate"
''' <summary>
''' Returns a command that do CPlaneTop.
''' </summary>
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
''' <summary>
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub Simulate()
End Sub
#End Region ' Simulate
#Region "Generate"
''' <summary>
@@ -239,12 +272,66 @@ Public Class SliceManagerVM
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub Generate()
' eseguo file Lua
ExecGenerate()
' eseguo calcoli
CalcSlice(False, True, True)
End Sub
#End Region ' Generate
#Region "Simulate"
''' <summary>
''' Returns a command that do CPlaneTop.
''' </summary>
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
''' <summary>
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub Simulate()
' verifico esistenza e correttezza machgroup
InitMachGroup(False)
' apro simulazione
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SIMULATION)
End Sub
#End Region ' Simulate
#Region "Exit"
''' <summary>
''' Returns a command that do CPlaneTop.
''' </summary>
Public ReadOnly Property Exit_Command As ICommand
Get
If m_cmdExit Is Nothing Then
m_cmdExit = New Command(AddressOf ExitCmd)
End If
Return m_cmdExit
End Get
End Property
''' <summary>
''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
''' </summary>
Public Sub ExitCmd()
' se in simulazione
If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION Then
' la chiudo
Map.refSimulationPanelVM.Ok()
End If
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
#End Region ' Exit
#End Region ' COMMANDS
End Class
+19 -19
View File
@@ -311,15 +311,15 @@ Public Class TFSEditorVM
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
' ricalcolo valori
Map.refSliceManagerVM.CalcSlice(False, True)
' ripristino layer selezionati
For Each Index In SelIndexList
Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
If Not IsNothing(NewLayer) Then
m_SelLayers.Add(NewLayer)
End If
Next
'' ricalcolo valori
'Map.refSliceManagerVM.CalcSlice(False, True)
'' ripristino layer selezionati
'For Each Index In SelIndexList
' Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
' If Not IsNothing(NewLayer) Then
' m_SelLayers.Add(NewLayer)
' End If
'Next
End Sub
#End Region ' Set
@@ -403,15 +403,15 @@ Public Class TFSEditorVM
For Each SelLayer In m_SelLayers
SelIndexList.Add(SelLayer.nIndex)
Next
' ricalcolo valori
Map.refSliceManagerVM.CalcSlice(False, True)
' ripristino layer selezionati
For Each Index In SelIndexList
Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
If Not IsNothing(NewLayer) Then
m_SelLayers.Add(NewLayer)
End If
Next
'' ricalcolo valori
'Map.refSliceManagerVM.CalcSlice(False, True)
'' ripristino layer selezionati
'For Each Index In SelIndexList
' Dim NewLayer As TFSLayer = m_LayerList.FirstOrDefault(Function(x) x.nIndex = Index)
' If Not IsNothing(NewLayer) Then
' m_SelLayers.Add(NewLayer)
' End If
'Next
End Sub
#End Region ' Media
@@ -437,7 +437,7 @@ Public Class TFSEditorVM
' cancello gruppo della tabella
Dim nLayTFSCalcId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, LAY_TFSCALC)
EgtEmptyGroup(nLayTFSCalcId)
Map.refSliceManagerVM.CalcSlice(False, True)
Map.refSliceManagerVM.CalcSlice(False, True, True)
End Sub
#End Region ' Reset
+13 -3
View File
@@ -12,6 +12,8 @@ Public Module CurrentMachine
Private m_sMachDir As String = String.Empty
' File ini della macchina
Private m_sMachIniFile As String = String.Empty
' File script della macchina
Private m_sMachScriptDir As String = String.Empty
' box della tavola macchina
Private m_b3Tab As New BBox3d
@@ -40,6 +42,12 @@ Public Module CurrentMachine
End Get
End Property
Friend ReadOnly Property sMachScriptDir As String
Get
Return m_sMachScriptDir
End Get
End Property
#End Region
#Region "Init"
@@ -51,6 +59,8 @@ Public Module CurrentMachine
m_sMachDir = sMachinesRootDir & "\" & sMachineName
' Impostazione path MachIni file
m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
' impostazione cartella script
m_sMachScriptDir = sMachinesRootDir & "\" & sMachineName & "\Scripts"
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' recupero box macchina
@@ -82,11 +92,11 @@ Public Module CurrentMachine
EgtSetLevel(nTabPartId, GDB_LV.SYSTEM)
EgtSetMode(nTabPartId, GDB_MD.LOCKED)
EgtSetStatus(nTabPartId, GDB_ST.ON_)
EgtSetName(nTabPartId, "TABLE")
EgtSetName(nTabPartId, TABLE)
Dim nTabLayerId As Integer = EgtCreateGroup(nTabPartId)
EgtSetName(nTabLayerId, "TABLE")
EgtSetName(nTabLayerId, TABLE)
Dim nTabOutlineId As Integer = EgtCreateRectangle2P(nTabLayerId, New Point3d(0, 0, 0), New Point3d(dTabX, dTabY, 0))
EgtSetName(nTabOutlineId, "TABLE_OUTLINE")
EgtSetName(nTabOutlineId, TABLE_OUTLINE)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End Sub
+1
View File
@@ -39,6 +39,7 @@
<PrintApp:MaterialDbVM x:Key="MaterialDbVM"/>
<PrintApp:SliderManagerVM x:Key="SliderManagerVM"/>
<PrintApp:RibParamPanelVM x:Key="RibParamPanelVM"/>
<PrintApp:SimulationPanelVM x:Key="SimulationPanelVM"/>
<!--<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
+8 -7
View File
@@ -5,11 +5,12 @@ Module LuaExec
Friend Function ExecSlice(bSlice As Boolean, bCalcTFS As Boolean) As Boolean
EgtOutLog("-- Start ExecSlice --")
Dim bOk As Boolean = True
' eseguo slice
If bSlice Then
EgtLuaCreateGlobTable("PRINT")
EgtLuaSetGlobIntVar("PRINT.PROGRAM", 1)
Map.refSceneHostVM.ExecScript(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
bOk = bOk AndAlso EgtLuaExecFile(Map.refMainWindowVM.MainWindowM.s3dPrintingDir & "\Slicing.lua")
' Cancello tavola globale
EgtLuaResetGlobVar("PRINT")
End If
@@ -37,13 +38,13 @@ Module LuaExec
EgtLuaSetGlobNumVar("MATERIAL.KZ", SelMaterialParam.dKZ)
EgtLuaSetGlobNumVar("MATERIAL.KN", SelMaterialParam.dKN)
' Eseguo lo script
Dim bOk As Boolean = False
If EgtLuaExecFile(sExecPath) Then
' Recupero i risultati
Dim nErr As Integer = 999
EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr)
bOk = (nErr <= 0)
If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString())
bOk = True
'' Recupero i risultati
'Dim nErr As Integer = 999
'EgtLuaGetGlobIntVar("MATERIAL.ERR", nErr)
'bOk = (nErr <= 0)
'If Not bOk Then EgtOutLog("ExecSlice Err=" & nErr.ToString())
Else
EgtOutLog("Error executing Slice Exec script " & sExecPath)
bOk = False
+12
View File
@@ -55,6 +55,7 @@ Module Map
Private m_refMaterialDbVM As MaterialDbVM
Private m_refSliderManagerVM As SliderManagerVM
Private m_refRibParamPanelVM As RibParamPanelVM
Private m_refSimulationPanelVM As SimulationPanelVM
#Region "Get"
@@ -387,6 +388,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refSimulationPanelVM As SimulationPanelVM
Get
Return m_refSimulationPanelVM
End Get
End Property
#End Region ' Get
#Region "Set"
@@ -665,6 +672,11 @@ Module Map
Return Not IsNothing(m_refRibParamPanelVM)
End Function
Friend Function SetRefSimulationPanelVM(SimulationPanelVM As SimulationPanelVM) As Boolean
m_refSimulationPanelVM = SimulationPanelVM
Return Not IsNothing(m_refSimulationPanelVM)
End Function
#End Region ' Set
#Region "Init"