diff --git a/AlarmsPageUC.xaml b/AlarmsPageUC.xaml
index e5a189e..c3ee3af 100644
--- a/AlarmsPageUC.xaml
+++ b/AlarmsPageUC.xaml
@@ -32,45 +32,77 @@
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb
index 1f82adc..8208227 100644
--- a/AlarmsPageUC.xaml.vb
+++ b/AlarmsPageUC.xaml.vb
@@ -6,46 +6,106 @@ Public Class AlarmsPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
+ Private m_CurrentMachine As CurrentMachine
Friend m_CN As CN_generico
' Properties
Private m_bFirst As Boolean = True
'Lista che contiene le lame disponibili (per Combobox pagina Alarms)
- Friend SawList As New List(Of String)
+ Private m_SawList As New List(Of String)
+ Private m_DrillList As New List(Of String)
+ Private m_MillList As New List(Of String)
+ Private m_AuxToolTypeList As New List(Of String)
Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs)
'Assegno liste a combobox
- CurrSawCmBx.ItemsSource = SawList
+ CurrSawCmBx.ItemsSource = m_SawList
+ CurrDrillCmBx.ItemsSource = m_DrillList
+ CurrMillCmBx.ItemsSource = m_MillList
+ AuxiliaryToolCmBx.ItemsSource = m_AuxToolTypeList
'Imposto i messaggi letti dal file dei messaggi
CurrSawTxBl.Text = "Lama corrente"
- AuxiliaryToolTxBl.Text = "Secondo utensile"
SafeZTxBl.Text = "Distanza di sicurezza"
End Sub
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs)
+ ' Variabile che accorcia il riferimento alla macchina corrente
+ m_CurrentMachine = m_MainWindow.m_CurrentMachine
+
If Not m_MainWindow.m_bNCLink = 0 Then
ErrorLstBx.ItemsSource = m_CN.sz_NC_error_messages
End If
' Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
- SawList.Clear()
- Dim ToolName As String = String.Empty
- Dim nType As Integer = MCH_TY.NONE
- If EgtTdbGetFirstTool(MCH_TF.SAWBLADE, ToolName, nType) Then
- SawList.Add(ToolName)
- While EgtTdbGetNextTool(MCH_TF.SAWBLADE, ToolName, nType)
- SawList.Add(ToolName)
- End While
- End If
+ CreateToolList(MCH_TF.SAWBLADE, m_SawList)
+ ' Seleziono lama corrente
+ CurrSawCmBx.SelectedItem = m_CurrentMachine.sCurrSaw
- ' Leggo lama corrente da file ini
- GetPrivateProfileString(S_MACH, K_CURRSAW, "", ToolName, m_MainWindow.GetIniFile())
- CurrSawCmBx.SelectedItem = ToolName
+ ' Verifico la configurazione della macchina per creare i combobox
+ Select Case m_CurrentMachine.MountedToolConfig
+ Case CurrentMachine.MountedToolConfigs.SAW
+ 'Non eseguo alcuna azione
+ Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
+ m_AuxToolTypeList.Add("Nessuno")
+ If m_CurrentMachine.bDrilling Then
+ m_AuxToolTypeList.Add("Fresatura")
+ If m_CurrentMachine.bMilling Then
+ m_AuxToolTypeList.Add("Foratura")
+ End If
+ Else
+ If m_CurrentMachine.bMilling Then
+ m_AuxToolTypeList.Add("Foratura")
+ End If
+ End If
+
+ AuxiliaryToolTxBl.Visibility = Windows.Visibility.Visible
+ AuxiliaryToolCmBx.Visibility = Windows.Visibility.Visible
+ CurrDrillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrDrillCmBx.Visibility = Windows.Visibility.Hidden
+ CurrMillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrMillCmBx.Visibility = Windows.Visibility.Hidden
+
+ If m_CurrentMachine.sCurrDrill <> String.Empty Then
+ AuxiliaryToolCmBx.SelectedItem = "Foratura"
+ CurrDrillTxBl.SetValue(Grid.RowProperty, 4)
+ CurrDrillCmBx.SetValue(Grid.RowProperty, 5)
+ CurrDrillTxBl.Visibility = Windows.Visibility.Visible
+ CurrDrillCmBx.Visibility = Windows.Visibility.Visible
+ ElseIf m_CurrentMachine.sCurrMill <> String.Empty Then
+ AuxiliaryToolCmBx.SelectedItem = "Fresatura"
+ CurrMillTxBl.Visibility = Windows.Visibility.Visible
+ CurrMillCmBx.Visibility = Windows.Visibility.Visible
+ Else
+ AuxiliaryToolCmBx.SelectedItem = "Nessuno"
+ End If
+
+ Case CurrentMachine.MountedToolConfigs.SAWAND2AUXTOOLS, CurrentMachine.MountedToolConfigs.TOOLCHANGER
+ CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
+ m_DrillList.Add("Nessuno")
+ CreateToolList(MCH_TF.MILL, m_MillList)
+ m_MillList.Add("Nessuna")
+ AuxiliaryToolTxBl.Visibility = Windows.Visibility.Hidden
+ AuxiliaryToolCmBx.Visibility = Windows.Visibility.Hidden
+ CurrDrillTxBl.Visibility = Windows.Visibility.Visible
+ CurrDrillCmBx.Visibility = Windows.Visibility.Visible
+ CurrMillTxBl.Visibility = Windows.Visibility.Visible
+ CurrMillCmBx.Visibility = Windows.Visibility.Visible
+ If m_CurrentMachine.sCurrDrill <> String.Empty Then
+ CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill
+ Else
+ CurrDrillCmBx.SelectedItem = "Nessuno"
+ End If
+ If m_CurrentMachine.sCurrMill <> String.Empty Then
+ CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill
+ Else
+ CurrMillCmBx.SelectedItem = "Nessuna"
+ End If
+ End Select
' Leggo distanza di sicurezza
Dim dSafeZ As Double = 0
@@ -54,11 +114,94 @@ Public Class AlarmsPageUC
End Sub
+ Private Sub AuxiliaryToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryToolCmBx.SelectionChanged
+ Select Case AuxiliaryToolCmBx.SelectedItem
+ Case "Nessuno"
+ CurrDrillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrDrillCmBx.Visibility = Windows.Visibility.Hidden
+ CurrMillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrMillCmBx.Visibility = Windows.Visibility.Hidden
+ m_CurrentMachine.sCurrDrill = String.Empty
+ m_CurrentMachine.sCurrMill = String.Empty
+ Case "Foratura"
+ CreateToolList(MCH_TF.DRILLBIT, m_DrillList)
+ m_DrillList.Add("Nessuno")
+ CurrDrillTxBl.SetValue(Grid.RowProperty, 4)
+ CurrDrillCmBx.SetValue(Grid.RowProperty, 5)
+ If m_CurrentMachine.sCurrDrill = String.Empty Then
+ CurrDrillCmBx.SelectedItem = "Nessuno"
+ Else
+ CurrDrillCmBx.SelectedItem = m_CurrentMachine.sCurrDrill
+ End If
+ m_CurrentMachine.sCurrMill = String.Empty
+ CurrDrillTxBl.Visibility = Windows.Visibility.Visible
+ CurrDrillCmBx.Visibility = Windows.Visibility.Visible
+ CurrMillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrMillCmBx.Visibility = Windows.Visibility.Hidden
+ Case "Fresatura"
+ CreateToolList(MCH_TF.MILL, m_MillList)
+ m_MillList.Add("Nessuna")
+ If m_CurrentMachine.sCurrMill = String.Empty Then
+ CurrMillCmBx.SelectedItem = "Nessuna"
+ Else
+ CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill
+ End If
+ m_CurrentMachine.sCurrDrill = String.Empty
+ CurrMillCmBx.SelectedItem = m_CurrentMachine.sCurrMill
+ CurrDrillTxBl.Visibility = Windows.Visibility.Hidden
+ CurrDrillCmBx.Visibility = Windows.Visibility.Hidden
+ CurrMillTxBl.Visibility = Windows.Visibility.Visible
+ CurrMillCmBx.Visibility = Windows.Visibility.Visible
+ End Select
+ End Sub
+
+ Private Sub CurrSawCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawCmBx.SelectionChanged
+ 'WritePrivateProfileString(S_MACH, K_CURRSAW, CurrSawCmBx.SelectedItem, m_MainWindow.GetIniFile())
+ m_CurrentMachine.sCurrSaw = CurrSawCmBx.SelectedItem
+
+ End Sub
+
+ Private Sub CurrDrillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillCmBx.SelectionChanged
+ If CurrDrillCmBx.SelectedItem = "Nessuno" Then
+ m_CurrentMachine.sCurrDrill = String.Empty
+ Else
+ m_CurrentMachine.sCurrDrill = CurrDrillCmBx.SelectedItem
+ If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
+ m_CurrentMachine.sCurrMill = String.Empty
+ End If
+ End If
+ End Sub
+
+ Private Sub CurrMillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrMillCmBx.SelectionChanged
+ If CurrMillCmBx.SelectedItem = "Nessuna" Then
+ m_CurrentMachine.sCurrMill = String.Empty
+ Else
+ m_CurrentMachine.sCurrMill = CurrMillCmBx.SelectedItem
+ If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
+ m_CurrentMachine.sCurrDrill = String.Empty
+ End If
+
+ End If
+ End Sub
+
+ Private Sub CreateToolList(ToolType As Integer, ToolList As List(Of String))
+ 'SawList.Clear()
+ Dim ToolName As String = String.Empty
+ Dim nType As Integer = MCH_TY.NONE
+ If EgtTdbGetFirstTool(ToolType, ToolName, nType) Then
+ ToolList.Add(ToolName)
+ While EgtTdbGetNextTool(ToolType, ToolName, nType)
+ ToolList.Add(ToolName)
+ End While
+ End If
+ End Sub
+
+
Friend Sub NcError()
If m_CN.sz_NC_error_messages.Count > 0 Then
NCErrorMessages.Text = m_CN.sz_NC_error_messages(0)
If m_CN.bIsErrorMessage Then
- m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background = Brushes.Red
+ m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background = Brushes.Red
End If
Else
NCErrorMessages.Text = ""
@@ -85,11 +228,6 @@ Public Class AlarmsPageUC
End Sub
- Private Sub CurrSawCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawCmBx.SelectionChanged
- WritePrivateProfileString(S_MACH, K_CURRSAW, CurrSawCmBx.SelectedItem, m_MainWindow.GetIniFile())
- m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = CurrSawCmBx.SelectedItem
- End Sub
-
Private Sub SafeZTxBx_EgtClosed(sender As Object, e As EventArgs) Handles SafeZTxBx.EgtClosed
Dim dSafeZ As Double = 0
StringToDouble(SafeZTxBx.Text, dSafeZ)
diff --git a/CN_Debug.vb b/CN_Debug.vb
index 8011602..f61860d 100644
--- a/CN_Debug.vb
+++ b/CN_Debug.vb
@@ -1,10 +1,14 @@
Public Class CN_Debug
Inherits CN_generico
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = Application.Current.MainWindow
+
Sub New()
End Sub
Public Overrides Function Init() As Boolean
+
' Assegno valori ad assi per test
d_axis_position(0) = -1500
d_axis_position(1) = -1300
@@ -12,6 +16,9 @@
d_axis_position(8) = 67.315
d_axis_position(7) = 90.0
+ 'Assegno icona modalità auto alla barra della macchina
+ m_MainWindow.m_MachineStatusUC.MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Auto.png", UriKind.Relative))
+
Return True
End Function
diff --git a/CamAuto.vb b/CamAuto.vb
index 3eff6d7..ed2aa69 100644
--- a/CamAuto.vb
+++ b/CamAuto.vb
@@ -6,7 +6,7 @@ Public Module CamAuto
Public Function AddMachinings(nPartId As Integer, bPreview As Boolean, bToolpath As Boolean) As Boolean
Dim sSawMch As String = String.Empty
- GetPrivateProfileString(S_MACH, K_CURRMACHINING, "", sSawMch, m_MainWindow.GetIniFile())
+ GetPrivateProfileString(S_MACH, K_CURRSAWING, "", sSawMch, m_MainWindow.GetIniFile())
Dim sDrillMch As String = String.Empty
GetPrivateProfileString(S_MACH, K_CURRDRILLING, "", sDrillMch, m_MainWindow.GetIniFile())
EgtLuaCreateGlobTable("CAM")
diff --git a/ChooseMachining.xaml b/ChooseMachining.xaml
new file mode 100644
index 0000000..d6aa9f7
--- /dev/null
+++ b/ChooseMachining.xaml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ChooseMachining.xaml.vb b/ChooseMachining.xaml.vb
new file mode 100644
index 0000000..18258fc
--- /dev/null
+++ b/ChooseMachining.xaml.vb
@@ -0,0 +1,191 @@
+Imports EgtUILib
+
+Public Class ChooseMachining
+
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = Application.Current.MainWindow
+ Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine
+ ' Liste che contengono gli elementi appartenenti alle ComboBox
+ Private m_SawingList As New List(Of String)
+ Private m_AuxiliaryMachiningTypeList As New List(Of String)
+ Private m_DrillingList As New List(Of String)
+ Private m_MillingList As New List(Of String)
+ ' Numero righe della finestra, necessario per non ridimensionarla quando si cambia il tipo di utensile ausiliario
+ Private m_RowNumber As Integer = 6
+
+ Sub New(Owner As Window)
+ Me.Owner = Owner
+ InitializeComponent()
+ ShowDialog()
+ End Sub
+
+ Private Sub ChooseMachining_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
+ Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
+ Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
+ CurrSawingCmBx.ItemsSource = m_SawingList
+ AuxiliaryMachiningCmBx.ItemsSource = m_AuxiliaryMachiningTypeList
+ CurrDrillingCmBx.ItemsSource = m_DrillingList
+ CurrMillingCmBx.ItemsSource = m_MillingList
+ End Sub
+
+ Private Sub ChooseMachining_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ InitializeMachiningLists()
+ End Sub
+
+ Private Sub InitializeMachiningLists()
+
+ 'Creo lista lavorazioni di lama
+ CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSaw, m_SawingList)
+
+ ' Verifico la configurazione della macchina per creare i combobox
+ Select Case m_CurrentMachine.MountedToolConfig
+ Case CurrentMachine.MountedToolConfigs.SAW
+ ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl)
+ ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx)
+ Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.SAWAND2AUXTOOLS, CurrentMachine.MountedToolConfigs.TOOLCHANGER
+ ' Definizione di due riga della tabella con la giusta altezza
+ For Index = 0 To 1
+ Dim Row As New RowDefinition
+ Row.Height = New GridLength(0.5, GridUnitType.Star)
+ ChooseMachiningGrid.RowDefinitions.Add(Row)
+ Next
+ AuxiliaryMachiningTxBl.SetValue(Grid.RowProperty, 2)
+ AuxiliaryMachiningCmBx.SetValue(Grid.RowProperty, 3)
+ ButtonsGrid.SetValue(Grid.RowProperty, 5)
+ AuxiliaryMachiningTxBl.Visibility = Windows.Visibility.Visible
+ AuxiliaryMachiningCmBx.Visibility = Windows.Visibility.Visible
+ Me.Height = 341.2
+ m_RowNumber += 2
+ End Select
+ CurrSawingCmBx.SelectedItem = If(Not IsNothing(m_SawingList(0)), m_SawingList(0), Nothing)
+
+ m_AuxiliaryMachiningTypeList.Add("Nessuna")
+ If m_CurrentMachine.bDrilling Then
+ m_AuxiliaryMachiningTypeList.Add("Fresatura")
+ If m_CurrentMachine.bMilling Then
+ m_AuxiliaryMachiningTypeList.Add("Foratura")
+ If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWAND2AUXTOOLS Or m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then
+ m_AuxiliaryMachiningTypeList.Add("Entrambe")
+ End If
+ End If
+ Else
+ If m_CurrentMachine.bMilling Then
+ m_AuxiliaryMachiningTypeList.Add("Foratura")
+ End If
+ End If
+ AuxiliaryMachiningCmBx.SelectedItem = "Nessuna"
+
+ End Sub
+
+ Private Sub CreateMachiningList(MachiningType As Integer, CurrTool As String, MachiningList As List(Of String))
+ 'Cerco tutte le lavorazioni che utilizzano l'utensile corrente le aggiungo alla lista
+ Dim MachiningTool As String = String.Empty
+ Dim MachiningName As String = String.Empty
+ If EgtMdbGetFirstMachining(MachiningType, MachiningName) Then
+ EgtMdbSetCurrMachining(MachiningName)
+ EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
+ If MachiningTool = CurrTool Then
+ MachiningList.Add(MachiningName)
+ End If
+ While EgtMdbGetNextMachining(MachiningType, MachiningName)
+ EgtMdbSetCurrMachining(MachiningName)
+ EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, MachiningTool)
+ If MachiningTool = CurrTool Then
+ MachiningList.Add(MachiningName)
+ End If
+ End While
+ End If
+
+ End Sub
+
+ Private Sub AuxiliaryMachiningCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryMachiningCmBx.SelectionChanged
+ Select Case AuxiliaryMachiningCmBx.SelectedItem
+ Case "Nessuna"
+ If m_RowNumber > 8 Then
+ For Index = m_RowNumber - 1 To 8 Step -1
+ ChooseMachiningGrid.RowDefinitions.RemoveAt(Index)
+ Next
+ m_RowNumber = 8
+ End If
+ ButtonsGrid.SetValue(Grid.RowProperty, 5)
+ CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden
+ CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden
+ CurrMillingTxBl.Visibility = Windows.Visibility.Hidden
+ CurrMillingCmBx.Visibility = Windows.Visibility.Hidden
+ Me.Height = 341.2
+ Case "Foratura"
+ ' Definizione di due riga della tabella con la giusta altezza
+ If m_RowNumber < 10 Then
+ For Index = 1 To 10 - m_RowNumber
+ Dim Row As New RowDefinition
+ Row.Height = New GridLength(0.5, GridUnitType.Star)
+ ChooseMachiningGrid.RowDefinitions.Add(Row)
+ Next
+ m_RowNumber = 10
+ End If
+ CurrDrillingTxBl.SetValue(Grid.RowProperty, 4)
+ CurrDrillingCmBx.SetValue(Grid.RowProperty, 5)
+ ButtonsGrid.SetValue(Grid.RowProperty, 7)
+ CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
+ CurrDrillingTxBl.Visibility = Windows.Visibility.Visible
+ CurrDrillingCmBx.Visibility = Windows.Visibility.Visible
+ CurrMillingTxBl.Visibility = Windows.Visibility.Hidden
+ CurrMillingCmBx.Visibility = Windows.Visibility.Hidden
+ Me.Height = 426.5
+ Case "Fresatura"
+ ' Definizione di due riga della tabella con la giusta altezza
+ If m_RowNumber < 10 Then
+ For Index = 1 To 10 - m_RowNumber
+ Dim Row As New RowDefinition
+ Row.Height = New GridLength(0.5, GridUnitType.Star)
+ ChooseMachiningGrid.RowDefinitions.Add(Row)
+ Next
+ m_RowNumber = 10
+ End If
+ CurrMillingTxBl.SetValue(Grid.RowProperty, 4)
+ CurrMillingCmBx.SetValue(Grid.RowProperty, 5)
+ ButtonsGrid.SetValue(Grid.RowProperty, 7)
+ CreateMachiningList(MCH_MY.MILLING, m_CurrentMachine.sCurrMill, m_MillingList)
+ CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden
+ CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden
+ CurrMillingTxBl.Visibility = Windows.Visibility.Visible
+ CurrMillingCmBx.Visibility = Windows.Visibility.Visible
+ Me.Height = 426.5
+ Case "Entrambe"
+ ' Definizione di quattro riga della tabella con la giusta altezza
+ If m_RowNumber < 12 Then
+ For Index = 1 To 12 - m_RowNumber
+ Dim Row As New RowDefinition
+ Row.Height = New GridLength(0.5, GridUnitType.Star)
+ ChooseMachiningGrid.RowDefinitions.Add(Row)
+ Next
+ m_RowNumber = 12
+ End If
+ CurrDrillingTxBl.SetValue(Grid.RowProperty, 4)
+ CurrDrillingCmBx.SetValue(Grid.RowProperty, 5)
+ CurrMillingTxBl.SetValue(Grid.RowProperty, 6)
+ CurrMillingCmBx.SetValue(Grid.RowProperty, 7)
+ ButtonsGrid.SetValue(Grid.RowProperty, 9)
+ CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList)
+ CreateMachiningList(MCH_MY.MILLING, m_CurrentMachine.sCurrMill, m_MillingList)
+ CurrDrillingTxBl.Visibility = Windows.Visibility.Visible
+ CurrDrillingCmBx.Visibility = Windows.Visibility.Visible
+ CurrMillingTxBl.Visibility = Windows.Visibility.Visible
+ CurrMillingCmBx.Visibility = Windows.Visibility.Visible
+ Me.Height = 511.8
+ End Select
+ End Sub
+
+ Private Sub CurrSawingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawingCmBx.SelectionChanged
+ m_MainWindow.m_CurrentMachine.sCurrSawing = CurrSawingCmBx.SelectedItem
+ End Sub
+
+ Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
+ DialogResult = True
+ End Sub
+
+ Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
+ DialogResult = False
+ End Sub
+
+End Class
diff --git a/ConstIni.vb b/ConstIni.vb
index 1ee6ffc..0457528 100644
--- a/ConstIni.vb
+++ b/ConstIni.vb
@@ -114,8 +114,11 @@ Module ConstIni
Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
Public Const K_CURRMACH As String = "CurrMach"
Public Const K_CURRSAW As String = "CurrSaw"
- Public Const K_CURRMACHINING As String = "CurrMachining"
+ Public Const K_CURRDRILL As String = "CurrDrill"
+ Public Const K_CURRMILL As String = "CurrMill"
+ Public Const K_CURRSAWING As String = "CurrSawing"
Public Const K_CURRDRILLING As String = "CurrDrilling"
+ Public Const K_CURRMILLING As String = "CurrMilling"
Public Const S_SIMUL As String = "Simul"
Public Const K_SLIDERX As String = "SliderX"
diff --git a/ConstMachIni.vb b/ConstMachIni.vb
index 8bdf77e..9bb7ce8 100644
--- a/ConstMachIni.vb
+++ b/ConstMachIni.vb
@@ -41,6 +41,7 @@
Public Const K_DRILLMAKER As String = "DrillMaker"
Public Const K_SAWBLADEMAKER As String = "SawBladeMaker"
Public Const K_MILLMAKER As String = "MillMaker"
+ Public Const K_MOUNTEDTOOLCONFIG As String = "MountedToolConfig"
Public Const S_MACHININGS As String = "Machinings"
Public Const K_DRILLING As String = "Drilling"
diff --git a/CurrentMachine.vb b/CurrentMachine.vb
new file mode 100644
index 0000000..4cc0841
--- /dev/null
+++ b/CurrentMachine.vb
@@ -0,0 +1,269 @@
+Imports EgtUILib
+
+Public Class CurrentMachine
+
+ ' Riferimento alla MainWindow
+ Private m_MainWindow As MainWindow = Application.Current.MainWindow
+
+ ' Nome macchina corrente
+ Private m_sMachineName As String
+
+ ' File ini della macchina
+ Private m_sMachIniFile As String
+
+ ' Numero e tipo di utensili correntemente disponibili sulla macchina
+ Private m_MountedToolConfig As MountedToolConfigs
+
+ ' Distanza di sicurezza
+ Private m_dSafeZ As Double
+
+ ' Flag che indicano stato tipologia utensili (attivo/non attivo)
+ Private m_bSaw As Boolean
+ Private m_bDrill As Boolean
+ Private m_bMill As Boolean
+
+ 'Flag che indicano presenza tipologia lavorazioni (attivo/non attivo)
+ Private m_bSawing As Boolean
+ Private m_bDrilling As Boolean
+ Private m_bMilling As Boolean
+
+ ' Variabili che nel caso di porta utensili indicano quanti utensili possono essere ospitati per tipo
+
+ ' Variabili che contengono il nome degli utensili disponibili per tipo
+ Private m_sCurrSaw(0) As String
+ Private m_sCurrDrill(0) As String
+ Private m_sCurrMill(0) As String
+
+ ' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
+ Private m_sCurrSawing As String
+ Private m_sCurrDrilling As String
+ Private m_sCurrMilling As String
+
+ ' Spessore sottopezzo
+ Private m_dAdditionalTable As Double
+
+ Friend Enum MountedToolConfigs As Integer
+ SAW = 0
+ SAWANDAUXTOOL = 1
+ SAWAND2AUXTOOLS = 2
+ TOOLCHANGER = 3
+ End Enum
+
+#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
+
+ Friend ReadOnly Property sMachineName As String
+ Get
+ Return m_sMachineName
+ End Get
+ End Property
+
+ Friend ReadOnly Property sMachIniFile As String
+ Get
+ Return m_sMachIniFile
+ End Get
+ End Property
+
+ Friend ReadOnly Property MountedToolConfig As MountedToolConfigs
+ Get
+ Return m_MountedToolConfig
+ End Get
+ End Property
+
+ Friend Property dSafeZ As Double
+ Get
+ If EgtMdbGetSafeZ(m_dSafeZ) Then
+ Return m_dSafeZ
+ Else
+ Return Nothing
+ End If
+ End Get
+ Set(value As Double)
+ If EgtMdbSetSafeZ(value) And
+ EgtMdbSave() Then
+ m_dSafeZ = value
+ End If
+ End Set
+ End Property
+
+ Friend ReadOnly Property bSaw As Boolean
+ Get
+ Return m_bSaw
+ End Get
+ End Property
+
+ Friend ReadOnly Property bDrill As Boolean
+ Get
+ Return m_bDrill
+ End Get
+ End Property
+
+ Friend ReadOnly Property bMill As Boolean
+ Get
+ Return m_bMill
+ End Get
+ End Property
+
+ Friend ReadOnly Property bSawing As Boolean
+ Get
+ Return m_bSawing
+ End Get
+ End Property
+
+ Friend ReadOnly Property bDrilling As Boolean
+ Get
+ Return m_bDrilling
+ End Get
+ End Property
+
+ Friend ReadOnly Property bMilling As Boolean
+ Get
+ Return m_bMilling
+ End Get
+ End Property
+
+ Friend Property sCurrSaw As String
+ Get
+ Return m_sCurrSaw(0)
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRSAW, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrSaw(0) = value
+ m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
+ End If
+ End Set
+ End Property
+
+ Friend Property sCurrDrill As String
+ Get
+ Return m_sCurrDrill(0)
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRDRILL, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrDrill(0) = value
+ End If
+ End Set
+ End Property
+
+ Friend Property sCurrMill As String
+ Get
+ Return m_sCurrMill(0)
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRMILL, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrMill(0) = value
+ End If
+ End Set
+ End Property
+
+ Friend Property sCurrSawing As String
+ Get
+ Return m_sCurrSawing
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRSAWING, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrSawing = value
+ End If
+ End Set
+ End Property
+
+ Friend Property sCurrDrilling As String
+ Get
+ Return m_sCurrDrilling
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRDRILLING, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrDrilling = value
+ End If
+ End Set
+ End Property
+
+ Friend Property sCurrMilling As String
+ Get
+ Return m_sCurrMilling
+ End Get
+ Set(value As String)
+ If WritePrivateProfileString(S_MACH, K_CURRMILLING, value, m_MainWindow.GetIniFile()) Then
+ m_sCurrMilling = value
+ End If
+ End Set
+ End Property
+
+ Friend Property dAdditionalTable As Double
+ Get
+ Return m_dAdditionalTable
+ End Get
+ Set(value As Double)
+ If WritePrivateProfileString(S_TABLE, K_ADDITIONALTABLE, value, sMachIniFile) Then
+ m_sCurrMilling = value
+ End If
+ End Set
+ End Property
+
+#End Region
+
+ Sub New()
+
+ ' Leggo da file ini nome macchina corrente
+ GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sMachineName, m_MainWindow.GetIniFile())
+ ' Impostazione path MachIni file
+ m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
+ ' Leggo configurazione degli utensili in macchina
+ m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
+ ' Leggo flag presenza tipologie utensili
+ ' lama
+ If GetPrivateProfileInt(S_TOOLS, K_SAWBLADE, Nothing, sMachIniFile) > 0 Then
+ m_bSaw = True
+ Else
+ m_bSaw = False
+ End If
+ ' foretto
+ If GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, Nothing, sMachIniFile) > 0 Then
+ m_bDrill = True
+ Else
+ m_bDrill = False
+ End If
+ ' fresa
+ If GetPrivateProfileInt(S_TOOLS, K_MILL, Nothing, sMachIniFile) > 0 Then
+ m_bMill = True
+ Else
+ m_bMill = False
+ End If
+ ' Leggo flag presenza tipologie lavorazioni
+ ' lama
+ If GetPrivateProfileInt(S_MACHININGS, K_SAWING, Nothing, sMachIniFile) > 0 Then
+ m_bSawing = True
+ Else
+ m_bSawing = False
+ End If
+ ' foretto
+ If GetPrivateProfileInt(S_MACHININGS, K_DRILLING, Nothing, sMachIniFile) > 0 Then
+ m_bDrilling = True
+ Else
+ m_bDrilling = False
+ End If
+ ' fresa
+ If GetPrivateProfileInt(S_MACHININGS, K_MILLING, Nothing, sMachIniFile) > 0 Then
+ m_bMilling = True
+ Else
+ m_bMilling = False
+ End If
+
+ ' Leggo utensili correnti
+ ' lama
+ GetPrivateProfileString(S_MACH, K_CURRSAW, Nothing, m_sCurrSaw(0), m_MainWindow.GetIniFile())
+ ' foretto
+ GetPrivateProfileString(S_MACH, K_CURRDRILL, Nothing, m_sCurrDrill(0), m_MainWindow.GetIniFile())
+ ' fresa
+ GetPrivateProfileString(S_MACH, K_CURRMILL, Nothing, m_sCurrMill(0), m_MainWindow.GetIniFile())
+
+ ' Leggo lavorazioni correnti
+ ' lama
+ GetPrivateProfileString(S_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, m_MainWindow.GetIniFile())
+ ' foretto
+ GetPrivateProfileString(S_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, m_MainWindow.GetIniFile())
+ ' fresa
+ GetPrivateProfileString(S_MACH, K_CURRMILLING, Nothing, m_sCurrMilling, m_MainWindow.GetIniFile())
+
+ End Sub
+
+End Class
diff --git a/CurrentProjectPageUC.xaml.vb b/CurrentProjectPageUC.xaml.vb
index a199bd5..d3efc4d 100644
--- a/CurrentProjectPageUC.xaml.vb
+++ b/CurrentProjectPageUC.xaml.vb
@@ -145,7 +145,7 @@ Public Class CurrentProjectPageUC
End If
Dim sCurrMach As String = String.Empty
- GetPrivateProfileString(S_MACH, K_CURRMACHINING, "", sCurrMach, m_MainWindow.GetIniFile())
+ GetPrivateProfileString(S_MACH, K_CURRSAWING, "", sCurrMach, m_MainWindow.GetIniFile())
MachiningTxBx.Text = sCurrMach
End Sub
diff --git a/DirectCutPageUC.xaml b/DirectCutPageUC.xaml
index 6f57bb3..d0de119 100644
--- a/DirectCutPageUC.xaml
+++ b/DirectCutPageUC.xaml
@@ -57,6 +57,10 @@
+
+
+
diff --git a/GridCut.xaml b/GridCut.xaml
index 527e012..8bd70c9 100644
--- a/GridCut.xaml
+++ b/GridCut.xaml
@@ -26,9 +26,9 @@
-
+
@@ -52,22 +52,17 @@
-
-
-
-
-
-
-
-
+
@@ -82,29 +77,29 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/GridCut.xaml.vb b/GridCut.xaml.vb
index c5ac324..924442c 100644
--- a/GridCut.xaml.vb
+++ b/GridCut.xaml.vb
@@ -37,14 +37,14 @@ Public Class GridCut
Right
End Enum
- Private Sub MultipleCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
+ Private Sub GridCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
' Reset punto acquisito
m_bPointP1Ok = False
'SawTipTxBl.Text = String.Empty
' Assegno parametri di lavorazione già definiti
DepthTxBx.Text = DoubleToString(m_dDepth, 1)
- LenghtTxBx.Text = DoubleToString(m_dLen, 1)
+ 'LenghtTxBx.Text = DoubleToString(m_dLen, 1)
' Origine tavola
m_bRawOk = True
If Not EgtGetTableRef(1, m_ptTabOri) Then
@@ -67,7 +67,7 @@ Public Class GridCut
EgtDisableModified()
End Sub
- Friend Sub MultipleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
+ Friend Sub GridCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
' Rimuovo eventuale pezzo per taglio diretto
EraseDirectCutPart()
' Riattivo eventuali lavorazioni presenti
@@ -162,7 +162,7 @@ Public Class GridCut
DirectionTxBx.Text = DoubleToString(m_dAngO, 2)
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Disegno il taglio
- CreateMultipleCut()
+ CreateGridCut()
EgtShowOnlyTable(False)
EgtDraw()
' Seleziono il bottone per indicare che il primo punto è stato acquisito
@@ -175,7 +175,7 @@ Public Class GridCut
End Sub
Private Sub Point2Btn_Click(sender As Object, e As RoutedEventArgs) Handles Point2Btn.Click
- ' Deseleziono il bottone (poichè si seleziona automaticamente) cos' nel caso ci sia un errore rimane deselezionato
+ ' Deseleziono il bottone (poichè si seleziona automaticamente) così nel caso ci sia un errore rimane deselezionato
Point2Btn.IsChecked = False
' Reset punto non acquisito
m_bPointP2Ok = False
@@ -254,15 +254,16 @@ Public Class GridCut
Dim dAngOrizzDeg As Double
vtDiff.ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
If dLen > EPS_SMALL Then
- LenghtTxBx.Text = DoubleToString(dLen, 1)
+ 'LenghtTxBx.Text = DoubleToString(dLen, 1)
m_dAngO = dAngOrizzDeg
DirectionTxBx.Text = DoubleToString(dAngOrizzDeg, 2)
- Create2PointsMultipleCut()
+ Create2PointsGridCut()
EgtShowOnlyTable(False)
EgtDraw()
' Seleziono il bottone per indicare che il secondo punto è stato acquisito
Point2Btn.IsChecked = True
Else
+ Point1Btn_Click(sender, e)
' Deseleziono il bottone per indicare che il secondo punto non è stato acquisito perchè uguale al primo
Point2Btn.IsChecked = False
End If
@@ -282,24 +283,24 @@ Public Class GridCut
End If
DepthTxBx.Text = DoubleToString(m_dDepth, 2)
' Disegno il taglio
- CreateMultipleCut()
+ CreateGridCut()
EgtDraw()
End Sub
- Private Sub LenghtTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LenghtTxBx.EgtClosed
- ' Verifico che la lunghezza del taglio impostata non sia inferiore a quella minima
- Dim dLenght As Double = 0
- StringToDouble(LenghtTxBx.Text, dLenght)
- If dLenght < MIN_CUT_LEN Then
- m_dLen = MIN_CUT_LEN
- Else
- m_dLen = dLenght
- End If
- LenghtTxBx.Text = DoubleToString(m_dLen, 2)
- ' Disegno il taglio
- CreateMultipleCut()
- EgtDraw()
- End Sub
+ 'Private Sub LenghtTxBx_EgtClosed(sender As Object, e As EventArgs) Handles LenghtTxBx.EgtClosed
+ ' ' Verifico che la lunghezza del taglio impostata non sia inferiore a quella minima
+ ' Dim dLenght As Double = 0
+ ' StringToDouble(LenghtTxBx.Text, dLenght)
+ ' If dLenght < MIN_CUT_LEN Then
+ ' m_dLen = MIN_CUT_LEN
+ ' Else
+ ' m_dLen = dLenght
+ ' End If
+ ' LenghtTxBx.Text = DoubleToString(m_dLen, 2)
+ ' ' Disegno il taglio
+ ' CreateGridCut()
+ ' EgtDraw()
+ 'End Sub
Private Sub DirectionTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DirectionTxBx.EgtClosed
' Assegno il nuovo valore di direzione
@@ -307,7 +308,7 @@ Public Class GridCut
StringToDouble(DirectionTxBx.Text, dDirection)
m_dAngO = dDirection
' Disegno il taglio
- CreateMultipleCut()
+ CreateGridCut()
EgtDraw()
End Sub
@@ -324,7 +325,7 @@ Public Class GridCut
End If
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
' Disegno il taglio
- CreateMultipleCut()
+ CreateGridCut()
EgtDraw()
End Sub
@@ -357,7 +358,7 @@ Public Class GridCut
m_MainWindow.m_DirectCutPageUC.m_ActiveDirectCutPage = DirectCutPageUC.DirectCutPages.DirectCut
End Sub
- Private Function CreateMultipleCut() As Boolean
+ Private Function CreateGridCut() As Boolean
' Verifico sia definito il punto iniziale e il grezzo
If Not m_bPointP1Ok Or Not m_bRawOk Then
m_bCutOk = False
@@ -374,15 +375,11 @@ Public Class GridCut
EgtSetName(nPartId, DIRECTCUT)
Dim nLayerId = EgtCreateGroup(nPartId)
EgtSetName(nLayerId, "OutLoop")
- ' Creo il taglio
+ ' Creo il taglio parallelo alla lama
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
- Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
- ' Imposto affondamento e angolo di fianco sul taglio
- EgtSetInfo(nCutId, "Depth", m_dDepth)
- EgtSetInfo(nCutId, "SideAng", m_dAngV)
' Funzione che crea i tagli successivi al primo
- MultiplyCut(nLayerId, nCutId)
+ MultiplyCut(nLayerId)
' Creo layer per crocetta di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocetta
@@ -400,7 +397,7 @@ Public Class GridCut
Return m_bCutOk
End Function
- Private Function Create2PointsMultipleCut() As Boolean
+ Private Function Create2PointsGridCut() As Boolean
' Verifico siano definiti punto iniziale punto finale e grezzo
If Not m_bPointP1Ok Or Not m_bPointP2Ok Or Not m_bRawOk Then
m_bCutOk = False
@@ -423,12 +420,8 @@ Public Class GridCut
Dim ptEnd As Point3d = m_ptTipP2
ptStart.z = 0
ptEnd.z = 0
- Dim nCutId = EgtCreateLine(nLayerId, ptStart, ptEnd)
- ' Imposto affondamento e angolo di fianco sul taglio
- EgtSetInfo(nCutId, "Depth", m_dDepth)
- EgtSetInfo(nCutId, "SideAng", m_dAngV)
' Funzione che crea i tagli successivi al primo
- MultiplyCut(nLayerId, nCutId)
+ MultiplyCut(nLayerId)
' Creo layer per crocette di riferimento
Dim nCrossLayerId = EgtCreateGroup(nPartId)
' Aggiungo crocette
@@ -447,65 +440,66 @@ Public Class GridCut
Return m_bCutOk
End Function
- Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer)
+ Private Function MultiplyCut(nLayerId As Integer)
' Recupero spessore della lama correntemente attiva
Dim dThick As Double = 0
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
' Ricalcolo lo spessore della lama in base all'inclinazione
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
- ' Imposto angolo di rotazione a seconda del lato dei tagli
- Dim dRotAngO As Double = If(SideChBx.IsChecked, -90, 90)
- 'Variabile che contiene la somma degli spostamenti
- Dim dTotPerpMove As Vector3d
+ ' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
+ Dim dRotAngOX As Double = If(SideChBx.IsChecked, -90, 90)
+ 'Recupero dati da interfaccia
+ Dim dDimPzX As Double
+ Dim nNumPzX As Integer
+ StringToDouble(DimPzXTxBx.Text, dDimPzX)
+ StringToDouble(NumPzXTxBx.Text, nNumPzX)
+ Dim dDimPzY As Double
+ Dim nNumPzY As Integer
+ StringToDouble(DimPzYTxBx.Text, dDimPzY)
+ StringToDouble(NumPzYTxBx.Text, nNumPzY)
' Definisco vettore di spostamento
Dim vtDelta As Vector3d
- ' Calcolo primo vettore di spostamento
- Dim dDimPz1 As Double
- Dim nNumPz1 As Integer
- StringToDouble(DimPz1TxBx.Text, dDimPz1)
- StringToDouble(NumPz1TxBx.Text, nNumPz1)
- If dDimPz1 <> 0 And nNumPz1 > 0 Then
- vtDelta = Vector3d.FromPolar((dDimPz1 + dThick), m_dAngO)
- vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
- For Index As Integer = 1 To nNumPz1
+ ' Calcolo primo taglio parallelo
+ Dim ptStart As Point3d = m_ptTipP1
+ ptStart.z = 0
+ If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
+ Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
+ Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX)
+ ' Imposto affondamento e angolo di fianco sul taglio
+ EgtSetInfo(nCutParaId, "Depth", m_dDepth)
+ EgtSetInfo(nCutParaId, "SideAng", m_dAngV)
+ ' Calcolo vettore di spostamento
+ vtDelta = Vector3d.FromPolar((dDimPzY + dThick), m_dAngO)
+ ' Ruoto il vettore di traslazione
+ vtDelta.Rotate(Vector3d.Z_AX, dRotAngOX)
+ For Index As Integer = 1 To nNumPzY
Dim vtPerpMove As Vector3d = Index * vtDelta
' Creo copie
- Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
+ Dim nCut2Id = EgtCopyGlob(nCutParaId, nLayerId)
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
Next
- dTotPerpMove += vtDelta * nNumPz1
- End If
- ' Calcolo secondo vettore di spostamento
- Dim dDimPz2 As Double
- Dim nNumPz2 As Integer
- StringToDouble(DimPz2TxBx.Text, dDimPz2)
- StringToDouble(NumPz2TxBx.Text, nNumPz2)
- If dDimPz2 <> 0 And nNumPz2 > 0 Then
- vtDelta = Vector3d.FromPolar((dDimPz2 + dThick), m_dAngO)
- vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
- For Index As Integer = 1 To nNumPz2
- Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
+ ' Calcolo primo taglio perpendicolare
+ Dim dLenY As Double = dThick + (dDimPzY + dThick) * nNumPzY
+ ' Arretro il punto di partenza di uno spessore lama
+ Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick, m_dAngO - 90)
+ Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY)
+ ' Specchio se è attivo il flag che cambia lato di disegno
+ If SideChBx.IsChecked Then
+ Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
+ EgtMirror(nCutPerpId, ptStart + Vector3d.FromPolar(dThick / 2, m_dAngO - 90), vtRot, GDB_RT.GLOB)
+ EgtInvertCurve(nCutPerpId)
+ End If
+ ' Imposto affondamento e angolo di fianco sul taglio
+ EgtSetInfo(nCutPerpId, "Depth", m_dDepth)
+ EgtSetInfo(nCutPerpId, "SideAng", m_dAngV)
+ ' Calcolo secondo vettore di spostamento
+ vtDelta = Vector3d.FromPolar((dDimPzX + dThick), m_dAngO)
+ For Index As Integer = 1 To nNumPzX
+ Dim vtPerpMove As Vector3d = vtDelta * Index
' Creo copie
- Dim nCut3Id = EgtCopyGlob(nCutId, nLayerId)
+ Dim nCut3Id = EgtCopyGlob(nCutPerpId, nLayerId)
EgtMove(nCut3Id, vtPerpMove, GDB_RT.GLOB)
Next
- dTotPerpMove += vtDelta * nNumPz2
- End If
- ' Calcolo terzo vettore di spostamento
- Dim dDimPz3 As Double
- Dim nNumPz3 As Integer
- StringToDouble(DimPz3TxBx.Text, dDimPz3)
- StringToDouble(NumPz3TxBx.Text, nNumPz3)
- If dDimPz3 <> 0 And nNumPz3 > 0 Then
- vtDelta = Vector3d.FromPolar((dDimPz3 + dThick), m_dAngO)
- vtDelta.Rotate(Vector3d.Z_AX, dRotAngO)
- For Index As Integer = 1 To nNumPz3
- Dim vtPerpMove As Vector3d = dTotPerpMove + vtDelta * Index
- ' Creo copie
- Dim nCut4Id = EgtCopyGlob(nCutId, nLayerId)
- EgtMove(nCut4Id, vtPerpMove, GDB_RT.GLOB)
- Next
- dTotPerpMove += vtDelta * nNumPz3
End If
Return True
End Function
@@ -536,12 +530,12 @@ Public Class GridCut
Return True
End Function
- Private Sub NumPz1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles NumPz1TxBx.EgtClosed, NumPz2TxBx.EgtClosed, NumPz3TxBx.EgtClosed, DimPz1TxBx.EgtClosed, DimPz2TxBx.EgtClosed, DimPz3TxBx.EgtClosed, SideChBx.Click
+ Private Sub NumPz1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles NumPzXTxBx.EgtClosed, NumPzYTxBx.EgtClosed, DimPzXTxBx.EgtClosed, DimPzYTxBx.EgtClosed, SideChBx.Click
' Disegno il taglio
If m_bPointP2Ok Then
- Create2PointsMultipleCut()
+ Create2PointsGridCut()
Else
- CreateMultipleCut()
+ CreateGridCut()
End If
EgtDraw()
End Sub
diff --git a/MachineStatusUC.xaml b/MachineStatusUC.xaml
index 092524e..9c70c7b 100644
--- a/MachineStatusUC.xaml
+++ b/MachineStatusUC.xaml
@@ -40,8 +40,8 @@
-
+
diff --git a/MachineStatusUC.xaml.vb b/MachineStatusUC.xaml.vb
index 5bab3bc..bc22979 100644
--- a/MachineStatusUC.xaml.vb
+++ b/MachineStatusUC.xaml.vb
@@ -142,11 +142,15 @@ Public Class MachineStatusUC
Sub DisplayActiveMode(Mode As Integer)
Select Case Mode
Case 0
- MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Nest.png", UriKind.Relative))
+ MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Auto.png", UriKind.Relative))
Case 1
+ MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Single.png", UriKind.Relative))
Case 2
- Case 3
+ MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Mdi.png", UriKind.Relative))
Case 7
+ MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Manual.png", UriKind.Relative))
+ Case 8
+ MachineStatusImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("\Resources\MachineStatusImage\Home.png", UriKind.Relative))
End Select
End Sub
diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb
index d0b4a05..08560f4 100644
--- a/MainWindow.xaml.vb
+++ b/MainWindow.xaml.vb
@@ -53,6 +53,8 @@ Class MainWindow
'Dichiarazione lista delle lingue disponibili e lingua corrente
Friend m_LanguagesList As New List(Of Language)
+ ' Dichiarazione classe macchina
+ Friend m_CurrentMachine As CurrentMachine
' Macchina corrente
Private m_sCurrMachine As String = String.Empty
@@ -149,6 +151,8 @@ Class MainWindow
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
' Impostazione path MachIni file
m_sMachIniFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & m_sCurrMachine & ".ini"
+ ' Inizializzo classe macchina corrente
+ m_CurrentMachine = New CurrentMachine
' Leggo e imposto chiave di protezione
Dim sLicFileName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName, m_sIniFile)
diff --git a/MultipleCut.xaml.vb b/MultipleCut.xaml.vb
index 73651e0..5703466 100644
--- a/MultipleCut.xaml.vb
+++ b/MultipleCut.xaml.vb
@@ -264,6 +264,7 @@ Public Class MultipleCut
' Seleziono il bottone per indicare che il secondo punto è stato acquisito
Point2Btn.IsChecked = True
Else
+ Point1Btn_Click(sender, e)
' Deseleziono il bottone per indicare che il secondo punto non è stato acquisito perchè uguale al primo
Point2Btn.IsChecked = False
End If
diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj
index 12055cf..18afcb8 100644
--- a/OmagCUT.vbproj
+++ b/OmagCUT.vbproj
@@ -129,11 +129,15 @@
+
+ ChooseMachining.xaml
+
+ CurrentProjectPageUC.xaml
@@ -244,6 +248,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -512,6 +520,13 @@
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
diff --git a/OmagCUTDictionary.xaml b/OmagCUTDictionary.xaml
index 76b13d5..3e4fe27 100644
--- a/OmagCUTDictionary.xaml
+++ b/OmagCUTDictionary.xaml
@@ -285,6 +285,13 @@
+
+
diff --git a/RawPartPageUC.xaml.vb b/RawPartPageUC.xaml.vb
index 55e1a47..602fef2 100644
--- a/RawPartPageUC.xaml.vb
+++ b/RawPartPageUC.xaml.vb
@@ -5,6 +5,8 @@ Public Class RawPartPageUC
' Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = Application.Current.MainWindow
Dim WithEvents m_CurrProjPage As CurrentProjectPageUC
+ ' Definizione pagina di scelta della lavorazione corrente
+ Dim m_ChooseMachiningPage As ChooseMachining
' Flag di pagina attiva
Private m_bActive As Boolean = False
' Dati per Drag
@@ -261,26 +263,30 @@ Public Class RawPartPageUC
End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
- ' Sistemo il grezzo
- AdjustRawPartOnExit()
- ' Ripristino visualizzazione di eventuali pezzi in parcheggio
- ShowParkedParts()
- ' Imposto spessore del grezzo
- m_CurrProjPage.m_dRawHeight = GetRawHeight()
- m_CurrProjPage.HeightTxBx.Text = DoubleToString(m_RawHeight, 2)
- ' Salvo nel file Ini le dimensioni del grezzo
- WritePrivateProfileString(S_RAWPART, K_RAWLENGTH, DoubleToString(m_RawLength, 2), m_MainWindow.GetIniFile())
- WritePrivateProfileString(S_RAWPART, K_RAWWIDTH, DoubleToString(m_RawWidth, 2), m_MainWindow.GetIniFile())
- WritePrivateProfileString(S_RAWPART, K_RAWHEIGHT, DoubleToString(m_RawHeight, 2), m_MainWindow.GetIniFile())
- WritePrivateProfileString(S_RAWPART, K_RAWOFFSX, DoubleToString(m_RawOffsX, 2), m_MainWindow.GetIniFile())
- WritePrivateProfileString(S_RAWPART, K_RAWOFFSY, DoubleToString(m_RawOffsY, 2), m_MainWindow.GetIniFile())
- WritePrivateProfileString(S_RAWPART, K_RAWKERF, DoubleToString(m_RawKerf, 2), m_MainWindow.GetIniFile())
- ' Esco dalla pagina
- m_bActive = False
- m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
- m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Visible
- m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
- m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
+ ' Apro pagina di selezione della lavorazione prima di chiudere il grezzo
+ m_ChooseMachiningPage = New ChooseMachining(m_MainWindow)
+ If m_ChooseMachiningPage.DialogResult Then
+ ' Sistemo il grezzo
+ AdjustRawPartOnExit()
+ ' Ripristino visualizzazione di eventuali pezzi in parcheggio
+ ShowParkedParts()
+ ' Imposto spessore del grezzo
+ m_CurrProjPage.m_dRawHeight = GetRawHeight()
+ m_CurrProjPage.HeightTxBx.Text = DoubleToString(m_RawHeight, 2)
+ ' Salvo nel file Ini le dimensioni del grezzo
+ WritePrivateProfileString(S_RAWPART, K_RAWLENGTH, DoubleToString(m_RawLength, 2), m_MainWindow.GetIniFile())
+ WritePrivateProfileString(S_RAWPART, K_RAWWIDTH, DoubleToString(m_RawWidth, 2), m_MainWindow.GetIniFile())
+ WritePrivateProfileString(S_RAWPART, K_RAWHEIGHT, DoubleToString(m_RawHeight, 2), m_MainWindow.GetIniFile())
+ WritePrivateProfileString(S_RAWPART, K_RAWOFFSX, DoubleToString(m_RawOffsX, 2), m_MainWindow.GetIniFile())
+ WritePrivateProfileString(S_RAWPART, K_RAWOFFSY, DoubleToString(m_RawOffsY, 2), m_MainWindow.GetIniFile())
+ WritePrivateProfileString(S_RAWPART, K_RAWKERF, DoubleToString(m_RawKerf, 2), m_MainWindow.GetIniFile())
+ ' Esco dalla pagina
+ m_bActive = False
+ m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
+ m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Visible
+ m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
+ m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
+ End If
End Sub
Private Sub RectangleBtnUC_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
diff --git a/Resources/MachineStatusImage/Auto.png b/Resources/MachineStatusImage/Auto.png
new file mode 100644
index 0000000..63d68c1
Binary files /dev/null and b/Resources/MachineStatusImage/Auto.png differ
diff --git a/Resources/MachineStatusImage/Home.png b/Resources/MachineStatusImage/Home.png
new file mode 100644
index 0000000..0aa01d5
Binary files /dev/null and b/Resources/MachineStatusImage/Home.png differ
diff --git a/Resources/MachineStatusImage/Manual.png b/Resources/MachineStatusImage/Manual.png
new file mode 100644
index 0000000..22504a7
Binary files /dev/null and b/Resources/MachineStatusImage/Manual.png differ
diff --git a/Resources/MachineStatusImage/Mdi.png b/Resources/MachineStatusImage/Mdi.png
new file mode 100644
index 0000000..840036c
Binary files /dev/null and b/Resources/MachineStatusImage/Mdi.png differ
diff --git a/Resources/MachineStatusImage/Single.png b/Resources/MachineStatusImage/Single.png
new file mode 100644
index 0000000..6932dd8
Binary files /dev/null and b/Resources/MachineStatusImage/Single.png differ
diff --git a/SingleCutUC.xaml.vb b/SingleCutUC.xaml.vb
index 8afe6c3..d9ac224 100644
--- a/SingleCutUC.xaml.vb
+++ b/SingleCutUC.xaml.vb
@@ -261,6 +261,7 @@ Public Class SingleCutUC
' Seleziono il bottone per indicare che il secondo punto è stato acquisito
Point2Btn.IsChecked = True
Else
+ Point1Btn_Click(sender, e)
' Deseleziono il bottone per indicare che il secondo punto non è stato acquisito perchè uguale al primo
Point2Btn.IsChecked = False
End If
diff --git a/SplitPageUC.xaml b/SplitPageUC.xaml
index 8d7bd7b..94a1133 100644
--- a/SplitPageUC.xaml
+++ b/SplitPageUC.xaml
@@ -11,9 +11,22 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+