Skip to content

Commit

Permalink
Moved fake dae back to ISISLiveData library.
Browse files Browse the repository at this point in the history
For some reason it didn't work when in the same library with the listener. Re #7954
  • Loading branch information
mantid-roman committed Sep 27, 2013
1 parent 348d30e commit 0ceae8e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/ISISLiveData/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
set ( SRC_FILES
src/example.cpp
src/FakeISISEventDAE.cpp
)

set ( INC_FILES
#inc/MantidISISLiveData/DllConfig.h
inc/MantidISISLiveData/TCPEventStreamDefs.h
inc/MantidISISLiveData/FakeISISEventDAE.h
)

set ( TEST_FILES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef MANTID_LIVEDATA_FAKEISISHISTODAE_H_
#define MANTID_LIVEDATA_FAKEISISHISTODAE_H_
#ifndef MANTID_ISISLIVEDATA_FAKEISISHISTODAE_H_
#define MANTID_ISISLIVEDATA_FAKEISISHISTODAE_H_

//----------------------------------------------------------------------
// Includes
Expand All @@ -16,7 +16,7 @@ namespace Poco

namespace Mantid
{
namespace LiveData
namespace ISISLiveData
{
/**
Simulates ISIS histogram DAE. It runs continuously until canceled and listens to port 6789 for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ When connected starts sending event packets.
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidLiveData/FakeISISEventDAE.h"
#include "MantidLiveData/ISIS/TCPEventStreamDefs.h"
#include "MantidISISLiveData/FakeISISEventDAE.h"
#include "MantidISISLiveData/TCPEventStreamDefs.h"

#include <Poco/Net/TCPServer.h>
#include <Poco/Net/StreamSocket.h>
Expand All @@ -18,7 +18,7 @@ When connected starts sending event packets.

namespace Mantid
{
namespace LiveData
namespace ISISLiveData
{
// Register the algorithm into the algorithm factory
DECLARE_ALGORITHM(FakeISISEventDAE);
Expand Down Expand Up @@ -162,7 +162,7 @@ void FakeISISEventDAE::exec()
{
break;
}
progress( 0.0, "Fake DAE" );
progress( 0.0, "Fake ISIS event DAE" );

// Sleep for 50 msec
Poco::Thread::sleep(50);
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/LiveData/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ set ( SRC_FILES
src/SNSLiveEventDataListener.cpp
src/StartLiveData.cpp
src/ISISLiveEventDataListener.cpp
src/FakeISISEventDAE.cpp
)

set ( SRC_UNITY_IGNORE_FILES src/LoadDAE/idc.cpp
Expand All @@ -38,7 +37,6 @@ set ( INC_FILES
inc/MantidLiveData/SNSLiveEventDataListener.h
inc/MantidLiveData/StartLiveData.h
inc/MantidLiveData/ISISLiveEventDataListener.h
inc/MantidLiveData/FakeISISEventDAE.h
inc/MantidLiveData/ISIS/TCPEventStreamDefs.h
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ ISISLiveEventDataListener::~ISISLiveEventDataListener()

bool ISISLiveEventDataListener::connect(const Poco::Net::SocketAddress &address)
{
std::cerr << "Connecting to " << address.toString() << std::endl;
// If we don't have an address, force a connection to the test server running on
// localhost on the default port
if (address.host().toString().compare( "0.0.0.0") == 0)
{
Poco::Net::SocketAddress tempAddress("localhost:10000");
Poco::Net::SocketAddress tempAddress("127.0.0.1:10000");
try {
std::cerr << "Connecting to test service " << tempAddress.toString() << std::endl;
m_socket.connect( tempAddress); // BLOCKING connect
std::cerr << "Actually connected to " << m_socket.address().toString() << std::endl;
} catch (...) {
g_log.error() << "Connection to " << tempAddress.toString() << " failed." << std::endl;
return false;
Expand All @@ -93,6 +94,7 @@ bool ISISLiveEventDataListener::connect(const Poco::Net::SocketAddress &address)
else
{
try {
std::cerr << "Connecting to live DAE " << address.toString() << std::endl;
m_socket.connect( address); // BLOCKING connect
} catch (...) {
g_log.debug() << "Connection to " << address.toString() << " failed." << std::endl;
Expand Down

0 comments on commit 0ceae8e

Please sign in to comment.