diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index b4629e0..5bc289f 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -29,6 +29,7 @@ Module ConstIni Public Const K_DATAFILENAME As String = "DataFileName" Public Const K_PARTPROGRAMFILENAME As String = "PartProgramFileName" Public Const K_PROBINGTIMEOUT As String = "ProbingTimeout" + Public Const K_PROBINGMODE As String = "ProbingMode" Public Const K_WINPLACE As String = "WinPlace" Public Const K_SUPPORT As String = "Support" diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b8d2481..426fd09 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -20,7 +20,7 @@ Imports System.Windows #End If - + @@ -60,5 +60,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProbingPanel/ProbingPanelV.xaml b/ProbingPanel/ProbingPanelV.xaml index 1fb7f59..58e2238 100644 --- a/ProbingPanel/ProbingPanelV.xaml +++ b/ProbingPanel/ProbingPanelV.xaml @@ -16,7 +16,16 @@ Margin="0,0,0,5"/> + Margin="0,0,0,5" + Visibility="{Binding DoorMeasuring_Visibility}"> + + + + diff --git a/ProbingPanel/ProbingPanelVM.vb b/ProbingPanel/ProbingPanelVM.vb index 664f951..083a7d2 100644 --- a/ProbingPanel/ProbingPanelVM.vb +++ b/ProbingPanel/ProbingPanelVM.vb @@ -5,6 +5,11 @@ Imports System.IO Public Class ProbingPanelVM Inherits VMBase + Public Enum ProbingModes As Integer + STANDARD = 0 + PROPERTIES = 1 + End Enum + Public Enum Properties As Integer NULL = 0 SKINNED = 1 @@ -52,6 +57,30 @@ Public Class ProbingPanelVM End Get End Property + Private m_DoorProperty_Visibility As Visibility + Public ReadOnly Property DoorProperty_Visibility As Visibility + Get + Return m_DoorProperty_Visibility + End Get + End Property + + Private m_DoorMeasuring As Boolean + Public Property DoorMeasuring As Boolean + Get + Return m_DoorMeasuring + End Get + Set(value As Boolean) + m_DoorMeasuring = value + End Set + End Property + + Private m_DoorMeasuring_Visibility As Visibility + Public ReadOnly Property DoorMeasuring_Visibility As Visibility + Get + Return m_DoorMeasuring_Visibility + End Get + End Property + Private m_Width As String Public Property Width As String Get @@ -134,6 +163,9 @@ Public Class ProbingPanelVM Private m_Timer_TimeOut As Integer Private m_Timer_Time As Integer + ' Modalità di tastatura + Private m_ProbingMode As ProbingModes = ProbingModes.PROPERTIES + ' definizione comandi Private m_cmdOpenDDF As ICommand Private m_cmdCancel As ICommand @@ -211,6 +243,17 @@ Public Class ProbingPanelVM Else m_Timer_TimeOut = 60 End If + ' Leggo modalità di tastatura + m_ProbingMode = GetMainPrivateProfileInt(S_GENERAL, K_PROBINGMODE, 1) + If m_ProbingMode = ProbingModes.PROPERTIES Then + m_DoorProperty_Visibility = Visibility.Visible + m_DoorMeasuring_Visibility = Visibility.Collapsed + Else + m_DoorProperty_Visibility = Visibility.Collapsed + m_DoorMeasuring_Visibility = Visibility.Visible + End If + NotifyPropertyChanged("DoorProperty_Visibility") + NotifyPropertyChanged("DoorMeasuring_Visibility") ' Attivo bottone apertura DDF EnableDDFButton(True) End Sub @@ -488,8 +531,8 @@ Public Class ProbingPanelVM ' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded. Public Sub Generate(ByVal param As Object) - ' se nessuna proprietà impostata do errore ed esco - If m_DoorProperty = Properties.NULL Then + ' se modalità proprietà e nessuna proprietà impostata do errore ed esco + If m_ProbingMode = ProbingModes.PROPERTIES And m_DoorProperty = Properties.NULL Then Map.refStatusBarVM.SetOutputMessage("Error, proprerty not readed!", MSG_TYPE.ERROR_) Return End If @@ -502,15 +545,21 @@ Public Class ProbingPanelVM Catch ex As Exception End Try + ' Verifico se generazione normale o con misurazione + Dim bIsMeasureProbing As Boolean = False + If m_ProbingMode = ProbingModes.PROPERTIES Then + bIsMeasureProbing = m_DoorProperty = Properties.SKINNED + Else + bIsMeasureProbing = m_DoorMeasuring + End If ' Inizio generazione primo PartProgram per entrambe le modalità - Dim bIsSkinned As Boolean = m_DoorProperty = Properties.SKINNED - Dim sProgramMsg As String = If(bIsSkinned, "Probing Part Program", "Part Program") - Dim GenFileExtension As String = If(bIsSkinned, ".prb", ".cnc") + Dim sProgramMsg As String = If(bIsMeasureProbing, "Probing Part Program", "Part Program") + Dim GenFileExtension As String = If(bIsMeasureProbing, ".prb", ".cnc") Dim GenFilePath As String = Path.ChangeExtension(m_DDFPath, GenFileExtension) SetStatus("Generating the " & sProgramMsg) ' Lancio il programma in cieco per generazione normale Try - Dim CommandLine As String = """" & m_DDFPath & """ " & If(bIsSkinned, "3", "2") + Dim CommandLine As String = """" & m_DDFPath & """ " & If(bIsMeasureProbing, "3", "2") Process.Start(m_EgtCAM5Path, CommandLine) Dim bTxtOk As Boolean = False For I = 0 To 150 @@ -553,7 +602,7 @@ Public Class ProbingPanelVM Return End Try ' se skinned - If m_DoorProperty = Properties.SKINNED Then + If bIsMeasureProbing Then ' cancello file di fine tastatura precedente Dim EndProbeFilePath As String = m_DataFilePath & m_CheckFileName Try