diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb index 3d80994..c8029ef 100644 --- a/AlarmsPageUC.xaml.vb +++ b/AlarmsPageUC.xaml.vb @@ -1,4 +1,6 @@ Imports System.Windows.Threading +Imports System.IO +Imports EgtUILib Public Class AlarmsPageUC @@ -11,11 +13,22 @@ Public Class AlarmsPageUC End Sub Friend Sub NcError(ErrorMsg As String) - NCErrorMessages.Text = m_CN.sz_NC_error_messages(0) + m_MainWindow.m_MachineStatusUC.Background = Brushes.Red + Dim nIndex As Integer + While m_CN.sz_NC_error_messages(nIndex) <> "" And nIndex <= m_CN.sz_NC_error_messages.Count - 1 + NCErrorMessages.Text &= m_CN.sz_NC_error_messages(nIndex) + End While End Sub Friend Sub PlcError(ErrorMsg As String) - PLCErrorMessages.Text = m_CN.sz_PLC_error_messages + m_MainWindow.m_MachineStatusUC.Background = Brushes.Red + Dim sFilePath As String = m_MainWindow.GetMachinesRootDir() & "/PLCMessages/" & EgtMsg(MSG_MACHINEPAGEUC + 1) + Dim sErrorText As String = File.ReadLines(sFilePath).Skip(m_CN.sz_PLC_error_messages).Take(1).First() + sErrorText = sErrorText.Substring(sErrorText.IndexOf("$")) + If sErrorText(0) = " " Then + sErrorText = sErrorText.Substring(1) + End If + PLCErrorMessages.Text = sErrorText End Sub End Class diff --git a/CNCommunication.vb b/CNCommunication.vb index a57a2c0..b36634b 100644 --- a/CNCommunication.vb +++ b/CNCommunication.vb @@ -167,13 +167,19 @@ Public Class CNCommunication If m_CN.b_NC_error Then m_AlarmsPage.NcError(m_CN.sz_NC_error_messages(0)) Else - m_AlarmsPage.NCErrorMessages.Text = "---------" + Dim BackColor As SolidColorBrush = m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background + If Colors.Red.Equals(BackColor.Color) Then + m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background = Brushes.DarkGray + End If End If If m_CN.b_PLC_error Then m_AlarmsPage.PlcError(m_CN.sz_PLC_error_messages) Else - m_AlarmsPage.PLCErrorMessages.Text = "---------" + Dim BackColor As SolidColorBrush = m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background + If Colors.Red.Equals(BackColor.Color) Then + m_MainWindow.m_MachineStatusUC.MachineStatusGrid.Background = Brushes.DarkGray + End If End If End Sub diff --git a/ConstIni.vb b/ConstIni.vb index 7ba03e8..77beb28 100644 --- a/ConstIni.vb +++ b/ConstIni.vb @@ -29,6 +29,9 @@ Module ConstIni Public Const K_CAMERALINK As String = "CameraLink" Public Const K_CNLINK As String = "CNLink" + Public Const S_LANGUAGES As String = "Languages" + Public Const K_LANGUAGE As String = "Language" + Public Const S_LUA As String = "Lua" Public Const K_LIBSDIR As String = "LibsDir" Public Const K_BASELIB As String = "BaseLib" diff --git a/DirectCutPageUC.xaml b/DirectCutPageUC.xaml index 0f8d08f..f0d064f 100644 --- a/DirectCutPageUC.xaml +++ b/DirectCutPageUC.xaml @@ -1,38 +1,71 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="DirectCutPage_Initialized" Loaded="DirectCutPage_Loaded"> - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +