diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb index e677393..cefe90b 100644 --- a/Constants/ConstGen.vb +++ b/Constants/ConstGen.vb @@ -37,120 +37,12 @@ Module ConstGen Public Const TEMP_DIR As String = "Temp" ' Sottodirettorio di default per le macchine Public Const MACHINES_DFL_DIR As String = "Machines" + ' Nome file Lua con le funzioni di attrezzaggio Public Const SETUP_LUA As String = "SetUp.lua" - ' Delta Z sovratavola per evitare problemi di visualizzazione texture - Public Const DELTAZ_ADDTAB As Double = 0.1 - - ' Nome testa con ventose per spostamento pezzi - Public Const VACUUM_HEAD As String = "H4" - ' Nome gruppo layout in testa con ventose - Public Const VACUUM_HEAD_LAYOUT As String = "LAYOUT" - ' Nome oggetto frame prima uscita di una testa - Public Const HEAD_FIRST_EXIT As String = "_T1" - - ' Costanti per lavorazioni - Public Const MACH_GROUP As String = "Mach01" - Public Const MAIN_TAB As String = "MainTab" - Public Const SECOND_TAB As String = "2ndTab" - Public Const PHOTO_GRP As String = "Photos" - Public Const PHOTO_NAME As String = "Raw" - - ' Nome della superficie del grezzo - Public Const NAME_RAW_SOLID As String = "RawSolid" - ' Nome del centro del grezzo - Public Const NAME_RAW_CENTER As String = "RawCenter" - ' Nome del contorno di kerf nel grezzo - Public Const NAME_KERF As String = "Kerf" - ' Chiave per info di kerf nel grezzo - Public Const KEY_KERF As String = "Kerf" - ' Nome del contorno del grezzo - Public Const NAME_RAW_OUTLINE As String = "RawOutline" - ' Nome della regione del kerf grezzo - Public Const NAME_KERF_REGION As String = "KerfRegion" - ' Nome della regione fuori kerf nel grezzo - Public Const NAME_OUTKERF As String = "SheetOut" - ' Chiave per definizione del grezzo per punti - Public Const KEY_RAWBYPOINTS As String = "Rbp" - ' Nome del contorno di un'area rovinata - Public Const NAME_DAMAGED As String = "Damaged" - ' Nome della regione di un'area rovinata - Public Const NAME_DAMAGED_REG As String = "DmgReg" - - ' Contrassegno di progetto OmagCut - Public Const NAME_PROJMARK As String = "OmagCut" - ' Info per stato flag taglio ridotto - Public Const INFO_REDUCEDCUT = "ReducedCut" - ' Info per lavorazioni già ordinate - Public Const INFO_MACHORDER As String = "MachOrder" - ' Info per indice progetto - Public Const INFO_PROJINDEX As String = "ProjIndex" - - ' Nome layer delle regioni - Public Const NAME_REGION As String = "Region" - ' Delta Z regioni di pezzi per evitare problemi di visualizzazione con grezzi - Public Const DELTAZ_REG As Double = 0.1 - ' Nome layer contorni esterni - Public Const NAME_OUTLOOP As String = "OutLoop" - ' Nome layer contorni interni - Public Const NAME_INLOOP As String = "InLoop" - ' Nome layer percorsi sul pezzo - Public Const NAME_ONPATH As String = "OnPath" - ' Nome layer preview - Public Const NAME_PREVIEW As String = "PV" - ' Info in entità da tagliare per affondamento - Public Const INFO_DEPTH As String = "Depth" - ' Info in entità da tagliare per angolo di lato - Public Const INFO_SIDE_ANGLE As String = "SideAng" - ' Info in entità da tagliare per abilitare possibilità di inversione - Public Const INFO_ENABLE_INVERT As String = "EnInv" - ' Info in preview lavorazione con identificativo layer preview spostato nel pezzo - Public Const INFO_PV_ONPART_ID As String = "PvId" - ' Info in lavorazione con identificativo lavorazioni inglobate - Public Const INFO_MCH_OTHMID As String = "OthMIds" - ' Info lavorazione disabilitata dall'utente - Public Const INFO_MCH_USER_OFF As String = "UserOff" - ' Nome contorno taglio - Public Const NAME_PV_CUT As String = "CUT" - ' Nome contorno pre-taglio - Public Const NAME_PV_PRECUT As String = "PRC" - ' Nome contorno post-taglio - Public Const NAME_PV_POSTCUT As String = "POC" - ' Nome contorno in basso taglio - Public Const NAME_PV_DOWN_CUT As String = "DCUT" - ' Nome contorno in basso pre-taglio - Public Const NAME_PV_DOWN_PRECUT As String = "DPRC" - ' Nome contorno in basso post-taglio - Public Const NAME_PV_DOWN_POSTCUT As String = "DPOC" - ' Info in lavorazione taglio per attacco originale - Public Const INFO_MCH_ORILEADIN As String = "OriLI" - ' Info in lavorazione taglio per uscita originale - Public Const INFO_MCH_ORILEADOUT As String = "OriLO" - ' Info in pezzo con path di Csv di provenienza - Public Const INFO_CSV_PATH As String = "CsvPath" - ' Info in pezzo con suo nome in Csv - Public Const INFO_CSV_PART As String = "CsvPart" - - ' Nome di pezzo che è una cornice - Public Const NAME_FRAME As String = "Frame" - ' Nome del layer con la sezione della cornice - Public Const NAME_SECT As String = "Sect" - ' Nome del layer con la linea guida della cornice - Public Const NAME_GUIDE As String = "Guide" - ' Nome del layer con la superficie della cornice - Public Const NAME_SURF As String = "Surf" - ' Info con direzione della cornice (0=lungoX,1=lungoY) - Public Const INFO_FRAME_DIR As String = "Dir" - ' Nome della lavorazione di sgrossatura cornici - Public Const NAME_FRAME_SAWROU As String = "FrameSawRou" - ' Nome della lavorazione di finitura cornici - Public Const NAME_FRAME_SAWFIN As String = "FrameSawFin" - ' Nome della lavorazione di spatolatura cornici - Public Const NAME_FRAME_SAWSIDEFIN As String = "FrameSawSideFin" - - ' Nome di pezzo temporaneo che serve per copia dime - Public Const NAME_COPYTEMPLATE As String = "CopyTemplate" + ' Chiave di Info in gruppo di lavoro per attivazione Virtual Milling + Public Const KEY_MCHGRP_VM As String = "Vm" ' Costante per flag di BBox Public Const BBFLAG As Integer = GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index d37201c..b2c7144 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -54,4 +54,7 @@ Public Const S_SETUP As String = "SetUp" Public Const K_DEFAULT As String = "Default" + Public Const S_VMILL As String = "VMill" + Public Const K_VM_ENABLE As String = "Enable" + End Module diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 32dfd63..c6b3453 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml index 83f1d8b..648152e 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml @@ -41,6 +41,13 @@ Minimum="1" Maximum="100" TickPlacement="BottomRight" TickFrequency="10" Margin="10,5,10,0" Value="{Binding SliderValue}"/> + + + + + diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb index 74d02b4..294c803 100644 --- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb +++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb @@ -201,6 +201,49 @@ Namespace EgtCAM5 End Set End Property + Private m_VMillActive As Boolean = False + Public Property VMillActive As Boolean + Get + Return m_VMillActive + End Get + Set(value As Boolean) + m_VMillActive = value + OnPropertyChanged("VMillActive") + If m_VMillActive Then + EgtSetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, m_VMillActive) + Else + EgtRemoveInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM) + End If + Application.Msn.NotifyColleagues(Application.EMITTITLE) + End Set + End Property + Public Sub SetVMillActive(value As Boolean) + m_VMillActive = value + OnPropertyChanged("VMillActive") + End Sub + + Private m_VMill_Visibility As Visibility = Visibility.Collapsed + Public Property VMill_Visibility As Visibility + Get + Return m_VMill_Visibility + End Get + Set(value As Visibility) + m_VMill_Visibility = value + OnPropertyChanged("VMill_Visibility") + End Set + End Property + + Private m_VMill_IsEnabled As Boolean = False + Public Property VMill_IsEnabled As Boolean + Get + Return m_VMill_IsEnabled + End Get + Set(value As Boolean) + m_VMill_IsEnabled = value + OnPropertyChanged("VMill_IsEnabled") + End Set + End Property + ' Definizione comandi Private m_cmdStep As ICommand Private m_cmdPlayPause As ICommand @@ -211,12 +254,19 @@ Namespace EgtCAM5 Public ReadOnly Property SimulationMsg As String Get - Return EgtMsg(MSG_SIMULATION + 7) + Return EgtMsg(MSG_SIMULATION + 7) 'Simulazione End Get End Property + Public ReadOnly Property GenerateMsg As String Get - Return EgtMsg(MSG_SIMULATION + 30) + Return EgtMsg(MSG_SIMULATION + 30) 'GENERA + End Get + End Property + + Public ReadOnly Property VMillMsg As String + Get + Return EgtMsg(MSG_SIMULATION + 16) 'Virtual Milling End Get End Property @@ -288,6 +338,8 @@ Namespace EgtCAM5 ''' Public Sub StepCmd(ByVal param As Object) StatusMsg = "" + ' Disabilito check VMill + VMill_IsEnabled = False ' Se stato stop, devo avviare simulazione If m_nStatus = SIM_ST.ST_STOP Then SimulationStatus = SIM_ST.ST_STEP @@ -329,6 +381,8 @@ Namespace EgtCAM5 Public Sub PlayPause(ByVal param As Object) StatusMsg = "" If m_bShowPlay Then + ' Disabilito check VMill + VMill_IsEnabled = False ' Aggiorno bottone m_bShowPlay = False OnPropertyChanged("PlayPauseImage") @@ -377,6 +431,8 @@ Namespace EgtCAM5 ''' Public Sub StopCmd(ByVal param As Object) StatusMsg = "" + ' Abilito check VMill + VMill_IsEnabled = True ' Se stato già stop, porto in home If m_nStatus = SIM_ST.ST_STOP Then ' Mi riporto all'inizio @@ -499,6 +555,20 @@ Namespace EgtCAM5 m_SliderX = GetPrivateProfileDouble(S_SIMUL, K_SLIDERX, 1) Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10) SliderValue = SliderVal + ' Gestione check VMill + If EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then + VMill_Visibility = Visibility.Visible + VMill_IsEnabled = True + Dim bVal As Boolean + SetVMillActive(EgtGetInfo(EgtGetCurrMachGroup(), KEY_MCHGRP_VM, bVal) And bVal) + Else + VMill_Visibility = Visibility.Collapsed + VMill_IsEnabled = False + ' Disabilito Vmill, ma inibisco dichiarazione progetto modificato + EgtDisableModified() + VMillActive = False + EgtEnableModified() + End If ' Inizio simulazione If Not EgtSimStart() Then If EgtGetLastMachMgrErrorId() <> 0 Then @@ -557,6 +627,8 @@ Namespace EgtCAM5 ' Aggiornamenti per bottone Play/Pause m_bShowPlay = True OnPropertyChanged("PlayPauseImage") + ' Abilito check VMill + VMill_IsEnabled = True Select Case nMove Case MCH_SIM.END_ StatusMsg = EgtMsg(MSG_SIMULATION + 1) 'Simulazione completata