diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb index cefe90b..49955da 100644 --- a/Constants/ConstGen.vb +++ b/Constants/ConstGen.vb @@ -44,6 +44,9 @@ Module ConstGen ' Chiave di Info in gruppo di lavoro per attivazione Virtual Milling Public Const KEY_MCHGRP_VM As String = "Vm" + ' Chiave di Info in gruppo di lavoro per none part-program + Public Const KEY_MCHGRP_NCNAME As String = "NcName" + ' 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/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb index c446e15..27eccc1 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb @@ -570,17 +570,22 @@ Public Class SimulationExpanderVM If EgtGetModified() Then Return End If End If - Dim sCncFile As String = Path.ChangeExtension(sCurrFilePath, Nothing) + Dim sCncFile As String = "" Dim sInfo As String = "EgtCAM5 - " & sCurrFilePath - If IniFile.m_bMachiningGroup Then - Dim sMGrpName As String = String.Empty - If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then - sCncFile &= "_" & sMGrpName & ".cnc" - sInfo &= "-" & sMGrpName + If EgtGetInfo( EgtGetCurrMachGroup(), KEY_MCHGRP_NCNAME, sCncFile) AndAlso Not String.IsNullOrWhiteSpace( sCncFile) then + sCncFile = Path.GetDirectoryName (sCurrFilePath) & "\" & sCncFile + else + sCncFile = Path.ChangeExtension(sCurrFilePath, Nothing) + If IniFile.m_bMachiningGroup Then + Dim sMGrpName As String = String.Empty + If EgtGetMachGroupName(EgtGetCurrMachGroup(), sMGrpName) Then + sCncFile &= "_" & sMGrpName & ".cnc" + sInfo &= "-" & sMGrpName + End If + Else + sCncFile &= ".cnc" End If - Else - sCncFile &= ".cnc" - End If + End if If Not EgtGenerate(sCncFile, sInfo) Then If EgtGetLastMachMgrErrorId() <> 0 Then Dim sErr As String = EgtGetLastMachMgrErrorString() @@ -589,7 +594,7 @@ Public Class SimulationExpanderVM MessageBox.Show(EgtMsg(MSG_SIMULATION + 6), EgtMsg(MSG_SIMULATION + 5), MessageBoxButton.OK, MessageBoxImage.Error) End If Else - Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 32)) + Application.Msn.NotifyColleagues(Application.NOTIFYSTATUSOUTPUT, EgtMsg(MSG_SIMULATION + 32) & " (" & sCncFile & ")") End If ' Torno alla fase originale (o alla prima se non definita) EgtSetCurrPhase(If(nPhase = 0, 1, nPhase), True) diff --git a/Project/ProjectVM.vb b/Project/ProjectVM.vb index 89f9103..907cdae 100644 --- a/Project/ProjectVM.vb +++ b/Project/ProjectVM.vb @@ -327,16 +327,13 @@ Public Class ProjectVM ' Flag Dim nFlag As Integer = 1 If Environment.GetCommandLineArgs.Count() > 3 Then Integer.TryParse(Environment.GetCommandLineArgs(3), nFlag) - ' File CN - Dim sNcFile As String = "" - If Environment.GetCommandLineArgs.Count() > 4 Then sNcFile = Environment.GetCommandLineArgs(4) ' Verifica abilitazione elaborazione travi - If Not VerifyBeam(sFile, sMachine, nFlag, sNcFile) Then + If Not VerifyBeam(sFile, sMachine, nFlag) Then Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATIONCOMMAND) Return End If ' Esecuzione - ExecBeam(sFile, sMachine, nFlag, sNcFile) + ExecBeam(sFile, sMachine, nFlag) ' Se richiesta uscita immediata If nFlag = 0 Or nFlag = 3 Then Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATIONCOMMAND) Return diff --git a/Special-Beam/Beam.vb b/Special-Beam/Beam.vb index 2179528..98d9be7 100644 --- a/Special-Beam/Beam.vb +++ b/Special-Beam/Beam.vb @@ -4,7 +4,7 @@ Imports EgtUILib Module Beam - Friend Function VerifyBeam(sFile As String, sMachine As String, nFlag As Integer, sNcFile As String) As Boolean + Friend Function VerifyBeam(sFile As String, sMachine As String, nFlag As Integer) As Boolean ' Se abilitato, esco con successo If IsActiveBeam() Then Return True ' Segnalo il problema @@ -17,7 +17,7 @@ Module Beam Return False End Function - Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer, sNcFile As String) As Boolean + Friend Function ExecBeam(sFile As String, sMachine As String, nFlag As Integer) As Boolean EgtOutLog("-- Start ExecBeam --") ' Recupero lo script da eseguire Dim sExecPath As String = "" @@ -35,7 +35,6 @@ Module Beam EgtLuaSetGlobStringVar("BEAM.FILE", sFile) EgtLuaSetGlobStringVar("BEAM.MACHINE", sMachine) EgtLuaSetGlobIntVar("BEAM.FLAG", nFlag) - EgtLuaSetGlobStringVar("BEAM.NCFILE", sNcFile) ' Eseguo lo script If Not EgtLuaExecFile(sExecPath) Then EgtOutLog("Error executing Beam Exec script " & sExecPath) diff --git a/Special-Doors/MTableDbVM.vb b/Special-Doors/MTableDbVM.vb index 4cd585c..31dae1a 100644 --- a/Special-Doors/MTableDbVM.vb +++ b/Special-Doors/MTableDbVM.vb @@ -395,6 +395,10 @@ Public Class MTableDbVM Next If EgtVerifyMachinesDir() AndAlso Not bActiveMTableFound AndAlso m_TablesList.Count > 0 Then m_TablesList(0).IsSelected = True + If Not m_TablesList(0).IsSelected Then + m_TablesList.RemoveAt( 0) + return + End If m_TablesList(0).SelMachine = m_TablesList(0).ActiveMachinesList(0) End If End Sub diff --git a/Special-Doors/MTableListBox.vb b/Special-Doors/MTableListBox.vb index e510aa2..7964cf7 100644 --- a/Special-Doors/MTableListBox.vb +++ b/Special-Doors/MTableListBox.vb @@ -47,7 +47,10 @@ Public Class MTableListBoxItem ' resetto stato bottoni di modifica della tabella delle lavorazioni ordinate (posiziona, raggruppa, sposta su e giù) m_IsMachiningOrdModified = False ' leggo la tabella - If Not ReadMTableFile() Then Return + If Not ReadMTableFile() Then + m_IsSelected = False + Return + End If SelectedAssociation = If(m_AssociationList.Count > 0, m_AssociationList(0), Nothing) SelMachine = m_ActiveMachinesList(0) m_delSearchInMTable(Me) @@ -1127,76 +1130,78 @@ Public Class MTableAssociationGridBoxItem ' Assegno l'operazione Oper = sOper ' dall'MId recupero la macchina a cui si riferisce questa associazione e la imposto come corrente - EgtSetCurrMachine(m_ActiveMachinesList(m_MachId - 1).SelectedMachine.Name) - ' Imposto MachType selezionato cercando il tipo delle lavorazioni - If EgtMdbSetCurrMachining(sMach) Then - Dim nMachType As Integer = GDB_ID.NULL - EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) - For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList - If nMachType = MachType.TypeId Then - SelectedMachType = MachType - Exit For - End If - Next - Else - SelectedMachType = Nothing - End If - If EgtMdbSetCurrMachining(sMachUp) Then - Dim nMachType As Integer = GDB_ID.NULL - EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) - For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList - If nMachType = MachType.TypeId Then - SelectedMachUpType = MachType - Exit For - End If - Next - Else - SelectedMachUpType = Nothing - End If - If EgtMdbSetCurrMachining(sMachDw) Then - Dim nMachType As Integer = GDB_ID.NULL - EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) - For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList - If nMachType = MachType.TypeId Then - SelectedMachDownType = MachType - Exit For - End If - Next - Else - SelectedMachDownType = Nothing - End If - NotifyPropertyChanged("SelectedMachType") - NotifyPropertyChanged("SelectedMachUpType") - NotifyPropertyChanged("SelectedMachDownType") - ' Per Log lavorazione non trovata - Dim sOutLog As String = "" - ' Imposto i Mach selezionati - If Not IsNothing(m_SelectedMachType) Then - m_Mach = sMach - ElseIf Not String.IsNullOrWhiteSpace(sMach) Then - sOutLog &= sMach & " (Std), " - End If - If Not IsNothing(m_SelectedMachUpType) Then - m_MachUp = sMachUp - ElseIf Not String.IsNullOrWhiteSpace(sMachUp) Then - sOutLog &= sMachUp & " (Up), " - End If - If Not IsNothing(m_SelectedMachDownType) Then - m_MachDw = sMachDw - ElseIf Not String.IsNullOrWhiteSpace(sMachDw) Then - sOutLog &= sMachDw & " (Dw), " - End If - If Not String.IsNullOrWhiteSpace(sOutLog) Then - EgtOutLog(sName & " : " & sOutLog & " not found") - End If - If Not String.IsNullOrWhiteSpace(Mach) Then - m_RefMachItem = RefMachItem - End If - If Not String.IsNullOrWhiteSpace(MachUp) Then - m_RefMachUpItem = RefMachUpItem - End If - If Not String.IsNullOrWhiteSpace(MachDw) Then - m_RefMachDwItem = RefMachDwItem + If not IsNothing(m_ActiveMachinesList(m_MachId - 1).SelectedMachine) Then + EgtSetCurrMachine(m_ActiveMachinesList(m_MachId - 1).SelectedMachine.Name) + ' Imposto MachType selezionato cercando il tipo delle lavorazioni + If EgtMdbSetCurrMachining(sMach) Then + Dim nMachType As Integer = GDB_ID.NULL + EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) + For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList + If nMachType = MachType.TypeId Then + SelectedMachType = MachType + Exit For + End If + Next + Else + SelectedMachType = Nothing + End If + If EgtMdbSetCurrMachining(sMachUp) Then + Dim nMachType As Integer = GDB_ID.NULL + EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) + For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList + If nMachType = MachType.TypeId Then + SelectedMachUpType = MachType + Exit For + End If + Next + Else + SelectedMachUpType = Nothing + End If + If EgtMdbSetCurrMachining(sMachDw) Then + Dim nMachType As Integer = GDB_ID.NULL + EgtMdbGetCurrMachiningParam(MCH_MP.TYPE, nMachType) + For Each MachType In m_ActiveMachinesList(m_MachId - 1).SelectedMachine.MachTypeList + If nMachType = MachType.TypeId Then + SelectedMachDownType = MachType + Exit For + End If + Next + Else + SelectedMachDownType = Nothing + End If + NotifyPropertyChanged("SelectedMachType") + NotifyPropertyChanged("SelectedMachUpType") + NotifyPropertyChanged("SelectedMachDownType") + ' Per Log lavorazione non trovata + Dim sOutLog As String = "" + ' Imposto i Mach selezionati + If Not IsNothing(m_SelectedMachType) Then + m_Mach = sMach + ElseIf Not String.IsNullOrWhiteSpace(sMach) Then + sOutLog &= sMach & " (Std), " + End If + If Not IsNothing(m_SelectedMachUpType) Then + m_MachUp = sMachUp + ElseIf Not String.IsNullOrWhiteSpace(sMachUp) Then + sOutLog &= sMachUp & " (Up), " + End If + If Not IsNothing(m_SelectedMachDownType) Then + m_MachDw = sMachDw + ElseIf Not String.IsNullOrWhiteSpace(sMachDw) Then + sOutLog &= sMachDw & " (Dw), " + End If + If Not String.IsNullOrWhiteSpace(sOutLog) Then + EgtOutLog(sName & " : " & sOutLog & " not found") + End If + If Not String.IsNullOrWhiteSpace(Mach) Then + m_RefMachItem = RefMachItem + End If + If Not String.IsNullOrWhiteSpace(MachUp) Then + m_RefMachUpItem = RefMachUpItem + End If + If Not String.IsNullOrWhiteSpace(MachDw) Then + m_RefMachDwItem = RefMachDwItem + End If End If m_IsModified = False End Sub diff --git a/Special-Doors/TableUtility.vb b/Special-Doors/TableUtility.vb index 94bd720..a2770d9 100644 --- a/Special-Doors/TableUtility.vb +++ b/Special-Doors/TableUtility.vb @@ -70,7 +70,12 @@ Module TableUtility End If Try Table.SharedMachIndex += 1 - Table.ActiveMachinesList.Add(New MTableMachineListBoxItem(sMachName, bNcGenerate, bMakeraw, Table.SharedMachIndex)) + Dim Temp As New MTableMachineListBoxItem(sMachName, bNcGenerate, bMakeraw, Table.SharedMachIndex) + If IsNothing( Temp.SelectedMachine) Then + EgtOutLog( "MTable error : missing selected machine " & sMachName) + Return False + End If + Table.ActiveMachinesList.Add(Temp) Table.m_MachIdList.Add(Table.SharedMachIndex) Catch ex As Exception EgtOutLog(ex.ToString)