Example #1
0
        internal void Deinitialize()
        {
            var oldState = m_ConnectionState;

            m_ConnectionState = DeviceConnectionState.DisconnectionInProcess;
            FireConnectionEvent(DeviceConnectionState.DisconnectionInProcess, "Commutation disconnecting");

            try
            {
                if (!m_IsCommutationEmulation && oldState == DeviceConnectionState.ConnectionSuccess)
                {
                    CallAction(ACT_DISABLE_POWER);
                }

                if (m_CheckSafetyThread != null)
                {
                    //завершаем работу потока, контролирующего срабатывание оптической системы безопасности
                    m_SafetyOn = false;
                    m_CheckSafetyThread.StopCycle(true);
                }

                m_ConnectionState = DeviceConnectionState.DisconnectionSuccess;
                FireConnectionEvent(DeviceConnectionState.DisconnectionSuccess, "Commutation disconnected");
            }
            catch (Exception)
            {
                m_ConnectionState = DeviceConnectionState.DisconnectionError;
                FireConnectionEvent(DeviceConnectionState.DisconnectionError, "Commutation disconnection error");
            }
        }
Example #2
0
        internal void Deinitialize()
        {
            var oldState = m_ConnectionState;

            m_ConnectionState = DeviceConnectionState.DisconnectionInProcess;
            FireConnectionEvent(DeviceConnectionState.DisconnectionInProcess, "Gateway disconnecting");

            if (!m_IsGatewayEmulation && oldState == DeviceConnectionState.ConnectionSuccess)
            {
                m_Thread.StopCycle(true);
            }

            m_ConnectionState = DeviceConnectionState.DisconnectionSuccess;
            FireConnectionEvent(DeviceConnectionState.DisconnectionSuccess, "Gateway disconnected");
        }
Example #3
0
        internal void Deinitialize()
        {
            var oldState = m_ConnectionState;

            if (oldState == DeviceConnectionState.ConnectionSuccess)
            {
                m_Thread.StopCycle(true);
            }

            m_ConnectionState = DeviceConnectionState.DisconnectionInProcess;
            FireConnectionEvent(DeviceConnectionState.DisconnectionInProcess, "Clamping disconnecting");

            try
            {
                if (!m_IsClampingEmulation && oldState == DeviceConnectionState.ConnectionSuccess)
                {
                    var devState = (HWDeviceState)
                                   ReadRegister(REG_DEVICE_STATE);

                    try
                    {
#if !MME_005
                        WriteRegister(REG_TEMP_SETPOINT, ROOM_TEMP * 10);
                        CallAction(ACT_SET_TEMPERATURE);
#endif
                    }
                    catch (Exception ex)
                    {
                        SystemHost.Journal.AppendLog(ComplexParts.Clamping, LogMessageType.Error, $"Error during Clamp deinitialization, temperature stage: {ex.Message}");
                    }

                    if (devState == HWDeviceState.ClampingDone)
                    {
                        Unsqueeze(new TestParameters());
                    }
                }

                m_ConnectionState = DeviceConnectionState.DisconnectionSuccess;
                FireConnectionEvent(DeviceConnectionState.DisconnectionSuccess, "Clamping disconnected");
            }
            catch (Exception)
            {
                m_ConnectionState = DeviceConnectionState.DisconnectionError;
                FireConnectionEvent(DeviceConnectionState.DisconnectionError, "Clamping disconnection error");
            }

            m_ConnectionState = DeviceConnectionState.DisconnectionSuccess;
        }