Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Number of conditional attributes, posted by Richard Stamper on Wed Jul 4 13:58:23 2012 
    icon2.gif   Re: Number of conditional attributes, posted by Stefan Ritt on Fri Jul 13 10:45:49 2012 
       icon2.gif   Re: Number of conditional attributes, posted by Richard Stamper on Fri Jul 13 17:09:58 2012 
Message ID: 67303     Entry time: Fri Jul 13 17:09:58 2012     In reply to: 67301
Icon: Reply  Author: Richard Stamper  Author Email: richard.stamper@stfc.ac.uk 
Category: Question  OS: All  ELOG Version: 2.9.2 
Subject: Re: Number of conditional attributes 

Stefan Ritt wrote:

Richard Stamper wrote:

Is there a limit on the number of conditions that can be simultaneously active in a log?  When I activate more than 10 conditions I start to see side effects with other conditions being deactivated.  I think this is due to the hard-coded array size of 10 for clist in the match_param function in elogd.c.  If so, could this limit be increased?  

Are there other limits on the number of conditions, or the length of condition names?  If I've understood the code right, the _condition string holds a comma-separated list of the active conditions, so the 256 byte length of this will also put some limit on the number of conditions that can be active.

Ups. I never imagined that someone would use more than 10 conditions. I'm not 100% sure if the problem is the clist array, but can you try to set it to 20 and see if it gets better? You can also send me your config file and I can try it myself. 

I'll try increasing the list size(s), and will also prepare a simplified config file for you to look at.  Maybe there is a another way to implement what I am trying to achieve?  

In general terms I am trying to give an e-log a "memory" of what has been recorded previously in order to constrain what is permissible to record next.  I do this by starting a log with an initial entry, then alter the config so that users can add records only by duplicating the last record.  The log records the current state of some variables, and allows users to record changes to the state of any of these variables. Conditions are used to constrain the permitted state changes, depending on the current state; conditions are also used, with subst options, to update the current state variables when changes are made.

Specifically, we have "Mate-Demate" logs for connectors to record when connectors are mated and demated.  Previously we just had an attribute for each connector in an assembly with options "Mate", "Demate" and "-" to indicate that either a mate or demate was carried out or that the connector was not touched on this occasion (although others were).  My cunning plan was to ensure that a "Demate" (or no-op) was possible only if the connector is currently mated, and conversely that a "Mate" (or no-op) was possible only if the connector is currently demated.  For each connector (e.g. ConnectorA), there are now two attributes

  • "ConnectorA state", to record the current state, and
  • "ConnectorA" to record any change.

A new record can be created only by duplicating the last record, thus copying the current state of the connectors, and for each connector the relevant config file entries are like this:

 

Show Attributes = ConnectorA
Show Attributes Edit = ConnectorA state, ConnectorA
Locked Attributes = ConnectorA state
Preset on duplicate ConnectorA = -
Options ConnectorA state = Mate{1}, Demate{2}
{2} Options ConnectorA = -, Mate{3}
{1} Options ConnectorA = -, Demate{3}
{3} Subst ConnectorA state = $ConnectorA

The logbook is set up with a record with "ConnectorA state" set to "Demate", which constrains "ConnectorA" to record either a no-op or a mate; if a mate is subsequently recorded then the Subst option for "ConnectorA state" substitutes the new status ("Mate") for the connector before the record is saved; in the new last record "ConnectorA state" is now set to "Mate" which permits only a demate; when a no-op is selected the state is unchanged, having been inherited through duplication from the last record.  The number of conditions used is one per "ConnectorX state" attribute, plus one for each connector whose state is changed, so for assemblies with more than 5 connectors it is possible to have more than 10 conditions active at once.
 
ELOG V3.1.5-fe60aaf