Commit 73ee314a authored by Marco De Marco's avatar Marco De Marco
Browse files

Alarm state added

parent e873abcb
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ void Client::handleResolve(const boost::system::error_code& errorCode,
    {
        ERROR_STREAM << "Client::handleResolve() " << errorCode.message() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());
    }
}
@@ -235,7 +235,7 @@ void Client::handleWriteRequest(const boost::system::error_code& errorCode)
    {
        ERROR_STREAM << "Client::handleRequest() " << errorCode.message() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());
    }
}
@@ -257,7 +257,7 @@ void Client::handleReadResponseHeader(const boost::system::error_code& errorCode
    {
        ERROR_STREAM << "Client::handleReadResponseHeader() " << errorCode.message() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());
    }
}
@@ -297,14 +297,14 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode)
        {
            ERROR_STREAM << "Client::handleResponse() " << ec.what() << endl;

            writeState(Tango::FAULT);
            writeState(Tango::ALARM);
            writeStatus(ec.what());
        }
        catch(...)
        {
            ERROR_STREAM << "Client::handleResponse() Unknown error" << endl;

            writeState(Tango::FAULT);
            writeState(Tango::ALARM);
            writeStatus("Unknown error");
        }
    }
@@ -312,7 +312,7 @@ void Client::handleReadResponseBody(const boost::system::error_code& errorCode)
    {
        ERROR_STREAM << "Client::handleResponse() " << errorCode.message() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -538,14 +538,14 @@ void MetadataImporter::on()
    }
    catch(std::exception& ex)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        std::stringstream error_stream;
        error_stream << "MetadataImporter::On() " << ex.what() << std::endl;
        set_status(error_stream.str());
    }
    catch(...)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        set_status("MetadataImporter::On() unknown error");
    }

@@ -570,14 +570,14 @@ void MetadataImporter::off()
    }
    catch(std::exception& ex)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        std::stringstream error_stream;
        error_stream << "MetadataImporter::Off() " << ex.what() << std::endl;
        set_status(error_stream.str());
    }
    catch(...)
    {
        set_state(Tango::FAULT);
        set_state(Tango::ALARM);
        set_status("MetadataImporter::Off() unknown error");
    }

+5 −1
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <excludedStates>ON</excludedStates>
      <excludedStates>FAULT</excludedStates>
      <excludedStates>ALARM</excludedStates>
    </commands>
    <commands name="Off" description="" execMethod="off" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="">
@@ -119,7 +120,10 @@
    <states name="OFF" description="Metadata importer is in OFF state (not connected to server)">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </states>
    <states name="FAULT" description="Metadata importer is in FAULT state (an error occurred)">
    <states name="FAULT" description="Metadata importer is in FAULT state (not ready to import metadata)">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </states>
    <states name="ALARM" description="Metadata importer is in FAULT state (not ready to import metadata)">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </states>
    <preferences docHome="./doc_html" makefileHome="/usr/local/tango-8.1.2/share/pogo/preferences"/>
+4 −2
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@
//================================================================
//  ON      |  Metadata importer is in ON state (connected to server and ready to import)
//  OFF     |  Metadata importer is in OFF state (not connected to server)
//  FAULT   |  Metadata importer is in FAULT state (an error occurred)
//  FAULT   |  Metadata importer is in FAULT state (not ready to import metadata)
//  ALARM   |  Metadata importer is in FAULT state (not ready to import metadata)


namespace MetadataImporter_ns
@@ -66,7 +67,8 @@ bool MetadataImporter::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
	//	Compare device state with not allowed states.
	if (get_state()==Tango::ON ||
		get_state()==Tango::FAULT)
		get_state()==Tango::FAULT ||
		get_state()==Tango::ALARM)
	{
	/*----- PROTECTED REGION ID(MetadataImporter::OnStateAllowed) ENABLED START -----*/

+5 −4
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ void PlainClient::startConnect(boost::asio::ip::tcp::resolver::iterator endPoint

        DEBUG_STREAM << "PlainClient::startConnect() " << infoStream.str() << endl;

        writeState(Tango::ON);
        writeStatus(infoStream.str());

        m_plainSocket.async_connect(endPointIterator->endpoint(),
@@ -88,7 +89,7 @@ void PlainClient::startConnect(boost::asio::ip::tcp::resolver::iterator endPoint
    {
        ERROR_STREAM << "PlainClient::startConnect() no more endpoint" << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus("No more endpoint");
    }
}
@@ -122,7 +123,7 @@ void PlainClient::handleConnect(const boost::system::error_code& errorCode,
    {
        ERROR_STREAM << "PlainClient::handleConnect() " << errorCode.message() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());

        if(m_plainSocket.is_open())
@@ -167,14 +168,14 @@ void PlainClient::startWriteRequest()
    {
        ERROR_STREAM << "PlainClient::startWriteRequest() " << ec.what() << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus(ec.what());
    }
    catch(...)
    {
        ERROR_STREAM << "PlainClient::startWriteRequest() unknown error" << endl;

        writeState(Tango::FAULT);
        writeState(Tango::ALARM);
        writeStatus("Unknown error");
    }
}
Loading