Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 10 of 11  Not logged in ELOG logo
ID Date Author Topic Subjectdown
  207   11 May 2016 Ryu SawadaInfoCan we reset histograms at the middle of a run in ROME?
Dear Sudeshna,

I added a new button to clear histograms.


Please update your ROME and use the 'develop' branch.

Best regards,

Ryu

> Hi All,
>
> Suppose I want to pause a run, at the middle, and change some run conditions. So
> I want to clear histograms at the middle of a run. Is that possible to do in ROME?
>
> That when I pause the run, I want to clear histograms. So with the new run
> conditions, when we resume that run, we will get clear pads and histograms will
> be filled in new.
>
>
> Thanks a lot!
> Sudeshna
  63   24 Mar 2005 Ryu SawadaInfoCVS_RSH
I recommended to my friend trying ROME, but he couldn't download it, because he didn't set CVS_RSH.
There is no instruction for setting CVS_RSH in ROME download page.

You had better to write about it.
  67   30 Mar 2005 Matthias SchneebeliInfoCVS_RSH
> I recommended to my friend trying ROME, but he couldn't download it, because he didn't set CVS_RSH.
> There is no instruction for setting CVS_RSH in ROME download page.
> 
> You had better to write about it.

Yes, thanks
  14   09 Nov 2004 Ryu SawadaSuggestionBank size check
in ROMEEventLoop::ReadEvent(), if  gROME->isOffline() and gROME->isMidas(),
ROME checks if bank size is greater than 0.

But It can happen that the bank size is 0 in normal file.
(Actually in my midas file bank size of "environment data" is 0 at this moment)

---------------------------------------------
 else if (gROME->isOffline()&&gROME->isMidas()) {
      // read event header
      EVENT_HEADER *pevent = (EVENT_HEADER*)gROME->GetMidasEvent();
      bool readError = false;
               .
               .
               .
         if (pevent->data_size <= 0) readError = true;
         else {
            n = read(fMidasFileHandle, pevent+1, pevent->data_size);
            if (n != (int) pevent->data_size) readError = true;
	    if ((int) ((BANK_HEADER*)(pevent+1))->data_size < 0) readError = true;    <-- I changed here
         }
      }
      // check input
      if (readError) {
         if (n > 0) cout << "Unexpected end of file\n";
         this->SetEndOfRun();
         return true;
  15   10 Nov 2004 Ryu SawadaSuggestionBank size check
> in ROMEEventLoop::ReadEvent(), if  gROME->isOffline() and gROME->isMidas(),
> ROME checks if bank size is greater than 0.
> 
> But It can happen that the bank size is 0 in normal file.
> (Actually in my midas file bank size of "environment data" is 0 at this moment)

Point may be that data format of "environment data" in my midas file is "FIXED".
According to MIDAS document, MIDAS analyzer cannnot work with this format too.
I guess it can happen that bank size seems negative when ROME reads FIXED data.
  96   21 Jul 2005 Ryu SawadaSuggestionAn idea of file I/O
Current file handling of ROME is based on run number. This way is simple and easy to understand. But 
there are some arguments on it.

(i) In case of .mid file. ROME assume the file name is like run00001.mid. But this is not always true. 
MIDAS users can have different name.

(ii) ROME saves one TTree in one file. But there are cases that user want to save several TTrees in a file

(iii) Especially rare event search experiments like MEG, one file may contain signal candidate events 
from several runs.

To solve this issue one idea is to move from run base I/O to filename base I/O.

* Input
Users may specify filename instead of run number with command line option like.
XXXanalyzer.exe -f run00001.mid,run00002.mid

Then ROMEAnalyzer provides information of filename to DAQ class.

How files are handled is depending on DAQ class. Normally each files will be read one by one.
But in case of bartender program, they will be read in parallel to mix.

In case of .mid file, run number is written in run header of files.
ROMEMidas should change current run number at the BeginOfRun.

* Output
For the output filename we can employ same technique as database path.
This way users can use also run number and some other parameters.
And they can store several TTrees in a file.

  <Tree>
      <TreeName>tree</TreeName>
      <TreeOutputFileName>"%s#.root",gAnalyzer->GetGSP()->GetFilePrefix()<TreeOutputFileName>
      <Branch>
        <BranchName>kine</BranchName>
        <RelatedFolder>Kinematics</RelatedFolder>
      </Branch>
  </Tree>
 

This change is quite big, and it affects all ROME users.
We have to discuss enough on it before changing.

(One choice is to remain run number base I/O.)
  178   22 Jan 2016 SUDESHNA GANGULYSuggestionAdding texts on a histigram while using <Argus> block for tabbing
Hi,

I am defining a histogram in the xml file like this:

<Histogram>
  <HistName>h2_dt_tcpgotheader</HistName>
  <HistFolderName>BC</HistFolderName>
  <HistType>TH2D</HistType>
<HistXLabel>time(us)</HistXLabel>
  <HistYLabel>Entries</HistYLabel>
  <HistXNbins>300000</HistXNbins>
  <HistXmin>-20000</HistXmin>
  <HistXmax>100000</HistXmax>
  <HistYNbins>10</HistYNbins>
  <HistYmin>0.0</HistYmin>
  <HistYmax>10</HistYmax>-->
  <Argus>
    <Tab>
      <TabName>SummaryBCBank</TabName>
      <Index>0</Index>
    </Tab>
  </Argus>
<Histogram>
  <HistName>h2_dt_tcpgotheader</HistName>
  <HistFolderName>BC</HistFolderName>
  <HistType>TH2D</HistType>
<HistXLabel>time(us)</HistXLabel>
  <HistYLabel>Entries</HistYLabel>
  <HistXNbins>300000</HistXNbins>
  <HistXmin>-20000</HistXmin>
  <HistXmax>100000</HistXmax>
  <HistYNbins>10</HistYNbins>
  <HistYmin>0.0</HistYmin>
  <HistYmax>10</HistYmax>-->
  <Argus>
    <Tab>
      <TabName>SummaryBCBank</TabName>
      <Index>0</Index>
    </Tab>
  </Argus>
</Histogram>

Now I want to add few texts and arrows on the same pad where the histogram is
being written.

I want to add this piece of code:

  TLatex title;
  title.SetTextFont(12);
  title.SetTextSize(0.03);
  title.SetNDC();


      title.SetTextColor(2);
      title.DrawLatex(0.01,0.32,"tcp header #rightarrow");
      title.SetTextColor(3);
      title.DrawLatex(0.01,0.4,"tcp data  #rightarrow");
      title.SetTextColor(4);
      title.DrawLatex(0.01,0.48,"copy to GPU #rightarrow");
      title.SetTextColor(5);
      title.DrawLatex(0.01,0.56,"GPU processing #rightarrow");
      title.SetTextColor(6);
      title.DrawLatex(0.01,0.64,"MFE start #rightarrow");
      title.SetTextColor(7);
      title.DrawLatex(0.01,0.72,"MFE stop #rightarrow");

The problem is that if I add this piece of code in the src/tasks, where I fill
in the histogram, then the problem is that this histogram replaces whatever is
on the last tab on the canvas.

As I recall that I am not supposed to add extra tabbing codes in the src codes
when I am using the <Argus> block for tabbing.

So where can I add these texts while still using <Argus> block for tabbing?

Any help might be very much appreciated.
  179   28 Jan 2016 Ryu SawadaSuggestionAdding texts on a histigram while using <Argus> block for tabbing
Dear Sudeshna

Unfortunately, with the current ROME, it is not possible to insert own code when you use <Argus> blocks for 
which the source code is supposed to be generated automatically (and not editable).

If you want to do more than the automatically generated code, you can use the normal type tabs although you 
need to program it by yourself (as you program tasks).

An example is $ROMESYS/examples/midas.
In midas.xml, you can find <Tabs> section where several normal tabs are defined.
Corresponding source files will be generated in src/tabs when you run romebuilder after modifying the 
definition 
XML.

As for source files of tasks, you can edit the source files of tabs as you want.
ROMEbuilder will not overwrite the files.
You can draw any ROOT GUI objects in the tabs including text.

You can get the pointer of histograms associated to a task.
For example, in the midas example, src/tabs/MIDTADCTab.cpp, a pointer of a histogram 'ADC' of 
'FillHistogram' 
task is obtained by
  gAnalyzer->GetFillHistogramTask()->GetADCAt(i)

Please let me know if you have any problems to write code for your tabs.

Best regards,

Ryu



> Hi,
> 
> I am defining a histogram in the xml file like this:
> 
> <Histogram>
>   <HistName>h2_dt_tcpgotheader</HistName>
>   <HistFolderName>BC</HistFolderName>
>   <HistType>TH2D</HistType>
> <HistXLabel>time(us)</HistXLabel>
>   <HistYLabel>Entries</HistYLabel>
>   <HistXNbins>300000</HistXNbins>
>   <HistXmin>-20000</HistXmin>
>   <HistXmax>100000</HistXmax>
>   <HistYNbins>10</HistYNbins>
>   <HistYmin>0.0</HistYmin>
>   <HistYmax>10</HistYmax>-->
>   <Argus>
>     <Tab>
>       <TabName>SummaryBCBank</TabName>
>       <Index>0</Index>
>     </Tab>
>   </Argus>
> <Histogram>
>   <HistName>h2_dt_tcpgotheader</HistName>
>   <HistFolderName>BC</HistFolderName>
>   <HistType>TH2D</HistType>
> <HistXLabel>time(us)</HistXLabel>
>   <HistYLabel>Entries</HistYLabel>
>   <HistXNbins>300000</HistXNbins>
>   <HistXmin>-20000</HistXmin>
>   <HistXmax>100000</HistXmax>
>   <HistYNbins>10</HistYNbins>
>   <HistYmin>0.0</HistYmin>
>   <HistYmax>10</HistYmax>-->
>   <Argus>
>     <Tab>
>       <TabName>SummaryBCBank</TabName>
>       <Index>0</Index>
>     </Tab>
>   </Argus>
> </Histogram>
> 
> Now I want to add few texts and arrows on the same pad where the histogram is
> being written.
> 
> I want to add this piece of code:
> 
>   TLatex title;
>   title.SetTextFont(12);
>   title.SetTextSize(0.03);
>   title.SetNDC();
> 
> 
>       title.SetTextColor(2);
>       title.DrawLatex(0.01,0.32,"tcp header #rightarrow");
>       title.SetTextColor(3);
>       title.DrawLatex(0.01,0.4,"tcp data  #rightarrow");
>       title.SetTextColor(4);
>       title.DrawLatex(0.01,0.48,"copy to GPU #rightarrow");
>       title.SetTextColor(5);
>       title.DrawLatex(0.01,0.56,"GPU processing #rightarrow");
>       title.SetTextColor(6);
>       title.DrawLatex(0.01,0.64,"MFE start #rightarrow");
>       title.SetTextColor(7);
>       title.DrawLatex(0.01,0.72,"MFE stop #rightarrow");
> 
> The problem is that if I add this piece of code in the src/tasks, where I fill
> in the histogram, then the problem is that this histogram replaces whatever is
> on the last tab on the canvas.
> 
> As I recall that I am not supposed to add extra tabbing codes in the src codes
> when I am using the <Argus> block for tabbing.
> 
> So where can I add these texts while still using <Argus> block for tabbing?
> 
> Any help might be very much appreciated.
  181   01 Mar 2016 SUDESHNA GANGULYInfoAdding different tabs under a single parent tab
Hi Everyone,

Is there any way I can put different tabs under a single click-able menu in ROME?
Suppose I have tabs A, B, C, D. Each one of these tabs contains histograms. Can
I now, put A, B, C, D under another click-able menu called "calorimeters" ?

So that when I click on "calorimeters", I will see A, B, C, D. And then when I
click on A/B/C/D I will see the histograms.

Can that be done?
Is there any example available?

Thanks for any help!
Sudeshna
  182   02 Mar 2016 Ryu SawadaInfoAdding different tabs under a single parent tab
Yes, it can be done easily by nesting the tab definition in your definition XML file.
An example is $ROMESYS/examples/argus/tabs

Ryu

> Hi Everyone,
> 
> Is there any way I can put different tabs under a single click-able menu in ROME?
> Suppose I have tabs A, B, C, D. Each one of these tabs contains histograms. Can
> I now, put A, B, C, D under another click-able menu called "calorimeters" ?
> 
> So that when I click on "calorimeters", I will see A, B, C, D. And then when I
> click on A/B/C/D I will see the histograms.
> 
> Can that be done?
> Is there any example available?
> 
> Thanks for any help!
> Sudeshna
  162   21 Oct 2015 SUDESHNA GANGULYInfoAdding Trees and Branches in ROME
Hi,

I need to add a tree, the tree will have n branches. Each branch will refer to
one event. Now Each branch will have 5 leaves. Each leaf will have data from one
WFD channel. There are data from total 5 WFD channels per event in our midas bank.

I have seen some examples of trees and branches in ROME, but I don't know how I
can loop over one channel to another channel and save those data into each leaf.

Any help will be appreciated greatly.

Sudeshna Ganguly
  163   22 Oct 2015 Ryu SawadaInfoAdding Trees and Branches in ROME
Dear Sudeshna Ganguly

It might be my misunderstanding, but do you mean that you want to add a new branch every time when you take one
event ? (namely, the number of branches n equals to the number of events ?)

In ROME, ( and I guess in most of user applications), each entry in the tree (instead of each branch) refers to one
event. Namely, the number of branches n is independent of the number of events; and the number of entries
increases as you take more events.

In the ROME applications, there is a one to one relation between,
- ROME Folder and Branch in Tree
- ROME Field in Folder and Leave in Tree
ROME folder and field are supposed to be defined in an XML file and the implementation (i.e. conversion to C++ code)
is done by ROMEBuilder.

Folders and fileds can be arrays.

I think, in your case, ROME folder could be like one of the followings depending on your data structure and preference,
Since I guess WFD stands for Wave Form Digitizer and guess has many numbers (instead of one), I expect you may use the 2nd or 3rd example,

1) A single variable 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <FieldComment>WFD Values</FieldComment>
            </Field>

2) A variable-length array 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>vector</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>

3) A fixed-length array 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>1024</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>

4) An array 'WFD' is in one 'Data' folder instance, and the array size of 'WFD' is five.
            <FolderName>Data</FolderName>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>5</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>


Once you add a relation between the 'Data' folder and a branch in a tree (as shown <Tree> section of $ROMESYS/examples/midas/midas.xml),
The generated application,
- reads the tree and copies data in to the folder before every event (if the <DAQSystem> in config XML is rome)
- fills the tree with copying data from the folder

So you don't need to write code to read/write tees.
Instead you need to access the folders.

The access method depends on the folder structure. For the example above,

1)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetDataAt(iCh)->SetWFD(some_number);
   }

2)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetDataAt(iCh)->SetWFDSize(1024);
      Int_t wfdSize = gAnalyzer->GetDataAt(iCh)->GetWFDSize();
      for (Int_t i = 0; i < wfdSize; i++) {
         gAnalyzer->GetDataAt(iCh)->SetWFDAt(i, some_number);
      }
   }

3)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      for (Int_t i = 0; i < 1024; i++) {
         gAnalyzer->GetDataAt(iCh)->SetWFDAt(i, some_number);
      }
   }

4)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetData()->SetWFDAt(iCh, some_number);
   }

You can read the variables by using GetWFD (or GetWFDAt if WFD is an array) function.


You can find more example of the folder structure in $ROMESYS/examples/argus/folders/folderEntries.xml.

Ryu

> Hi,
>
> I need to add a tree, the tree will have n branches. Each branch will refer to
> one event. Now Each branch will have 5 leaves. Each leaf will have data from one
> WFD channel. There are data from total 5 WFD channels per event in our midas bank.
>
> I have seen some examples of trees and branches in ROME, but I don't know how I
> can loop over one channel to another channel and save those data into each leaf.
>
> Any help will be appreciated greatly.
>
> Sudeshna Ganguly
  74   15 Apr 2005 Ryu SawadaSuggestionAbout parameters in definition and configuration file
At first there must be several opinions and discussions. Following is just my opinion.
Probably asking opinion some users before changing ROME is better.

There are some properties for histograms and databases.

* database name
* database type and connection
* field database name and path
* histogram properties

I assume that definition file is shared by several persons in experimental group and configuration files 
are created for each users at the first execution. If you assume that we should share also configuration 
file, story written below is different.

My basic concept is that
 *Parameters which is complicated or will be shared among several users should be in definition file.
 *Parameters which can be often changed at run time should be in configuration file.

The good point to specify values in definition file is that they are flexible, because we can use 
ROMEString::SetFormatted.
It is outstanding point of ROME that we can design framework very flexibly due to builder.

Other point is that parameters in definition file will be written by programer while those in 
configuration file can be written by non-experts. It is better that the application can work with few 
changes of configuration file as possible. In my feeling, to specify database paths and histogram 
parameters in configuration file correctly is too tough for normal users.

In my opinion, they are separated like,
Definition file:
* field database name and path
* histogram properties

Configuration file:
* database type and connection
* (histogram properties)

-- about database path
Normally, users share the same database structure. So I think it should be in definition file. I don't think 
paths are changed so often.

-- about database type and connection
At first type and connection can be written in one line like,
   xml://directory_of_database/database_name
   mysql://[user_name]:[passwd]@[hostname]:[port]/database_name
   none://
      (  odb://[host_name]/[experiment] or odb://experiment@host_name  )
(parameters in [] are optional)

These parameters will be changed user by user, because they can have xml files in different place, and 
they can use replicated SQL servers.
Password can be written in connection. So it should be in configuration file.

-- about histogram parameters
We can specify them with calculation if they are in definition file. I think it should be in definition file.
And to allow to overwrite in configuration file is also attractive. In my opinion overwriting with normal 
type like Float_t,Int_t... is enough.

---------
In result, my opinion is like following.
Database name, database paths and histogram parameters are in definition file.
In default configuration file, config class writes database entries appeared in definition file.
Config class writes histogram parameters entries with empty values if the histogram is <Configurable>. 
Only when 
some value is written there, analyzer overwrite these parameters.

As I wrote above I think normal number like following are enough as values of histogram parameters in 
configuration file.
   <HistXmax>1000</HistXmax>
I don't think following is necessary.
   </HistXmax>/GSP/parameter</HistXmax>


Definition file
    <Folder>
        <FolderName>foldername</FolderName>
        <DataBaseAccess>true</DataBaseAccess>
        <Field>
          <FieldName>fieldname</FieldName>
          <FieldType>Float_t</FieldType>
          <DataBaseName>first_database</DataBaseName>
          <DataBasePath>"/Path/to/record"</DataBasePath>
        </Field>
       <Field>
          <FieldName>fieldname2</FieldName>
          <FieldType>Float_t</FieldType>
          <DataBaseName>second_database</DataBaseName>
          <DataBasePath>"/Path/to/record2"</DataBasePath>
        </Field>
   </Folder>
...
     <Histogram>
        <HistName>histname</HistName>
        <Configurable>true</Configurable>
        <HistType>TH1F</HistType>
        <HistTitle>ADC0 Bank</HistTitle>
        <HistFolderTitle>ADC</HistFolderTitle>
        <HistArraySize>gAnalyzer->GetGSP()->GetNumberOfADC()</HistArraySize>
        <HistXNbins>4094</HistXNbins>
        <HistXmin>1</HistXmin>
        <HistXmax>4095</HistXmax>
      </Histogram>

Default configuration file
    <DataBases>
      <DataBase>
        <Name>first_database</Name>
        <Connection>none://</Connection>
      </DataBase>
     <DataBase>
        <Name>second_database</Name>
        <Connection>none://</Connection>
      </DataBase>
    </DataBases> 
...
     <Histogram>
        <HistName>histname</HistName>
        <HistFolderTitle></HistFolderTitle>
        <HistArraySize></HistArraySize>
        <HistXNbins></HistXNbins>
        <HistXmin></HistXmin>
        <HistXmax></HistXmax>
      </Histogram>
  148   02 Sep 2015 Farrukh AzfarForumARGUS display with canvas and pads ...
Dear Colleagues,

We are succesfully running a ROME executable both online and offline with an 
ARGUS display with a canvas that has multiple pads on it. We have also 
implemented a "Save" button which one can click on and save the _entire_ canvas 
(containing all the pads) and saves it to pdf.

I was wondering how one would go about making the following modification :

When a user moves a mouse over to a particular pad and clicks on it - then only 
the histogram on that pad is displayed on a separate canvas (so the user can 
examine it closely) and also save just this one histogram - with a save button 
similar to the one we've already written.

many thanks for any insight

Farrukh 
  149   03 Sep 2015 Ryu SawadaForumARGUS display with canvas and pads ...
Dear Farrukh

What you want to do is probably possible ( I will write a possible method later.).
However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
could override other pre-implemented operations.)
I will write three solutions below.
I wrote an example of the first method.

== Method 1 : Menu ==
For this solutions, I modified an example in the ROME package.
The update is done only in the 'develop' branch.
You can read the example by 'git checkout develop' command after you clone the ROME package.
The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.

== Method 2 : dedicated buttons ==
If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
either of the following two methods,
 1) TGTextButton, which can work as the same way as your Save button
 2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.

I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.

The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.

== Method 3: click on Pad ==
You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
draw a clone of itself.
You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.

If you are satisfied with the first method, please try the example.
The second method with TGTextButton must not be very difficult.

If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
For the two methods, I think you need to write your own classes.

Best regards,

Ryu

> Dear Colleagues,
> 
> We are succesfully running a ROME executable both online and offline with an 
> ARGUS display with a canvas that has multiple pads on it. We have also 
> implemented a "Save" button which one can click on and save the _entire_ canvas 
> (containing all the pads) and saves it to pdf.
> 
> I was wondering how one would go about making the following modification :
> 
> When a user moves a mouse over to a particular pad and clicks on it - then only 
> the histogram on that pad is displayed on a separate canvas (so the user can 
> examine it closely) and also save just this one histogram - with a save button 
> similar to the one we've already written.
> 
> many thanks for any insight
> 
> Farrukh 
  150   03 Sep 2015 Farrukh AzfarForumARGUS display with canvas and pads ...
Hi Ryu

thanks very much - I will certainly look at this example. In the meantime we are having some issues with out save buttons - I will post a thread separately
-Farrukh

> Dear Farrukh
> 
> What you want to do is probably possible ( I will write a possible method later.).
> However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
> could override other pre-implemented operations.)
> I will write three solutions below.
> I wrote an example of the first method.
> 
> == Method 1 : Menu ==
> For this solutions, I modified an example in the ROME package.
> The update is done only in the 'develop' branch.
> You can read the example by 'git checkout develop' command after you clone the ROME package.
> The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
> 
> == Method 2 : dedicated buttons ==
> If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
> either of the following two methods,
>  1) TButton, which can work as the same way as your Save button
>  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> 
> I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
> 
> The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
> In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
> A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
> 
> == Method 3: click on Pad ==
> You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
> draw a clone of itself.
> You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
> 
> If you are satisfied with the first method, please try the example.
> The second method with TButton must not be very difficult.
> 
> If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
> For the two methods, I think you need to write your own classes.
> 
> Best regards,
> 
> Ryu
> 
> > Dear Colleagues,
> > 
> > We are succesfully running a ROME executable both online and offline with an 
> > ARGUS display with a canvas that has multiple pads on it. We have also 
> > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > (containing all the pads) and saves it to pdf.
> > 
> > I was wondering how one would go about making the following modification :
> > 
> > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > the histogram on that pad is displayed on a separate canvas (so the user can 
> > examine it closely) and also save just this one histogram - with a save button 
> > similar to the one we've already written.
> > 
> > many thanks for any insight
> > 
> > Farrukh 
  152   03 Sep 2015 Farrukh AzfarForumARGUS display with canvas and pads ...
Hi Ryu 

thanks ever so much. 

We will modify our code as per your example - is it neccesary to build in development as well or is that only where your example is

-Farrukh

> Dear Farrukh
> 
> What you want to do is probably possible ( I will write a possible method later.).
> However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
> could override other pre-implemented operations.)
> I will write three solutions below.
> I wrote an example of the first method.
> 
> == Method 1 : Menu ==
> For this solutions, I modified an example in the ROME package.
> The update is done only in the 'develop' branch.
> You can read the example by 'git checkout develop' command after you clone the ROME package.
> The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
> 
> == Method 2 : dedicated buttons ==
> If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
> either of the following two methods,
>  1) TGTextButton, which can work as the same way as your Save button
>  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> 
> I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
> 
> The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
> In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
> A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
> 
> == Method 3: click on Pad ==
> You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
> draw a clone of itself.
> You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
> 
> If you are satisfied with the first method, please try the example.
> The second method with TGTextButton must not be very difficult.
> 
> If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
> For the two methods, I think you need to write your own classes.
> 
> Best regards,
> 
> Ryu
> 
> > Dear Colleagues,
> > 
> > We are succesfully running a ROME executable both online and offline with an 
> > ARGUS display with a canvas that has multiple pads on it. We have also 
> > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > (containing all the pads) and saves it to pdf.
> > 
> > I was wondering how one would go about making the following modification :
> > 
> > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > the histogram on that pad is displayed on a separate canvas (so the user can 
> > examine it closely) and also save just this one histogram - with a save button 
> > similar to the one we've already written.
> > 
> > many thanks for any insight
> > 
> > Farrukh 
  153   04 Sep 2015 Ryu SawadaForumARGUS display with canvas and pads ...
Dear Farrukh

It is not necessary to build in 'develop' branch of ROME.

Ryu

> Hi Ryu 
> 
> thanks ever so much. 
> 
> We will modify our code as per your example - is it neccesary to build in development as well or is that only where your example is
> 
> -Farrukh
> 
> > Dear Farrukh
> > 
> > What you want to do is probably possible ( I will write a possible method later.).
> > However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
> > could override other pre-implemented operations.)
> > I will write three solutions below.
> > I wrote an example of the first method.
> > 
> > == Method 1 : Menu ==
> > For this solutions, I modified an example in the ROME package.
> > The update is done only in the 'develop' branch.
> > You can read the example by 'git checkout develop' command after you clone the ROME package.
> > The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> > In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
> > 
> > == Method 2 : dedicated buttons ==
> > If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
> > either of the following two methods,
> >  1) TGTextButton, which can work as the same way as your Save button
> >  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> > 
> > I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
> > 
> > The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
> > In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
> > A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
> > 
> > == Method 3: click on Pad ==
> > You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
> > draw a clone of itself.
> > You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
> > 
> > If you are satisfied with the first method, please try the example.
> > The second method with TGTextButton must not be very difficult.
> > 
> > If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
> > For the two methods, I think you need to write your own classes.
> > 
> > Best regards,
> > 
> > Ryu
> > 
> > > Dear Colleagues,
> > > 
> > > We are succesfully running a ROME executable both online and offline with an 
> > > ARGUS display with a canvas that has multiple pads on it. We have also 
> > > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > > (containing all the pads) and saves it to pdf.
> > > 
> > > I was wondering how one would go about making the following modification :
> > > 
> > > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > > the histogram on that pad is displayed on a separate canvas (so the user can 
> > > examine it closely) and also save just this one histogram - with a save button 
> > > similar to the one we've already written.
> > > 
> > > many thanks for any insight
> > > 
> > > Farrukh 
  154   04 Sep 2015 Farrukh AzfarForumARGUS display with canvas and pads ...
Dear Ryu,

we've coded up our own example menu based on what you made for us - and thank you very much for that - we notice however that the resulting menu is nowhere to be seen on the frame.

When we did buttons we had to associate them with a frame - and I note that there seems to be no association to a frame in the code you wrote for us - so we never see a menu - is 
this what is to be expceted ?

thanks 
Farrukh

> Hi Ryu
> 
> thanks very much - I will certainly look at this example. In the meantime we are having some issues with out save buttons - I will post a thread separately
> -Farrukh
> 
> > Dear Farrukh
> > 
> > What you want to do is probably possible ( I will write a possible method later.).
> > However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
> > could override other pre-implemented operations.)
> > I will write three solutions below.
> > I wrote an example of the first method.
> > 
> > == Method 1 : Menu ==
> > For this solutions, I modified an example in the ROME package.
> > The update is done only in the 'develop' branch.
> > You can read the example by 'git checkout develop' command after you clone the ROME package.
> > The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> > In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
> > 
> > == Method 2 : dedicated buttons ==
> > If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
> > either of the following two methods,
> >  1) TButton, which can work as the same way as your Save button
> >  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> > 
> > I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
> > 
> > The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
> > In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
> > A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
> > 
> > == Method 3: click on Pad ==
> > You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
> > draw a clone of itself.
> > You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
> > 
> > If you are satisfied with the first method, please try the example.
> > The second method with TButton must not be very difficult.
> > 
> > If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
> > For the two methods, I think you need to write your own classes.
> > 
> > Best regards,
> > 
> > Ryu
> > 
> > > Dear Colleagues,
> > > 
> > > We are succesfully running a ROME executable both online and offline with an 
> > > ARGUS display with a canvas that has multiple pads on it. We have also 
> > > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > > (containing all the pads) and saves it to pdf.
> > > 
> > > I was wondering how one would go about making the following modification :
> > > 
> > > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > > the histogram on that pad is displayed on a separate canvas (so the user can 
> > > examine it closely) and also save just this one histogram - with a save button 
> > > similar to the one we've already written.
> > > 
> > > many thanks for any insight
> > > 
> > > Farrukh 
  155   04 Sep 2015 Ryu SawadaForumARGUS display with canvas and pads ...
Dear Farrukh

The menu items are defined in,
examples/argus/menu/menu.xml, in the part for 'T3' tab.

Did you modify the definition XML for your program ?

Ryu


> Dear Ryu,
> 
> we've coded up our own example menu based on what you made for us - and thank you very much 
for that - we notice however that the resulting menu is nowhere to be seen on the frame.
> 
> When we did buttons we had to associate them with a frame - and I note that there seems to be no 
association to a frame in the code you wrote for us - so we never see a menu - is 
> this what is to be expceted ?
> 
> thanks 
> Farrukh
> 
> > Hi Ryu
> > 
> > thanks very much - I will certainly look at this example. In the meantime we are having some 
issues with out save buttons - I will post a thread separately
> > -Farrukh
> > 
> > > Dear Farrukh
> > > 
> > > What you want to do is probably possible ( I will write a possible method later.).
> > > However TPad has already several mouse operations (zoom, right-click menu, select active pad 
and so on); so I am not sure it is the best idea to add own mouse operation (which 
> > > could override other pre-implemented operations.)
> > > I will write three solutions below.
> > > I wrote an example of the first method.
> > > 
> > > == Method 1 : Menu ==
> > > For this solutions, I modified an example in the ROME package.
> > > The update is done only in the 'develop' branch.
> > > You can read the example by 'git checkout develop' command after you clone the ROME 
package.
> > > The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> > > In ROME, you can easily add menu items in the menu bar. In the example, menu items to open 
and save a specific tab are prepared.
> > > 
> > > == Method 2 : dedicated buttons ==
> > > If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" 
function in the example instead of adding menus. The buttons can be implemented 
> > > either of the following two methods,
> > >  1) TButton, which can work as the same way as your Save button
> > >  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each 
canvas.
> > > 
> > > I hope the first method is obvious for you. You can make another button similar to your Save 
button and call "OpenPad" function.
> > > 
> > > The second method is a little more complicated; you make your own class and override 
"ExecuteEvent" method.
> > > In the overriding function, you can call any functions when the box or marker is single-clicked, 
double-clicked, mouse-over and so on.
> > > A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF 
files too.
> > > 
> > > == Method 3: click on Pad ==
> > > You can probably do what you write with making own class derived from TPad; then you 
override "ExecuteEvent" function for calling a function to make a separated canvas and 
> > > draw a clone of itself.
> > > You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes 
instead of regular TPad and TCanvas.
> > > 
> > > If you are satisfied with the first method, please try the example.
> > > The second method with TButton must not be very difficult.
> > > 
> > > If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is 
actually possible.
> > > For the two methods, I think you need to write your own classes.
> > > 
> > > Best regards,
> > > 
> > > Ryu
> > > 
> > > > Dear Colleagues,
> > > > 
> > > > We are succesfully running a ROME executable both online and offline with an 
> > > > ARGUS display with a canvas that has multiple pads on it. We have also 
> > > > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > > > (containing all the pads) and saves it to pdf.
> > > > 
> > > > I was wondering how one would go about making the following modification :
> > > > 
> > > > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > > > the histogram on that pad is displayed on a separate canvas (so the user can 
> > > > examine it closely) and also save just this one histogram - with a save button 
> > > > similar to the one we've already written.
> > > > 
> > > > many thanks for any insight
> > > > 
> > > > Farrukh 
ELOG V3.1.4-2e1708b5