RunSnarlEntry Class Reference

#include <RunSnarlEntry.h>

Inheritance diagram for RunSnarlEntry:
GuiHBox GuiBox GuiCompositeFrameBase GuiBase

List of all members.

Public Member Functions

 RunSnarlEntry (TGWindow &parent, Mint *mint=0)
 ~RunSnarlEntry ()
void Update (Mint *mint)

Private Member Functions

 RunSnarlEntry (const RunSnarlEntry &rhs)
RunSnarlEntryoperator= (const RunSnarlEntry &rhs)
void RSEntryHandler (void)
void RunningEntryHandler (GuiTextEntry *gte, int ind)

Private Attributes

GuiTextEntryfRunEntry
GuiTextEntryfSnarlEntry
GuiTextEntryfJumpEntry
MintfMint

Detailed Description

Definition at line 27 of file RunSnarlEntry.h.


Constructor & Destructor Documentation

RunSnarlEntry::RunSnarlEntry ( TGWindow &  parent,
Mint mint = 0 
)

Definition at line 27 of file RunSnarlEntry.cxx.

References GuiTextEntry::activated, GuiCompositeFrameBase::Add(), fRunEntry, fSnarlEntry, RSEntryHandler(), running_labels, and RunningEntryHandler().

00028     : GuiHBox(parent)
00029     ,fMint(mint)
00030 {
00031     using namespace SigC;
00032 
00033     for (int ind = 0; ind < 4; ++ind) {
00034 
00035         GuiLabel* lab = manage(new GuiLabel(*this,running_labels[ind]));
00036         this->Add(*lab);
00037         GuiTextEntry* gte = manage(new GuiTextEntry(*this," "));
00038         this->Add(*gte);
00039         gte->activated.connect
00040             (bind(slot(*this,&RunSnarlEntry::RunningEntryHandler),
00041                   gte,ind));
00042     }
00043 
00044     // run:
00045     GuiLabel* runlab = manage(new GuiLabel(*this,"Run:"));
00046     this->Add(*runlab);
00047     fRunEntry = manage(new GuiTextEntry(*this," "));
00048     this->Add(*fRunEntry);
00049     fRunEntry->activated.connect(slot(*this,&RunSnarlEntry::RSEntryHandler));
00050 
00051     // snarl:
00052     GuiLabel* snarllab = manage(new GuiLabel(*this,"Snarl:"));
00053     this->Add(*snarllab);
00054     fSnarlEntry = manage(new GuiTextEntry(*this," "));
00055     this->Add(*fSnarlEntry);
00056     fSnarlEntry->activated.connect(slot(*this,&RunSnarlEntry::RSEntryHandler));    
00057 
00058 }

RunSnarlEntry::~RunSnarlEntry (  ) 

Definition at line 60 of file RunSnarlEntry.cxx.

00061 {
00062 }

RunSnarlEntry::RunSnarlEntry ( const RunSnarlEntry rhs  )  [private]

Member Function Documentation

RunSnarlEntry& RunSnarlEntry::operator= ( const RunSnarlEntry rhs  )  [private]
void RunSnarlEntry::RSEntryHandler ( void   )  [private]

Definition at line 76 of file RunSnarlEntry.cxx.

References fMint, fRunEntry, fSnarlEntry, Mint::GetJint(), Jint::GoTo(), and run().

Referenced by RunSnarlEntry().

00077 {
00078     if (!fMint) return;
00079 
00080     string run = fRunEntry->GetText();
00081     string snarl = fSnarlEntry->GetText();
00082 
00083     if (run == "" || snarl == "" || run == " " || snarl == " ") {
00084         cerr << "Both run and snarl must be set to jump to record\n";
00085         return;
00086     }
00087 
00088     int runi = atoi(run.c_str());
00089     int snarli = atoi(snarl.c_str());
00090 
00091     fMint->GetJint().GoTo(runi,snarli);
00092 }

void RunSnarlEntry::RunningEntryHandler ( GuiTextEntry gte,
int  ind 
) [private]

Definition at line 94 of file RunSnarlEntry.cxx.

References fMint, Mint::GetJint(), Jint::Next(), Jint::Prev(), Jint::Run(), running_labels, and running_mode.

Referenced by RunSnarlEntry().

00096 {
00097     const char* jump = gte->GetText();
00098     if ( std::string(jump) == "") {
00099         cerr << running_labels[ind] << " no entry set\n";
00100         return;
00101     }
00102     int jumpi = atoi(jump);
00103 
00104     if (!ind) {
00105         if (jumpi > 0) fMint->GetJint().Next(jumpi);
00106         else if (jumpi < 0) fMint->GetJint().Prev(-1*jumpi);
00107     }
00108     else {
00109         fMint->GetJint().Run(jumpi,running_mode[ind]);
00110     }
00111     gte->SetText("");    
00112 }

void RunSnarlEntry::Update ( Mint mint  ) 

Definition at line 64 of file RunSnarlEntry.cxx.

References fMint, Form(), fRunEntry, fSnarlEntry, Mint::GetJobC(), DataUtil::GetRunSnarlEvent(), JobC::Mom, and run().

Referenced by PageDisplay::UpdateDisplay().

00065 {
00066     fMint = mint;
00067     if (!fMint) return;
00068 
00069     int run=0, snarl=0, event=0;
00070     DataUtil::GetRunSnarlEvent(&(fMint->GetJobC().Mom), run, snarl, event);
00071 
00072     fRunEntry->SetText(Form("%d",run));
00073     fSnarlEntry->SetText(Form("%d",snarl));
00074 }


Member Data Documentation

Definition at line 48 of file RunSnarlEntry.h.

Definition at line 49 of file RunSnarlEntry.h.

Referenced by RSEntryHandler(), RunningEntryHandler(), and Update().

Definition at line 48 of file RunSnarlEntry.h.

Referenced by RSEntryHandler(), RunSnarlEntry(), and Update().

Definition at line 48 of file RunSnarlEntry.h.

Referenced by RSEntryHandler(), RunSnarlEntry(), and Update().


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

Generated on 22 May 2017 for loon by  doxygen 1.6.1