OmagCUT :
- aggiunta pagina parametri di lavorazione in cornici. - aggiunta possibilità in split di selezionare più lavorazioni con lo shift. - aggiunti nuovi bottoni gestione macchina divisi in pagina Controls e Vacuum.
This commit is contained in:
+73
-5
@@ -241,12 +241,52 @@ Public Class CNCommunication
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Power, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_SPINDLE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Spindle, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_COOLANT, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Coolant, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_LASER, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Laser, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_COOLANT, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Coolant, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_INTERNALCOOLANT, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.InternalCoolant, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_EXTERNCOOLANT, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.ExternCoolant, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_CBAXES, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.CBAxes, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_AIRBLOW, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.AirBlow, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_HOME, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Home, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_TABLEUP, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.TableUp, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_TABLEDOWN, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.TableDown, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_DOORCLOSED, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.DoorClosed, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_LIMITZ, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.LimitZ, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_POWEROVR, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.PowerOvr, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUUMPOSITION, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.VacuumPosition, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUUMROT, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.VacuumRot, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUU3STATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Vacuum3State, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUU4STATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Vacuum4State, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUU135STATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Vacuum135State, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUU246STATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Vacuum246State, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_OPENALLSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.OpenAllState, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_CLOSEALLSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.CloseAllState, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_BLOWSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BlowState, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_VACUUMSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.VacuumState, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_BYPASSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
|
||||
|
||||
' Inizializzo la comunicazione
|
||||
m_CN.Init()
|
||||
@@ -298,6 +338,8 @@ Public Class CNCommunication
|
||||
m_MainWindow.m_MachinePageUC.m_AlarmsPageUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_ManualAxesMove.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_RawPartPage.m_MachineButtons.m_CN = Me.m_CN
|
||||
@@ -403,9 +445,35 @@ Public Class CNCommunication
|
||||
|
||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.SpindleStateChanged(m_CN.bSpindleState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LaserStateChanged(m_CN.bLaserState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CoolantStateChanged(m_CN.bCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.InternalCoolantStateChanged(m_CN.bInternalCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ExternCoolantStateChanged(m_CN.bExternCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.CBAxesStateChanged(m_CN.bCBAxesState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.AirBlowStateChanged(m_CN.bAirBlowState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.HomeStateChanged(m_CN.bHomeState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableUpChanged(m_CN.bTableUpState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.TableDownChanged(m_CN.bTableDownState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.DoorClosedChanged(m_CN.nDoorClosedState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumPositionChanged(m_CN.bVacuumPosition)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumRotChanged(m_CN.bVacuumRot)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum3Changed(m_CN.bVacuum3State)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum4Changed(m_CN.bVacuum4State)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum135Changed(m_CN.bVacuum135State)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum246Changed(m_CN.bVacuum246State)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.OpenAllChanged(m_CN.bOpenAllState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.CloseAllChanged(m_CN.bCloseAllState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BlowChanged(m_CN.bBlowState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumChanged(m_CN.bVacuumState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.BypassChanged(m_CN.bBypassState)
|
||||
Else
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.SpindleStateChanged(m_CN.bSpindleState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||
End If
|
||||
If m_CN.Is_G24_active() Then
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(True)
|
||||
|
||||
+42
-2
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
||||
Public Const MAX_VAR As Short = 100
|
||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||
Public Const MAX_TOOLS As Short = 100
|
||||
Public Const NUM_DATA = 13 ' Numero di dati del CN (Speed,Feed,...)
|
||||
Public Const NUM_DATA = 33 ' Numero di dati del CN (Speed,Feed,...)
|
||||
Public Enum CnData
|
||||
Mode = 0
|
||||
JogIncr = 1
|
||||
@@ -23,6 +23,26 @@ Public MustInherit Class CN_generico
|
||||
PowerOvr = 10
|
||||
Comm = 11
|
||||
Refresh = 12
|
||||
InternalCoolant = 13
|
||||
ExternCoolant = 14
|
||||
CBAxes = 15
|
||||
AirBlow = 16
|
||||
Home = 17
|
||||
TableUp = 18
|
||||
TableDown = 19
|
||||
DoorClosed = 20
|
||||
LimitZ = 21
|
||||
VacuumPosition = 22
|
||||
VacuumRot = 23
|
||||
Vacuum3State = 24
|
||||
Vacuum4State = 25
|
||||
Vacuum135State = 26
|
||||
Vacuum246State = 27
|
||||
OpenAllState = 28
|
||||
CloseAllState = 29
|
||||
BlowState = 30
|
||||
VacuumState = 31
|
||||
BypassState = 32
|
||||
End Enum
|
||||
|
||||
#End Region
|
||||
@@ -98,9 +118,29 @@ Public MustInherit Class CN_generico
|
||||
Public bIsErrorMessage As Boolean = True
|
||||
|
||||
Public bSpindleState As Boolean
|
||||
Public bCoolantState As Boolean
|
||||
Public bLaserState As Boolean
|
||||
Public bCoolantState As Boolean
|
||||
Public bInternalCoolantState As Boolean
|
||||
Public bExternCoolantState As Boolean
|
||||
Public bCBAxesState As Boolean
|
||||
Public bAirBlowState As Boolean
|
||||
Public bHomeState As Boolean
|
||||
Public bTableUpState As Boolean
|
||||
Public bTableDownState As Boolean
|
||||
Public nDoorClosedState As Integer
|
||||
Public bLimitZState As Boolean
|
||||
Public bPowerOvr As Double
|
||||
Public bVacuumPosition As Boolean
|
||||
Public bVacuumRot As Boolean
|
||||
Public bVacuum3State As Boolean
|
||||
Public bVacuum4State As Boolean
|
||||
Public bVacuum135State As Boolean
|
||||
Public bVacuum246State As Boolean
|
||||
Public bOpenAllState As Boolean
|
||||
Public bCloseAllState As Boolean
|
||||
Public bBlowState As Boolean
|
||||
Public bVacuumState As Boolean
|
||||
Public bBypassState As Boolean
|
||||
|
||||
Public nMachineMode As Integer
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ Friend Module CamAuto
|
||||
' Se altrimenti progetto con cornici
|
||||
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
|
||||
' Reinserisco tutte le lavorazioni delle cornici
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_dEndTrim)
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
|
||||
''' <summary>
|
||||
''' A command whose sole purpose is to
|
||||
''' relay its functionality to other
|
||||
''' objects by invoking delegates. The
|
||||
''' default return value for the CanExecute
|
||||
''' method is 'true'.
|
||||
''' </summary>
|
||||
Public Class Command
|
||||
Implements ICommand
|
||||
|
||||
#Region "Fields"
|
||||
|
||||
Private ReadOnly _execute As Action(Of Object)
|
||||
Private ReadOnly _canExecute As Predicate(Of Object)
|
||||
|
||||
#End Region ' Fields
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command that can always execute.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object))
|
||||
Me.New(execute, Nothing)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Creates a new command.
|
||||
''' </summary>
|
||||
''' <param name="execute">The execution logic.</param>
|
||||
''' <param name="canExecute">The execution status logic.</param>
|
||||
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
|
||||
If execute Is Nothing Then
|
||||
Throw New ArgumentNullException("execute")
|
||||
End If
|
||||
|
||||
_execute = execute
|
||||
_canExecute = canExecute
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ICommand Members"
|
||||
|
||||
<DebuggerStepThrough> _
|
||||
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
|
||||
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
|
||||
End Function
|
||||
|
||||
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
|
||||
AddHandler(ByVal value As EventHandler)
|
||||
AddHandler CommandManager.RequerySuggested, value
|
||||
End AddHandler
|
||||
RemoveHandler(ByVal value As EventHandler)
|
||||
RemoveHandler CommandManager.RequerySuggested, value
|
||||
End RemoveHandler
|
||||
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
End RaiseEvent
|
||||
End Event
|
||||
|
||||
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
|
||||
_execute(parameter)
|
||||
End Sub
|
||||
|
||||
#End Region ' ICommand Members
|
||||
End Class
|
||||
+23
-1
@@ -50,9 +50,29 @@
|
||||
Public Const K_SPEEDOVR As String = "SpeedOvr"
|
||||
Public Const K_POWER As String = "Power"
|
||||
Public Const K_SPINDLE As String = "Spindle"
|
||||
Public Const K_COOLANT As String = "Coolant"
|
||||
Public Const K_LASER As String = "Laser"
|
||||
Public Const K_COOLANT As String = "Coolant"
|
||||
Public Const K_INTERNALCOOLANT As String = "InternalCoolant"
|
||||
Public Const K_EXTERNCOOLANT As String = "ExternCoolant"
|
||||
Public Const K_CBAXES As String = "CBAxes"
|
||||
Public Const K_AIRBLOW As String = "AirBlow"
|
||||
Public Const K_HOME As String = "Home"
|
||||
Public Const K_TABLEUP As String = "TableUp"
|
||||
Public Const K_TABLEDOWN As String = "TableDown"
|
||||
Public Const K_DOORCLOSED As String = "DoorClosed"
|
||||
Public Const K_LIMITZ As String = "LimitZ"
|
||||
Public Const K_POWEROVR As String = "PowerOvr"
|
||||
Public Const K_VACUUMPOSITION As String = "VacuumPosition"
|
||||
Public Const K_VACUUMROT As String = "VacuumRot"
|
||||
Public Const K_VACUU3STATE As String = "Vacuum3State"
|
||||
Public Const K_VACUU4STATE As String = "Vacuum4State"
|
||||
Public Const K_VACUU135STATE As String = "Vacuum135State"
|
||||
Public Const K_VACUU246STATE As String = "Vacuum246State"
|
||||
Public Const K_OPENALLSTATE As String = "OpenAllState"
|
||||
Public Const K_CLOSEALLSTATE As String = "CoseAllState"
|
||||
Public Const K_BLOWSTATE As String = "BlowState"
|
||||
Public Const K_VACUUMSTATE As String = "VacuumState"
|
||||
Public Const K_BYPASSTATE As String = "BypassState"
|
||||
|
||||
Public Const S_PRODUCTIONLINE As String = "ProductionLine"
|
||||
Public Const K_ACTIVE As String = "Active"
|
||||
@@ -155,6 +175,8 @@
|
||||
Public Const K_FINALHOME As String = "FinalHome"
|
||||
|
||||
Public Const S_MACHBUTTONS As String = "MachButtons"
|
||||
Public Const S_CONTROLMACHBUTTONS As String = "ControlMachButtons"
|
||||
Public Const S_VACUUMMACHBUTTONS As String = "VacuumMachButtons"
|
||||
Public Const K_BUTTON As String = "Button"
|
||||
|
||||
Public Const S_MACH_INPROGRESS As String = "InProgress"
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<UserControl x:Class="ControlsMachineButtonUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="Self"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:OmagCUT="clr-namespace:OmagCUT"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||
|
||||
<Border Style="{StaticResource OmagCut_Page2Border}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:TwoStateButton}">
|
||||
<ToggleButton IsChecked="{Binding Button_IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:ThreeStateButton}">
|
||||
<Button Command="{Binding ExecuteCommand}"
|
||||
Background="{Binding Background}"
|
||||
Style="{StaticResource OmagCut_MachineCommandsYellowGradientYellowIconButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:DoubleCommandButton}">
|
||||
<ToggleButton IsChecked="{Binding IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:PressedCommandButton}">
|
||||
<Button Style="{StaticResource OmagCut_MachineCommandsYellowGradientYellowIconButton}"
|
||||
PreviewMouseUp="PressedCommandButton_PreviewMouseUp"
|
||||
PreviewMouseDown="PressedCommandButton_PreviewMouseDown">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
<!--<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ToggleButton IsChecked="{Binding IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>-->
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="3" Rows="7"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,704 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ControlsMachineButtonUC
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
' Costanti per nomi stati dei bottoni
|
||||
Private Const BTN_STATE_SPINDLE As String = "Spindle"
|
||||
Private Const BTN_STATE_COOLANT As String = "Coolant"
|
||||
Private Const BTN_STATE_LASER As String = "Laser"
|
||||
Private Const BTN_STATE_THREEAXIS As String = "ThreeAxis"
|
||||
Private Const BTN_STATE_FIVEAXIS As String = "FiveAxis"
|
||||
Private Const BTN_STATE_NOTHING As String = "Nothing"
|
||||
|
||||
Private Enum MachineButtonType As Integer
|
||||
NOSTATE = 0
|
||||
TWOSTATE = 1
|
||||
THREESTATE = 2
|
||||
DOUBLECOMMAND = 3
|
||||
PRESSEDCOMMAND = 4
|
||||
End Enum
|
||||
|
||||
' Dichiarazione delle Page UserControl
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private m_DirectCutPage As DirectCutPageUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
Private m_ButtonList As New ObservableCollection(Of MachineButton)
|
||||
Public ReadOnly Property ButtonList As ObservableCollection(Of MachineButton)
|
||||
Get
|
||||
Return m_ButtonList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub ControlsMachineButtonUC_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
Me.DataContext = Me
|
||||
End Sub
|
||||
|
||||
Private Sub ControlsMachineButtonUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
If m_bFirst Then
|
||||
m_DirectCutPage = m_MainWindow.m_DirectCutPageUC
|
||||
'MachineButton.m_DirectCutPage = m_DirectCutPage
|
||||
'MachineButton.m_CN = m_CN
|
||||
m_bFirst = False
|
||||
|
||||
' Lettura configurazione bottoni da Ini di macchina
|
||||
Dim m_nCount As Integer = 1
|
||||
Dim bFoundedBtn As Boolean = True
|
||||
While bFoundedBtn
|
||||
Dim sNameBtn As String = K_BUTTON & (m_nCount).ToString()
|
||||
Dim sMachineButtonType As String = String.Empty
|
||||
Dim sTImageName As String = String.Empty
|
||||
Dim sTLuaScriptName As String = String.Empty
|
||||
Dim sFImageName As String = String.Empty
|
||||
Dim sFLuaScriptName As String = String.Empty
|
||||
Dim sStateFlag As String = String.Empty
|
||||
bFoundedBtn = GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, sNameBtn, sMachineButtonType, sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag, m_MainWindow.GetMachIniFile())
|
||||
If bFoundedBtn Then 'And
|
||||
'(Not m_bOnlyLaser Or sButtonStateFlag = sNameBtn) Then
|
||||
m_nCount += 1
|
||||
Dim ButtonToAdd As MachineButton = Nothing
|
||||
Select Case sMachineButtonType
|
||||
Case MachineButtonType.NOSTATE
|
||||
ButtonToAdd = New TwoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.TWOSTATE
|
||||
ButtonToAdd = New TwoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.THREESTATE
|
||||
ButtonToAdd = New ThreeStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.DOUBLECOMMAND
|
||||
ButtonToAdd = New DoubleCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.PRESSEDCOMMAND
|
||||
ButtonToAdd = New PressedCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
End Select
|
||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||
End If
|
||||
End While
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||
Dim SpindleButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_SPINDLE Then
|
||||
SpindleButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(SpindleButton) Then
|
||||
SpindleButton.SetButtonIsChecked(SpindleState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub LaserStateChanged(LaserState As Boolean)
|
||||
Dim LaserButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_LASER Then
|
||||
LaserButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(LaserButton) Then
|
||||
LaserButton.SetButtonIsChecked(LaserState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub CoolantStateChanged(CoolantState As Boolean)
|
||||
Dim CoolantButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_COOLANT Then
|
||||
CoolantButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(CoolantButton) Then
|
||||
CoolantButton.SetButtonIsChecked(CoolantState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub InternalCoolantStateChanged(InternalCoolantState As Boolean)
|
||||
Dim IntCoolantButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_INTERNALCOOLANT Then
|
||||
IntCoolantButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(IntCoolantButton) Then
|
||||
IntCoolantButton.SetButtonIsChecked(InternalCoolantState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ExternCoolantStateChanged(ExternCoolantState As Boolean)
|
||||
Dim ExtCoolantButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_EXTERNCOOLANT Then
|
||||
ExtCoolantButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(ExtCoolantButton) Then
|
||||
ExtCoolantButton.SetButtonIsChecked(ExternCoolantState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub CBAxesStateChanged(CBAxesState As Boolean)
|
||||
Dim CBAxesButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_CBAXES Then
|
||||
CBAxesButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(CBAxesButton) Then
|
||||
CBAxesButton.SetButtonIsChecked(CBAxesState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub AirBlowStateChanged(AirBlowState As Boolean)
|
||||
Dim AirBlowButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_AIRBLOW Then
|
||||
AirBlowButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(AirBlowButton) Then
|
||||
AirBlowButton.SetButtonIsChecked(AirBlowState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub HomeStateChanged(HomeState As Boolean)
|
||||
Dim HomeButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_HOME Then
|
||||
HomeButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(HomeButton) Then
|
||||
HomeButton.SetButtonIsChecked(HomeState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub TableUpChanged(TableUpState As Boolean)
|
||||
Dim TableUpButton As PressedCommandButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_TABLEUP Then
|
||||
TableUpButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(TableUpButton) Then
|
||||
TableUpButton.SetIsPressed(TableUpState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub TableDownChanged(TableDownState As Boolean)
|
||||
Dim TableDownButton As PressedCommandButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_TABLEDOWN Then
|
||||
TableDownButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(TableDownButton) Then
|
||||
TableDownButton.SetIsPressed(TableDownState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub DoorClosedChanged(DoorClosedState As Integer)
|
||||
Dim DoorClosedButton As ThreeStateButton = Nothing
|
||||
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_DOORCLOSED Then
|
||||
'If TypeOf MachineButton Is NoStateButton Then
|
||||
' DoorClosedButton = DirectCast(MachineButton, NoStateButton)
|
||||
'ElseIf TypeOf MachineButton Is TwoStateButton Then
|
||||
' DoorClosedButton = DirectCast(MachineButton, TwoStateButton)
|
||||
'ElseIf TypeOf MachineButton Is ThreeStateButton Then
|
||||
' DoorClosedButton = DirectCast(MachineButton, ThreeStateButton)
|
||||
'ElseIf TypeOf MachineButton Is DoubleCommandButton Then
|
||||
' DoorClosedButton = DirectCast(MachineButton, DoubleCommandButton)
|
||||
'ElseIf TypeOf MachineButton Is PressedCommandButton Then
|
||||
' DoorClosedButton = DirectCast(MachineButton, PressedCommandButton)
|
||||
'End If
|
||||
DoorClosedButton = MachineButton
|
||||
End If
|
||||
If MachineButton.StateFlag = "DoorOpened" Then
|
||||
DoorOpenedButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(DoorClosedButton) Then
|
||||
Select Case DoorClosedState
|
||||
Case 0
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||
Case 1, 2
|
||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
End Select
|
||||
End If
|
||||
If Not IsNothing(DoorOpenedButton) Then
|
||||
Select Case DoorClosedState
|
||||
Case 0
|
||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||
Case 1
|
||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
Case 2
|
||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub LimitZChanged(LimitZState As Boolean)
|
||||
Dim LimitZButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_LIMITZ Then
|
||||
LimitZButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(LimitZButton) Then
|
||||
LimitZButton.SetButtonIsChecked(LimitZState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub ThreeAxisStateChanged(ThreeAxisState As Boolean)
|
||||
Dim ThreeAxisButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_LIMITZ Then
|
||||
ThreeAxisButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(ThreeAxisButton) Then
|
||||
ThreeAxisButton.SetButtonIsChecked(ThreeAxisState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub FiveAxisStateChanged(FiveAxisState As Boolean)
|
||||
Dim FiveAxisButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_LIMITZ Then
|
||||
FiveAxisButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(FiveAxisButton) Then
|
||||
FiveAxisButton.SetButtonIsChecked(FiveAxisState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetPrivateProfileMachineButtons(
|
||||
ByVal lpAppName As String,
|
||||
ByVal lpKeyName As String,
|
||||
ByRef lpMachineButtonType As String,
|
||||
ByRef lpTImageName As String,
|
||||
ByRef lpTLuaScriptName As String,
|
||||
ByRef lpFImageName As String,
|
||||
ByRef lpFLuaScriptName As String,
|
||||
ByRef lpStateFlag As String,
|
||||
ByVal lpFileName As String) As Boolean
|
||||
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() >= 3 Then
|
||||
lpMachineButtonType = sItems(0)
|
||||
lpTImageName = sItems(1)
|
||||
lpTLuaScriptName = sItems(2)
|
||||
If sItems.Count() >= 4 Then
|
||||
lpStateFlag = sItems(3)
|
||||
If sItems.Count() >= 6 Then
|
||||
lpFImageName = sItems(4)
|
||||
lpFLuaScriptName = sItems(5)
|
||||
End If
|
||||
Else
|
||||
lpStateFlag = BTN_STATE_NOTHING
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
End Sub
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub PressedCommandButton_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Button As Button = DirectCast(sender, Button)
|
||||
If TypeOf Button.DataContext Is PressedCommandButton Then
|
||||
Dim PressedButton As PressedCommandButton = DirectCast(Button.DataContext, PressedCommandButton)
|
||||
PressedButton.OnMouseUp()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PressedCommandButton_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Button As Button = DirectCast(sender, Button)
|
||||
If TypeOf Button.DataContext Is PressedCommandButton Then
|
||||
Dim PressedButton As PressedCommandButton = DirectCast(Button.DataContext, PressedCommandButton)
|
||||
PressedButton.OnMouseDown()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
|
||||
Public MustInherit Class MachineButton
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
' Costanti per nomi stati dei bottoni
|
||||
Friend Const BTN_STATE_SPINDLE As String = "Spindle"
|
||||
Friend Const BTN_STATE_COOLANT As String = "Coolant"
|
||||
Friend Const BTN_STATE_LASER As String = "Laser"
|
||||
Friend Const BTN_STATE_THREEAXIS As String = "ThreeAxis"
|
||||
Friend Const BTN_STATE_FIVEAXIS As String = "FiveAxis"
|
||||
Friend Const BTN_STATE_NOTHING As String = "Nothing"
|
||||
' Dichiarazione delle Page UserControl
|
||||
Friend Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Friend Shared m_DirectCutPage As DirectCutPageUC = m_MainWindow.m_DirectCutPageUC
|
||||
Friend Shared m_CN As CN_generico = m_MainWindow.m_DirectCutPageUC.m_CN
|
||||
|
||||
Private m_TImageName As String
|
||||
Public ReadOnly Property TImageName As String
|
||||
Get
|
||||
Return m_TImageName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_TLuaScriptName As String
|
||||
Public ReadOnly Property TLuaScriptName As String
|
||||
Get
|
||||
Return m_TLuaScriptName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_FImageName As String
|
||||
Public ReadOnly Property FImageName As String
|
||||
Get
|
||||
Return m_FImageName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_FLuaScriptName As String
|
||||
Public ReadOnly Property FLuaScriptName As String
|
||||
Get
|
||||
Return m_FLuaScriptName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_StateFlag As String
|
||||
Public ReadOnly Property StateFlag As String
|
||||
Get
|
||||
Return m_StateFlag
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String, StateFlag As String)
|
||||
m_TImageName = TImagePath
|
||||
m_TLuaScriptName = TLuaScriptPath
|
||||
m_FImageName = FImagePath
|
||||
m_FLuaScriptName = FLuaScriptPath
|
||||
m_StateFlag = StateFlag
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
'Friend MustOverride Sub ExecuteCommand(bIsChecked As Boolean)
|
||||
|
||||
Friend Sub ExecuteMDICommand(sLuaFileName As String)
|
||||
Dim CmdString As String = String.Empty
|
||||
Dim b2Start As Boolean = False
|
||||
ExecuteDirectCmdLua(sLuaFileName, CmdString, b2Start)
|
||||
Dim nResult As Short
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
End Select
|
||||
m_CN.sz_ManualDataInput = CmdString
|
||||
m_CN.MDI_command()
|
||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||
Case 1, 2
|
||||
System.Threading.Thread.Sleep(300)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
Case 3
|
||||
'Per il siemens non devo fare nulla
|
||||
End Select
|
||||
|
||||
If b2Start Then
|
||||
System.Threading.Thread.Sleep(300)
|
||||
m_CN.DGeneralFunctions_CycleStart()
|
||||
End If
|
||||
System.Threading.Thread.Sleep(300)
|
||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||
End Sub
|
||||
|
||||
Friend Sub ExecuteDirectCmdLua(LuaFileName As String, ByRef CmdString As String, ByRef b2Start As Boolean)
|
||||
Dim sBaseDir As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||
EgtLuaExecFile(sBaseDir & LuaFileName)
|
||||
Dim dFeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text) Then
|
||||
StringToLen(m_DirectCutPage.m_ManualAxesMove.FeedTxBx.Text, dFeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||
Dim dSpeed As Double = 0
|
||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||
Else
|
||||
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
End If
|
||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||
EgtLuaSetGlobNumVar("CMD.L2", dL2)
|
||||
EgtLuaSetGlobNumVar("CMD.L3", dL3)
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
EgtLuaCallFunction("CmdString")
|
||||
' Leggo variabili
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
EgtLuaGetGlobBoolVar("CMD.DOUBLESTART", b2Start)
|
||||
' Reset lua
|
||||
EgtLuaResetGlobVar("CmdString")
|
||||
EgtLuaResetGlobVar("CMD")
|
||||
' Log del comando
|
||||
EgtOutLog("CmdString=" & CmdString & " b2Start=" & b2Start.ToString())
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class TwoStateButton
|
||||
Inherits MachineButton
|
||||
|
||||
Private m_Button_IsChecked As Boolean
|
||||
Public Property Button_IsChecked As Boolean
|
||||
Get
|
||||
Return m_Button_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Button_IsChecked = value
|
||||
If value Then
|
||||
ExecuteMDICommand(TLuaScriptName)
|
||||
Else
|
||||
ExecuteMDICommand(FLuaScriptName)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetButtonIsChecked(value As Boolean)
|
||||
m_Button_IsChecked = value
|
||||
NotifyPropertyChanged("Button_IsChecked")
|
||||
NotifyPropertyChanged("ImageSource")
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ImageSource As String
|
||||
Get
|
||||
' Se variabile di stato "Nothing" o non collegato a CN, imposto immagine fissa
|
||||
If StateFlag = BTN_STATE_NOTHING Or Not m_MainWindow.m_bNCLink Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
End If
|
||||
If m_Button_IsChecked Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
Else
|
||||
' ritorno immagine dello stato false
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & FImageName
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String, StateFlag As String)
|
||||
MyBase.New(TImagePath, TLuaScriptPath, FImagePath, FLuaScriptPath, StateFlag)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class NoStateButton
|
||||
Inherits MachineButton
|
||||
|
||||
Public ReadOnly Property ImageSource As String
|
||||
Get
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String)
|
||||
MyBase.New(TImagePath, TLuaScriptPath, Nothing, Nothing, Nothing)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ThreeStateButton
|
||||
Inherits MachineButton
|
||||
|
||||
' definizione comandi
|
||||
Private m_cmdExecute As ICommand
|
||||
|
||||
Private m_Background As SolidColorBrush
|
||||
Public Property Background As SolidColorBrush
|
||||
Get
|
||||
Return m_Background
|
||||
End Get
|
||||
Set(value As SolidColorBrush)
|
||||
m_Background = value
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property ImageSource As String
|
||||
Get
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String, StateFlag As String)
|
||||
MyBase.New(TImagePath, TLuaScriptPath, FImagePath, FLuaScriptPath, StateFlag)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Execute"
|
||||
|
||||
' Returns a command that manage the MainWindow_Unloaded command
|
||||
Public ReadOnly Property ExecuteCommand() As ICommand
|
||||
Get
|
||||
If m_cmdExecute Is Nothing Then
|
||||
m_cmdExecute = New Command(AddressOf Execute)
|
||||
End If
|
||||
Return m_cmdExecute
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
|
||||
Public Sub Execute()
|
||||
ExecuteMDICommand(TLuaScriptName)
|
||||
End Sub
|
||||
|
||||
#End Region ' Execute
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class DoubleCommandButton
|
||||
Inherits MachineButton
|
||||
|
||||
Private m_IsChecked As Boolean
|
||||
Public Property IsChecked As Boolean
|
||||
Get
|
||||
Return m_IsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsChecked = value
|
||||
ExecuteMDICommand(TLuaScriptName)
|
||||
ExecuteMDICommand(FLuaScriptName)
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetIsChecked(value As Boolean)
|
||||
m_IsChecked = value
|
||||
NotifyPropertyChanged("IsChecked")
|
||||
NotifyPropertyChanged("ImageSource")
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ImageSource As String
|
||||
Get
|
||||
' Se variabile di stato "Nothing" o non collegato a CN, imposto immagine fissa
|
||||
If StateFlag = BTN_STATE_NOTHING Or Not m_MainWindow.m_bNCLink Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
End If
|
||||
If m_IsChecked Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
Else
|
||||
' ritorno immagine dello stato false
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & FImageName
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String, StateFlag As String)
|
||||
MyBase.New(TImagePath, TLuaScriptPath, FImagePath, FLuaScriptPath, StateFlag)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class PressedCommandButton
|
||||
Inherits MachineButton
|
||||
|
||||
Private m_IsPressed As Boolean
|
||||
Friend Sub SetIsPressed(value As Boolean)
|
||||
m_IsPressed = value
|
||||
NotifyPropertyChanged("ImageSource")
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property ImageSource As String
|
||||
Get
|
||||
' Se variabile di stato "Nothing" o non collegato a CN, imposto immagine fissa
|
||||
If StateFlag = BTN_STATE_NOTHING Or Not m_MainWindow.m_bNCLink Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
End If
|
||||
If m_IsPressed Then
|
||||
' ritorno immagine dello stato true
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & TImageName
|
||||
Else
|
||||
' ritorno immagine dello stato false
|
||||
Return m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & FImageName
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Sub New(TImagePath As String, TLuaScriptPath As String, FImagePath As String, FLuaScriptPath As String, StateFlag As String)
|
||||
MyBase.New(TImagePath, TLuaScriptPath, FImagePath, FLuaScriptPath, StateFlag)
|
||||
End Sub
|
||||
|
||||
Friend Sub OnMouseDown()
|
||||
ExecuteMDICommand(TLuaScriptName)
|
||||
SetIsPressed(True)
|
||||
End Sub
|
||||
|
||||
Friend Sub OnMouseUp()
|
||||
ExecuteMDICommand(FLuaScriptName)
|
||||
SetIsPressed(False)
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
+23
-2
@@ -75,17 +75,38 @@
|
||||
<Button Name="SawTestBtn" Grid.Row="6"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale per bottoni macchina -->
|
||||
<Grid Name="MachineButtonGrid" Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
</Grid.RowDefinitions>
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid inferiore -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="2" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="8*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ManualModeBtn" Grid.Column="2"
|
||||
<ToggleButton Name="ControlsMachineBtn" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="Resources/Manual.png" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
|
||||
<ToggleButton Name="VacuumMachineBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="Resources/Manual.png" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
|
||||
<Button Name="ManualModeBtn" Grid.Column="4"
|
||||
Style="{StaticResource OmagCut_YellowGradientYellowIconButton}">
|
||||
<Image Source="Resources/Manual.png" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
+54
-3
@@ -13,6 +13,8 @@ Public Class DirectCutPageUC
|
||||
Friend m_CopyTemplate As CopyTemplateUC
|
||||
Friend m_FlatteningCut As FlatteningCut
|
||||
Friend m_SawTest As SawTestUC
|
||||
Friend m_ControlsMachineButton As ControlsMachineButtonUC
|
||||
Friend m_VacuumMachineButton As VacuumMachineButtonUC
|
||||
' Stato di visualizzazione della macchina
|
||||
Friend m_bShowMachine As Boolean = False
|
||||
Friend m_nMachLook As Integer = MCH_LOOK.ALL
|
||||
@@ -21,9 +23,15 @@ Public Class DirectCutPageUC
|
||||
Private m_bFirst As Boolean = True
|
||||
' Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActiveDirectCutPage As DirectCutPages = DirectCutPages.DirectCut
|
||||
' Variabili che indicano attivazione paginette con bottoni macchina
|
||||
Private m_ControlsBtn_IsActive As Boolean
|
||||
|
||||
' Variabile che indica se sono attivi i bottoni macchina nuovi o vecchi
|
||||
Friend m_NewMachineButtonsType As Boolean
|
||||
|
||||
Enum DirectCutPages
|
||||
DirectCut
|
||||
ManualAxesMove
|
||||
SingleCut
|
||||
MultipleCut
|
||||
GridCut
|
||||
@@ -43,9 +51,12 @@ Public Class DirectCutPageUC
|
||||
m_FlatteningCut = New FlatteningCut
|
||||
m_CopyTemplate = New CopyTemplateUC
|
||||
m_SawTest = New SawTestUC
|
||||
m_ControlsMachineButton = New ControlsMachineButtonUC
|
||||
m_VacuumMachineButton = New VacuumMachineButtonUC
|
||||
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||
m_SingleCut.SetValue(Grid.RowProperty, 1)
|
||||
m_MultipleCut.SetValue(Grid.RowProperty, 1)
|
||||
@@ -53,9 +64,16 @@ Public Class DirectCutPageUC
|
||||
m_FlatteningCut.SetValue(Grid.RowProperty, 1)
|
||||
m_CopyTemplate.SetValue(Grid.RowProperty, 1)
|
||||
m_SawTest.SetValue(Grid.RowProperty, 1)
|
||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
m_VacuumMachineButton.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
'Assegno MachineButtons alla pagina
|
||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||
If Not m_NewMachineButtonsType Then
|
||||
'Assegno MachineButtons alla pagina
|
||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||
End If
|
||||
|
||||
If GetPrivateProfileInt(S_NUMERICALCONTROL, K_TYPE, 0, m_MainWindow.GetMachIniFile()) = 0 Then
|
||||
ManualBtn.IsEnabled = False
|
||||
@@ -137,6 +155,7 @@ Public Class DirectCutPageUC
|
||||
|
||||
Private Sub ManualBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualBtn.Click
|
||||
LeftButtonGrid.Children.Add(m_ManualAxesMove)
|
||||
m_ActiveDirectCutPage = DirectCutPages.ManualAxesMove
|
||||
End Sub
|
||||
|
||||
Private Sub SingleCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles SingleCutBtn.Click
|
||||
@@ -169,6 +188,30 @@ Public Class DirectCutPageUC
|
||||
m_ActiveDirectCutPage = DirectCutPages.SawTest
|
||||
End Sub
|
||||
|
||||
Private Sub ControlsMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles ControlsMachineBtn.Click
|
||||
If ControlsMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
||||
If VacuumMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||
VacuumMachineBtn.IsChecked = False
|
||||
End If
|
||||
Else
|
||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
||||
If VacuumMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
||||
If ControlsMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||
ControlsMachineBtn.IsChecked = False
|
||||
End If
|
||||
Else
|
||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
||||
If m_bShowMachine Then
|
||||
' aggiorno lo stato
|
||||
@@ -188,7 +231,7 @@ Public Class DirectCutPageUC
|
||||
|
||||
Friend Sub DirectCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
Select Case m_ActiveDirectCutPage
|
||||
Case DirectCutPages.DirectCut
|
||||
Case DirectCutPages.DirectCut Or DirectCutPages.ManualAxesMove
|
||||
' Non è necessario fare alcunché
|
||||
Case DirectCutPages.SingleCut
|
||||
LeftButtonGrid.Children.Remove(m_SingleCut)
|
||||
@@ -203,6 +246,14 @@ Public Class DirectCutPageUC
|
||||
Case DirectCutPages.SawTest
|
||||
LeftButtonGrid.Children.Remove(m_SawTest)
|
||||
End Select
|
||||
If ControlsMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||
ControlsMachineBtn.IsChecked = False
|
||||
End If
|
||||
If VacuumMachineBtn.IsChecked Then
|
||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||
VacuumMachineBtn.IsChecked = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
|
||||
|
||||
+41
-24
@@ -41,18 +41,26 @@
|
||||
</Button>
|
||||
<Button Name="ImportBtn" Grid.Column="3" Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
|
||||
<Image Source="Resources/Import.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Button>
|
||||
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||
<Image Source="Resources/FrameMachining.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.RowSpan="2">
|
||||
<Grid Name="LeftGrid" Grid.Row="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.6*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
@@ -69,7 +77,7 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ComboBox Name="AlongAxCmBx" Grid.Row="1" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -78,27 +86,34 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="OffsZTxBl" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
||||
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="1" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="OffsXyTxBl" Grid.Row="3" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="OffsXyTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="3" Width="50"
|
||||
<EgtWPFLib:EgtTextBox Name="OffsXyTxBx" Grid.Column="2" Grid.Row="2" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<UniformGrid Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="3" Columns="2" >
|
||||
<UniformGrid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3" Columns="2" >
|
||||
<Button Name="MirrorPartBtn"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="RemovePartBtn"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<TextBlock Name="SawRoughingTxBl" Grid.Row="5" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
<UniformGrid Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="3" Columns="2" >
|
||||
<Button Name="SelectSectionBtn"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="SelectGuideBtn"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<ComboBox Name="SawRoughingCmBx" Grid.Row="6" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawRoughingCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -107,10 +122,10 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="SawFinishingTxBl" Grid.Row="7" Grid.ColumnSpan="3"
|
||||
<TextBlock Name="SawFinishingTxBl" Grid.Row="6" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawFinishingCmBx" Grid.Row="8" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<ComboBox Name="SawFinishingCmBx" Grid.Row="7" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -119,10 +134,10 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="SawSideFinTxBl" Grid.Row="9" Grid.ColumnSpan="3"
|
||||
<TextBlock Name="SawSideFinTxBl" Grid.Row="8" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawSideFinCmBx" Grid.Row="10" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<ComboBox Name="SawSideFinCmBx" Grid.Row="9" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -131,29 +146,31 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="StartTrimTxBl" Grid.Row="11" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="StartTrimTxBl" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="StartTrimTxBx" Grid.Column="2" Grid.Row="11" Width="50"
|
||||
<EgtWPFLib:EgtTextBox Name="StartTrimTxBx" Grid.Column="2" Grid.Row="10" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="EndTrimTxBl" Grid.Row="12" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="EndTrimTxBl" Grid.Row="11" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="EndTrimTxBx" Grid.Column="2" Grid.Row="12" Width="50"
|
||||
<EgtWPFLib:EgtTextBox Name="EndTrimTxBx" Grid.Column="2" Grid.Row="11" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="SawSingleTxBl" Grid.Row="13" Grid.ColumnSpan="3"
|
||||
<TextBlock Name="SawSingleTxBl" Grid.Row="12" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawSingleCmBx" Grid.Row="14" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<ComboBox Name="SawSingleCmBx" Grid.Row="13" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</ComboBox>-->
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+275
-248
@@ -8,6 +8,7 @@ Public Class FrameCutPageUC
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
Friend m_ProjectMgr As ProjectMgrUC
|
||||
Private m_CurrMachine As CurrentMachine
|
||||
Friend m_FrameMachiningUC As FrameMachiningUC
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
@@ -19,20 +20,20 @@ Public Class FrameCutPageUC
|
||||
Private m_AlongAx As New List(Of String)
|
||||
' Direzione corrente
|
||||
Private m_CurrAx As Integer = 0
|
||||
' Lista per lavorazioni di sgrossatura con lama
|
||||
Private m_SawRoughingList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni di finitura con lama
|
||||
Private m_SawFinishingList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni di spatolatura con lama
|
||||
Private m_SawSideFinList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni singole con lama
|
||||
Private m_SawSingleList As New ObservableCollection(Of String)
|
||||
' Flag per disabilitare ricalcolo lavorazioni su impostazione selezione combo
|
||||
Private m_DisableCalc As Boolean = False
|
||||
' Trim iniziale della lavorazione
|
||||
Friend m_dStartTrim As Double = 0
|
||||
' Trim finale della lavorazione
|
||||
Friend m_dEndTrim As Double = 0
|
||||
'' Lista per lavorazioni di sgrossatura con lama
|
||||
'Private m_SawRoughingList As New ObservableCollection(Of String)
|
||||
'' Lista per lavorazioni di finitura con lama
|
||||
'Private m_SawFinishingList As New ObservableCollection(Of String)
|
||||
'' Lista per lavorazioni di spatolatura con lama
|
||||
'Private m_SawSideFinList As New ObservableCollection(Of String)
|
||||
'' Lista per lavorazioni singole con lama
|
||||
'Private m_SawSingleList As New ObservableCollection(Of String)
|
||||
'' Flag per disabilitare ricalcolo lavorazioni su impostazione selezione combo
|
||||
'Private m_DisableCalc As Boolean = False
|
||||
'' Trim iniziale della lavorazione
|
||||
'Friend m_dStartTrim As Double = 0
|
||||
'' Trim finale della lavorazione
|
||||
'Friend m_dEndTrim As Double = 0
|
||||
|
||||
' Costante per lavorazione non definita
|
||||
Private Const NO_MACHINING As String = "-----"
|
||||
@@ -40,20 +41,18 @@ Public Class FrameCutPageUC
|
||||
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Creazione delle Page UserControl
|
||||
m_ProjectMgr = New ProjectMgrUC
|
||||
m_FrameMachiningUC = New FrameMachiningUC
|
||||
|
||||
' Posizionamento nella griglia delle Page UserControl
|
||||
m_ProjectMgr.SetValue(Grid.RowProperty, 2)
|
||||
m_ProjectMgr.SetValue(Grid.ColumnProperty, 1)
|
||||
m_FrameMachiningUC.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
' Assegno UC a questa pagina
|
||||
FrameCutPageGrid.Children.Add(m_ProjectMgr)
|
||||
|
||||
' Associo ComboBox e Liste
|
||||
AlongAxCmBx.ItemsSource = m_AlongAx
|
||||
SawRoughingCmBx.ItemsSource = m_SawRoughingList
|
||||
SawFinishingCmBx.ItemsSource = m_SawFinishingList
|
||||
SawSideFinCmBx.ItemsSource = m_SawSideFinList
|
||||
SawSingleCmBx.ItemsSource = m_SawSingleList
|
||||
|
||||
' Imposto offset in Z dal sopra del grezzo e in XY da angolo in basso a sx
|
||||
Dim dOffsZ As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSZ, 5, m_MainWindow.GetIniFile())
|
||||
@@ -61,28 +60,16 @@ Public Class FrameCutPageUC
|
||||
Dim dOffsXY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXY, 5, m_MainWindow.GetIniFile())
|
||||
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
|
||||
|
||||
' Imposto accorciamenti iniziale e finale di lavorazione
|
||||
m_dStartTrim = GetPrivateProfileDouble(S_FRAME, K_STARTTRIM, 0, m_MainWindow.GetIniFile())
|
||||
StartTrimTxBx.Text = LenToString(m_dStartTrim, 3)
|
||||
m_dEndTrim = GetPrivateProfileDouble(S_FRAME, K_ENDTRIM, 0, m_MainWindow.GetIniFile())
|
||||
EndTrimTxBx.Text = LenToString(m_dEndTrim, 3)
|
||||
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
m_AlongAx.Add( EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||
m_AlongAx.Add( EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
||||
If GetPrivateProfileInt( S_FRAME, "EnableArc", 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
m_AlongAx.Add( "Arco")
|
||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
|
||||
If GetPrivateProfileInt(S_FRAME, "EnableArc", 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
m_AlongAx.Add("Arco")
|
||||
End If
|
||||
MirrorPartBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 7) 'Mirror cornice
|
||||
RemovePartBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 3) 'Rimuovi cornice
|
||||
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
|
||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||
SawRoughingTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 4) 'Sgrossatura
|
||||
SawFinishingTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 5) 'Finitura
|
||||
SawSideFinTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 6) 'Spatolatura
|
||||
StartTrimTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 10) 'Accorcia inizio
|
||||
EndTrimTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 11) 'Accorcia fine
|
||||
SawSingleTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 12) 'Taglio singolo
|
||||
End Sub
|
||||
|
||||
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
@@ -99,38 +86,38 @@ Public Class FrameCutPageUC
|
||||
EgtGetInfo(m_nRawId, KEY_KERF, m_dKerf)
|
||||
' Imposto direzione cornici
|
||||
UpdateAlongAxCmbBx()
|
||||
' Aggiorno liste lavorazioni disponibili
|
||||
UpdateMachiningList(MCH_MY.SAWROUGHING, m_CurrMachine.sCurrSaw, m_SawRoughingList)
|
||||
UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ALONG, m_CurrMachine.sCurrSaw, m_SawFinishingList)
|
||||
UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ACROSS, m_CurrMachine.sCurrSaw, m_SawSideFinList)
|
||||
UpdateMachiningList(MCH_MY.SAWING, m_CurrMachine.sCurrSaw, m_SawSingleList)
|
||||
' Imposto lavorazioni correnti
|
||||
m_DisableCalc = True
|
||||
If SawRoughingCmBx.Items.Contains(m_CurrMachine.sCurrSawRoughing) Then
|
||||
SawRoughingCmBx.SelectedItem = m_CurrMachine.sCurrSawRoughing
|
||||
Else
|
||||
SawRoughingCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
End If
|
||||
If SawFinishingCmBx.Items.Contains(m_CurrMachine.sCurrSawFinishing) Then
|
||||
SawFinishingCmBx.SelectedItem = m_CurrMachine.sCurrSawFinishing
|
||||
Else
|
||||
SawFinishingCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
End If
|
||||
If SawSideFinCmBx.Items.Contains(m_CurrMachine.sCurrSawSideFinishing) Then
|
||||
SawSideFinCmBx.SelectedItem = m_CurrMachine.sCurrSawSideFinishing
|
||||
Else
|
||||
SawSideFinCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
End If
|
||||
If SawSingleCmBx.Items.Contains(m_CurrMachine.sCurrSawSingle) Then
|
||||
SawSingleCmBx.SelectedItem = m_CurrMachine.sCurrSawSingle
|
||||
Else
|
||||
SawSingleCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
End If
|
||||
m_DisableCalc = False
|
||||
'' Aggiorno liste lavorazioni disponibili
|
||||
'UpdateMachiningList(MCH_MY.SAWROUGHING, m_CurrMachine.sCurrSaw, m_SawRoughingList)
|
||||
'UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ALONG, m_CurrMachine.sCurrSaw, m_SawFinishingList)
|
||||
'UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ACROSS, m_CurrMachine.sCurrSaw, m_SawSideFinList)
|
||||
'UpdateMachiningList(MCH_MY.SAWING, m_CurrMachine.sCurrSaw, m_SawSingleList)
|
||||
'' Imposto lavorazioni correnti
|
||||
'm_DisableCalc = True
|
||||
'If SawRoughingCmBx.Items.Contains(m_CurrMachine.sCurrSawRoughing) Then
|
||||
' SawRoughingCmBx.SelectedItem = m_CurrMachine.sCurrSawRoughing
|
||||
'Else
|
||||
' SawRoughingCmBx.SelectedItem = NO_MACHINING
|
||||
' m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
'End If
|
||||
'If SawFinishingCmBx.Items.Contains(m_CurrMachine.sCurrSawFinishing) Then
|
||||
' SawFinishingCmBx.SelectedItem = m_CurrMachine.sCurrSawFinishing
|
||||
'Else
|
||||
' SawFinishingCmBx.SelectedItem = NO_MACHINING
|
||||
' m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
'End If
|
||||
'If SawSideFinCmBx.Items.Contains(m_CurrMachine.sCurrSawSideFinishing) Then
|
||||
' SawSideFinCmBx.SelectedItem = m_CurrMachine.sCurrSawSideFinishing
|
||||
'Else
|
||||
' SawSideFinCmBx.SelectedItem = NO_MACHINING
|
||||
' m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
'End If
|
||||
'If SawSingleCmBx.Items.Contains(m_CurrMachine.sCurrSawSingle) Then
|
||||
' SawSingleCmBx.SelectedItem = m_CurrMachine.sCurrSawSingle
|
||||
'Else
|
||||
' SawSingleCmBx.SelectedItem = NO_MACHINING
|
||||
' m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
'End If
|
||||
'm_DisableCalc = False
|
||||
' Se macchina fotografica abilitata
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then
|
||||
PhotoBtn.IsEnabled = True
|
||||
@@ -142,7 +129,7 @@ Public Class FrameCutPageUC
|
||||
' Aggiorno geometria
|
||||
UpdateFrames()
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
AddFrameMachinings(m_FrameMachiningUC.m_dStartTrim, m_FrameMachiningUC.m_dEndTrim)
|
||||
End If
|
||||
' Abilito visualizzazione delle lavorazioni
|
||||
EgtSetCurrPhase(1)
|
||||
@@ -158,91 +145,109 @@ Public Class FrameCutPageUC
|
||||
If EgtGetInfo(nPartId, INFO_FRAME_DIR, nDir) Then m_CurrAx = nDir
|
||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||
AlongAxCmBx.IsEnabled = False
|
||||
' Altrimenti, abilito cambio direzione
|
||||
' Altrimenti, abilito cambio direzione
|
||||
Else
|
||||
AlongAxCmBx.SelectedIndex = m_CurrAx
|
||||
AlongAxCmBx.IsEnabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateMachiningList(MachiningType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' Pulisco la lista
|
||||
MachiningList.Clear()
|
||||
' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
Dim sTuuid As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
If sTool = CurrTool And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
End While
|
||||
' Aggiungo la lavorazione nulla
|
||||
MachiningList.Add(NO_MACHINING)
|
||||
Private Sub AlongAxCmBx_SelectionChanged() Handles AlongAxCmBx.SelectionChanged
|
||||
Select Case AlongAxCmBx.SelectedIndex
|
||||
Case 0, 1 'Lungo X, Lungo Y
|
||||
SelectSectionBtn.Visibility = Windows.Visibility.Collapsed
|
||||
SelectGuideBtn.Visibility = Windows.Visibility.Collapsed
|
||||
Case 2 'Arco
|
||||
'SelectSectionBtn.Visibility = Windows.Visibility.Visible
|
||||
'SelectGuideBtn.Visibility = Windows.Visibility.Visible
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateMachiningList(MachiningType As Integer, MachiningSubType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' Pulisco la lista
|
||||
MachiningList.Clear()
|
||||
' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
Dim SubType As Integer
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, SubType)
|
||||
Dim sTuuid As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
If sTool = CurrTool And SubType = MachiningSubType And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
End While
|
||||
' Aggiungo la lavorazione nulla
|
||||
MachiningList.Add(NO_MACHINING)
|
||||
End Sub
|
||||
'Private Sub UpdateMachiningList(MachiningType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' ' Pulisco la lista
|
||||
' MachiningList.Clear()
|
||||
' ' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
' Dim MachiningName As String = String.Empty
|
||||
' Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
' While bFound
|
||||
' EgtMdbSetCurrMachining(MachiningName)
|
||||
' Dim sTuuid As String = String.Empty
|
||||
' Dim sTool As String = String.Empty
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
' EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
' If sTool = CurrTool And VerifyMatThickCompatibility() Then
|
||||
' MachiningList.Add(MachiningName)
|
||||
' End If
|
||||
' bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
' End While
|
||||
' ' Aggiungo la lavorazione nulla
|
||||
' MachiningList.Add(NO_MACHINING)
|
||||
'End Sub
|
||||
|
||||
Private Function VerifyMatThickCompatibility() As Boolean
|
||||
If Not IsNothing(m_CurrMachine.CurrMat) Then
|
||||
Dim SysNotes As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
If SysNotes <> String.Empty Then
|
||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
SysNotes = String.Empty
|
||||
For Each Material In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param(0) = m_CurrMachine.CurrMat.nId.ToString() Then
|
||||
Dim dRawHeight = GetRawHeight()
|
||||
Dim MatMinH As Double = 0
|
||||
StringToDouble(Param(1), MatMinH)
|
||||
Dim MatMaxH As Double = 0
|
||||
StringToDouble(Param(2), MatMaxH)
|
||||
If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
'Private Sub UpdateMachiningList(MachiningType As Integer, MachiningSubType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' ' Pulisco la lista
|
||||
' MachiningList.Clear()
|
||||
' ' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
' Dim MachiningName As String = String.Empty
|
||||
' Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
' While bFound
|
||||
' EgtMdbSetCurrMachining(MachiningName)
|
||||
' Dim SubType As Integer
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, SubType)
|
||||
' Dim sTuuid As String = String.Empty
|
||||
' Dim sTool As String = String.Empty
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
' EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
' If sTool = CurrTool And SubType = MachiningSubType And VerifyMatThickCompatibility() Then
|
||||
' MachiningList.Add(MachiningName)
|
||||
' End If
|
||||
' bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
' End While
|
||||
' ' Aggiungo la lavorazione nulla
|
||||
' MachiningList.Add(NO_MACHINING)
|
||||
'End Sub
|
||||
|
||||
'Private Function VerifyMatThickCompatibility() As Boolean
|
||||
' If Not IsNothing(m_CurrMachine.CurrMat) Then
|
||||
' Dim SysNotes As String = String.Empty
|
||||
' EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
' If SysNotes <> String.Empty Then
|
||||
' Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
' SysNotes = String.Empty
|
||||
' For Each Material In MachiningMaterials
|
||||
' Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
' If Param(0) = m_CurrMachine.CurrMat.nId.ToString() Then
|
||||
' Dim dRawHeight = GetRawHeight()
|
||||
' Dim MatMinH As Double = 0
|
||||
' StringToDouble(Param(1), MatMinH)
|
||||
' Dim MatMaxH As Double = 0
|
||||
' StringToDouble(Param(2), MatMaxH)
|
||||
' If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then
|
||||
' Return True
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Return False
|
||||
' Else
|
||||
' Return True
|
||||
' End If
|
||||
' Else
|
||||
' Return True
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
Private Sub FrameCutPage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Nascondo tutte le lavorazioni
|
||||
HideAllMachinings()
|
||||
' se aperta pagina lavorazioni la chiudo
|
||||
If MachiningBtn.IsChecked Then
|
||||
LeftGrid.Children.Remove(m_FrameMachiningUC)
|
||||
MachiningBtn.IsChecked = False
|
||||
End If
|
||||
|
||||
' La dichiaro non attiva
|
||||
m_bActive = False
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||
@@ -323,7 +328,7 @@ Public Class FrameCutPageUC
|
||||
' Aggiorno geometria
|
||||
UpdateFrames()
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
AddFrameMachinings(m_FrameMachiningUC.m_dStartTrim, m_FrameMachiningUC.m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
' Salvo offset in Z dal sopra del grezzo e in XY da angolo in basso a sx
|
||||
@@ -358,17 +363,17 @@ Public Class FrameCutPageUC
|
||||
' Per arco
|
||||
If m_CurrAx = 2 Then
|
||||
' Inverto senso
|
||||
EgtInvertCurve( nCrvId)
|
||||
EgtInvertCurve(nCrvId)
|
||||
' Porto l'inizio della curva a X0 locale
|
||||
ChangeCurveStartToX0( nCrvId)
|
||||
ChangeCurveStartToX0(nCrvId)
|
||||
End If
|
||||
' Aggiorno la cornice
|
||||
UpdateFrame( nId)
|
||||
UpdateFrame(nId)
|
||||
' Passo al successivo selezionato
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
AddFrameMachinings(m_FrameMachiningUC.m_dStartTrim, m_FrameMachiningUC.m_dEndTrim)
|
||||
' Aggiorno vista
|
||||
EgtDraw()
|
||||
End Sub
|
||||
@@ -403,87 +408,101 @@ Public Class FrameCutPageUC
|
||||
nId = EgtGetFirstPart()
|
||||
End While
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
AddFrameMachinings(m_FrameMachiningUC.m_dStartTrim, m_FrameMachiningUC.m_dEndTrim)
|
||||
' Aggiorno vista
|
||||
EgtDraw()
|
||||
' Aggiorno combo per direzioni
|
||||
UpdateAlongAxCmbBx()
|
||||
End Sub
|
||||
|
||||
Private Sub SawRoughingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawRoughingCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawRoughingCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di sgrossatura con lama
|
||||
If SawRoughingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawRoughing = SawRoughingCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawRoughing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
Private Sub SelectSectionBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectSectionBtn.Click
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut
|
||||
End Sub
|
||||
|
||||
Private Sub SawFinishingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawFinishingCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawFinishingCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di finitura con lama
|
||||
If SawFinishingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawFinishing = SawFinishingCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
Private Sub SelectGuideBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectGuideBtn.Click
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut
|
||||
End Sub
|
||||
|
||||
Private Sub SawSideFinCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSideFinCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawSideFinCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di finitura con lama
|
||||
If SawSideFinCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawSideFinishing = SawSideFinCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawSideFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
'Private Sub SawRoughingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawRoughingCmBx.SelectionChanged
|
||||
' If m_DisableCalc Or IsNothing(SawRoughingCmBx.SelectedItem) Then Return
|
||||
' ' La imposto come lavorazione corrente di sgrossatura con lama
|
||||
' If SawRoughingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
' m_CurrMachine.sCurrSawRoughing = SawRoughingCmBx.SelectedItem.ToString()
|
||||
' Else
|
||||
' m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
' End If
|
||||
' ' La inserisco
|
||||
' AddFrameSawRoughing(m_dStartTrim, m_dEndTrim)
|
||||
' ' Aggiorno visualizzazione
|
||||
' EgtDraw()
|
||||
'End Sub
|
||||
|
||||
Private Sub SawSingleCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSingleCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawSingleCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di taglio singolo con lama
|
||||
If SawSingleCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawSingle = SawSingleCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawSingle()
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
'Private Sub SawFinishingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawFinishingCmBx.SelectionChanged
|
||||
' If m_DisableCalc Or IsNothing(SawFinishingCmBx.SelectedItem) Then Return
|
||||
' ' La imposto come lavorazione corrente di finitura con lama
|
||||
' If SawFinishingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
' m_CurrMachine.sCurrSawFinishing = SawFinishingCmBx.SelectedItem.ToString()
|
||||
' Else
|
||||
' m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
' End If
|
||||
' ' La inserisco
|
||||
' AddFrameSawFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' ' Aggiorno visualizzazione
|
||||
' EgtDraw()
|
||||
'End Sub
|
||||
|
||||
Private Sub XXTrimTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StartTrimTxBx.EgtClosed, EndTrimTxBx.EgtClosed
|
||||
' Trim iniziale
|
||||
Dim dStartTrim As Double = 0
|
||||
If StringToLen(StartTrimTxBx.Text, dStartTrim) Then
|
||||
m_dStartTrim = dStartTrim
|
||||
WritePrivateProfileString(S_FRAME, K_STARTTRIM, DoubleToString(dStartTrim, 3), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
' Trim finale
|
||||
Dim dEndTrim As Double = 0
|
||||
If StringToLen(EndTrimTxBx.Text, dEndTrim) Then
|
||||
m_dEndTrim = dEndTrim
|
||||
WritePrivateProfileString(S_FRAME, K_ENDTRIM, DoubleToString(dEndTrim, 3), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
'Private Sub SawSideFinCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSideFinCmBx.SelectionChanged
|
||||
' If m_DisableCalc Or IsNothing(SawSideFinCmBx.SelectedItem) Then Return
|
||||
' ' La imposto come lavorazione corrente di finitura con lama
|
||||
' If SawSideFinCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
' m_CurrMachine.sCurrSawSideFinishing = SawSideFinCmBx.SelectedItem.ToString()
|
||||
' Else
|
||||
' m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
' End If
|
||||
' ' La inserisco
|
||||
' AddFrameSawSideFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' ' Aggiorno visualizzazione
|
||||
' EgtDraw()
|
||||
'End Sub
|
||||
|
||||
'Private Sub SawSingleCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSingleCmBx.SelectionChanged
|
||||
' If m_DisableCalc Or IsNothing(SawSingleCmBx.SelectedItem) Then Return
|
||||
' ' La imposto come lavorazione corrente di taglio singolo con lama
|
||||
' If SawSingleCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
' m_CurrMachine.sCurrSawSingle = SawSingleCmBx.SelectedItem.ToString()
|
||||
' Else
|
||||
' m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
' End If
|
||||
' ' La inserisco
|
||||
' AddFrameSawSingle()
|
||||
' ' Aggiorno visualizzazione
|
||||
' EgtDraw()
|
||||
'End Sub
|
||||
|
||||
'Private Sub XXTrimTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StartTrimTxBx.EgtClosed, EndTrimTxBx.EgtClosed
|
||||
' ' Trim iniziale
|
||||
' Dim dStartTrim As Double = 0
|
||||
' If StringToLen(StartTrimTxBx.Text, dStartTrim) Then
|
||||
' m_dStartTrim = dStartTrim
|
||||
' WritePrivateProfileString(S_FRAME, K_STARTTRIM, DoubleToString(dStartTrim, 3), m_MainWindow.GetIniFile())
|
||||
' End If
|
||||
' ' Trim finale
|
||||
' Dim dEndTrim As Double = 0
|
||||
' If StringToLen(EndTrimTxBx.Text, dEndTrim) Then
|
||||
' m_dEndTrim = dEndTrim
|
||||
' WritePrivateProfileString(S_FRAME, K_ENDTRIM, DoubleToString(dEndTrim, 3), m_MainWindow.GetIniFile())
|
||||
' End If
|
||||
' ' Ricalcolo lavorazioni
|
||||
' AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
' ' Aggiorno visualizzazione
|
||||
' EgtDraw()
|
||||
'End Sub
|
||||
|
||||
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
@@ -492,7 +511,7 @@ Public Class FrameCutPageUC
|
||||
If Not m_MainWindow.m_Camera.CameraClick() Then
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90313)) 'Fotografia non riuscita
|
||||
End If
|
||||
' Altrimenti lancio browser di immagini
|
||||
' Altrimenti lancio browser di immagini
|
||||
Else
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PhotoPage)
|
||||
@@ -516,6 +535,14 @@ Public Class FrameCutPageUC
|
||||
m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachiningBtn.Click
|
||||
If MachiningBtn.IsChecked Then
|
||||
LeftGrid.Children.Add(m_FrameMachiningUC)
|
||||
Else
|
||||
LeftGrid.Children.Remove(m_FrameMachiningUC)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||
' Aggiorno direzione corrente
|
||||
m_CurrAx = AlongAxCmBx.SelectedIndex
|
||||
@@ -554,10 +581,10 @@ Public Class FrameCutPageUC
|
||||
Dim nSectIds(0) As Integer
|
||||
nSectIds(0) = nCrvId
|
||||
Dim nSurfId As Integer = EgtCreateSurfTmByRegionExtrusion(nSurfLayId, 1, nSectIds, vtExtr, EPS_STM, GDB_RT.GLOB)
|
||||
' altrimenti cornice ad arco
|
||||
' altrimenti cornice ad arco
|
||||
Else
|
||||
' Porto l'inizio della curva a X0 locale
|
||||
ChangeCurveStartToX0( nCrvId)
|
||||
ChangeCurveStartToX0(nCrvId)
|
||||
' Porto la sezione nel piano YZ
|
||||
EgtChangeGroupFrame(nSectLayId, New Frame3d(Point3d.ORIG, Frame3d.TYPE.LEFT))
|
||||
' Creo layer per la curva guida
|
||||
@@ -566,27 +593,27 @@ Public Class FrameCutPageUC
|
||||
EgtSetColor(nGuideLayId, COL_FRAME())
|
||||
' Creo la curva guida (per ora arco)
|
||||
Dim ptStart As Point3d : EgtStartPoint(nCrvId, nGuideLayId, ptStart)
|
||||
Dim dRad As Double = GetPrivateProfileDouble( S_FRAME, "ArcRad", 400, m_MainWindow.GetIniFile())
|
||||
Dim dAngCenDeg As Double = Math.Abs( GetPrivateProfileDouble( S_FRAME, "ArcAng", 90, m_MainWindow.GetIniFile()))
|
||||
Dim dRad As Double = GetPrivateProfileDouble(S_FRAME, "ArcRad", 400, m_MainWindow.GetIniFile())
|
||||
Dim dAngCenDeg As Double = Math.Abs(GetPrivateProfileDouble(S_FRAME, "ArcAng", 90, m_MainWindow.GetIniFile()))
|
||||
If dAngCenDeg > 360 Then dAngCenDeg = 360
|
||||
Dim dAngIniDeg As Double = If( dAngCenDeg < 180, -90 - dAngCenDeg / 2, -dAngCenDeg)
|
||||
Dim ptCen As Point3d = ptStart - Vector3d.FromPolar( dRad, dAngIniDeg)
|
||||
Dim nGuideId As Integer = EgtCreateArc( nGuideLayId, ptCen, dRad, dAngIniDeg, dAngCenDeg, 0)
|
||||
Dim dAngIniDeg As Double = If(dAngCenDeg < 180, -90 - dAngCenDeg / 2, -dAngCenDeg)
|
||||
Dim ptCen As Point3d = ptStart - Vector3d.FromPolar(dRad, dAngIniDeg)
|
||||
Dim nGuideId As Integer = EgtCreateArc(nGuideLayId, ptCen, dRad, dAngIniDeg, dAngCenDeg, 0)
|
||||
' Creo layer per la superficie
|
||||
Dim nSurfLayId As Integer = EgtCreateGroup(nPartId, New Frame3d())
|
||||
EgtSetName(nSurfLayId, NAME_SURF)
|
||||
EgtSetColor(nSurfLayId, COL_FRAME())
|
||||
' Creo la superficie : screw più eventuali tappi (per ora)
|
||||
Dim dSectRotDeg As Double = 90 + dAngIniDeg
|
||||
EgtRotate( nSectLayId, ptStart, Vector3d.Z_AX, dSectRotDeg, GDB_RT.LOC)
|
||||
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX, dSectRotDeg, GDB_RT.LOC)
|
||||
Dim nScrId As Integer = EgtCreateSurfTmByScrewing(nSurfLayId, nCrvId, ptCen, Vector3d.Z_AX, dAngCenDeg, 0, EPS_STM, GDB_RT.LOC)
|
||||
' Se angolo della curva guida inferiore a 360 deg, aggiungo i tappi
|
||||
If dAngCenDeg < 360 Then
|
||||
Dim nT1Id As Integer = EgtCreateSurfTmByFlatContour( nSurfLayId, nCrvId, EPS_STM)
|
||||
Dim nT2Id As Integer = EgtCopy( nT1Id, nSurfLayId)
|
||||
EgtRotate( nT2Id, ptCen, Vector3d.Z_AX, dAngCenDeg, GDB_RT.LOC)
|
||||
EgtInvertSurface( nT2Id)
|
||||
Dim nSurfId As Integer = EgtCreateSurfTmBySewing( nSurfLayId, 3, { nScrId, nT1Id, nT2Id}, true)
|
||||
Dim nT1Id As Integer = EgtCreateSurfTmByFlatContour(nSurfLayId, nCrvId, EPS_STM)
|
||||
Dim nT2Id As Integer = EgtCopy(nT1Id, nSurfLayId)
|
||||
EgtRotate(nT2Id, ptCen, Vector3d.Z_AX, dAngCenDeg, GDB_RT.LOC)
|
||||
EgtInvertSurface(nT2Id)
|
||||
Dim nSurfId As Integer = EgtCreateSurfTmBySewing(nSurfLayId, 3, {nScrId, nT1Id, nT2Id}, True)
|
||||
End If
|
||||
End If
|
||||
' Assegno nome e direzione a pezzo
|
||||
@@ -654,7 +681,7 @@ Public Class FrameCutPageUC
|
||||
Dim nSectIds(0) As Integer
|
||||
nSectIds(0) = nCrvId
|
||||
nSurfId = EgtCreateSurfTmByRegionExtrusion(nSurfLayId, 1, nSectIds, vtExtr, EPS_STM, GDB_RT.GLOB)
|
||||
' altrimenti cornice ad arco
|
||||
' altrimenti cornice ad arco
|
||||
Else
|
||||
' Porto la sezione nel piano YZ
|
||||
EgtChangeGroupFrame(nSectLayId, New Frame3d(Point3d.ORIG, Frame3d.TYPE.LEFT))
|
||||
@@ -669,11 +696,11 @@ Public Class FrameCutPageUC
|
||||
EgtSetColor(nGuideLayId, COL_FRAME())
|
||||
' Creo la curva guida (per ora arco)
|
||||
Dim ptStart As Point3d : EgtStartPoint(nCrvId, nGuideLayId, ptStart)
|
||||
Dim dRad As Double = GetPrivateProfileDouble( S_FRAME, "ArcRad", 400, m_MainWindow.GetIniFile())
|
||||
Dim dAngCenDeg As Double = GetPrivateProfileDouble( S_FRAME, "ArcAng", 90, m_MainWindow.GetIniFile())
|
||||
Dim ptCen As Point3d = ptStart + Vector3d.FromPolar( dRad, 90 - dAngCenDeg / 2)
|
||||
Dim ptEnd As Point3d = ptCen + Vector3d.FromPolar( dRad, - 90 + dAngCenDeg / 2)
|
||||
Dim nGuideId As Integer = EgtCreateArcC2P( nGuideLayId, ptCen, ptStart, ptEnd)
|
||||
Dim dRad As Double = GetPrivateProfileDouble(S_FRAME, "ArcRad", 400, m_MainWindow.GetIniFile())
|
||||
Dim dAngCenDeg As Double = GetPrivateProfileDouble(S_FRAME, "ArcAng", 90, m_MainWindow.GetIniFile())
|
||||
Dim ptCen As Point3d = ptStart + Vector3d.FromPolar(dRad, 90 - dAngCenDeg / 2)
|
||||
Dim ptEnd As Point3d = ptCen + Vector3d.FromPolar(dRad, -90 + dAngCenDeg / 2)
|
||||
Dim nGuideId As Integer = EgtCreateArcC2P(nGuideLayId, ptCen, ptStart, ptEnd)
|
||||
' Recupero layer per la superficie
|
||||
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
|
||||
If nSurfLayId = GDB_ID.NULL Then
|
||||
@@ -684,13 +711,13 @@ Public Class FrameCutPageUC
|
||||
End If
|
||||
EgtSetColor(nSurfLayId, COL_FRAME())
|
||||
' Creo la superficie : screw più tappi (per ora)
|
||||
EgtRotate( nSectLayId, Point3d.ORIG, Vector3d.Z_AX, - dAngCenDeg / 2, GDB_RT.LOC)
|
||||
EgtRotate(nSectLayId, Point3d.ORIG, Vector3d.Z_AX, -dAngCenDeg / 2, GDB_RT.LOC)
|
||||
Dim nScrId As Integer = EgtCreateSurfTmByScrewing(nSurfLayId, nCrvId, ptCen, Vector3d.Z_AX, dAngCenDeg, 0, EPS_STM, GDB_RT.LOC)
|
||||
Dim nT1Id As Integer = EgtCreateSurfTmByFlatContour( nSurfLayId, nCrvId, EPS_STM)
|
||||
Dim nT2Id As Integer = EgtCopy( nT1Id, nSurfLayId)
|
||||
EgtRotate( nT2Id, ptCen, Vector3d.Z_AX, dAngCenDeg, GDB_RT.LOC)
|
||||
EgtInvertSurface( nT2Id)
|
||||
nSurfId = EgtCreateSurfTmBySewing( nSurfLayId, 3, { nScrId, nT1Id, nT2Id}, true)
|
||||
Dim nT1Id As Integer = EgtCreateSurfTmByFlatContour(nSurfLayId, nCrvId, EPS_STM)
|
||||
Dim nT2Id As Integer = EgtCopy(nT1Id, nSurfLayId)
|
||||
EgtRotate(nT2Id, ptCen, Vector3d.Z_AX, dAngCenDeg, GDB_RT.LOC)
|
||||
EgtInvertSurface(nT2Id)
|
||||
nSurfId = EgtCreateSurfTmBySewing(nSurfLayId, 3, {nScrId, nT1Id, nT2Id}, True)
|
||||
End If
|
||||
' Assegno nome e direzione a pezzo
|
||||
EgtSetName(nPartId, NAME_FRAME)
|
||||
@@ -793,23 +820,23 @@ Public Class FrameCutPageUC
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ChangeCurveStartToX0( nCrvId As Integer) As Boolean
|
||||
Dim ptStart As Point3d : EgtStartPoint( nCrvId, ptStart)
|
||||
Dim dUs, dUe As double
|
||||
EgtCurveDomain( nCrvId, dUs, dUe)
|
||||
Private Function ChangeCurveStartToX0(nCrvId As Integer) As Boolean
|
||||
Dim ptStart As Point3d : EgtStartPoint(nCrvId, ptStart)
|
||||
Dim dUs, dUe As Double
|
||||
EgtCurveDomain(nCrvId, dUs, dUe)
|
||||
Dim dU As Double = dUs
|
||||
While dU < dUe + EPS_ZERO
|
||||
Dim ptCurr As Point3d
|
||||
EgtAtParamPoint( nCrvId, dU, ptCurr)
|
||||
If Math.Abs( ptCurr.x) < Math.Abs( ptStart.x) Then
|
||||
EgtAtParamPoint(nCrvId, dU, ptCurr)
|
||||
If Math.Abs(ptCurr.x) < Math.Abs(ptStart.x) Then
|
||||
ptStart = ptCurr
|
||||
End If
|
||||
dU += 1
|
||||
End While
|
||||
EgtChangeClosedCurveStartPoint( nCrvId, ptStart)
|
||||
If Math.Abs( ptStart.x) > EPS_SMALL Then
|
||||
EgtMove( nCrvId, New Vector3d( -ptStart.x, 0, 0))
|
||||
End If
|
||||
EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
|
||||
If Math.Abs(ptStart.x) > EPS_SMALL Then
|
||||
EgtMove(nCrvId, New Vector3d(-ptStart.x, 0, 0))
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -850,7 +877,7 @@ Public Class FrameCutPageUC
|
||||
ptIns.y = m_dKerf
|
||||
End If
|
||||
Else
|
||||
If m_CurrAx = 0 Or m_CurrAx =2 Then
|
||||
If m_CurrAx = 0 Or m_CurrAx = 2 Then
|
||||
ptIns.x = m_dKerf
|
||||
ptIns.y = OtherBox.Max().y - m_RawBox.Min().y + dMinDist
|
||||
Else
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<UserControl x:Class="FrameMachiningUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="Self"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:OmagCUT="clr-namespace:OmagCUT"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||
|
||||
<Grid Grid.Row="1" Background="{StaticResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.4*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.4*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.4*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.4*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="SawRoughingTxBl" Grid.Row="0" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawRoughingCmBx" Grid.Row="1" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="SawFinishingTxBl" Grid.Row="2" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawFinishingCmBx" Grid.Row="3" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="SawSideFinTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawSideFinCmBx" Grid.Row="5" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="StartTrimTxBl" Grid.Row="6" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="StartTrimTxBx" Grid.Column="2" Grid.Row="6" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="EndTrimTxBl" Grid.Row="7" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="EndTrimTxBx" Grid.Column="2" Grid.Row="7" Width="50"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="SawSingleTxBl" Grid.Row="8" Grid.ColumnSpan="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||
|
||||
<ComboBox Name="SawSingleCmBx" Grid.Row="9" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Width="200" MaxDropDownHeight="300">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,240 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class FrameMachiningUC
|
||||
|
||||
' Riferimenti a pagine
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
Friend m_ProjectMgr As ProjectMgrUC
|
||||
Private m_CurrMachine As CurrentMachine
|
||||
Private m_FrameCutPageUC As FrameCutPageUC
|
||||
|
||||
' Lista per lavorazioni di sgrossatura con lama
|
||||
Private m_SawRoughingList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni di finitura con lama
|
||||
Private m_SawFinishingList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni di spatolatura con lama
|
||||
Private m_SawSideFinList As New ObservableCollection(Of String)
|
||||
' Lista per lavorazioni singole con lama
|
||||
Private m_SawSingleList As New ObservableCollection(Of String)
|
||||
' Flag per disabilitare ricalcolo lavorazioni su impostazione selezione combo
|
||||
Private m_DisableCalc As Boolean = False
|
||||
' Trim iniziale della lavorazione
|
||||
Friend m_dStartTrim As Double = 0
|
||||
' Trim finale della lavorazione
|
||||
Friend m_dEndTrim As Double = 0
|
||||
|
||||
' Costante per lavorazione non definita
|
||||
Private Const NO_MACHINING As String = "-----"
|
||||
|
||||
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Associo ComboBox e Liste
|
||||
SawRoughingCmBx.ItemsSource = m_SawRoughingList
|
||||
SawFinishingCmBx.ItemsSource = m_SawFinishingList
|
||||
SawSideFinCmBx.ItemsSource = m_SawSideFinList
|
||||
SawSingleCmBx.ItemsSource = m_SawSingleList
|
||||
|
||||
' Imposto accorciamenti iniziale e finale di lavorazione
|
||||
m_dStartTrim = GetPrivateProfileDouble(S_FRAME, K_STARTTRIM, 0, m_MainWindow.GetIniFile())
|
||||
StartTrimTxBx.Text = LenToString(m_dStartTrim, 3)
|
||||
m_dEndTrim = GetPrivateProfileDouble(S_FRAME, K_ENDTRIM, 0, m_MainWindow.GetIniFile())
|
||||
EndTrimTxBx.Text = LenToString(m_dEndTrim, 3)
|
||||
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
SawRoughingTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 4) 'Sgrossatura
|
||||
SawFinishingTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 5) 'Finitura
|
||||
SawSideFinTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 6) 'Spatolatura
|
||||
StartTrimTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 10) 'Accorcia inizio
|
||||
EndTrimTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 11) 'Accorcia fine
|
||||
SawSingleTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 12) 'Taglio singolo
|
||||
End Sub
|
||||
|
||||
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_FrameCutPageUC = m_MainWindow.m_FrameCutPageUC
|
||||
m_CurrMachine = m_MainWindow.m_CurrentMachine
|
||||
' Aggiorno liste lavorazioni disponibili
|
||||
UpdateMachiningList(MCH_MY.SAWROUGHING, m_CurrMachine.sCurrSaw, m_SawRoughingList)
|
||||
UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ALONG, m_CurrMachine.sCurrSaw, m_SawFinishingList)
|
||||
UpdateMachiningList(MCH_MY.SAWFINISHING, MCH_SAWFIN_SUB.ACROSS, m_CurrMachine.sCurrSaw, m_SawSideFinList)
|
||||
UpdateMachiningList(MCH_MY.SAWING, m_CurrMachine.sCurrSaw, m_SawSingleList)
|
||||
' Imposto lavorazioni correnti
|
||||
m_DisableCalc = True
|
||||
If SawRoughingCmBx.Items.Contains(m_CurrMachine.sCurrSawRoughing) Then
|
||||
SawRoughingCmBx.SelectedItem = m_CurrMachine.sCurrSawRoughing
|
||||
Else
|
||||
SawRoughingCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
End If
|
||||
If SawFinishingCmBx.Items.Contains(m_CurrMachine.sCurrSawFinishing) Then
|
||||
SawFinishingCmBx.SelectedItem = m_CurrMachine.sCurrSawFinishing
|
||||
Else
|
||||
SawFinishingCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
End If
|
||||
If SawSideFinCmBx.Items.Contains(m_CurrMachine.sCurrSawSideFinishing) Then
|
||||
SawSideFinCmBx.SelectedItem = m_CurrMachine.sCurrSawSideFinishing
|
||||
Else
|
||||
SawSideFinCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
End If
|
||||
If SawSingleCmBx.Items.Contains(m_CurrMachine.sCurrSawSingle) Then
|
||||
SawSingleCmBx.SelectedItem = m_CurrMachine.sCurrSawSingle
|
||||
Else
|
||||
SawSingleCmBx.SelectedItem = NO_MACHINING
|
||||
m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
End If
|
||||
m_DisableCalc = False
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateMachiningList(MachiningType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' Pulisco la lista
|
||||
MachiningList.Clear()
|
||||
' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
Dim sTuuid As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
If sTool = CurrTool And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
End While
|
||||
' Aggiungo la lavorazione nulla
|
||||
MachiningList.Add(NO_MACHINING)
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateMachiningList(MachiningType As Integer, MachiningSubType As Integer, CurrTool As String, ByRef MachiningList As ObservableCollection(Of String))
|
||||
' Pulisco la lista
|
||||
MachiningList.Clear()
|
||||
' Cerco tutte le lavorazioni che utilizzano l'utensile corrente e le aggiungo alla lista
|
||||
Dim MachiningName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtMdbGetFirstMachining(MachiningType, MachiningName)
|
||||
While bFound
|
||||
EgtMdbSetCurrMachining(MachiningName)
|
||||
Dim SubType As Integer
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SUBTYPE, SubType)
|
||||
Dim sTuuid As String = String.Empty
|
||||
Dim sTool As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
||||
EgtTdbGetToolFromUUID(sTuuid, sTool)
|
||||
If sTool = CurrTool And SubType = MachiningSubType And VerifyMatThickCompatibility() Then
|
||||
MachiningList.Add(MachiningName)
|
||||
End If
|
||||
bFound = EgtMdbGetNextMachining(MachiningType, MachiningName)
|
||||
End While
|
||||
' Aggiungo la lavorazione nulla
|
||||
MachiningList.Add(NO_MACHINING)
|
||||
End Sub
|
||||
|
||||
Private Function VerifyMatThickCompatibility() As Boolean
|
||||
If Not IsNothing(m_CurrMachine.CurrMat) Then
|
||||
Dim SysNotes As String = String.Empty
|
||||
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
||||
If SysNotes <> String.Empty Then
|
||||
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
||||
SysNotes = String.Empty
|
||||
For Each Material In MachiningMaterials
|
||||
Dim Param() As String = Material.Split(",".ToCharArray)
|
||||
If Param(0) = m_CurrMachine.CurrMat.nId.ToString() Then
|
||||
Dim dRawHeight = GetRawHeight()
|
||||
Dim MatMinH As Double = 0
|
||||
StringToDouble(Param(1), MatMinH)
|
||||
Dim MatMaxH As Double = 0
|
||||
StringToDouble(Param(2), MatMaxH)
|
||||
If dRawHeight > MatMinH - EPS_SMALL And dRawHeight < MatMaxH + EPS_SMALL Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub SawRoughingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawRoughingCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawRoughingCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di sgrossatura con lama
|
||||
If SawRoughingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawRoughing = SawRoughingCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawRoughing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawRoughing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SawFinishingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawFinishingCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawFinishingCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di finitura con lama
|
||||
If SawFinishingCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawFinishing = SawFinishingCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawFinishing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SawSideFinCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSideFinCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawSideFinCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di finitura con lama
|
||||
If SawSideFinCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawSideFinishing = SawSideFinCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawSideFinishing = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawSideFinishing(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SawSingleCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SawSingleCmBx.SelectionChanged
|
||||
If m_DisableCalc Or IsNothing(SawSingleCmBx.SelectedItem) Then Return
|
||||
' La imposto come lavorazione corrente di taglio singolo con lama
|
||||
If SawSingleCmBx.SelectedItem.ToString() <> NO_MACHINING Then
|
||||
m_CurrMachine.sCurrSawSingle = SawSingleCmBx.SelectedItem.ToString()
|
||||
Else
|
||||
m_CurrMachine.sCurrSawSingle = String.Empty
|
||||
End If
|
||||
' La inserisco
|
||||
AddFrameSawSingle()
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub XXTrimTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StartTrimTxBx.EgtClosed, EndTrimTxBx.EgtClosed
|
||||
' Trim iniziale
|
||||
Dim dStartTrim As Double = 0
|
||||
If StringToLen(StartTrimTxBx.Text, dStartTrim) Then
|
||||
m_dStartTrim = dStartTrim
|
||||
WritePrivateProfileString(S_FRAME, K_STARTTRIM, DoubleToString(dStartTrim, 3), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
' Trim finale
|
||||
Dim dEndTrim As Double = 0
|
||||
If StringToLen(EndTrimTxBx.Text, dEndTrim) Then
|
||||
m_dEndTrim = dEndTrim
|
||||
WritePrivateProfileString(S_FRAME, K_ENDTRIM, DoubleToString(dEndTrim, 3), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_dStartTrim, m_dEndTrim)
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -747,7 +747,7 @@ Public Class ImportPageUC
|
||||
' Creo la cornice
|
||||
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
|
||||
' Ricalcolo lavorazioni
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_dEndTrim)
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||
' Cancello il file
|
||||
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||
End Sub
|
||||
|
||||
@@ -1005,6 +1005,46 @@ Namespace Num
|
||||
Case CnData.PowerOvr ' (10) valore assorbimento massimo mandrino con l'utensile corrente
|
||||
bPowerOvr = CDbl(values(n))
|
||||
b_spindle_power_changed = True
|
||||
Case CnData.InternalCoolant ' (13) Stato acqua interna
|
||||
bInternalCoolantState = CBool(values(n))
|
||||
Case CnData.ExternCoolant ' (14) Stato acqua esterna
|
||||
bExternCoolantState = CBool(values(n))
|
||||
Case CnData.CBAxes ' (15) Stato ativazione assi c e b
|
||||
bCBAxesState = CBool(values(n))
|
||||
Case CnData.AirBlow ' (16) Stato soffio utensile
|
||||
bAirBlowState = CBool(values(n))
|
||||
Case CnData.Home ' (17) Stato home
|
||||
bHomeState = CBool(values(n))
|
||||
Case CnData.TableUp ' (18) Stato tavolo su
|
||||
bTableUpState = CBool(values(n))
|
||||
Case CnData.TableDown ' (19) Stato tavolo giu'
|
||||
bTableDownState = CBool(values(n))
|
||||
Case CnData.DoorClosed ' (20) Stato porte
|
||||
nDoorClosedState = CInt(values(n))
|
||||
Case CnData.LimitZ ' (21) Stato limitazione asse Z
|
||||
bLimitZState = CBool(values(n))
|
||||
Case CnData.VacuumPosition ' (21) Stato limitazione asse Z
|
||||
bVacuumPosition = CBool(values(n))
|
||||
Case CnData.VacuumRot ' (21) Stato limitazione asse Z
|
||||
bVacuumRot = CBool(values(n))
|
||||
Case CnData.Vacuum3State ' (21) Stato limitazione asse Z
|
||||
bVacuum3State = CBool(values(n))
|
||||
Case CnData.Vacuum4State ' (21) Stato limitazione asse Z
|
||||
bVacuum4State = CBool(values(n))
|
||||
Case CnData.Vacuum135State ' (21) Stato limitazione asse Z
|
||||
bVacuum135State = CBool(values(n))
|
||||
Case CnData.Vacuum246State ' (21) Stato limitazione asse Z
|
||||
bVacuum246State = CBool(values(n))
|
||||
Case CnData.OpenAllState ' (21) Stato limitazione asse Z
|
||||
bOpenAllState = CBool(values(n))
|
||||
Case CnData.CloseAllState ' (21) Stato limitazione asse Z
|
||||
bCloseAllState = CBool(values(n))
|
||||
Case CnData.BlowState ' (21) Stato limitazione asse Z
|
||||
bBlowState = CBool(values(n))
|
||||
Case CnData.VacuumState ' (21) Stato limitazione asse Z
|
||||
bVacuumState = CBool(values(n))
|
||||
Case CnData.BypassState ' (21) Stato limitazione asse Z
|
||||
bBypassState = CBool(values(n))
|
||||
End Select
|
||||
Next
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@
|
||||
<Compile Include="CN_Debug.vb" />
|
||||
<Compile Include="CN_generico.vb" />
|
||||
<Compile Include="CN_Siemens.vb" />
|
||||
<Compile Include="Command.vb" />
|
||||
<Compile Include="CompoDimensionUC.xaml.vb">
|
||||
<DependentUpon>CompoDimensionUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -186,6 +187,9 @@
|
||||
</Compile>
|
||||
<Compile Include="ConstMachIni.vb" />
|
||||
<Compile Include="ConstMsg.vb" />
|
||||
<Compile Include="ControlsMachineButtonUC.xaml.vb">
|
||||
<DependentUpon>ControlsMachineButtonUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CopyTemplateUC.xaml.vb">
|
||||
<DependentUpon>CopyTemplateUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -210,6 +214,9 @@
|
||||
<Compile Include="EditValueWD.xaml.vb">
|
||||
<DependentUpon>EditValueWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FrameMachiningUC.xaml.vb">
|
||||
<DependentUpon>FrameMachiningUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SideAngle.vb" />
|
||||
<Compile Include="UnderDrillUC.xaml.vb">
|
||||
<DependentUpon>UnderDrillUC.xaml</DependentUpon>
|
||||
@@ -326,6 +333,9 @@
|
||||
</Compile>
|
||||
<Compile Include="Utility.vb" />
|
||||
<Compile Include="VacuumCups.vb" />
|
||||
<Compile Include="VacuumMachineButtonUC.xaml.vb">
|
||||
<DependentUpon>VacuumMachineButtonUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="VeinMatchingWindow.xaml.vb">
|
||||
<DependentUpon>VeinMatchingWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
@@ -361,6 +371,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ControlsMachineButtonUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="CopyTemplateUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -389,6 +403,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="FrameMachiningUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="UnderDrillUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -547,6 +565,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="VacuumMachineButtonUC.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="VeinMatchingWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -739,6 +761,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\AboutBoxImage.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\FrameMachining.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||
|
||||
@@ -279,6 +279,36 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
</Style>
|
||||
|
||||
<!--YellowOmagCutButton Special for MachineCommands-->
|
||||
<Style x:Key="OmagCut_MachineCommandsYellowGradientYellowIconButton" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
|
||||
<Setter Property="project:ButtonExtensions.CornerRadius" Value="{StaticResource Button_CornerRadius}"/>
|
||||
<Setter Property="Margin" Value="{StaticResource Button_MarginThickness}"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{StaticResource OmagCut_GradientYellow}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FFB8C3CD"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource OmagCut_Blue}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" Value="#FFF4F4F4"/>
|
||||
<Setter Property="BorderBrush" Value="#FFADB2B5"/>
|
||||
<Setter Property="TextElement.Foreground" Value="#FF838383"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--CheckBox-->
|
||||
|
||||
@@ -616,7 +616,7 @@ Public Class RawPartPageUC
|
||||
' Se altrimenti progetto con cornici
|
||||
ElseIf nPrjType = CurrentProjectPageUC.PRJ_TYPE.FRAMES Then
|
||||
' Reinserisco tutte le lavorazioni delle cornici
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_dEndTrim)
|
||||
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||
End If
|
||||
End If
|
||||
Return True
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
+1
-1
@@ -64,7 +64,7 @@
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"
|
||||
SelectionMode="Single">
|
||||
SelectionMode="Extended">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Style.Triggers>
|
||||
|
||||
+243
-196
@@ -14,7 +14,10 @@ Public Class SplitPageUC
|
||||
Private m_nCurrPhase As Integer = 0
|
||||
Private m_MachiningList As New List(Of SplitMach)
|
||||
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
|
||||
Private m_CurrInd As Integer = -1
|
||||
'Private m_CurrInd As Integer = -1
|
||||
'Private m_CurrItems As New List(Of NameIdLsBxItem)
|
||||
Private m_CurrFirstInd As Integer = -1
|
||||
Private m_CurrLastInd As Integer = -1
|
||||
Friend m_bShow As Boolean = False
|
||||
Private m_bModified As Boolean = False
|
||||
Private m_nNbrGrpId As Integer = GDB_ID.NULL
|
||||
@@ -102,7 +105,8 @@ Public Class SplitPageUC
|
||||
' Abilito impostazione modificato
|
||||
EgtEnableModified()
|
||||
' Nessun item corrente
|
||||
m_CurrInd = -1
|
||||
m_CurrFirstInd = -1
|
||||
m_CurrLastInd = -1
|
||||
' Reset flag di modifica
|
||||
m_bModified = False
|
||||
' Reset flag tipo uscita
|
||||
@@ -155,15 +159,21 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nInd As Integer = SelItem.Ind
|
||||
If nInd <> m_CurrInd Then
|
||||
MarkMachining(m_CurrInd, False)
|
||||
MarkMachining(nInd, True)
|
||||
m_CurrInd = nInd
|
||||
EgtDraw()
|
||||
If MachiningLsBx.SelectedItems.Count = 0 Then Return
|
||||
If m_CurrFirstInd > -1 Then
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
MarkMachining(m_ItemList(Index).Ind, False)
|
||||
Next
|
||||
End If
|
||||
m_CurrFirstInd = -1
|
||||
m_CurrLastInd = -1
|
||||
For Each Item In MachiningLsBx.SelectedItems
|
||||
Dim ItemCast As NameIdLsBxItem = Item
|
||||
MarkMachining(ItemCast.Ind, True)
|
||||
Next
|
||||
m_CurrFirstInd = m_ItemList.IndexOf(MachiningLsBx.SelectedItems(0))
|
||||
m_CurrLastInd = m_ItemList.IndexOf(MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1))
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||
@@ -176,44 +186,41 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub MoveItem(direction As Integer)
|
||||
' Checking selected item
|
||||
If MachiningLsBx.SelectedItem Is Nothing OrElse MachiningLsBx.SelectedIndex < 0 OrElse MachiningLsBx.SelectedItems.Count > 1 Then
|
||||
If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then
|
||||
Return
|
||||
End If
|
||||
' No selected item - nothing to do
|
||||
' Calculate new index using move direction
|
||||
Dim newIndex As Integer = MachiningLsBx.SelectedIndex + direction
|
||||
|
||||
' Checking bounds of the range
|
||||
If newIndex < 0 OrElse newIndex >= MachiningLsBx.Items.Count Then
|
||||
Return
|
||||
' Se la direzione è giù
|
||||
If direction = 1 Then
|
||||
' sposto il successivo prima di tutti i selezionati
|
||||
m_ItemList.Move(m_CurrLastInd + 1, m_CurrFirstInd)
|
||||
m_CurrFirstInd += 1
|
||||
m_CurrLastInd += 1
|
||||
ElseIf direction = -1 Then
|
||||
' sposto il precedente dopo tutti i selezionati
|
||||
m_ItemList.Move(m_CurrFirstInd - 1, m_CurrLastInd)
|
||||
m_CurrFirstInd -= 1
|
||||
m_CurrLastInd -= 1
|
||||
End If
|
||||
' Index out of range - nothing to do
|
||||
Dim selected As Object = MachiningLsBx.SelectedItem
|
||||
|
||||
' Removing removable element
|
||||
m_ItemList.Remove(selected)
|
||||
' Insert it in new position
|
||||
m_ItemList.Insert(newIndex, selected)
|
||||
' Restore selection
|
||||
MachiningLsBx.SelectedItem = selected
|
||||
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
End Sub
|
||||
|
||||
Private Sub OnOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles OnOffBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
SelItem.bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
SelItem.bIsActive = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
m_ItemList(Index).bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
m_ItemList(Index).bIsActive = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
Next
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
@@ -254,17 +261,23 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub CutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
' Provo ad entrambi gli estremi
|
||||
Dim bModif As Boolean = AdjustBothCuts(nI)
|
||||
' Provo all'inizio
|
||||
If Not bModif Then bModif = AdjustStartCut(nI)
|
||||
' Provo alla fine
|
||||
If Not bModif Then bModif = AdjustEndCut(nI)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Provo ad entrambi gli estremi
|
||||
Dim bModif As Boolean = AdjustBothCuts(nI)
|
||||
' Provo all'inizio
|
||||
If Not bModif Then bModif = AdjustStartCut(nI)
|
||||
' Provo alla fine
|
||||
If Not bModif Then bModif = AdjustEndCut(nI)
|
||||
' Se modificato qualcosa
|
||||
If bModif Then
|
||||
bGenModif = True
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bModif Then
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
m_bModified = True
|
||||
End If
|
||||
@@ -273,11 +286,17 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub CutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutEndBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
' Eseguo
|
||||
If AdjustEndCut(nI) Then
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Eseguo
|
||||
If AdjustEndCut(nI) Then
|
||||
bGenModif = True
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
m_bModified = True
|
||||
End If
|
||||
@@ -286,11 +305,17 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub CutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutStartBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
' Eseguo
|
||||
If AdjustStartCut(nI) Then
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
' Eseguo
|
||||
If AdjustStartCut(nI) Then
|
||||
bGenModif = True
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
m_bModified = True
|
||||
End If
|
||||
@@ -408,44 +433,47 @@ Public Class SplitPageUC
|
||||
End Function
|
||||
|
||||
Private Sub OutCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenStartBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then
|
||||
Return
|
||||
End If
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
@@ -503,44 +531,47 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OutCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutCenEndBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then
|
||||
Return
|
||||
End If
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
@@ -641,83 +672,96 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub ModifStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifStartBtn.Click
|
||||
' Recupero la lavorazione corrente
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo( nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||
ValWnd.SetVal( dOrigUsal)
|
||||
If ValWnd.ShowDialog() Then
|
||||
' Modifica della lavorazione
|
||||
Dim dUsal As Double = ValWnd.GetVal()
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUsal < - 10 * EPS_SMALL Then
|
||||
return
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUsal)
|
||||
If ValWnd.ShowDialog() Then
|
||||
' Modifica della lavorazione
|
||||
Dim dUsal As Double = ValWnd.GetVal()
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
|
||||
EgtSetInfo( nOperId, INFO_MCH_USER_SAL, dUsal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ModifEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles ModifEndBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo( nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||
ValWnd.SetVal( dOrigUeal)
|
||||
If ValWnd.ShowDialog() Then
|
||||
' Modifica della lavorazione
|
||||
Dim dUeal As Double = ValWnd.GetVal()
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUeal < - 10 * EPS_SMALL Then
|
||||
return
|
||||
' Recupero la lavorazione corrente
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
' Dialogo richiesta valore
|
||||
Dim ValWnd As New EditValueWD(m_MainWindow, EgtMsg(MSG_SPLITPAGEUC + 35)) ' Allungamento
|
||||
ValWnd.SetVal(dOrigUeal)
|
||||
If ValWnd.ShowDialog() Then
|
||||
' Modifica della lavorazione
|
||||
Dim dUeal As Double = ValWnd.GetVal()
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim dAddLen As Double = 0
|
||||
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
|
||||
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
|
||||
Return
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
EgtSetInfo(nOperId, INFO_MCH_USER_EAL, dUeal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
bGenModif = True
|
||||
End If
|
||||
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
|
||||
EgtSetInfo( nOperId, INFO_MCH_USER_EAL, dUeal)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
' verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumber(nI)
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
If bGenModif Then
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
|
||||
If IsNothing(SelItem) Then Return
|
||||
Dim nI As Integer = SelItem.Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
If GetPause(nOperId) Then
|
||||
ResetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = False
|
||||
RemovePauseText(SelItem.Name)
|
||||
Else
|
||||
SetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = True
|
||||
AddPauseText(SelItem.Name)
|
||||
End If
|
||||
If m_CurrFirstInd = -1 Then Return
|
||||
Dim bGenModif As Boolean = False
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
Dim nOperId As Integer = m_MachiningList(nI).m_nId
|
||||
If GetPause(nOperId) Then
|
||||
ResetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = False
|
||||
RemovePauseText(m_ItemList(Index).Name)
|
||||
Else
|
||||
SetPause(nOperId)
|
||||
m_MachiningList(nI).m_bPause = True
|
||||
AddPauseText(m_ItemList(Index).Name)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||
@@ -1100,9 +1144,12 @@ Public Class SplitPageUC
|
||||
Private Sub RemoveMarkAndNumbers()
|
||||
EgtDisableModified()
|
||||
' cancello evidenziazione
|
||||
If m_CurrInd >= 0 Then
|
||||
MarkMachining(m_CurrInd, False)
|
||||
m_CurrInd = -1
|
||||
If m_CurrFirstInd >= 0 Then
|
||||
For Index = m_CurrFirstInd To m_CurrLastInd
|
||||
MarkMachining(m_ItemList(Index).Ind, False)
|
||||
Next
|
||||
m_CurrFirstInd = -1
|
||||
m_CurrLastInd = -1
|
||||
End If
|
||||
' cancello gruppo di numerazione e ripristino colori lavorazioni
|
||||
EgtErase(m_nNbrGrpId)
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<UserControl x:Class="VacuumMachineButtonUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
DataContext="Self"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:OmagCUT="clr-namespace:OmagCUT"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||
|
||||
<Border Style="{StaticResource OmagCut_Page2Border}">
|
||||
|
||||
<ItemsControl ItemsSource="{Binding ButtonList}">
|
||||
<ItemsControl.Resources>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:TwoStateButton}">
|
||||
<ToggleButton IsChecked="{Binding IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:ThreeStateButton}">
|
||||
<Button Command="{Binding ExecuteCommand}"
|
||||
Background="{Binding Background}"
|
||||
Style="{StaticResource OmagCut_MachineCommandsYellowGradientYellowIconButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:DoubleCommandButton}">
|
||||
<ToggleButton IsChecked="{Binding IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type OmagCUT:PressedCommandButton}">
|
||||
<Button Style="{StaticResource OmagCut_MachineCommandsYellowGradientYellowIconButton}"
|
||||
PreviewMouseUp="PressedCommandButton_PreviewMouseUp"
|
||||
PreviewMouseDown="PressedCommandButton_PreviewMouseDown">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</ItemsControl.Resources>
|
||||
<!--<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ToggleButton IsChecked="{Binding IsChecked}"
|
||||
Style="{StaticResource OmagCut_GradientYellowIconToggleButton}">
|
||||
<Image Source="{Binding ImageSource}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>-->
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Columns="3" Rows="7"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,279 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class VacuumMachineButtonUC
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
' Costanti per nomi stati dei bottoni
|
||||
Private Const BTN_STATE_SPINDLE As String = "Spindle"
|
||||
Private Const BTN_STATE_COOLANT As String = "Coolant"
|
||||
Private Const BTN_STATE_LASER As String = "Laser"
|
||||
Private Const BTN_STATE_THREEAXIS As String = "ThreeAxis"
|
||||
Private Const BTN_STATE_FIVEAXIS As String = "FiveAxis"
|
||||
Private Const BTN_STATE_NOTHING As String = "Nothing"
|
||||
|
||||
Private Enum MachineButtonType As Integer
|
||||
NOSTATE = 0
|
||||
TWOSTATE = 1
|
||||
THREESTATE = 2
|
||||
DOUBLECOMMAND = 3
|
||||
PRESSEDCOMMAND = 4
|
||||
End Enum
|
||||
|
||||
' Dichiarazione delle Page UserControl
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private m_DirectCutPage As DirectCutPageUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
Private m_ButtonList As New ObservableCollection(Of MachineButton)
|
||||
Public ReadOnly Property ButtonList As ObservableCollection(Of MachineButton)
|
||||
Get
|
||||
Return m_ButtonList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Sub ManualAxesMove_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
Me.DataContext = Me
|
||||
End Sub
|
||||
|
||||
Private Sub ManualAxesMove_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
If m_bFirst Then
|
||||
m_DirectCutPage = m_MainWindow.m_DirectCutPageUC
|
||||
'MachineButton.m_DirectCutPage = m_DirectCutPage
|
||||
'MachineButton.m_CN = m_CN
|
||||
m_bFirst = False
|
||||
|
||||
' Lettura configurazione bottoni da Ini di macchina
|
||||
Dim m_nCount As Integer = 1
|
||||
Dim bFoundedBtn As Boolean = True
|
||||
While bFoundedBtn
|
||||
Dim sNameBtn As String = K_BUTTON & (m_nCount).ToString()
|
||||
Dim sMachineButtonType As String = String.Empty
|
||||
Dim sTImageName As String = String.Empty
|
||||
Dim sTLuaScriptName As String = String.Empty
|
||||
Dim sFImageName As String = String.Empty
|
||||
Dim sFLuaScriptName As String = String.Empty
|
||||
Dim sStateFlag As String = String.Empty
|
||||
bFoundedBtn = GetPrivateProfileMachineButtons(S_VACUUMMACHBUTTONS, sNameBtn, sMachineButtonType, sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag, m_MainWindow.GetMachIniFile())
|
||||
If bFoundedBtn Then 'And
|
||||
'(Not m_bOnlyLaser Or sButtonStateFlag = sNameBtn) Then
|
||||
m_nCount += 1
|
||||
Dim ButtonToAdd As MachineButton = Nothing
|
||||
Select Case sMachineButtonType
|
||||
Case MachineButtonType.NOSTATE
|
||||
ButtonToAdd = New TwoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.TWOSTATE
|
||||
ButtonToAdd = New TwoStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.THREESTATE
|
||||
ButtonToAdd = New ThreeStateButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.DOUBLECOMMAND
|
||||
ButtonToAdd = New DoubleCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
Case MachineButtonType.PRESSEDCOMMAND
|
||||
ButtonToAdd = New PressedCommandButton(sTImageName, sTLuaScriptName, sFImageName, sFLuaScriptName, sStateFlag)
|
||||
End Select
|
||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||
End If
|
||||
End While
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub VacuumPositionChanged(VacuumPosition As Boolean)
|
||||
Dim VacuumPositionButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUUMPOSITION Then
|
||||
VacuumPositionButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(VacuumPositionButton) Then
|
||||
VacuumPositionButton.SetButtonIsChecked(VacuumPosition)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub VacuumRotChanged(VacuumRot As Boolean)
|
||||
Dim VacuumRotButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUUMROT Then
|
||||
VacuumRotButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(VacuumRotButton) Then
|
||||
VacuumRotButton.SetButtonIsChecked(VacuumRot)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Vacuum3Changed(Vacuum3State As Boolean)
|
||||
Dim Vacuum3StateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUU3STATE Then
|
||||
Vacuum3StateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(Vacuum3StateButton) Then
|
||||
Vacuum3StateButton.SetButtonIsChecked(Vacuum3State)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Vacuum4Changed(Vacuum4State As Boolean)
|
||||
Dim Vacuum4StateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUU4STATE Then
|
||||
Vacuum4StateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(Vacuum4StateButton) Then
|
||||
Vacuum4StateButton.SetButtonIsChecked(Vacuum4State)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Vacuum135Changed(Vacuum135State As Boolean)
|
||||
Dim Vacuum135StateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUU135STATE Then
|
||||
Vacuum135StateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(Vacuum135StateButton) Then
|
||||
Vacuum135StateButton.SetButtonIsChecked(Vacuum135State)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub Vacuum246Changed(Vacuum246State As Boolean)
|
||||
Dim Vacuum246StateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUU246STATE Then
|
||||
Vacuum246StateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(Vacuum246StateButton) Then
|
||||
Vacuum246StateButton.SetButtonIsChecked(Vacuum246State)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub OpenAllChanged(OpenAllState As Boolean)
|
||||
Dim OpenAllStateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_OPENALLSTATE Then
|
||||
OpenAllStateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(OpenAllStateButton) Then
|
||||
OpenAllStateButton.SetButtonIsChecked(OpenAllState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub CloseAllChanged(CloseAllState As Boolean)
|
||||
Dim CloseAllStateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_CLOSEALLSTATE Then
|
||||
CloseAllStateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(CloseAllStateButton) Then
|
||||
CloseAllStateButton.SetButtonIsChecked(CloseAllState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub BlowChanged(BlowState As Boolean)
|
||||
Dim BlowStateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_BLOWSTATE Then
|
||||
BlowStateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(BlowStateButton) Then
|
||||
BlowStateButton.SetButtonIsChecked(BlowState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub VacuumChanged(VacuumState As Boolean)
|
||||
Dim VacuumStateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_VACUUMSTATE Then
|
||||
VacuumStateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(VacuumStateButton) Then
|
||||
VacuumStateButton.SetButtonIsChecked(VacuumState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub BypassChanged(BypassState As Boolean)
|
||||
Dim BypassStateButton As TwoStateButton = Nothing
|
||||
For Each MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_BYPASSTATE Then
|
||||
BypassStateButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(BypassStateButton) Then
|
||||
BypassStateButton.SetButtonIsChecked(BypassState)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetPrivateProfileMachineButtons(
|
||||
ByVal lpAppName As String,
|
||||
ByVal lpKeyName As String,
|
||||
ByRef lpMachineButtonType As String,
|
||||
ByRef lpTImageName As String,
|
||||
ByRef lpTLuaScriptName As String,
|
||||
ByRef lpFImageName As String,
|
||||
ByRef lpFLuaScriptName As String,
|
||||
ByRef lpStateFlag As String,
|
||||
ByVal lpFileName As String) As Boolean
|
||||
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() >= 3 Then
|
||||
lpMachineButtonType = sItems(0)
|
||||
lpTImageName = sItems(1)
|
||||
lpTLuaScriptName = sItems(2)
|
||||
If sItems.Count() >= 4 Then
|
||||
lpStateFlag = sItems(3)
|
||||
If sItems.Count() >= 6 Then
|
||||
lpFImageName = sItems(4)
|
||||
lpFLuaScriptName = sItems(5)
|
||||
End If
|
||||
Else
|
||||
lpStateFlag = BTN_STATE_NOTHING
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
End Sub
|
||||
|
||||
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
#Region "EVENTS"
|
||||
|
||||
Private Sub PressedCommandButton_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Button As Button = DirectCast(sender, Button)
|
||||
If TypeOf Button.DataContext Is PressedCommandButton Then
|
||||
Dim PressedButton As PressedCommandButton = DirectCast(Button.DataContext, PressedCommandButton)
|
||||
PressedButton.OnMouseUp()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub PressedCommandButton_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Dim Button As Button = DirectCast(sender, Button)
|
||||
If TypeOf Button.DataContext Is PressedCommandButton Then
|
||||
Dim PressedButton As PressedCommandButton = DirectCast(Button.DataContext, PressedCommandButton)
|
||||
PressedButton.OnMouseDown()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user