コード例 #1
0
ファイル: QueueWorker.cs プロジェクト: lardc/mme_software
        public void AddExceptionEvent(ComplexParts Device, string Message)
        {
            m_ActionQueue.Enqueue(delegate
            {
                Cache.Welcome.IsBackEnable    = false;
                Cache.Welcome.IsRestartEnable = true;
                Cache.Welcome.State(Device, DeviceConnectionState.ConnectionFailed, Message);

                if (Cache.Main.mainFrame.Content.Equals(Cache.UserTest))
                {
                    Cache.UserTest.SetResultAll(DeviceState.Fault);
                }
                else
                {
                    Cache.Gate.SetResultAll(DeviceState.Fault);
                    Cache.SL.SetResultAll(DeviceState.Fault);
                    Cache.Bvt.SetResultAll(DeviceState.Fault);
                }

                Cache.Main.mainFrame.Navigate(Cache.Welcome);

                if (Settings.Default.FTDIPresent)
                {
                    Cache.FTDI.LedGreenSwitch(false);
                    Cache.FTDI.LedRedBlinkStart();
                }
            });
        }
コード例 #2
0
ファイル: IOCommutation.cs プロジェクト: lardc/mme_software
        internal IOCommutation(IOAdapter Adapter, BroadcastCommunication Communication, bool CommutationEmulation, int CommutationNode, bool Type6, ComplexParts ID)
        {
            m_ID                     = ID;
            m_IOAdapter              = Adapter;
            m_Communication          = Communication;
            m_IsCommutationEmulation = CommutationEmulation;

            //читаем из файла конфигурации тип установленной системы безопасности
            if (m_ID == ComplexParts.Commutation)
            {
                m_SafetyType = ReadSafetyTypeFromConfig();

                if (m_SafetyType == ComplexSafety.Optical)
                {
                    //если это оптическая шторка - создаём поток, который будет опрашивать её состояние
                    m_CheckSafetyThread = new ThreadService();
                    m_CheckSafetyThread.FinishedHandler += CheckSafetyThread_FinishedHandler;
                }
            }

            m_Node  = (ushort)CommutationNode;
            m_Type6 = Type6;

            SystemHost.Journal.AppendLog(m_ID, LogMessageType.Info, String.Format("Commutation created. Emulation mode: {0}", m_IsCommutationEmulation));
        }
コード例 #3
0
        private void ShowError(ComplexParts Device, string Error)
        {
            switch (Device)
            {
            case ComplexParts.Gate:
                ErrorGate = Error;
                break;

            case ComplexParts.SL:
                ErrorVtm = Error;
                break;

            case ComplexParts.BVT:
                ErrorBvt = Error;
                break;

            case ComplexParts.Clamping:
                ErrorClamping = Error;
                break;

            case ComplexParts.DvDt:
                ErrordVdt = Error;
                break;
            }
        }
コード例 #4
0
        internal int GetTimeout(ComplexParts Device)
        {
            switch (Device)
            {
            case ComplexParts.Service:
                return(serviceControl.OperationTimeout);

            case ComplexParts.Sync:
                return(syncControl.OperationTimeout);

            case ComplexParts.Commutation:
                return(commutationControl.OperationTimeout);

            case ComplexParts.CommutationEx:
                return(commutationControlEx.OperationTimeout);

            case ComplexParts.Adapter:
                return(adapterControl.OperationTimeout);

            case ComplexParts.Gateway:
                return(gatewayControl.OperationTimeout);

            case ComplexParts.Gate:
                return(gateControl.OperationTimeout);

            case ComplexParts.SL:
                return(vtmControl.OperationTimeout);

            case ComplexParts.BVT:
                return(bvtControl.OperationTimeout);

            case ComplexParts.Clamping:
                return(clampControl.ClampTimeout);

            case ComplexParts.DvDt:
                return(dVdtControl.OperationTimeout);

            case ComplexParts.ATU:
                return(aTUControl.OperationTimeout);

            case ComplexParts.QrrTq:
                return(qrrTqControl.OperationTimeout);

            case ComplexParts.RAC:
                return(rACControl.OperationTimeout);

            case ComplexParts.IH:
                return(ihControl.OperationTimeout);

            case ComplexParts.TOU:
                return(touControl.OperationTimeout);

            default:
                return(10000);
            }
        }
コード例 #5
0
        internal bool IsDeviceEnabled(ComplexParts Device)
        {
            switch (Device)
            {
            case ComplexParts.Service:
                return(!serviceControl.IsDisabled);

            case ComplexParts.Sync:
                return(!syncControl.IsDisabled);

            case ComplexParts.Adapter:
                return(!adapterControl.IsDisabled);

            case ComplexParts.Gateway:
                return(!gatewayControl.IsDisabled);

            case ComplexParts.Commutation:
                return(!commutationControl.IsDisabled);

            case ComplexParts.Gate:
                return(!gateControl.IsDisabled);

            case ComplexParts.SL:
                return(!vtmControl.IsDisabled);

            case ComplexParts.BVT:
                return(!bvtControl.IsDisabled);

            case ComplexParts.Clamping:
                return(!clampControl.IsDisabled);

            case ComplexParts.CommutationEx:
                return(!commutationControlEx.IsDisabled);

            case ComplexParts.DvDt:
                return(!dVdtControl.IsDisabled);

            case ComplexParts.ATU:
                return(!aTUControl.IsDisabled);

            case ComplexParts.QrrTq:
                return(!qrrTqControl.IsDisabled);

            case ComplexParts.RAC:
                return(!rACControl.IsDisabled);

            case ComplexParts.IH:
                return(!ihControl.IsDisabled);

            case ComplexParts.TOU:
                return(!touControl.IsDisabled);

            default:
                return(false);
            }
        }
コード例 #6
0
        internal void State(ComplexParts Device, DeviceConnectionState ConnectionState, string Message)
        {
            switch (Device)
            {
            case ComplexParts.FTDI:
                internalControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Service:
                serviceControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Adapter:
                adapterControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Gateway:
                gatewayControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Commutation:
                commutationControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Gate:
                gateControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.SL:
                vtmControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.BVT:
                bvtControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Clamping:
                clampControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.CommutationEx:
                commutationControlEx.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.DvDt:
                dVdtControl.SetConnectionStatus(ConnectionState, Message);
                break;

            case ComplexParts.Sctu:
                sctuControl.SetConnectionStatus(ConnectionState, Message);
                break;
            }
        }
コード例 #7
0
ファイル: EventJournal.cs プロジェクト: lardc/mme_software
        /// <summary>
        ///     Append log file
        /// </summary>
        /// <param name="Device">Device that triggered log append</param>
        /// <param name="Type">Type of log message</param>
        /// <param name="Message">Message of log item</param>
        public void AppendLog(ComplexParts Device, LogMessageType Type, string Message)
        {
            Message = Message.Replace("'", string.Empty);

            m_MessageList.Enqueue(new LogItem
            {
                Timestamp   = DateTime.Now,
                Source      = Device,
                MessageType = Type,
                Message     = Message
            });

            m_ListEvent.Set();
        }
コード例 #8
0
        internal bool IsDeviceEnabled(ComplexParts Device)
        {
            switch (Device)
            {
            case ComplexParts.FTDI:
                return(!internalControl.IsDisabled);

            case ComplexParts.Service:
                return(!serviceControl.IsDisabled);

            case ComplexParts.Adapter:
                return(!adapterControl.IsDisabled);

            case ComplexParts.Gateway:
                return(!gatewayControl.IsDisabled);

            case ComplexParts.Commutation:
                return(!commutationControl.IsDisabled);

            case ComplexParts.Gate:
                return(!gateControl.IsDisabled);

            case ComplexParts.SL:
                return(!vtmControl.IsDisabled);

            case ComplexParts.BVT:
                return(!bvtControl.IsDisabled);

            case ComplexParts.Clamping:
                return(!clampControl.IsDisabled);

            case ComplexParts.CommutationEx:
                return(!commutationControlEx.IsDisabled);

            case ComplexParts.DvDt:
                return(!dVdtControl.IsDisabled);

            case ComplexParts.Sctu:
                return(!sctuControl.IsDisabled);

            default:
                return(false);
            }
        }
コード例 #9
0
        internal int GetTimeout(ComplexParts Device)
        {
            switch (Device)
            {
            case ComplexParts.FTDI:
                return(internalControl.OperationTimeout);

            case ComplexParts.Service:
                return(serviceControl.OperationTimeout);

            case ComplexParts.Commutation:
                return(commutationControl.OperationTimeout);

            case ComplexParts.CommutationEx:
                return(commutationControlEx.OperationTimeout);

            case ComplexParts.Adapter:
                return(adapterControl.OperationTimeout);

            case ComplexParts.Gateway:
                return(gatewayControl.OperationTimeout);

            case ComplexParts.Gate:
                return(gateControl.OperationTimeout);

            case ComplexParts.SL:
                return(vtmControl.OperationTimeout);

            case ComplexParts.BVT:
                return(bvtControl.OperationTimeout);

            case ComplexParts.Clamping:
                return(clampControl.OperationTimeout);

            case ComplexParts.DvDt:
                return(dVdtControl.OperationTimeout);

            case ComplexParts.Sctu:
                return(sctuControl.OperationTimeout);

            default:
                return(10000);
            }
        }
コード例 #10
0
ファイル: EventJournal.cs プロジェクト: lardc/mme_software
        private void InsertIntoDatabase(DateTime Timestamp, ComplexParts Source, LogMessageType Type, string Message)
        {
            lock (ms_Locker)
            {
                if (m_Connection == null || m_Connection.State != ConnectionState.Open)
                {
                    return;
                }

                try
                {
                    m_InsertCommand.CommandText =
                        string.Format(
                            "INSERT INTO MainTable(ID, DateTimeStamp, SourceID, TypeID, Message) VALUES(NULL, '{0}', {1}, {2}, '{3}')",
                            Timestamp.ToString(@"yyyy-MM-dd HH:mm:ss.fff", CultureInfo.InvariantCulture), (byte)Source, (byte)Type, Message);

                    m_InsertCommand.ExecuteNonQuery();
                }
                catch (Exception)
                {
                }
            }
        }
コード例 #11
0
        private void Read(ComplexParts Device)
        {
            try
            {
                switch (Device)
                {
                case ComplexParts.Gate:
                    ParamsGate = Cache.Net.GateReadCalibrationParameters();
                    ErrorGate  = string.Empty;
                    break;

                case ComplexParts.SL:
                    ParamsVtm = Cache.Net.SLReadCalibrationParameters();
                    ErrorVtm  = string.Empty;
                    break;

                case ComplexParts.BVT:
                    ParamsBvt = Cache.Net.BvtReadCalibrationParameters();
                    ErrorBvt  = string.Empty;
                    break;

                case ComplexParts.Clamping:
                    ParamsClamping = Cache.Net.CSReadCalibrationParameters();
                    ErrorClamping  = string.Empty;
                    break;

                case ComplexParts.DvDt:
                    ParamsdVdt = Cache.Net.DvDtReadCalibrationParameters();
                    ErrordVdt  = string.Empty;
                    break;
                }
            }
            catch (FaultException <FaultData> ex)
            {
                ShowError(Device, string.Format("{0}. {1} : {2}", ex.Detail.Device, ex.Message, ex.Detail.Message));
            }
        }
コード例 #12
0
ファイル: ControlServer.cs プロジェクト: lardc/mme_software
 ushort IExternalControl.ActivationWorkPlace(ComplexParts Device, ChannelByClumpType ChByClumpType, SctuWorkPlaceActivationStatuses ActivationStatus)
 {
     return(_IoMain.ActivationWorkPlace(Device, ChByClumpType, ActivationStatus));
 }
コード例 #13
0
ファイル: IoIH.cs プロジェクト: lardc/mme_software
 private void FireNotificationEvent(ComplexParts Sender, ushort Problem, ushort Warning, ushort Fault, ushort Disable)
 {
     SystemHost.Journal.AppendLog(ComplexParts.IH, LogMessageType.Warning, string.Format("IH device notification: {0} problem {1}, {0} warning {2}, {0} fault {3}, {0} disable {4}", Sender, Problem, Warning, Fault, Disable));
     m_Communication.PostIHNotificationEvent(Problem, Warning, Fault, Disable);
 }
コード例 #14
0
 public void PostExceptionEvent(ComplexParts Device, string Message)
 {
     EnumerateClients(Client => Client.ExceptionHandler(Device, Message));
 }
コード例 #15
0
 public void PostDeviceConnectionEvent(ComplexParts Device, DeviceConnectionState State, string Message)
 {
     EnumerateClients(Client => Client.DeviceConnectionHandler(Device, State, Message));
 }
コード例 #16
0
ファイル: QueueWorker.cs プロジェクト: lardc/mme_software
 public void AddDeviceConnectionEvent(ComplexParts Device, DeviceConnectionState State, string Message)
 {
     m_ActionQueue.Enqueue(() => Cache.Welcome.State(Device, State, Message));
 }
コード例 #17
0
 public ushort ActivationWorkPlace(ComplexParts Device, ChannelByClumpType ChByClumpType, SctuWorkPlaceActivationStatuses ActivationStatus)
 {
     return(Channel.ActivationWorkPlace(Device, ChByClumpType, ActivationStatus));
 }
コード例 #18
0
ファイル: ControlServer.cs プロジェクト: lardc/mme_software
 void IExternalControl.WriteRegister(ComplexParts Device, ushort Address, ushort Value)
 {
     _IoMain.WriteRegister(Device, Address, Value);
 }
コード例 #19
0
 public void CallAction(ComplexParts Device, ushort Address)
 {
     Channel.CallAction(Device, Address);
 }
コード例 #20
0
 public void WriteRegister(ComplexParts Device, ushort Address, ushort Value)
 {
     Channel.WriteRegister(Device, Address, Value);
 }
コード例 #21
0
 public ushort ReadRegister(ComplexParts Device, ushort Address)
 {
     return(Channel.ReadRegister(Device, Address));
 }
コード例 #22
0
ファイル: ControlServer.cs プロジェクト: lardc/mme_software
 void IExternalControl.ClearFault(ComplexParts Device)
 {
     _IoMain.ClearFault(Device);
 }
コード例 #23
0
ファイル: ControlServer.cs プロジェクト: lardc/mme_software
 ushort IExternalControl.ReadRegister(ComplexParts Device, ushort Address)
 {
     return(_IoMain.ReadRegister(Device, Address));
 }
コード例 #24
0
        internal void State(ComplexParts device, DeviceConnectionState connectionState, string message)
        {
            switch (device)
            {
            case ComplexParts.Service:
                serviceControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Sync:
                syncControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Adapter:
                adapterControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Gateway:
                gatewayControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Commutation:
                commutationControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Gate:
                gateControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.SL:
                vtmControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.BVT:
                bvtControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.Clamping:
                clampControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.CommutationEx:
                commutationControlEx.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.DvDt:
                dVdtControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.ATU:
                aTUControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.QrrTq:
                qrrTqControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.RAC:
                rACControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.IH:
                ihControl.SetConnectionStatus(connectionState, message);
                break;

            case ComplexParts.TOU:
                touControl.SetConnectionStatus(connectionState, message);
                break;
            }
        }
コード例 #25
0
ファイル: ControlServer.cs プロジェクト: lardc/mme_software
 void IExternalControl.CallAction(ComplexParts Device, ushort Address)
 {
     _IoMain.CallAction(Device, Address);
 }
コード例 #26
0
 public void ClearFault(ComplexParts Device)
 {
     Channel.ClearFault(Device);
 }