Compare commits

...

11 Commits

Author SHA1 Message Date
NicolaP 47b98c6392 Merge branch 'develop' 2022-12-07 19:46:45 +01:00
NicolaP a0f5585391 Correzione gestioen ventose per prelievo 2022-12-07 19:46:19 +01:00
NicolaP e93c4e41a3 Merge remote-tracking branch 'origin/HEAD' into develop 2022-11-24 20:30:05 +01:00
DarioS ed4fc25c5d OmagCUT :
- modifiche per lancio script di macchina opzionale.
2022-11-23 13:14:03 +01:00
NicolaP d1d48bf8a4 Merge branch 'develop' 2022-11-21 10:58:08 +01:00
NicolaP 4e0d362b36 Gestione comunicazione errori nel programma. 2022-11-21 10:57:50 +01:00
NicolaP 1afdc8551f Merge commit 'd17cd8d2d81400a42720871a91979d9d2f43cda0' into develop 2022-11-21 10:34:56 +01:00
NicolaP d17cd8d2d8 Cambio versione 2.4k2 2022-11-21 10:34:22 +01:00
NicolaP cc11ab463f Merge branch 'develop' 2022-11-21 10:32:54 +01:00
NicolaP d322dc192d Merge branch 'Features/Btn_Exec_Lua' into develop 2022-11-21 10:32:40 +01:00
NicolaP 29eae5517a Merge branch 'develop' 2022-11-03 19:33:27 +01:00
5 changed files with 50 additions and 61 deletions
+11 -4
View File
@@ -451,14 +451,14 @@ Module VacuumCups
Dim dPreferredRot As Double = m_dPreferredRot
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
' verifico l'orientamento del pezzo
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
If bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
' se l'orientamento è verticale
If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus
Else
dPreferredRot = m_dPrefVertRotXPlus
End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
ElseIf bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus
@@ -467,8 +467,8 @@ Module VacuumCups
End If
End If
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
Dim dAngDelta As Double = If(Math.Abs(b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
dRotAngDeg -= dAngDelta
End While
While dRotAngDeg - dPreferredRot <= -dAngDelta / 2
@@ -539,6 +539,13 @@ Module VacuumCups
Return dDist
End Function
Private Function IsHorizontal(dDegAng As Double) As Boolean
If (Math.Abs(dDegAng) > 45 And Math.Abs(dDegAng) < 135) Or (Math.Abs(dDegAng) > 225 And Math.Abs(dDegAng) < 315) Then
Return False
End If
Return True
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double
-2
View File
@@ -47,9 +47,7 @@
Public Const K_PHOTODELEY As String = "PhotoDeley"
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_DIRSCRIPT_LUA As String = "DirScript"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
Public Const K_CALLFUNCTION As String = "CallFunction"
Public Const S_NCDATA As String = "NcData"
Public Const K_NEWVARIABLE As String = "NewVariable"
+34 -50
View File
@@ -29,7 +29,7 @@ Public Class AlarmsPageUC
Private Sub AlarmsPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
'Assegno liste a combobox
' Assegno liste a combobox
CurrSawCmBx.ItemsSource = m_SawList
CurrDrillCmBx.ItemsSource = m_DrillList
CurrMillCmBx.ItemsSource = m_MillList
@@ -37,8 +37,11 @@ Public Class AlarmsPageUC
CurrWJetCmBx.ItemsSource = m_WaterJetList
AuxiliaryToolCmBx.ItemsSource = m_AuxToolTypeList
' Variabile che accorcia il riferimento alla macchina corrente
m_CurrentMachine = m_MainWindow.m_CurrentMachine
' Assegno lista ad elenco materiali
MaterialsLstBx.ItemsSource = m_MainWindow.m_CurrentMachine.Materials
MaterialsLstBx.ItemsSource = m_CurrentMachine.Materials
' Se non è impostato il controllo numerico, nascondo il bottone di tastatura lama
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
@@ -123,8 +126,6 @@ Public Class AlarmsPageUC
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
If m_bFirst Then
' Variabile che accorcia il riferimento alla macchina corrente
m_CurrentMachine = m_MainWindow.m_CurrentMachine
' in assenza dell'uscita H1 nascondo i parametri lama
If EgtGetHeadId("H1") = GDB_ID.NULL Then
@@ -195,8 +196,8 @@ Public Class AlarmsPageUC
m_bFirst = False
End If
' Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
CreateToolList(MCH_TF.SAWBLADE, m_SawList)
' Aggiorno lista delle lame per pagina macchina in cui scegliere quella corrente
CreateToolList(MCH_TF.SAWBLADE, m_SawList)
' Seleziono lama corrente
CurrSawCmBx.SelectedItem = m_CurrentMachine.sCurrSaw
@@ -350,7 +351,7 @@ Public Class AlarmsPageUC
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_ENGRAVING_WIDTH, 0, m_MainWindow.GetMachIniFile())
TmWidthTxBx.Text = LenToString(dVal, 2)
' Flag per movimento in home alla fine dei tagli diretti
FinalHomeChBx.IsChecked = m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome
FinalHomeChBx.IsChecked = m_CurrentMachine.bDirectCutsFinalHome
' Leggo tagli ridotti per interferenza in nesting
CompleteCutsChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, m_MainWindow.GetMachIniFile()) = 0)
@@ -372,7 +373,7 @@ Public Class AlarmsPageUC
AdditionalTableTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 36) & " " & GetCurrentTable().ToString()
End If
' Leggo altezza sovratavola
dVal = m_MainWindow.m_CurrentMachine.dAdditionalTable
dVal = m_CurrentMachine.dAdditionalTable
AdditionalTableTxBx.Text = LenToString(dVal, 2)
' Leggo soglia e tolleranza per contorno grezzo da foto
ThresholdTxBx.Text = m_MainWindow.m_Camera.Threshold.ToString()
@@ -446,7 +447,7 @@ Public Class AlarmsPageUC
CurrWaterJettingTxBx.Text = m_CurrentMachine.sCurrWaterJetting
CurrWaterJettingTxBl.Visibility = Windows.Visibility.Visible
CurrWaterJettingTxBx.Visibility = Windows.Visibility.Visible
If m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
If m_CurrentMachine.bFromDBWaterJet Then
CurrWaterJettingTxBx.SetValue(Grid.ColumnSpanProperty, 1)
CurrWaterJettingTxBx.SetValue(MarginProperty, New Thickness(CurrWaterJettingTxBx.Margin.Left,
CurrWaterJettingTxBx.Margin.Top,
@@ -949,9 +950,9 @@ Public Class AlarmsPageUC
Private Sub FinalHomeChBx_Click(sender As Object, e As RoutedEventArgs) Handles FinalHomeChBx.Click
If FinalHomeChBx.IsChecked() Then
m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome = True
m_CurrentMachine.bDirectCutsFinalHome = True
Else
m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome = False
m_CurrentMachine.bDirectCutsFinalHome = False
End If
End Sub
@@ -993,7 +994,7 @@ Public Class AlarmsPageUC
Private Sub AdditionalTableTxBx_EgtClosed(sender As Object, e As EventArgs) Handles AdditionalTableTxBx.EgtClosed
Dim dVal As Double = 0
StringToLen(AdditionalTableTxBx.Text, dVal)
m_MainWindow.m_CurrentMachine.dAdditionalTable = dVal
m_CurrentMachine.dAdditionalTable = dVal
End Sub
Private Sub NewMatBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewMatBtn.Click
@@ -1119,7 +1120,7 @@ Public Class AlarmsPageUC
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
End Select
' Recupero file LUA
EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
' Recupero utensile da tastare
Dim ToolForProbing As ToolPos = ChooseToolForProbing()
If IsNothing(ToolForProbing) OrElse String.IsNullOrWhiteSpace(ToolForProbing.m_ToolName) Then Return
@@ -1158,7 +1159,7 @@ Public Class AlarmsPageUC
' Modifico stringa per inserire i newline
CmdString = CmdString.Replace("<br/>", Environment.NewLine)
' Creo file...
Dim FilePath As String = m_MainWindow.GetCncDir() & "\SawProbing" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim FilePath As String = m_MainWindow.GetCncDir() & "\SawProbing" & m_CurrentMachine.sIsoFileExt
' ...e ci scrivo
Dim Writer As New IO.StreamWriter(FilePath, False)
Writer.Write(CmdString)
@@ -1286,9 +1287,9 @@ Public Class AlarmsPageUC
End Sub
Private Function ChooseToolForProbing() As ToolPos
Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig
Select Case m_CurrentMachine.MountedToolConfig
Case CurrentMachine.MountedToolConfigs.SAW
Return New ToolPos(m_MainWindow.m_CurrentMachine.sCurrSaw, "T100", True)
Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True)
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
If ChooseTool.ShowDialog Then
@@ -1336,51 +1337,34 @@ Public Class AlarmsPageUC
Private Sub ExecLuaBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExecLuaBtn.Click
Dim sExecFile As String = GetExecLuaFile()
Dim sCallFunction As String = GetCallFunction()
' Recupero file LUA
Dim bExec As Boolean = EgtLuaExecFile(sExecFile)
' Lancio l'esecuzione della funzione principale
bExec = bExec And EgtLuaCallFunction(sCallFunction)
' Leggo variabili
Dim nErr As Integer = 0
EgtLuaGetGlobIntVar("CMD.ERR", nErr)
' Eseguo file LUA e recupero risultato
Dim nErr As Integer = 999
EgtLuaExecFile(sExecFile)
EgtLuaGetGlobIntVar("ELS.ERR", nErr)
' Reset lua
EgtLuaResetGlobVar("CMD")
EgtLuaResetGlobVar("ELS")
' Verifico condizioni di errore
If nErr <> 0 And bExec Then
' Errore in tastatura lama
EgtOutLog("Error in execution file: " & sExecFile & ", calling function: " & sCallFunction & ", CMD.ERR=" & nErr, ToString)
If nErr Then
' Errore...
EgtOutLog("Error executing file: " & sExecFile & ", ELS.ERR=" & nErr.ToString)
' Error executing script
Dim MsgBoxError As New EgtMsgBox(m_MainWindow, "", EgtMsg(90259), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
Return
End If
End Sub
' Recupero il percorso del file lua da eseguire
Private Function GetExecLuaFile() As String
Dim sDir As String = String.Empty
Dim sFile As String = String.Empty
If GetPrivateProfileString(S_EXECLUA, K_DIRSCRIPT_LUA, "", sDir, m_MainWindow.GetMachIniFile()) <> 0 And
GetPrivateProfileString(S_EXECLUA, K_FILESCRIPT_LUA, "", sFile, m_MainWindow.GetMachIniFile()) <> 0 Then
' Formatto le stringhe lette
sDir = sDir.Trim
sFile = sFile.Trim
If sDir.EndsWith("\"c) Then
sDir = sDir.Remove(sDir.LastIndexOf("\"c))
End If
If Not sFile.EndsWith(".lua") Then
sFile = sFile & ".lua"
End If
If File.Exists(sDir & "\" & sFile) Then
Return sDir & "\" & sFile
End If
If GetPrivateProfileString(S_EXECLUA, K_FILESCRIPT_LUA, "", sFile, m_MainWindow.GetMachIniFile()) <> 0 Then
' Sistemo nome file
sFile = sFile.Trim()
If Not sFile.EndsWith(".lua") Then sFile = sFile & ".lua"
' Creo path
Dim sPath As String = m_CurrentMachine.sMachDir() & "\Scripts\" & sFile
If File.Exists(sPath) Then Return sPath
End If
Return String.Empty
End Function
' Recupera il nome della funzione che deve essere chiamata
Private Function GetCallFunction() As String
Dim sCallFunction As String = "CMD.CmdString"
GetPrivateProfileString(S_EXECLUA, K_CALLFUNCTION, sCallFunction, sCallFunction, m_MainWindow.GetMachIniFile())
Return sCallFunction
End Function
End Class
+3 -3
View File
@@ -303,7 +303,7 @@ Class MainWindow
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sCurrMachine, m_sIniFile)
' Impostazione path MachIni file
m_sMachIniFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & m_sCurrMachine & ".ini"
' Impostazione path KitIni file
' Impostazione path Kit file
m_sKitsFile = m_sMachinesRoot & "\" & m_sCurrMachine & "\" & MACHININGS_DIR & "\" & KITS_FILE
' Imposto tipo di chiave
#If TRIAL Then
@@ -326,8 +326,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2411, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2411, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2412, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2412, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.1")>
<Assembly: AssemblyFileVersion("2.4.11.1")>
<Assembly: AssemblyVersion("2.4.12.1")>
<Assembly: AssemblyFileVersion("2.4.12.1")>