Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 4 of 11  Not logged in ELOG logo
ID Date Author Topicup Subject
  85   01 Jun 2005 Ryu SawadaForumTaskHierarchy
This is a proposal on specifying relation of tasks.

Currently, ROME has task hierarchy system. It may be enough.
But a missing thing is that we can not use "||".

So a possibility is like this.

For example, there are two calibration tasks B and D, and a calculation task A requires one of B or D.
B and D dependes on data filling task C.

This case, one writes down the relation in definition file.
<TaskDependenses>
  <TaskDependense taskname="A"/> B || D </TaskDependense>
  <TaskDependense taskname="B"/> C </TaskDependense>
  <TaskDependense taskname="D"/> C && !B </TaskDependense>
</TaskDependeses>

Then, builder analyzes the relation and re-arranges the execution order like,
C->B->D->A

At run time, ROMEEventLoop checks if depending tasks were executed before calling a task. And when 
B or C is executed, it calls A.

This way users can specify complicated relation like ((A && B) || C ) || !D )....

A problem is that you can not express the relation with indent in configuration file and documentation.


This is just a proposal, I'm not sure which is better, TaskHierarcy or TaskDependense.
Personaly, I am not using task controll.
  99   08 Sep 2005 Ryu SawadaForumDividing xml the definition xml file.
I am thinking to divide my definition xml file into several files.

I do not know if there is a general way, but I found some web pages mentioning about it. According to 
these pages we can include an xml document to  other one like.

---------- booklist.xml ------------
<?xml version="1.0"?>
<!DOCTYPE books [
<!ENTITY book1 SYSTEM "book1.xml">
]>

<books>
  &book1;
</books>
------------------------------------
------------ book1.xml -------------
<?xml version="1.0"?>
<book>
  <title>Title of the book</title>
  <author>Author of the book</author>
</book>
------------------------------------

Is it possible to do it with mxml ?


I have two reasons.
1.
 I have two ROME programs.  I call them as "writer" and "reader" in this message. "reader" reads output 
file from "writer". In this case, "reader" needs to know the structure of branch folder defined in "writer"'s 
xml file.
What I am doing is adding headers of "writer" to DictionaryHeaders in Makefile.user of "reader". At least, 
it works, but this way I have to write reading function of trees by hand. On the other hand, If it is 
possible to include a part of xml file of "writer" in that of "reader", romebuilder can create proper 
functions automatically.

2.
 My project definition file is already big. It has more than 2000 lines. If one has good XML editor, it may 
not be a problem. But unfortunately I do not know good editor on Linux. What I am thinking is making a 
directory structure like this.
.
|-- main_definition.xml
`-- xml
    |-- folders
    |   |-- folder_1.xml
    |   |-- folder_2.xml
    |   `-- folder_3.xml
    `-- tasks
        |-- task_1.xml
        |-- task_2.xml
        `-- task_3.xml

folder_[1-3].xml and task_[1-3].xml will be included in main_definition.xml.
  100   06 Oct 2005 Ryu SawadaForumDividing xml the definition xml file.
> I am thinking to divide my definition xml file into several files.
> 
> I do not know if there is a general way, but I found some web pages mentioning about it. According to 
> these pages we can include an xml document to  other one like.
> 
> ---------- booklist.xml ------------
> <?xml version="1.0"?>
> <!DOCTYPE books [
> <!ENTITY book1 SYSTEM "book1.xml">
> ]>
> 
> <books>
>   &book1;
> </books>
> ------------------------------------
> ------------ book1.xml -------------
> <?xml version="1.0"?>
> <book>
>   <title>Title of the book</title>
>   <author>Author of the book</author>
> </book>
> ------------------------------------
> 
> Is it possible to do it with mxml ?

I made a patch to enable it with mxml.
Please test it.

If it is reliable, I will commit it.

----
cd $ROMESYS
patch -p0 < mxml.diff  
----
Attachment 1: mxml.diff
Index: include/mxml.h
===================================================================
RCS file: /usr/local/cvsroot/rome/include/mxml.h,v
retrieving revision 1.7
diff -u -r1.7 mxml.h
--- include/mxml.h	12 Jul 2005 09:04:15 -0000	1.7
+++ include/mxml.h	6 Oct 2005 21:53:13 -0000
@@ -43,6 +43,10 @@
 #define PROCESSING_INSTRUCTION_NODE   3
 #define COMMENT_NODE                  4
 #define DOCUMENT_NODE                 5
+#define ENTITY_NODE                   6
+
+#define INTERNAL_ENTITY               0
+#define EXTERNAL_ENTITY               1
 
 typedef struct {
    int  fh;
@@ -115,6 +119,7 @@
 PMXML_NODE mxml_create_root_node();
 PMXML_NODE mxml_parse_file(char *file_name, char *error, int error_size);
 PMXML_NODE mxml_parse_buffer(char *buffer, char *error, int error_size);
+PMXML_NODE mxml_parse_entity(char *buf, char *error, int error_size);
 int mxml_write_tree(char *file_name, PMXML_NODE tree);
 void mxml_debug_tree(PMXML_NODE tree, int level);
 void mxml_free_tree(PMXML_NODE tree);
Index: src/mxml.c
===================================================================
RCS file: /usr/local/cvsroot/rome/src/mxml.c,v
retrieving revision 1.8
diff -u -r1.8 mxml.c
--- src/mxml.c	11 May 2005 12:50:02 -0000	1.8
+++ src/mxml.c	6 Oct 2005 21:53:13 -0000
@@ -1209,6 +1209,30 @@
 
             p += 2;
 
+         } else if (strncmp(p, "!ENTITY", 7) == 0) {
+
+            /* found !ENTITY element */
+            pnew = mxml_add_special_node(ptree, ENTITY_NODE, "ENTYTY", NULL);
+            pv = p+1;
+
+            p++;
+            if (strstr(p, ">") == NULL)
+               return read_error(HERE, "Unterminated !ENTITY element");
+
+            while (*p != '>') {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+
+            len = (size_t)p - (size_t)pv;
+            pnew->value = (char *)malloc(len+1);
+            memcpy(pnew->value, pv, len);
+            pnew->value[len] = 0;
+            mxml_decode(pnew->value);
+
+            p ++;
+
          } else {
             
             /* found normal element */
@@ -1407,6 +1431,249 @@
 
 /*------------------------------------------------------------------*/
 
+PMXML_NODE mxml_parse_entity(char *buf, char *error, int error_size)
+/* parse !ENTYTY entries of XML files and replace with references. Return NULL
+   in case of error, return error description. Optional file_name is used
+   for error reporting if called from mxml_parse_file() */
+{
+   char *p;
+   char *pv;
+   char delimiter;
+   int  i,j,k, line_number;
+   char replacement[1000];
+   char entity_name[256][256];
+   char entity_reference_name[256][256];
+   char *entity_value[256];
+   int  entity_type[256]; /* internal or external */
+   int  nentity;
+   int  fh, length,len;
+   char *buffer;
+   PMXML_NODE root = mxml_create_root_node(); // dummy for 'HERE'
+   char *file_name = NULL; // dummy for 'HERE'
+
+   /* copy string to temporary space */
+   buffer = (char *)malloc(strlen(buf)+1);
+   strcpy(buffer,buf);
+   free(buf);
+
+   p = buffer;
+   line_number = 1;
+   nentity = -1;
+
+   /* search !ENTITY */
+   do {
+      if (*p == '<') {
+
+         /* found new entity */
+         p++;
+         while (*p && isspace(*p)) {
+            if (*p == '\n')
+               line_number++;
+            p++;
+         }
+         if (!*p)
+            return read_error(HERE, "Unexpected end of file");
+
+         if (strncmp(p, "!ENTITY", 7) == 0) {
+
+            /* found entity */
+            nentity++;
+            if(nentity>=1000)
+               return read_error(HERE, "Too much entities");
+
+            pv = p+7;
+            while (*pv == ' ')
+               pv++;
+
+            /* extract entity name */
+            p = pv;
+
+            while (*p && isspace(*p) && *p != '<' && *p != '>') {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+            if (*p == '<' || *p == '>')
+               return read_error(HERE, "Unexpected \'%c\' inside !ENTITY", *p);
+
+            pv = p;
+            while (*pv && !isspace(*pv) && *pv != '<' && *pv != '>')
+               pv++;
+
+            if (!*pv)
+               return read_error(HERE, "Unexpected end of file");
+            if (*pv == '<'  || *pv == '>' )
+               return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv, &entity_name[nentity][1]);
+
+            len = (size_t)pv - (size_t)p;
+            if (len > (int)sizeof(replacement)-1)
+               len = sizeof(replacement)-1;
+            memcpy(replacement, p, len);
+            replacement[len] = 0;
+            mxml_decode(replacement);
+
+            entity_name[nentity][0] = '&';
+            i = 1;
+            entity_name[nentity][i] = 0;
+            while (*p && !isspace(*p) && *p != '/' && *p != '>' && *p != '<' && i<253)
+               entity_name[nentity][i++] = *p++;
+            entity_name[nentity][i++] = ';';
+            entity_name[nentity][i] = 0;
+
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+            if (*p == '<')
+               return read_error(HERE, "Unexpected \'<\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+            /* extract replacement or SYSTEM*/
+            while (*p && isspace(*p)) {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+            if (*p == '>')
+               return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+            /* check if SYSTEM */
+            if(strncmp(p, "SYSTEM", 6) == 0){
+               entity_type[nentity] = EXTERNAL_ENTITY;
+               p += 6;
+            }
+            else{
+               entity_type[nentity] = INTERNAL_ENTITY;
+            }
+
+            /* extract replacement */
+            while (*p && isspace(*p)) {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+            if (*p == '>')
+               return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+
+            if (*p != '\"' && *p != '\'')
+               return read_error(HERE, "Replacement was not found for entity \"%s\"", &entity_name[nentity][1]);
+            delimiter = *p;
+            p++;
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+            pv = p;
+            while (*pv && *pv != delimiter )
+               pv++;
+
+            if (!*pv)
+               return read_error(HERE, "Unexpected end of file");
+            if (*pv == '<' )
+               return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv, &entity_name[nentity][1]);
+
+            len = (size_t)pv - (size_t)p;
+            if (len > (int)sizeof(replacement)-1)
+               len = sizeof(replacement)-1;
+            memcpy(replacement, p, len);
+            replacement[len] = 0;
+
+            if(entity_type[nentity] == EXTERNAL_ENTITY){
+               strcpy(entity_reference_name[nentity],replacement);
+            }
+            else{
+               entity_value[nentity] = (char *)malloc(strlen(replacement));
+               strcpy(entity_value[nentity],replacement);
+            }
+
+            p = pv;
+            while (*p && isspace(*p)) {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p)
+               return read_error(HERE, "Unexpected end of file");
+         }
+      }
+
+      /* go to next element */
+      while (*p && *p != '<') {
+         if (*p == '\n')
+            line_number++;
+         p++;
+      }
+   } while (*p);
+   nentity++;
+
+   /* read external file */
+   for(i=0;i<nentity;i++){
+      if(entity_type[i] == EXTERNAL_ENTITY){
+         fh = open(entity_reference_name[i], O_RDONLY | O_TEXT, 0644);
+
+         if (fh == -1) {
+            return read_error(HERE, "Unable to open file \"%s\"",entity_reference_name[i]);
+         }
+
+         length = lseek(fh, 0, SEEK_END);
+         lseek(fh, 0, SEEK_SET);
+         entity_value[i] = (char *)malloc(length+1);
+         if (entity_value[i] == NULL) {
+            close(fh);
+            return read_error(HERE, "Cannot allocate buffer of %d bytes for \"%s\".",length+1,&entity_name[1]);
+         }
+
+         /* read complete file at once */
+         length = read(fh, entity_value[i], length);
+         entity_value[i][length] = 0;
+         close(fh);
+      }
+   }
+
+   /* count length of output string */
+   length = strlen(buffer);
+   for(i=0;i<nentity;i++){
+      p = buffer;
+      while(1){
+         pv =strstr(entity_name[i],p);
+         if(pv){
+            length += -strlen(entity_name[i]) + strlen(entity_value[i]);
+            p = pv+1;
+         }
+         else{
+            break;
+         }
+      }
+   }
+
+   /* allocate memory */
+   buf = (char *)malloc(length+1);
+
+   /* replace entities */
+   p = buffer;
+   pv = buf;
+   do {
+      if (*p == '&') {
+         /* found entity */
+         for(j=0;j<nentity;j++){
+            if(strncmp(p,entity_name[j],strlen(entity_name[j])) == 0){
+               for(k=0;k<(int)strlen(entity_value[j]);k++)
+                  *pv++ = entity_value[j][k];
+               p += strlen(entity_name[j]);
+               break;
+            }
... 27 more lines ...
  101   07 Oct 2005 Ryu SawadaForumDividing xml the definition xml file.
> I made a patch to enable it with mxml.
> Please test it.
> 
> If it is reliable, I will commit it.
> 
> ----
> cd $ROMESYS
> patch -p0 < mxml.diff  
> ----

I modified bugs, and commited.
Attachment 1: mxml.patch
? mxml.c
? mxml.h
? mxml.patch
? obj
? src/indent.txt
Index: include/mxml.h
===================================================================
RCS file: /usr/local/cvsroot/rome/include/mxml.h,v
retrieving revision 1.7
diff -u -r1.7 mxml.h
--- include/mxml.h	12 Jul 2005 09:04:15 -0000	1.7
+++ include/mxml.h	7 Oct 2005 13:15:53 -0000
@@ -43,6 +43,11 @@
 #define PROCESSING_INSTRUCTION_NODE   3
 #define COMMENT_NODE                  4
 #define DOCUMENT_NODE                 5
+#define ENTITY_NODE                   6
+
+#define INTERNAL_ENTITY               0
+#define EXTERNAL_ENTITY               1
+#define MXML_MAX_ENTITY            1000
 
 typedef struct {
    int  fh;
@@ -115,6 +120,7 @@
 PMXML_NODE mxml_create_root_node();
 PMXML_NODE mxml_parse_file(char *file_name, char *error, int error_size);
 PMXML_NODE mxml_parse_buffer(char *buffer, char *error, int error_size);
+PMXML_NODE mxml_parse_entity(char **buf, char *error, int error_size);
 int mxml_write_tree(char *file_name, PMXML_NODE tree);
 void mxml_debug_tree(PMXML_NODE tree, int level);
 void mxml_free_tree(PMXML_NODE tree);
Index: src/mxml.c
===================================================================
RCS file: /usr/local/cvsroot/rome/src/mxml.c,v
retrieving revision 1.8
diff -u -r1.8 mxml.c
--- src/mxml.c	11 May 2005 12:50:02 -0000	1.8
+++ src/mxml.c	7 Oct 2005 13:15:53 -0000
@@ -1209,6 +1209,30 @@
 
             p += 2;
 
+         } else if (strncmp(p, "!ENTITY", 7) == 0) {
+
+            /* found !ENTITY element */
+            pnew = mxml_add_special_node(ptree, ENTITY_NODE, "ENTYTY", NULL);
+            pv = p + 1;
+
+            p++;
+            if (strstr(p, ">") == NULL)
+               return read_error(HERE, "Unterminated !ENTITY element");
+
+            while (*p != '>') {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+
+            len = (size_t)p - (size_t)pv;
+            pnew->value = (char *)malloc(len+1);
+            memcpy(pnew->value, pv, len);
+            pnew->value[len] = 0;
+            mxml_decode(pnew->value);
+
+            p ++;
+
          } else {
             
             /* found normal element */
@@ -1407,6 +1431,422 @@
 
 /*------------------------------------------------------------------*/
 
+PMXML_NODE mxml_parse_entity(char **buf, char *error, int error_size)
+/* parse !ENTYTY entries of XML files and replace with references. Return NULL
+   in case of error, return error description. Optional file_name is used
+   for error reporting if called from mxml_parse_file() */
+{
+   char *p;
+   char *pv;
+   char delimiter;
+   int i, j, k, line_number;
+   char *replacement;
+   char entity_name[MXML_MAX_ENTITY][256];
+   char entity_reference_name[MXML_MAX_ENTITY][256];
+   char *entity_value[MXML_MAX_ENTITY];
+   int entity_type[MXML_MAX_ENTITY];    /* internal or external */
+   int nentity;
+   int fh, length, len;
+   char *buffer;
+   PMXML_NODE root = mxml_create_root_node();   /* dummy for 'HERE' */
+   char *file_name = NULL;      /* dummy for 'HERE' */
+   int ip;                      /* counter for entity value */
+
+   for (ip = 0; ip < MXML_MAX_ENTITY; ip++)
+      entity_value[ip] = NULL;
+
+   line_number = 1;
+   nentity = -1;
+
+   /* copy string to temporary space */
+   buffer = (char *) malloc(strlen(*buf) + 1);
+   if (buffer == NULL) {
+      return read_error(HERE, "Cannot allocate memory.");
+   }
+
+   p = buffer;
+
+   strcpy(buffer, *buf);
+   free(*buf);
+
+   /* search !ENTITY */
+   do {
+      if (*p == '<') {
+
+         /* found new entity */
+         p++;
+         while (*p && isspace(*p)) {
+            if (*p == '\n')
+               line_number++;
+            p++;
+         }
+         if (!*p) {
+/*
+            free(buffer);
+            for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+               free(entity_value[ip]);
+*/
+            return read_error(HERE, "Unexpected end of file");
+         }
+
+         if (strncmp(p, "!ENTITY", 7) == 0) {
+
+            /* found entity */
+            nentity++;
+            if (nentity >= MXML_MAX_ENTITY) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Too much entities");
+            }
+
+            pv = p + 7;
+            while (*pv == ' ')
+               pv++;
+
+            /* extract entity name */
+            p = pv;
+
+            while (*p && isspace(*p) && *p != '<' && *p != '>') {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            if (*p == '<' || *p == '>') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected \'%c\' inside !ENTITY", *p);
+            }
+
+            pv = p;
+            while (*pv && !isspace(*pv) && *pv != '<' && *pv != '>')
+               pv++;
+
+            if (!*pv) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            if (*pv == '<' || *pv == '>') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected \'%c\' inside entity \"%s\"", *pv,
+                                 &entity_name[nentity][1]);
+            }
+
+            len = (size_t) pv - (size_t) p;
+
+            entity_name[nentity][0] = '&';
+            i = 1;
+            entity_name[nentity][i] = 0;
+            while (*p && !isspace(*p) && *p != '/' && *p != '>' && *p != '<' && i < 253)
+               entity_name[nentity][i++] = *p++;
+            entity_name[nentity][i++] = ';';
+            entity_name[nentity][i] = 0;
+
+            if (!*p) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            if (*p == '<') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected \'<\' inside entity \"%s\"", &entity_name[nentity][1]);
+            }
+
+            /* extract replacement or SYSTEM */
+            while (*p && isspace(*p)) {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            if (*p == '>') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+            }
+
+            /* check if SYSTEM */
+            if (strncmp(p, "SYSTEM", 6) == 0) {
+               entity_type[nentity] = EXTERNAL_ENTITY;
+               p += 6;
+            } else {
+               entity_type[nentity] = INTERNAL_ENTITY;
+            }
+
+            /* extract replacement */
+            while (*p && isspace(*p)) {
+               if (*p == '\n')
+                  line_number++;
+               p++;
+            }
+            if (!*p) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            if (*p == '>') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected \'>\' inside entity \"%s\"", &entity_name[nentity][1]);
+            }
+
+            if (*p != '\"' && *p != '\'') {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Replacement was not found for entity \"%s\"",
+                                 &entity_name[nentity][1]);
+            }
+            delimiter = *p;
+            p++;
+            if (!*p) {
+/*
+               free(buffer);
+               for(ip=0;ip<MXML_MAX_ENTITY;ip++)
+                  free(entity_value[ip]);
+*/
+               return read_error(HERE, "Unexpected end of file");
+            }
+            pv = p;
+            while (*pv && *pv != delimiter)
+               pv++;
+
... 207 more lines ...
  107   06 Jan 2006 Steven SheetsForumTNetFolder.h
I just downloaded ROME v 2.0, I think. After running the make file I try and use romebuilder.exe
on the example stepbystep given in the download. When running romebuilder.exe
on stepbystep.xml I found it could not locate the file TNetFolder.h.

I googled this file and found a version of it which I copied to rome/include but still the builder will not build the analyzer. At this point I'm not sure how to get around this problem. If you have suggestions I'd appreciate it.

thanks,
Steven Sheets
  108   06 Jan 2006 Ryu SawadaForumTNetFolder.h
You can download the latest TNetFolder.h from the repository with web browser.

http://savannah.psi.ch/websvn/listing.php?repname=rome&path=%2Ftrunk%2Frome%2F&rev=0&sc=0


TNetFolder.h was added to "rome/include" in two weeks ago. Please make sure you have recent version.
If your copy is old, please update your copy with "svn update" command.


If the problem is not still fixed, could you paste error message from compiler ?
  126   29 Jun 2006 Steven SheetsForumROME analyzer crashes on reading midas file.
Hello,

So I'm stuck on this problem. The ROME based analyzer I use crashes everytime it attempts to open a midas file giving me this error:

Reading Midas-File /home/sheets4/run04750.mid.gz

*** Break *** segmentation violation
Generating stack trace...
0x00002b93efa9cd5c in gzread + 0xfc from /home/sheets4/root/lib/libCore.so
0x00000000004c47d9 in ROMEMidasDAQ::Event(long long) + 0x165 from ./danceanalyzer.exe
0x00000000004c452e in ROMEMidasDAQ::BeginOfRun() + 0x534 from ./danceanalyzer.exe
0x00000000004bf3da in ROMEDAQSystem::BeginOfRunDAQ() + 0x32 from ./danceanalyzer.exe
0x00000000004c1555 in ROMEEventLoop::DAQBeginOfRun(long long) + 0x15d from ./danceanalyzer.exe
0x00000000004c0721 in ROMEEventLoop::ExecuteTask(char const*) + 0x2d5 from ./danceanalyzer.exe
0x00000000004bb395 in ROMEAnalyzer::Start(int, char**) + 0x35d from ./danceanalyzer.exe
0x00000000005d121d in main + 0x2b1 from ./danceanalyzer.exe
0x000000363331c4bb in __libc_start_main + 0xdb from /lib64/tls/libc.so.6
0x00000000004b2e1a in TApplicationImp::ShowMembers(TMemberInspector&, char*) + 0x82 from ./danceanalyzer.exe
Aborted


I'd guess the problem is connected with ROOT but I'm not sure how to fix it.

I run ROOT v5.10.00
ROME v2.4
on a machine with Dual AMD opterons, 64 Bit with Red Hat Enterprise.

Any help would be appreciated.

thanks,
Steven
  127   04 Jul 2006 Matthias SchneebeliForumROME analyzer crashes on reading midas file.
From the error message I don't see where the problem is.
Are you sure that your midas file is ok?

You can send me the xml definition file, all source files of your project and the midas file. Then I will take a look at it.

Matthias




Steven Sheets wrote:
Hello,

So I'm stuck on this problem. The ROME based analyzer I use crashes everytime it attempts to open a midas file giving me this error:

Reading Midas-File /home/sheets4/run04750.mid.gz

*** Break *** segmentation violation
Generating stack trace...
0x00002b93efa9cd5c in gzread + 0xfc from /home/sheets4/root/lib/libCore.so
0x00000000004c47d9 in ROMEMidasDAQ::Event(long long) + 0x165 from ./danceanalyzer.exe
0x00000000004c452e in ROMEMidasDAQ::BeginOfRun() + 0x534 from ./danceanalyzer.exe
0x00000000004bf3da in ROMEDAQSystem::BeginOfRunDAQ() + 0x32 from ./danceanalyzer.exe
0x00000000004c1555 in ROMEEventLoop::DAQBeginOfRun(long long) + 0x15d from ./danceanalyzer.exe
0x00000000004c0721 in ROMEEventLoop::ExecuteTask(char const*) + 0x2d5 from ./danceanalyzer.exe
0x00000000004bb395 in ROMEAnalyzer::Start(int, char**) + 0x35d from ./danceanalyzer.exe
0x00000000005d121d in main + 0x2b1 from ./danceanalyzer.exe
0x000000363331c4bb in __libc_start_main + 0xdb from /lib64/tls/libc.so.6
0x00000000004b2e1a in TApplicationImp::ShowMembers(TMemberInspector&, char*) + 0x82 from ./danceanalyzer.exe
Aborted


I'd guess the problem is connected with ROOT but I'm not sure how to fix it.

I run ROOT v5.10.00
ROME v2.4
on a machine with Dual AMD opterons, 64 Bit with Red Hat Enterprise.

Any help would be appreciated.

thanks,
Steven
  128   07 Jul 2006 Ryu SawadaForumROME analyzer crashes on reading midas file.
I have tested midas file reading on 64 bit CPU. And there was no problem.

My environment is

-- Wring
Linux 2.6.9 SMP pentium4 32bit
ROOT v5.11/06 32 bit
MIDAS rev.3165 32 bit
midas files was written by frontend in midas/examples/experiment

-- Reading
Linux 2.6.17 SMP x86_64 AMD dual-core Athlon 64bit
ROME rev.1223 64 bit
ROOT v5.08/00b 64 bit

midas file was compressed with gzip 1.3.3
  131   23 Feb 2007 Matthias SchneebeliForumDuplicate header file
> I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> interesting issue trying to compile my analyzer. I tracked the problem to the
> fact that both Root and Rome are loading their own version of a header file
> called TArrayL64.h. The content of the two files are essentially identical. I
> solved the problem by changing the conditional at the start of the file
> $ROMESYS/include/TArrayL64.h from
> 
> #ifndef TArrayL64_H
> #define TArrayL64_H
> 
> to
> 
> #ifndef ROOT_TArrayL64
> #define ROOT_TArrayL64
> 
> The latter is what I found in the Root version of the file. Now it only gets
> loaded once. I looked at the svn sources that I just updated and it also uses
> TArrayL64_H.
> 
> Question, why are there two copies.
> 
> UPDATE 2-21-07:
> It seems that Root was the cause of this. Rome has used this header for some
> time, but earlier versions of Root did not include it.


As you already mentioned the older root version didn't include this header. But we
needed to include it in rome earlier. Now we still have it in the rome
distribution to be compatible with the older root versions.

There should not be any problem with this header in the current rome version. If
you have compilation problems do a  make distclean  and try again.
  132   23 Feb 2007 Konstantin OlchanskiForumDuplicate header file
> > I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> > interesting issue trying to compile my analyzer. I tracked the problem to the
> > fact that both Root and Rome are loading their own version of a header file
> > called TArrayL64.h.

I have just run into the TArrayL64.h problem myself. I recommend that we resolve
the clashing header files. We could ask Rene Brun to rename his file or we could
rename the clashing file in Rome.

K.O.
  133   28 Feb 2007 Ryu SawadaForumDuplicate header file
> > > I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> > > interesting issue trying to compile my analyzer. I tracked the problem to the
> > > fact that both Root and Rome are loading their own version of a header file
> > > called TArrayL64.h.
> 
> I have just run into the TArrayL64.h problem myself. I recommend that we resolve
> the clashing header files. We could ask Rene Brun to rename his file or we could
> rename the clashing file in Rome.
> 
> K.O.

As Matthias mensioned, this problem is solved in SVN version of ROME.
I propose to release ROME version 2.8, which will not have this problem.

If there are users who want to continue to use 2.7, we could also release patch release of 2.7. (2.7.1), in which only compatibility problems 
are fixed.

Ryu
  134   28 Feb 2007 Ryu SawadaForumDuplicate header file
> > > > I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> > > > interesting issue trying to compile my analyzer. I tracked the problem to the
> > > > fact that both Root and Rome are loading their own version of a header file
> > > > called TArrayL64.h.
> > 
> > I have just run into the TArrayL64.h problem myself. I recommend that we resolve
> > the clashing header files. We could ask Rene Brun to rename his file or we could
> > rename the clashing file in Rome.
> > 
> > K.O.
> 
> As Matthias mensioned, this problem is solved in SVN version of ROME.
> I propose to release ROME version 2.8, which will not have this problem.
> 
> If there are users who want to continue to use 2.7, we could also release patch release of 2.7. (2.7.1), in which only compatibility problems 
> are fixed.

I prepared a new release 2.8. It can be downloaded from http://midas.psi.ch/rome/download.html

The new release works with also ROOT 5.14 or 5.15.

At this release, style of configuration file was changed. Please see following message for details. 
https://ladd00.triumf.ca/elog/Rome/129
  136   06 Jun 2008 Todd BredewegForumRome License
I was wondering what type of license, if any, applies to the Rome distribution.
Midas is using GPL and Root is using LGPL.
  137   09 Jun 2008 Stefan RittForumRome License
> I was wondering what type of license, if any, applies to the Rome distribution.
> Midas is using GPL and Root is using LGPL.

Midas uses GPL because when I started that project, the LGPL was not yet in
existence. If anybody want Midas under the LGPL, I could consider switching that.
ROME is under the LGPL.
  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 
ELOG V3.1.4-2e1708b5