CycloBranch
cMainThread Class Reference

The class representing a thread launched by the command 'Search->Run'. More...

#include <cMainThread.h>

Inheritance diagram for cMainThread:

Public Types

typedef std::basic_ostream< char, std::char_traits< char > > CoutType
 This is the type of std::cout.
 
typedef CoutType &(* StandardEndLine) (CoutType &)
 This is the function signature of std::endl.
 

Signals

void message (QString s)
 A message which will be shown in log window. More...
 
void enableRunButtonAndSettings (bool enable)
 Enable or disable options 'Search->Run' and 'Search->Settings...'. More...
 
void enableStopButton (bool enable)
 Enable or disable the option 'Search->Stop'. More...
 
void enableButtonsHandlingResults (bool enable)
 Enable or disable buttons handling results. More...
 
void sendParameters (cParameters parameters)
 Send parameters to cMainWindow when the thread has finished. More...
 
void reportSpectra ()
 Report results.
 
void setGraph (string s)
 Set the graph into the cGraphWidget. More...
 

Public Member Functions

 cMainThread (cParameters &parameters, cTheoreticalSpectrumList &listoftheoreticalspectra, bool enablelogwindow=true, bool enablestdout=true)
 The constructor. More...
 
void setGraphReaderIsWorking (bool working)
 Set the flag that the graph reader is working. More...
 
bool isGraphReaderWorking ()
 Check the flag whether the graph reader is working. More...
 
template<class T >
cMainThreadoperator<< (const T &x)
 Overloaded operator <<.
 
cMainThreadoperator<< (const char *x)
 Overloaded operator <<.
 
cMainThreadoperator<< (const string &x)
 Overloaded operator <<.
 
cMainThreadoperator<< (StandardEndLine manip)
 Define an operator << to take in std::endl.
 
void addToParallelOutputState (int value)
 Add a value to the output state (for internal threads). More...
 

Protected Member Functions

void run ()
 The main method of the thread.
 
void emitEndSignals ()
 The signals emitted when the thread has successfully finished.
 

Detailed Description

The class representing a thread launched by the command 'Search->Run'.

Constructor & Destructor Documentation

◆ cMainThread()

cMainThread::cMainThread ( cParameters parameters,
cTheoreticalSpectrumList listoftheoreticalspectra,
bool  enablelogwindow = true,
bool  enablestdout = true 
)

The constructor.

Parameters
parametersreference to input paramaters
listoftheoreticalspectralists of theoretical spectra
enablelogwindowif true then messages are logged into the log window
enablestdoutif true then messages are logged into the standard output

Member Function Documentation

◆ addToParallelOutputState()

void cMainThread::addToParallelOutputState ( int  value)

Add a value to the output state (for internal threads).

Parameters
valuevalue

◆ enableButtonsHandlingResults

void cMainThread::enableButtonsHandlingResults ( bool  enable)
signal

Enable or disable buttons handling results.

Parameters
enabletrue == enable, false == disable

◆ enableRunButtonAndSettings

void cMainThread::enableRunButtonAndSettings ( bool  enable)
signal

Enable or disable options 'Search->Run' and 'Search->Settings...'.

Parameters
enabletrue == enable, false == disable

◆ enableStopButton

void cMainThread::enableStopButton ( bool  enable)
signal

Enable or disable the option 'Search->Stop'.

Parameters
enabletrue == enable, false == disable

◆ isGraphReaderWorking()

bool cMainThread::isGraphReaderWorking ( )

Check the flag whether the graph reader is working.

Return values
booltrue when the graph reader is working, false otherwise

◆ message

void cMainThread::message ( QString  s)
signal

A message which will be shown in log window.

Parameters
stext of the message

◆ sendParameters

void cMainThread::sendParameters ( cParameters  parameters)
signal

Send parameters to cMainWindow when the thread has finished.

Parameters
parametersparameters

◆ setGraph

void cMainThread::setGraph ( string  s)
signal

Set the graph into the cGraphWidget.

Parameters
sgraph printed as a string

◆ setGraphReaderIsWorking()

void cMainThread::setGraphReaderIsWorking ( bool  working)

Set the flag that the graph reader is working.

Parameters
workingset true when the graph reader is working, otherwise set false

The documentation for this class was generated from the following files: