Merge branch 'Features/Comandi_Siemens'
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
Public Const K_PATH_HMI As String = "PathHmi"
|
||||
Public Const K_USENEWMDI As String = "UseNewMDI"
|
||||
Public Const K_ISSIEMENSONE As String = "IsSiemensOne"
|
||||
Public Const K_ISACTIVEMODESUBSCR As String = "IsActiveModeSubscr"
|
||||
Public Const K_DBVARPATH As String = "DBVarPath"
|
||||
Public Const K_NEWWRITECNCMODE As String = "NewWriteCNCMode"
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ Public Class SingleDrillUC
|
||||
Point1Btn.IsChecked = True
|
||||
End Sub
|
||||
|
||||
Private Function GetDrillFromDrilling(ByRef sCurrDrill As String)
|
||||
Private Sub GetDrillFromDrilling(ByRef sCurrDrill As String)
|
||||
If String.IsNullOrEmpty(sCurrDrill) Or String.IsNullOrWhiteSpace(sCurrDrill) Then
|
||||
' creo l'elenco degli utensili di foratura
|
||||
Dim sToolName As String = String.Empty
|
||||
@@ -301,7 +301,7 @@ Public Class SingleDrillUC
|
||||
sCurrDrill = String.Empty
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
End Sub
|
||||
|
||||
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
|
||||
' Recupero il valore della coordinata (in 0 Tab)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<ScrollViewer Grid.Row="0" Margin="20">
|
||||
<TreeView ItemsSource="{Binding FamilyList}" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpFamily}" ItemsSource="{Binding ToolList}">
|
||||
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolFamily}" ItemsSource="{Binding ToolList}">
|
||||
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -88,7 +88,7 @@
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
</HierarchicalDataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpItem}">
|
||||
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpToolItem}">
|
||||
<Grid Height="20">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
|
||||
@@ -493,17 +493,17 @@ Public Class ToolsDbPageUC
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
|
||||
' creo lista utensili per esportazione
|
||||
Dim ToolToExportList = New ObservableCollection(Of ImpExpFamily)
|
||||
Dim ToolToExportList = New ObservableCollection(Of ImpExpToolFamily)
|
||||
Dim Family As CathegoryItem
|
||||
Dim Tool As CustomItem
|
||||
For Each Family In ToolsList
|
||||
Dim ImpExpFamily As New ImpExpFamily(Family.Name, Family.nTType)
|
||||
ImpExpFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png"
|
||||
Dim ImpExpToolFamily As New ImpExpToolFamily(Family.Name, Family.nTType)
|
||||
ImpExpToolFamily.PictureString = "/Resources/ToolsTreeviewImages/Folder.png"
|
||||
For Each Tool In Family.Items
|
||||
Dim CurrTool = New ImpExpItem(Tool.Name, False)
|
||||
ImpExpFamily.ToolList.Add(CurrTool)
|
||||
Dim CurrTool = New ImpExpToolItem(Tool.Name, False)
|
||||
ImpExpToolFamily.ToolList.Add(CurrTool)
|
||||
Next
|
||||
ToolToExportList.Add(ImpExpFamily)
|
||||
ToolToExportList.Add(ImpExpToolFamily)
|
||||
Next
|
||||
|
||||
Dim ExportWndVM As New ImportExportToolWindowVM(ToolToExportList)
|
||||
@@ -530,7 +530,7 @@ Public Class ToolsDbPageUC
|
||||
Dim ImportFileToolFamilyList As Integer() = Nothing
|
||||
EgtTdbToBeImported(ImportFilePath, ImportFileToolNameList, ImportFileToolFamilyList)
|
||||
' li inserisco in lista per finestra di scelta
|
||||
Dim ToolToImportList As New ObservableCollection(Of ImpExpFamily)
|
||||
Dim ToolToImportList As New ObservableCollection(Of ImpExpToolFamily)
|
||||
' creo famiglie di utensili in base a quelle trovate in lista importata
|
||||
For ToolIndex As Integer = 0 To ImportFileToolNameList.Count - 1
|
||||
Dim ToolName As String = ImportFileToolNameList(ToolIndex)
|
||||
@@ -544,17 +544,17 @@ Public Class ToolsDbPageUC
|
||||
MCH_TF.WATERJET Or
|
||||
MCH_TF.COMPO)
|
||||
Dim bFounded As Boolean = False
|
||||
Dim ToolToImportFamily As ImpExpFamily
|
||||
Dim ToolToImportFamily As ImpExpToolFamily
|
||||
For Each ToolToImportFamily In ToolToImportList
|
||||
If (ToolFamily = ToolToImportFamily.FamilyType) Then
|
||||
ToolToImportFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName)))
|
||||
ToolToImportFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
|
||||
bFounded = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bFounded Then
|
||||
Dim NewFamily As New ImpExpFamily(GetToolFamilyName(ToolFamily), ToolFamily)
|
||||
NewFamily.ToolList.Add(New ImpExpItem(ToolName, AlreadyExist(ToolName)))
|
||||
Dim NewFamily As New ImpExpToolFamily(GetToolFamilyName(ToolFamily), ToolFamily)
|
||||
NewFamily.ToolList.Add(New ImpExpToolItem(ToolName, AlreadyExist(ToolName)))
|
||||
ToolToImportList.Add(NewFamily)
|
||||
End If
|
||||
Next
|
||||
|
||||
+2
-2
@@ -323,8 +323,8 @@ Class MainWindow
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2310, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2310, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2312, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2312, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
|
||||
@@ -11,6 +11,8 @@ Public Class CNCommunication
|
||||
Private m_AlarmsPage As AlarmsPageUC = m_MainWindow.m_MachinePageUC.m_AlarmsPageUC
|
||||
Private m_CurrProjPage As CurrentProjectPageUC = m_MainWindow.m_CurrentProjectPageUC
|
||||
|
||||
Friend m_nCountRefresh As Integer = 0
|
||||
|
||||
' Variabile per tipologia CN
|
||||
Friend m_nNCType As Integer
|
||||
|
||||
@@ -379,6 +381,7 @@ Public Class CNCommunication
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
If m_CN.m_IsSiemensOne Then
|
||||
' stati bottoni parte 1
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
|
||||
@@ -395,6 +398,8 @@ Public Class CNCommunication
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
|
||||
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Error starting Process -> NcLink=True type=0")
|
||||
@@ -698,12 +703,17 @@ Public Class CNCommunication
|
||||
m_MachineStatus.DisplayVar()
|
||||
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
|
||||
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
If m_nCountRefresh > 10 Then
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
m_nCountRefresh = 0
|
||||
Else
|
||||
m_nCountRefresh = m_nCountRefresh + 1
|
||||
End If
|
||||
|
||||
If m_CN.b_NC_error Then
|
||||
|
||||
@@ -131,7 +131,7 @@ Public Class CN_Siemens
|
||||
|
||||
Public Overrides Function read_active_mode() As Short
|
||||
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
||||
If m_IsSiemensOne Then
|
||||
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||
Select Case n_data(3)
|
||||
Case 1
|
||||
Return 0
|
||||
@@ -144,7 +144,7 @@ Public Class CN_Siemens
|
||||
End Select
|
||||
Else
|
||||
' per verificare che la comunicazione funzioni correttamente
|
||||
'EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||
Return M_MMFiles.read_active_mode()
|
||||
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||
End If
|
||||
|
||||
@@ -88,6 +88,8 @@ Public MustInherit Class CN_generico
|
||||
#Region " Interface"
|
||||
|
||||
Friend m_IsSiemensOne As Boolean = False
|
||||
Friend m_IsActiveModeSubscription As Boolean = False
|
||||
|
||||
Friend m_DbVarPath As String = ""
|
||||
|
||||
Public IsFlexiumPlus As Boolean = False
|
||||
|
||||
+20
-20
@@ -476,6 +476,7 @@ Module M_MMFiles
|
||||
SiemensSend.n_param1 = nChannel
|
||||
|
||||
execute_command()
|
||||
|
||||
'EgtOutLog("MDI_command end dell'm_mmFiles")
|
||||
Return SiemensRet.n_result
|
||||
|
||||
@@ -614,7 +615,6 @@ Module M_MMFiles
|
||||
'----------------------------------------------------------------------------------------------------------
|
||||
'
|
||||
Sub execute_command()
|
||||
|
||||
Try
|
||||
' Attesa eventuale busy iniziale
|
||||
Dim nCount As Integer = 0
|
||||
@@ -641,25 +641,25 @@ Module M_MMFiles
|
||||
bEnd = False
|
||||
While Not bEnd
|
||||
Select Case nState
|
||||
Case State.Command_on ' alzato il comando attendo il busy
|
||||
If SiemensRet.b_busy Then
|
||||
nState = State.Busy_On
|
||||
Else
|
||||
System.Threading.Thread.Sleep(50)
|
||||
End If
|
||||
Case State.Busy_On ' trovato il busy abbasso il comando
|
||||
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
|
||||
' scrivo !!!!!
|
||||
Marshal.StructureToPtr(SiemensSend, pView, False)
|
||||
nState = State.Command_off
|
||||
Case State.Command_off ' abbassato il comando attendo il busy basso
|
||||
If SiemensRet.b_busy Then
|
||||
System.Threading.Thread.Sleep(50)
|
||||
Else
|
||||
nState = State.Busy_Off
|
||||
End If
|
||||
Case State.Busy_Off
|
||||
bEnd = True
|
||||
Case State.Command_on ' alzato il comando attendo il busy
|
||||
If SiemensRet.b_busy Then
|
||||
nState = State.Busy_On
|
||||
Else
|
||||
System.Threading.Thread.Sleep(50)
|
||||
End If
|
||||
Case State.Busy_On ' trovato il busy abbasso il comando
|
||||
SiemensSend.n_Flag = COMMAND_OFF ' abbasso il comando
|
||||
' scrivo !!!!!
|
||||
Marshal.StructureToPtr(SiemensSend, pView, False)
|
||||
nState = State.Command_off
|
||||
Case State.Command_off ' abbassato il comando attendo il busy basso
|
||||
If SiemensRet.b_busy Then
|
||||
System.Threading.Thread.Sleep(50)
|
||||
Else
|
||||
nState = State.Busy_Off
|
||||
End If
|
||||
Case State.Busy_Off
|
||||
bEnd = True
|
||||
End Select
|
||||
' controllo massimo numero di cicli
|
||||
nCount += 1
|
||||
|
||||
Reference in New Issue
Block a user