OpendTect  6.6
cmdrecorder.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Jaap Glas
8  Date: March 2009
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uicmddrivermod.h"
15 #include "callback.h"
16 #include "separstr.h"
17 #include "od_ostream.h"
18 
19 #include "cmddriverbasics.h"
20 
21 class uiMenu;
22 class StreamData;
23 class uiMainWin;
24 class uiAction;
25 
26 
27 namespace CmdDrive
28 {
29 
30 #define mRecOutStrm \
31  if ( !rec_.mustSkip() ) rec_.outputStrm()
32 
33 
34 mExpClass(uiCmdDriver) CmdRecEvent
35 {
36 public:
38  : begin_(true), refnr_(0) , srcwin_(0)
39  , openqdlg_(false), stolen_(false)
40  , object_(0), similarobjs_(true), mnuitm_(0)
41  , dynamicpopup_(false), casedep_(false)
42  , nraccepts_(0)
43  {}
44 
46  bool begin_;
47  int refnr_;
49 
51  bool openqdlg_;
53  bool stolen_;
54 
58  uiAction* mnuitm_;
61  bool casedep_;
63 
65 };
66 
67 
68 class CmdComposer;
69 
70 mExpClass(uiCmdDriver) CmdRecorder : public CallBacker
71 {
72 public:
73  friend class CmdComposer;
74 
75  CmdRecorder(const uiMainWin& applwin);
77 
78  void setOutputFile(const char* fnm) { outputfnm_ = fnm; }
79  void setBufferSize(int sz) { bufsize_ = sz; }
80  void writeTailOnly(bool yn) { writetailonly_ = yn; }
82 
84  bool mustSkip() const;
85 
86  bool start();
87  void stop(bool fatal=false);
88 
89  bool isRecording() const { return recording_; }
90 
92 
93 protected:
94 
97 
100 
101  void flush();
102 
103  const uiMainWin* applWin() const { return applwin_; }
105 
113 
116 
119 
122 
124 
128  int bufsize_;
130  mutable int outputcounter_;
131 };
132 
133 
134 }; // namespace CmdDrive
135 
136 
CmdDrive::CmdRecorder::lastobjsearched_
const CallBacker * lastobjsearched_
Definition: cmdrecorder.h:120
CmdDrive::CmdRecEvent::mnuitm_
uiAction * mnuitm_
Definition: cmdrecorder.h:58
CmdDrive::CmdRecorder::start
bool start()
CmdDrive::CmdRecorder::bufsize_
int bufsize_
Definition: cmdrecorder.h:128
CmdDrive::CmdRecorder::writeTailOnly
void writeTailOnly(bool yn)
Definition: cmdrecorder.h:80
CmdDrive::CmdRecEvent::idstr_
BufferString idstr_
Definition: cmdrecorder.h:45
uiMainWin
User interface main window.
Definition: uimainwin.h:35
CmdDrive::CmdRecorder
Definition: cmdrecorder.h:71
CmdDrive::CmdRecorder::flush
void flush()
CmdDrive::CmdRecorder::bufstream_
od_ostrstream & bufstream_
Definition: cmdrecorder.h:126
StreamData
Holds data to use and close an iostream. Usually created by StreamProvider.
Definition: strmdata.h:27
ObjectSet< const uiMainWin >
CmdDrive::CmdRecorder::composers_
ObjectSet< CmdComposer > composers_
Definition: cmdrecorder.h:123
od_ostream.h
CmdDrive::CmdRecEvent::object_
CallBacker * object_
Definition: cmdrecorder.h:55
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
CmdDrive::CmdRecEvent::srcwin_
const uiMainWin * srcwin_
Definition: cmdrecorder.h:50
CmdDrive::CmdRecEvent::nraccepts_
int nraccepts_
Definition: cmdrecorder.h:64
CmdDrive::CmdRecorder::lastobjfreewins_
ObjectSet< const uiMainWin > lastobjfreewins_
Definition: cmdrecorder.h:121
CmdDrive::CmdRecorder::bufstr_
BufferString bufstr_
Definition: cmdrecorder.h:127
CmdDrive::CmdRecorder::findKeyString
bool findKeyString(const uiMainWin &, CmdRecEvent &)
callback.h
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
CmdDrive::CmdRecEvent::openqdlg_
bool openqdlg_
Definition: cmdrecorder.h:51
CmdDrive::CmdRecEvent::begin_
bool begin_
Definition: cmdrecorder.h:46
CmdDrive::CmdRecorder::ignoreCmdDriverWindows
void ignoreCmdDriverWindows(bool)
CmdDrive::CmdComposer
Definition: cmdcomposer.h:52
CmdDrive::CmdRecorder::insertWinAssertion
void insertWinAssertion(const CmdRecEvent &)
CmdDrive::CmdRecorder::stop
void stop(bool fatal=false)
CmdDrive::CmdRecorder::winassertcasedep_
bool winassertcasedep_
Definition: cmdrecorder.h:112
CmdDrive::CmdRecorder::setOutputFile
void setOutputFile(const char *fnm)
Definition: cmdrecorder.h:78
CmdDrive::CmdRecorder::winstack_
WindowStack winstack_
Definition: cmdrecorder.h:114
CmdDrive::CmdRecorder::dynamicMenuInterceptor
void dynamicMenuInterceptor(CallBacker *)
CmdDrive::CmdRecEvent::refnr_
int refnr_
Definition: cmdrecorder.h:47
CmdDrive::CmdRecEvent::similarobjs_
bool similarobjs_
Definition: cmdrecorder.h:56
CmdDrive::CmdRecorder::applwin_
const uiMainWin * applwin_
Definition: cmdrecorder.h:104
CmdDrive::WindowStack
Definition: cmddriverbasics.h:178
CmdDrive::CmdRecorder::openqdialog_
bool openqdialog_
Definition: cmdrecorder.h:117
CmdDrive::CmdRecorder::handleEvent
void handleEvent(CallBacker *)
CmdDrive::CmdRecEvent::stolen_
bool stolen_
Definition: cmdrecorder.h:53
CmdDrive::CmdRecEvent::menupath_
BufferString menupath_
Definition: cmdrecorder.h:60
CmdDrive::CmdRecorder::mustSkip
bool mustSkip() const
CmdDrive::CmdRecorder::~CmdRecorder
~CmdRecorder()
BufferString
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size.
Definition: bufstring.h:40
CmdDrive::CmdRecEvent::qdlgtitle_
BufferString qdlgtitle_
Definition: cmdrecorder.h:52
CmdDrive::CmdRecorder::outputStrm
od_ostream & outputStrm() const
CmdDrive::CmdRecEvent::execprefix_
BufferString execprefix_
Definition: cmdrecorder.h:62
CmdDrive
Command Drive
Definition: canvascommands.h:22
CmdDrive::CmdRecorder::winassertion_
BufferString winassertion_
Definition: cmdrecorder.h:111
CmdDrive::CmdRecorder::setBufferSize
void setBufferSize(int sz)
Definition: cmdrecorder.h:79
CmdDrive::CmdRecorder::outputstrm_
od_ostream & outputstrm_
Definition: cmdrecorder.h:109
CmdDrive::CmdRecorder::writetailonly_
bool writetailonly_
Definition: cmdrecorder.h:125
CmdDrive::CmdRecorder::applWin
const uiMainWin * applWin() const
Definition: cmdrecorder.h:103
CmdDrive::CmdRecEvent
Definition: cmdrecorder.h:35
cmddriverbasics.h
CmdDrive::CmdRecEvent::casedep_
bool casedep_
Definition: cmdrecorder.h:61
CmdDrive::CmdRecorder::updateCmdComposers
void updateCmdComposers()
uiMenu
Definition: uimenu.h:65
CmdDrive::CmdRecorder::recording_
bool recording_
Definition: cmdrecorder.h:107
CmdDrive::CmdRecorder::popuprefnrs_
TypeSet< int > popuprefnrs_
Definition: cmdrecorder.h:115
CmdDrive::CmdRecorder::outputfnm_
BufferString outputfnm_
Definition: cmdrecorder.h:108
CmdDrive::CmdRecorder::isRecording
bool isRecording() const
Definition: cmdrecorder.h:89
CmdDrive::CmdRecorder::CmdRecorder
CmdRecorder(const uiMainWin &applwin)
CmdDrive::CmdRecorder::nrparskipped_
int nrparskipped_
Definition: cmdrecorder.h:129
od_ostrstream
OD class for stream write into string.
Definition: od_strstream.h:36
CmdDrive::CmdRecEvent::msg_
BufferString msg_
Definition: cmdrecorder.h:48
CmdDrive::CmdRecorder::outputcounter_
int outputcounter_
Definition: cmdrecorder.h:130
od_ostream
OD class for stream write common access to the user log file, or std::cout in other than od_main.
Definition: od_ostream.h:26
CmdDrive::CmdRecorder::rec_
CmdRecorder & rec_
Definition: cmdrecorder.h:106
CmdDrive::CmdRecorder::dynamicpopupmenu_
uiMenu * dynamicpopupmenu_
Definition: cmdrecorder.h:110
CmdDrive::CmdRecEvent::CmdRecEvent
CmdRecEvent()
Definition: cmdrecorder.h:37
CmdDrive::CmdRecEvent::dynamicpopup_
bool dynamicpopup_
Definition: cmdrecorder.h:59
CmdDrive::CmdRecorder::ignorecmddriverwindows_
bool ignorecmddriverwindows_
Definition: cmdrecorder.h:118
CmdDrive::CmdRecEvent::keystr_
BufferString keystr_
Definition: cmdrecorder.h:57
TypeSet< int >
separstr.h

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021