OmagCUT 1.6u4 :

- gestione nesting allineato (con regione di riferimento a L)
- gestione epl pezzi rovinati da OmagVIEW per linee di produzione
- piccole migliorie varie.
This commit is contained in:
Dario Sassi
2016-09-22 14:47:57 +00:00
parent 85e906e4c8
commit ff30a4d3b6
18 changed files with 248 additions and 161 deletions
+31 -9
View File
@@ -183,7 +183,7 @@
</GroupBox>
<GroupBox Name="SawGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Column="1" Grid.RowSpan="2">
<Grid Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
@@ -205,14 +205,9 @@
<EgtWPFLib:EgtTextBox Name="AngleCutExtraLenTxBx" Grid.Column="1" Grid.Row="1" Width="150"
Style="{StaticResource OmagCut_CalculatorTextBox}" />
<TextBlock Name="CompleteCutsTxBl" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="CompleteCutsChBx" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Height="40" Width="40"
HorizontalAlignment="Right" Margin="0,0,11,0"/>
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="3" FontSize="20"
<TextBlock Name="ExtArcMinRadTxBl" Grid.Column="0" Grid.Row="2" FontSize="20"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="ExtArcMinRadTxBx" Grid.Column="1" Grid.Row="3" Width="150"
<EgtWPFLib:EgtTextBox Name="ExtArcMinRadTxBx" Grid.Column="1" Grid.Row="2" Width="150"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
</Grid>
@@ -247,7 +242,7 @@
</GroupBox>
<GroupBox Name="DirectCutsParamGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Column="2" Grid.Row="3">
<Grid Grid.Column="3" Grid.Row="1">
<Grid>
<TextBlock Name="FinalHomeTxBl"
Style="{StaticResource OmagCut_ToolsDBTextBlock}" />
@@ -258,6 +253,33 @@
</GroupBox>
<GroupBox Name="NestingParamGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Column="2" Grid.Row="4" Grid.RowSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<TextBlock Name="CompleteCutsTxBl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="CompleteCutsChBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Height="40" Width="40"
HorizontalAlignment="Right" Margin="0,0,11,0"/>
<TextBlock Name="AlignTxBl" Grid.Row="1" Grid.ColumnSpan="2"
Style="{StaticResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="AlignChBx" Grid.Row="1" Grid.ColumnSpan="2" Height="40" Width="40"
HorizontalAlignment="Right" Margin="0,0,11,0"/>
</Grid>
</GroupBox>
</Grid>
</Border>
+15 -1
View File
@@ -61,6 +61,8 @@ Public Class AlarmsPageUC
FinalHomeTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 28) ' Home finale
MillingsParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 29) ' Parametri fresature
InternalCutsTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 30) ' Sempre sugli interni
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
AlignTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 32) ' Allineato
End Sub
Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -188,6 +190,10 @@ Public Class AlarmsPageUC
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, m_MainWindow.GetMachIniFile()) <> 0)
' Flag per movimento in home alla fine dei tagli diretti
FinalHomeChBx.IsChecked = m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome
' Flag per nesting allineato
AlignChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, m_MainWindow.GetMachIniFile()) <> 0)
End Sub
Private Sub AuxiliaryToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryToolCmBx.SelectionChanged
@@ -394,7 +400,7 @@ Public Class AlarmsPageUC
' Se pezzi in interferenza
If Not NestPage.VerifyPartsNesting(False) Then
' Ci sono interferenze, alcuni pezzi saranno parcheggiati. Vuoi continuare ?
Dim Dlg As New EgtMsgBox(m_MainWindow, "", EgtMsg(91105), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.ESCLAMATION, 1)
Dim Dlg As New EgtMsgBox(m_MainWindow, "", EgtMsg(91105), EgtMsgBox.Buttons.OK_CANCEL, EgtMsgBox.Icons.NULL, 1, 1)
If Dlg.DialogResult = 1 Then ' Ok
NestPage.StoreCollisionParts(False)
WritePrivateProfileString(S_MACH_NEST, K_MACH_REDUCEDCUT, "0", m_MainWindow.GetMachIniFile())
@@ -423,6 +429,14 @@ Public Class AlarmsPageUC
End If
End Sub
Private Sub AlignChBx_Click(sender As Object, e As RoutedEventArgs) Handles AlignChBx.Click
If AlignChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_ALIGNED, "1", m_MainWindow.GetMachIniFile())
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_ALIGNED, "0", m_MainWindow.GetMachIniFile())
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)
+1
View File
@@ -220,6 +220,7 @@ Public Class CNCommunication
EgtOutLog("ProcessStart : " & m_sCNSiemensHMIPath & " " & sArg)
Process.Start(m_sCNSiemensHMIPath, sArg)
Catch ex As Exception
EgtOutLog("Error starting Process -> NcLink=True type=0")
' Per evitare crash con azioni verso il controllo, avvio quello di debug
Me.m_CN.Stop_Connection()
m_nNCType = 0
+1 -1
View File
@@ -105,7 +105,7 @@ Public Class CN_Siemens
End Sub
Public Overrides Function read_active_mode() As Int16
EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
'Return M_MMFiles.read_active_mode()
Return CShort(M_MMFiles.SiemensRet.n_param2)
End Function
+2
View File
@@ -378,6 +378,8 @@ Public Class CSVPage
' Eseguo nesting
Dim bFit As Boolean = False
If m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateNestRegions() Then
Dim bAligned As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, m_MainWindow.GetMachIniFile()) <> 0)
m_MainWindow.m_CadCutPageUC.m_NestPage.EnableReferenceRegion(bAligned)
If Not EgtExistsInfo(m_nRawId, KEY_RAWBYPOINTS) Then
bFit = EgtPackPartInRectangle(nId2, True, True)
End If
+5 -1
View File
@@ -80,7 +80,11 @@ Module ConstGen
' 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"
Public Const NAME_OUTKERF_REG As String = "SheetOut"
' Nome della regione di riferimento nel grezzo
Public Const NAME_REF_REG As String = "RefReg"
' Chiave per disabilitare la regione di riferimento
Public Const KEY_REF_REG_OFF As String = "Off"
' Chiave per definizione del grezzo per punti
Public Const KEY_RAWBYPOINTS As String = "Rbp"
' Nome del contorno di un'area rovinata
+1
View File
@@ -33,6 +33,7 @@ Module ConstIni
Public Const K_CNLINK As String = "CNLink"
Public Const K_TESTINGPAGE As String = "TestingPage"
Public Const K_SHOWTIPAXES As String = "ShowTipAxes"
Public Const K_LASTPROJTOVIEW As String = "LastProjToView"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
+1
View File
@@ -85,6 +85,7 @@
Public Const K_MACH_REDUCEDDEPTH As String = "ReducedDepth"
Public Const K_MACH_EXTARCMINRAD As String = "ExtArcMinRad"
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
Public Const S_TOOLCHANGER As String = "ToolChanger"
Public Const K_NUMBER As String = "Number"
+2 -2
View File
@@ -25,8 +25,8 @@
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 930
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 950
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 950
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 980
Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
+87 -103
View File
@@ -21,6 +21,7 @@ Module M_MMFiles
#Region " Structures"
<StructLayout(LayoutKind.Sequential)> _
Structure SiemensSendStruct
Public n_Flag As Integer
@@ -42,7 +43,7 @@ Module M_MMFiles
End Structure
Dim SiemensSend As SiemensSendStruct
Private SiemensSend As SiemensSendStruct
<StructLayout(LayoutKind.Sequential)> _
@@ -116,7 +117,7 @@ Module M_MMFiles
' view must be within the maximum size of the file mapping object (MAP_SIZE).
' If VIEW_SIZE is 0, the mapping extends from the offset (VIEW_OFFSET) to
' the end of the file mapping.
Friend Const ViewSize As UInt32 = &H400
Friend Const ViewSize As UInt32 = &H1000
#End Region
@@ -192,9 +193,9 @@ Module M_MMFiles
'
Sub init()
Call MMFile_init()
MMFile_init()
Call Timer_init()
Timer_init()
End Sub
@@ -270,7 +271,7 @@ Module M_MMFiles
' scrivo !!!!!
Marshal.StructureToPtr(SiemensSend, pView, False)
' Call execute_command()
' execute_command()
System.Threading.Thread.Sleep(2000)
@@ -316,7 +317,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_ActivateProgram
SiemensSend.sz_string = sz_part_program
Call execute_command()
execute_command()
EgtOutLog("ActivateProgram end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -328,7 +329,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_Delete_NC_prog
SiemensSend.sz_string = sz_filename
Call execute_command()
execute_command()
EgtOutLog("Delete_NC_prog end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -339,7 +340,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_CycleStart
Call execute_command()
execute_command()
EgtOutLog("CycleStart end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -350,7 +351,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_FeedHold
Call execute_command()
execute_command()
EgtOutLog("FeedHold end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -361,7 +362,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_Reset
Call execute_command()
execute_command()
EgtOutLog("Reset end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -372,7 +373,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_WriteCncMode
SiemensSend.n_param1 = nmode
Call execute_command()
execute_command()
EgtOutLog("WriteCncMode end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -384,7 +385,7 @@ Module M_MMFiles
SiemensSend.sz_string = sz_Pc_file_name
SiemensSend.sz_string_2 = sz_NC_filen
Call execute_command()
execute_command()
EgtOutLog("Download_NC_prog end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -400,7 +401,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_MDI_command
SiemensSend.sz_string = sz_command
Call execute_command()
execute_command()
EgtOutLog("MDI_command end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -411,7 +412,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_set_OP_OM
SiemensSend.n_param1 = n
Call execute_command()
execute_command()
EgtOutLog("set_OP_OM end dell'm_mmFiles")
End Sub
@@ -419,7 +420,7 @@ Module M_MMFiles
EgtOutLog("read_active_mode start dell'm_mmFiles")
SiemensSend.n_Command = CMD.CMD_read_active_mode
Call execute_command()
execute_command()
EgtOutLog("read_active_mode end dell'm_mmFiles")
Return SiemensRet.n_result
@@ -440,7 +441,7 @@ Module M_MMFiles
SiemensSend.n_Command = CMD.CMD_Read_Nc_var
SiemensSend.n_param1 = n_var
Call execute_command()
execute_command()
m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value = SiemensRet.d_param1
EgtOutLog("Read_Nc_var end dell'm_mmFiles")
@@ -453,64 +454,54 @@ Module M_MMFiles
'
Sub execute_command()
Dim lstate As State = State.Command_on
Dim b_end As Boolean = False
Try
' attesa eventuale busy iniziale
b_end = False
While Not b_end
' Attesa eventuale busy iniziale
Dim bEnd As Boolean = False
While Not bEnd
If SiemensRet.b_busy Then
System.Threading.Thread.Sleep(100) ' se busy attendo a botte di 100 msec
System.Threading.Thread.Sleep(50)
Else
b_end = True
bEnd = True
End If
End While
SiemensSend.n_Flag = COMMAND_ON ' alzo il comando
' scrivo !!!!!
' Alzo il comando
SiemensSend.n_Flag = COMMAND_ON
' scrivo
Marshal.StructureToPtr(SiemensSend, pView, False)
b_end = False
While Not b_end
Select Case lstate
Case State.Command_on ' alzato il comando attendo il busy
If SiemensRet.b_busy Then
lstate = State.Busy_On
Else
System.Threading.Thread.Sleep(100)
End If
Case State.Busy_On ' trovato il busy abbasso il comando
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
' scrivo !!!!!
Marshal.StructureToPtr(SiemensSend, pView, False)
lstate = State.Command_off
Case State.Command_off
If Not SiemensRet.b_busy Then ' abbassato il comando attendo il busy basso
lstate = State.Busy_Off
Else
System.Threading.Thread.Sleep(100)
End If
Case State.Busy_Off
b_end = True
' Ciclo di attesa della risposta
Dim nState As State = State.Command_on
bEnd = False
While Not bEnd
Select Case nState
Case State.Command_on ' alzato il comando attendo il busy
If SiemensRet.b_busy Then
nState = State.Busy_On
Else
System.Threading.Thread.Sleep(50)
End If
Case State.Busy_On ' trovato il busy abbasso il comando
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
' scrivo !!!!!
Marshal.StructureToPtr(SiemensSend, pView, False)
nState = State.Command_off
Case State.Command_off
If Not SiemensRet.b_busy Then ' abbassato il comando attendo il busy basso
nState = State.Busy_Off
Else
System.Threading.Thread.Sleep(50)
End If
Case State.Busy_Off
bEnd = True
End Select
End While
EgtOutLog("Eseguito comando :" & SiemensSend.n_Command.ToString())
Catch ex As Exception
EgtOutLog("Errore nell'esecuzione di un comando" & ex.ToString)
EgtOutLog("Errore nell'esecuzione di un comando :" & ex.ToString())
End Try
End Sub
@@ -545,7 +536,7 @@ Module M_MMFiles
aTimer.Enabled = False
b_busy = True
Call TimerProcessing()
TimerProcessing()
b_busy = False
aTimer.Enabled = True
@@ -555,12 +546,11 @@ Module M_MMFiles
Sub TimerProcessing()
' !!!!!!!!!!!! mettete tutti i travasi di dati
Try
SiemensRet = Marshal.PtrToStructure(pView2, SiemensRet.GetType)
EgtOutLog("Siemens TimerProcessing start")
SiemensRet = Marshal.PtrToStructure(pView2, SiemensRet.GetType)
For n As Short = 0 To COPY_MAX_AXES - 1
@@ -569,7 +559,6 @@ Module M_MMFiles
Next
' copy R vars
For n = 0 To (N_R_VAR - 1)
@@ -578,8 +567,6 @@ Module M_MMFiles
' copy spindle current
m_MainWindow.m_CNCommunication.m_CN.d_spindle_power = SiemensRet.d_interf_spindle_power
'EgtOutLog("Ampere =" & m_MainWindow.m_CNCommunication.m_CN.d_spindle_power)
m_MainWindow.m_CNCommunication.m_CN.n_spindle_override(0) = SiemensRet.n_interf_spindle_override
@@ -606,6 +593,8 @@ Module M_MMFiles
End If
EgtOutLog("stop")
Catch ex As Exception
EgtOutLog("Errore nella lettura delle quote e simili variabili" & ex.ToString)
End Try
@@ -661,25 +650,24 @@ Module M_MMFiles
''' Represents a wrapper class for a file mapping handle.
''' </summary>
''' <remarks></remarks>
<HostProtection(SecurityAction.LinkDemand, MayLeakOnAbort:=True)> _
<HostProtection(SecurityAction.Demand, MayLeakOnAbort:=True)>
Friend NotInheritable Class SafeFileMappingHandle
Inherits SafeHandleZeroOrMinusOneIsInvalid
<SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode:=True)> _
<SecurityPermission(SecurityAction.Demand, UnmanagedCode:=True)>
Private Sub New()
MyBase.New(True)
End Sub
<SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode:=True)> _
Public Sub New(ByVal handle As IntPtr, ByVal ownsHandle As Boolean)
<SecurityPermission(SecurityAction.Demand, UnmanagedCode:=True)>
Public Sub New(handle As IntPtr, ownsHandle As Boolean)
MyBase.New(ownsHandle)
MyBase.SetHandle(handle)
End Sub
<ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), _
DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Private Shared Function CloseHandle(ByVal handle As IntPtr) _
As <MarshalAs(UnmanagedType.Bool)> Boolean
<ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success),
DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Private Shared Function CloseHandle(handle As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
Protected Overrides Function ReleaseHandle() As Boolean
@@ -725,15 +713,14 @@ Module M_MMFiles
''' If the function succeeds, the return value is a handle to the newly
''' created file mapping object.
''' </returns>
<DllImport("Kernel32.dll", SetLastError:=True)> _
Public Shared Function CreateFileMapping( _
ByVal hFile As IntPtr, _
ByVal lpAttributes As IntPtr, _
ByVal flProtect As FileProtection, _
ByVal dwMaximumSizeHigh As UInt32, _
ByVal dwMaximumSizeLow As UInt32, _
ByVal lpName As String) _
As SafeFileMappingHandle
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function CreateFileMapping(
hFile As IntPtr,
lpAttributes As IntPtr,
flProtect As FileProtection,
dwMaximumSizeHigh As UInt32,
dwMaximumSizeLow As UInt32,
lpName As String) As SafeFileMappingHandle
End Function
''' <summary>
@@ -755,12 +742,11 @@ Module M_MMFiles
''' If the function succeeds, the return value is an open handle to the
''' specified file mapping object.
''' </returns>
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function OpenFileMapping( _
ByVal dwDesiredAccess As FileMapAccess, _
ByVal bInheritHandle As Boolean, _
ByVal lpName As String) _
As SafeFileMappingHandle
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function OpenFileMapping(
dwDesiredAccess As FileMapAccess,
bInheritHandle As Boolean,
lpName As String) As SafeFileMappingHandle
End Function
@@ -790,14 +776,13 @@ Module M_MMFiles
''' If the function succeeds, the return value is the starting address of
''' the mapped view.
''' </returns>
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function MapViewOfFile( _
ByVal hFileMappingObject As SafeFileMappingHandle, _
ByVal dwDesiredAccess As FileMapAccess, _
ByVal dwFileOffsetHigh As UInt32, _
ByVal dwFileOffsetLow As UInt32, _
ByVal dwNumberOfBytesToMap As UInt32) _
As IntPtr
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function MapViewOfFile(
hFileMappingObject As SafeFileMappingHandle,
dwDesiredAccess As FileMapAccess,
dwFileOffsetHigh As UInt32,
dwFileOffsetLow As UInt32,
dwNumberOfBytesToMap As UInt32) As IntPtr
End Function
@@ -810,10 +795,9 @@ Module M_MMFiles
''' be unmapped.
''' </param>
''' <returns></returns>
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function UnmapViewOfFile( _
ByVal lpBaseAddress As IntPtr) _
As <MarshalAs(UnmanagedType.Bool)> Boolean
<DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
Public Shared Function UnmapViewOfFile(
lpBaseAddress As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
End Class
+33 -30
View File
@@ -12,37 +12,39 @@ Public Class MachineStatusUC
Friend m_CN As CN_generico
' Flag per tipo visualizzazione assi
Private m_bShowTipAxes As Boolean = False
' Flag bistabile per delta (per lampeggiare delta Z anche quando macchina ferma)
Private m_bEven As Boolean = True
Private Sub MachineStatus_Initialized(sender As Object, e As EventArgs)
If m_MainWindow.m_dHorScale < 1 Then
MachineStatusImage.Height *= m_MainWindow.m_dHorScale
MachineStatusImage.Width *= m_MainWindow.m_dHorScale
Axis1NameTxBx.FontSize *= m_MainWindow.m_dHorScale
Axis1TxBx.FontSize *= m_MainWindow.m_dHorScale
DeltaAxis1TxBx.FontSize *= m_MainWindow.m_dHorScale
Axis2NameTxBx.FontSize *= m_MainWindow.m_dHorScale
Axis2TxBx.FontSize *= m_MainWindow.m_dHorScale
DeltaAxis2TxBx.FontSize *= m_MainWindow.m_dHorScale
Axis3NameTxBx.FontSize *= m_MainWindow.m_dHorScale
Axis3TxBx.FontSize *= m_MainWindow.m_dHorScale
DeltaAxis3TxBx.FontSize *= m_MainWindow.m_dHorScale
Axis4NameTxBx.FontSize *= m_MainWindow.m_dHorScale
Axis4TxBx.FontSize *= m_MainWindow.m_dHorScale
DeltaAxis4TxBx.FontSize *= m_MainWindow.m_dHorScale
Axis5NameTxBx.FontSize *= m_MainWindow.m_dHorScale
Axis5TxBx.FontSize *= m_MainWindow.m_dHorScale
DeltaAxis5TxBx.FontSize *= m_MainWindow.m_dHorScale
FeedNameTxBx.FontSize *= m_MainWindow.m_dHorScale
FeedTxBx.FontSize *= m_MainWindow.m_dHorScale
FeedOverrideNameTxBx.FontSize *= m_MainWindow.m_dHorScale
FeedOverrideTxBx.FontSize *= m_MainWindow.m_dHorScale
SpeedNameTxBx.FontSize *= m_MainWindow.m_dHorScale
SpeedTxBx.FontSize *= m_MainWindow.m_dHorScale
SpeedOverrideNameTxBx.FontSize *= m_MainWindow.m_dHorScale
SpeedOverrideTxBx.FontSize *= m_MainWindow.m_dHorScale
ConsumptionNameTxBx.FontSize *= m_MainWindow.m_dHorScale
ConsumptionTxBx.FontSize *= m_MainWindow.m_dHorScale
AOverrideTxBx.FontSize *= m_MainWindow.m_dHorScale
If m_MainWindow.m_dMWinScale < 1 Then
MachineStatusImage.Height *= m_MainWindow.m_dMWinScale
MachineStatusImage.Width *= m_MainWindow.m_dMWinScale
Axis1NameTxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis1TxBx.FontSize *= m_MainWindow.m_dMWinScale
DeltaAxis1TxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis2NameTxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis2TxBx.FontSize *= m_MainWindow.m_dMWinScale
DeltaAxis2TxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis3NameTxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis3TxBx.FontSize *= m_MainWindow.m_dMWinScale
DeltaAxis3TxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis4NameTxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis4TxBx.FontSize *= m_MainWindow.m_dMWinScale
DeltaAxis4TxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis5NameTxBx.FontSize *= m_MainWindow.m_dMWinScale
Axis5TxBx.FontSize *= m_MainWindow.m_dMWinScale
DeltaAxis5TxBx.FontSize *= m_MainWindow.m_dMWinScale
FeedNameTxBx.FontSize *= m_MainWindow.m_dMWinScale
FeedTxBx.FontSize *= m_MainWindow.m_dMWinScale
FeedOverrideNameTxBx.FontSize *= m_MainWindow.m_dMWinScale
FeedOverrideTxBx.FontSize *= m_MainWindow.m_dMWinScale
SpeedNameTxBx.FontSize *= m_MainWindow.m_dMWinScale
SpeedTxBx.FontSize *= m_MainWindow.m_dMWinScale
SpeedOverrideNameTxBx.FontSize *= m_MainWindow.m_dMWinScale
SpeedOverrideTxBx.FontSize *= m_MainWindow.m_dMWinScale
ConsumptionNameTxBx.FontSize *= m_MainWindow.m_dMWinScale
ConsumptionTxBx.FontSize *= m_MainWindow.m_dMWinScale
AOverrideTxBx.FontSize *= m_MainWindow.m_dMWinScale
End If
End Sub
@@ -155,9 +157,10 @@ Public Class MachineStatusUC
' Visualizzazione
DeltaAxis1TxBx.Text = LenToString(dL1, -3)
DeltaAxis2TxBx.Text = LenToString(dL2, -3)
DeltaAxis3TxBx.Text = LenToString(dL3, -3)
DeltaAxis3TxBx.Text = LenToString(If(m_bEven, dL3, dL3 + EPS_SMALL), -3)
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
m_bEven = Not m_bEven
End Sub
Sub DisplayFeed()
+32 -6
View File
@@ -18,8 +18,8 @@ Class MainWindow
' Dichiarazione della MachineStatusBar
Friend m_MachineStatusUC As MachineStatusUC
' Coefficiente di scalatura orizzontale rispetto a standard
Friend m_dHorScale As Double = 1
' Coefficiente di scalatura della finestra rispetto a standard
Friend m_dMWinScale As Double = 1
' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
@@ -275,7 +275,7 @@ Class MainWindow
Me.Height = nHeight
Me.Width = nWidth
WindowState = If(nFlag = 1, WindowState.Maximized, WindowState.Normal)
m_dHorScale = Me.Width / 1280
m_dMWinScale = Math.Min(Me.Width / 1280, Me.Height / 832)
' Info su opzioni chiave
EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
' Inizializzazione della libreria EgtWPFLib
@@ -874,8 +874,29 @@ Class MainWindow
' OnProdLine
Private Sub OnProdLine()
' Acquisizione eventuale file epl
' !!! DA FARE !!!
' Acquisizione eventuale file epl dei pezzi rovinati :
' lo sposto dal direttorio condiviso al direttorio corrente dei CSV
Const CURR_PROJ_EPL As String = "CurrProj.epl"
If My.Computer.FileSystem.FileExists(m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL) Then
' Leggo direttorio corrente dei file CSV
Dim sCurrDir As String = String.Empty
GetPrivateProfileString(S_CSV, K_CSVCURRDIR, "C:\", sCurrDir, GetIniFile())
If My.Computer.FileSystem.DirectoryExists(sCurrDir) Then
' Recupero da INI ultimo progetto mandato a View
Dim sName As String = String.Empty
GetPrivateProfileString(S_GENERAL, K_LASTPROJTOVIEW, "", sName, GetIniFile())
' Eseguo spostamento
Try
My.Computer.FileSystem.MoveFile(m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL, sCurrDir & "\Ruined" & sName & ".epl", True)
Catch ex As Exception
EgtOutLog("Error moving " & CURR_PROJ_EPL)
End Try
Else
EgtOutLog("Error in ruined parts management : " & sCurrDir & " not found")
' Errore nella gestione dei pezzi rovinati
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(91119))
End If
End If
' Leggo variabile con indice progetto da copiare per OmagVIEW (standard E80025)
m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
@@ -892,8 +913,10 @@ Class MainWindow
' Verifico esistenza progetto con numerazione equivalente e assenza file di lock
Dim sNgeFile As String = GetSaveDir() & "\" & nVarCopy.ToString("D4") & ".nge"
Dim sLockFile As String = m_CurrentMachine.sLineDataDir & "\CurrProj.lck"
Dim sEplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL
If My.Computer.FileSystem.FileExists(sNgeFile) And
Not My.Computer.FileSystem.FileExists(sLockFile) Then
Not My.Computer.FileSystem.FileExists(sLockFile) And
Not My.Computer.FileSystem.FileExists(sEplFile) Then
Try
' Copio file di progetto nge
Dim sNgeDest As String = m_CurrentMachine.sLineDataDir & "\CurrProj.nge"
@@ -912,7 +935,10 @@ Class MainWindow
FileClose(nF)
' Dichiaro progetto copiato
m_CNCommunication.m_CN.DVariables_WriteVariables2(m_CurrentMachine.sVarProjCopy, "0")
' Salvo in INI indice del progetto copiato
WritePrivateProfileString(S_GENERAL, K_LASTPROJTOVIEW, nVarCopy.ToString("D4"), GetIniFile())
Catch ex As Exception
EgtOutLog("Error copying files to OmagVIEW")
' Errore in copia file per OmagVIEW
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(91117))
End Try
+2 -2
View File
@@ -60,5 +60,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.6.20.4")>
<Assembly: AssemblyFileVersion("1.6.20.4")>
<Assembly: AssemblyVersion("1.6.21.4")>
<Assembly: AssemblyFileVersion("1.6.21.4")>
+25
View File
@@ -157,6 +157,7 @@ Public Class NestPageUC
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' muovo il pezzo
EgtMovePart(nMoveId, m_bReducedCut, vtMove)
EgtSaveCollInfo()
@@ -246,6 +247,7 @@ Public Class NestPageUC
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' eseguo movimento
Dim dStep As Double = If(m_bMaximizeMove, m_dMaxStep, m_dStep)
EgtMovePart(GDB_ID.SEL, m_bReducedCut, New Vector3d(0, dStep, 0))
@@ -274,6 +276,7 @@ Public Class NestPageUC
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' eseguo movimento
Dim dStep As Double = If(m_bMaximizeMove, m_dMaxStep, m_dStep)
EgtMovePart(GDB_ID.SEL, m_bReducedCut, New Vector3d(0, -dStep, 0))
@@ -302,6 +305,7 @@ Public Class NestPageUC
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' eseguo movimento
Dim dStep As Double = If(m_bMaximizeMove, m_dMaxStep, m_dStep)
EgtMovePart(GDB_ID.SEL, m_bReducedCut, New Vector3d(dStep, 0, 0))
@@ -330,6 +334,7 @@ Public Class NestPageUC
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' eseguo movimento
Dim dStep As Double = If(m_bMaximizeMove, m_dMaxStep, m_dStep)
EgtMovePart(GDB_ID.SEL, m_bReducedCut, New Vector3d(-dStep, 0, 0))
@@ -404,6 +409,7 @@ Public Class NestPageUC
Else
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
Return EgtRotatePart(GDB_ID.SEL, m_bReducedCut, ptCen, dAngRotDeg)
End If
End Function
@@ -452,6 +458,8 @@ Public Class NestPageUC
' Eseguo nesting
Dim bFit As Boolean = False
If UpdateNestRegions() Then
Dim bAligned As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, m_MainWindow.GetMachIniFile()) <> 0)
EnableReferenceRegion(bAligned)
If Not EgtExistsInfo(m_nRawId, KEY_RAWBYPOINTS) Then
bFit = EgtPackPartInRectangle(nId, m_bReducedCut, True)
End If
@@ -668,6 +676,7 @@ Public Class NestPageUC
Friend Function VerifyPartsNesting(bReducedCut As Boolean) As Boolean
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' Ciclo su tutti i pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId)
While nPartId <> GDB_ID.NULL
@@ -682,6 +691,7 @@ Public Class NestPageUC
Friend Function StoreCollisionParts(bReducedCut As Boolean) As Boolean
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' Ciclo su tutti i pezzi in tavola (dall'ultimo)
Dim nPartId As Integer = EgtGetLastGroupInGroup(m_nRawId)
While nPartId <> GDB_ID.NULL
@@ -698,6 +708,8 @@ Public Class NestPageUC
' Se necessario, creo la regione fuori kerf
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
EgtCreateOutRegion(m_CurrProjPage.m_nRawId, nKerfId)
' Se necessario, creo la regione di riferimento
EgtCreateReferenceRegion(m_CurrProjPage.m_nRawId, nKerfId, True)
' Se necessario, creo le regioni per le aree danneggiate
Dim nId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_DAMAGED)
While nId <> GDB_ID.NULL
@@ -707,4 +719,17 @@ Public Class NestPageUC
Return True
End Function
Friend Function EnableReferenceRegion(bEnable As Boolean) As Boolean
' Recupero identificativo della regione di riferimento
Dim nRegId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_REF_REG)
If nRegId = GDB_ID.NULL Then Return False
' Imposto l'abilitazione voluta
If bEnable Then
EgtRemoveInfo(nRegId, KEY_REF_REG_OFF)
Else
EgtSetInfo(nRegId, KEY_REF_REG_OFF, 1)
End If
Return True
End Function
End Class
+1
View File
@@ -69,6 +69,7 @@
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
+1 -1
View File
@@ -863,7 +863,7 @@
<Style x:Key="OmagCut_ToolsDBTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource OmagCut_LowerCaseCharacterTextBlock}">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Margin" Value="25,0,0,0"/>
<Setter Property="Margin" Value="10,0,0,0"/>
</Style>
<Style x:Key="OmagCut_LowerBarTitleTextBlock" TargetType="{x:Type TextBlock}">
+6 -3
View File
@@ -238,7 +238,8 @@ Public Class RawPartPageUC
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
m_nDragEnt = -1
m_dDragPar = -1
ElseIf sName = NAME_KERF Then
ElseIf sName = NAME_KERF And
(m_ActiveRawMode = RAWMODE.RECTANGLE Or m_ActiveRawMode = RAWMODE.BY_POINTS) Then
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
Dim dDist, dU As Double
If Not EgtGetMinDistPointCurve(m_ptPrev.Loc(nKerfId), nKerfId, dDist, dU) Then
@@ -248,7 +249,7 @@ Public Class RawPartPageUC
m_dDragPar = dU
' Privilegio il kerf, pertanto esco
Exit While
ElseIf sName = NAME_DAMAGED Then
ElseIf sName = NAME_DAMAGED And m_ActiveRawMode = RAWMODE.DAMAGED Then
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev)
Dim dDist, dU As Double
If Not EgtGetMinDistPointCurve(m_ptPrev.Loc(nSelId), nSelId, dDist, dU) Then
@@ -1014,7 +1015,9 @@ Public Class RawPartPageUC
Private Function RemoveNestRegions() As Boolean
' Cancello eventuale vecchia regione fuori kerf per nesting
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_OUTKERF))
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_OUTKERF_REG))
' Cancello eventuale vecchia regione di riferimento per nesting
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_REF_REG))
' Cancello eventuali vecchie regioni aree rovinate per nesting
Dim nId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_DAMAGED_REG)
While nId <> GDB_ID.NULL
+2 -2
View File
@@ -386,11 +386,11 @@
</Grid.ColumnDefinitions>
<TextBlock Name="MaxAbsorptionTxBl" Grid.Column="0"
Style="{StaticResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="1" Margin="25,11,0,10" ScrollViewer.VerticalScrollBarVisibility="Disabled" TextWrapping="Wrap"/>
Style="{StaticResource OmagCut_ToolsDBTextBlock}" Grid.ColumnSpan="1" Margin="10,11,0,10" ScrollViewer.VerticalScrollBarVisibility="Disabled" TextWrapping="Wrap"/>
<EgtWPFLib:EgtTextBox Name="MaxAbsorptionTxBx" Grid.Column="1" Width="150"
Style="{StaticResource OmagCut_CalculatorTextBox}" Margin="9,9,10,9" />
<TextBlock Name="MinFeedTxBl" Grid.Column="2" Style="{StaticResource OmagCut_ToolsDBTextBlock}" Margin="25,11,0,10"/>
<TextBlock Name="MinFeedTxBl" Grid.Column="2" Style="{StaticResource OmagCut_ToolsDBTextBlock}" Margin="10,11,0,10"/>
<EgtWPFLib:EgtTextBox Name="MinFeedTxBx" Grid.Column="3" Width="150"
Style="{StaticResource OmagCut_CalculatorTextBox}" Margin="9,9,10,9" />