Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxStreamer.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #include "cxStreamer.h"
13 #include "cxSender.h"
14 
15 namespace cx
16 {
17 
19  QObject(NULL), mSendInterval(0), mSendTimer(0), mInitialized(false)
20 {}
21 
22 void Streamer::setSendInterval(int milliseconds)
23 {
24  mSendInterval = milliseconds;
25 }
26 
28 {
29  return mSendInterval;
30 }
31 
32 void Streamer::setInitialized(bool initialized)
33 {
34  mInitialized = initialized;
35 }
36 
38 {
39  return mInitialized;
40 }
41 
42 void Streamer::createSendTimer(bool singleshot)
43 {
44  mSendTimer = new QTimer(this);
45  mSendTimer->setSingleShot(singleshot);
46  connect(mSendTimer, SIGNAL(timeout()), this, SLOT(streamSlot()));
47 }
48 
50 {
51  return mSender && mSender->isReady();
52 }
53 
54 //--------------------------------------------------------
55 
56 
57 //--------------------------------------------------------
58 
60 {
61  mArguments = arguments;
62 }
63 
64 }//namespace cx
void createSendTimer(bool singleshot=false)
Definition: cxStreamer.cpp:42
void setSendInterval(int milliseconds)
how often an image should be sent (in milliseconds)
Definition: cxStreamer.cpp:22
bool isReadyToSend()
Definition: cxStreamer.cpp:49
virtual void streamSlot()=0
std::map< QString, QString > StringMap
void setInitialized(bool initialized)
Definition: cxStreamer.cpp:32
bool isInitialized()
Definition: cxStreamer.cpp:37
QTimer * mSendTimer
Definition: cxStreamer.h:66
SenderPtr mSender
Definition: cxStreamer.h:65
virtual void initialize(StringMap arguments)
Definition: cxStreamer.cpp:59
int getSendInterval() const
how often an image should be sent (in milliseconds)
Definition: cxStreamer.cpp:27
Namespace for all CustusX production code.