9 #include <QtCore/QDebug>
10 #include <QtCore/QFuture>
12 #if QT_VERSION >= 0x050000
13 #include <QtConcurrent/QtConcurrent>
14 #include <QtWidgets/QMessageBox>
16 #include <QtCore/QtConcurrentRun>
17 #include <QtGui/QMessageBox>
20 #include <QtTest/QTest>
25 #include "soapCASSsoapProxy.h"
26 #include "CASSsoap.nsmap"
33 : _transferredBytes(0)
44 client.soap_endpoint =
_server.c_str();
47 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::getHistogram,
48 key.toStdString(), id, &ret);
54 if( (future.
result() != SOAP_OK) || !ret)
56 soap_multipart::iterator attachment(client.dime.begin());
57 if(client.dime.end() == attachment)
61 cass::Serializer serializer( std::string((
char *)(*attachment).ptr, (*attachment).size) );
70 client.soap_endpoint =
_server.c_str();
71 soap_set_dime(&client);
79 soap_set_dime_attachment(&client, (
char*)
data.data(),
data.size(),
80 "application/processorList",
"0", 0, NULL);
81 int status = client.getResults(
false, &success);
85 if (status != SOAP_OK || !success)
88 soap_multipart::iterator attachment(client.dime.begin());
89 if(client.dime.end() == attachment)
91 cass::Serializer deserializer(std::string((
char*)(*attachment).ptr,(*attachment).size));
92 for (
int i(0); i<list.size(); ++i)
103 CASSsoapProxy client;
104 client.soap_endpoint =
_server.c_str();
107 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::getPostprocessorIds, &ret);
113 if( (future.
result() != SOAP_OK) || !ret)
116 tr(
"Error resultNames: No communication to '") +
120 soap_multipart::iterator attachment (client.dime.begin());
121 if(client.dime.end() == attachment)
124 tr(
"Error resultNames: Server '")+
134 cass::Serializer serializer( std::string((
char *)(*attachment).ptr, (*attachment).size) );
152 CASSsoapProxy client;
153 client.soap_endpoint =
_server.c_str();
156 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::readini,0,&ret);
164 tr(
"Error: Cannot reload the ini file "));
169 CASSsoapProxy client;
170 client.soap_endpoint =
_server.c_str();
173 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::controlDarkcal,
174 command.toStdString(), &ret);
182 tr(
"Error: Cannot broadcast ") + command);
187 CASSsoapProxy client;
188 client.soap_endpoint =
_server.c_str();
191 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::receiveCommand,
192 key.toStdString(), command.toStdString(),
201 tr(
"Error: Cannot send '") + command +
tr(
"' to '")+
207 _server = serverstring.toStdString();
212 CASSsoapProxy client;
213 client.soap_endpoint =
_server.c_str();
216 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::quit, &ret);
224 tr(
"Error: Cannot communicate quitServer command."));
229 CASSsoapProxy client;
230 client.soap_endpoint =
_server.c_str();
233 QFuture<int> future = QtConcurrent::run(&client,&CASSsoapProxy::clearHistogram, key.toStdString(), &ret);
241 tr(
"Error: Cannot communicate clearHistogram command."));
size_t _transferredBytes
the amount of bytes transferred
const QStringList & getList() const
getter for the internal list
void reloadIni() const
reload .ini file
void quitServer() const
tell the server to quit
virtual ~TCPClient()
destructor
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
file contains the classes connect to cass
void broadcastCommand(const QString &command) const
broadcast a command to all processors in the server
tr(const char *sourceText, const char *disambiguation=0, int n=-1)
QString type() const
return the type of source we are
void setServer(const QString &serverstring)
change the server to connect to
fromStdString(const std::string &str)
processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
void clearHistogram(QString key) const
clear the histogram of a processor
const std::string buffer() const
retrieve a const reference to the compressed string.
QStringList resultNames()
retrieve the list of available histograms
size_t receivedBytes() const
retrieve the transferred bytes
auxiliary data[Processor]
cass::Result< float > result_t
define the result type
file contains the classes that can serialize the key list
std::string _server
the server string
void sendCommandTo(const QString &key, const QString &command) const
broadcast a command to all processors in the server
push_back(const T &value)
QVector< result_t::shared_pointer > results(const QStringList &list)
retrieve a list of results all with the same id
result_t::shared_pointer result(const QString &key, quint64 id=0)
retrieve a specific result
TCPClient()
default constructor
void serialize(cass::SerializerBackend &out) const
implmented but doesn't do anything
and the shutter status[Processor]