Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 120 of 807  Not logged in ELOG logo
    icon2.gif   Re: Calculations & Interfacing a DataBase with Elog., posted by John on Sat Jun 22 10:21:39 2019 

Thanks Stefan soo much. As I've said, I will update this post(s) as I make any progress :)

John

Stefan Ritt wrote:

Yes elog stores data in a flat file database. Go to your logbook directory and look for files YYMMDDa.log where you find all data. Some people do a post submit call to scripts, other integrate JS directly on each page (e.g. via "bottom text" option where you can load a whole JavaScript file), then pick the fields and do calculations directly in the edit window.

Stefan

John wrote:

Hi, I am trying to calculate two or more Elog fields and then return the value to Elog. I am currently learning Perl to do this. I realize JS can do this.. but so can IBM Basic ;)  I am savy with other db techniques like sql. My question is before I get too far along with this project, is it safe to say the current storage of Elog data is 'Flat File' database? I also want to find out if it would be better to try and grab the data prior OR  after it gets into the Elog database. I see there are other forum messages related to sql interfacing and such, but nothing conclusive.  I will submit my personal progress here. Thanks again, John

 

 

icon5.gif   How to update date fields so 'alarms' work correctly., posted by John on Sat Feb 29 06:04:57 2020 

Hi Stefan!

In the user manual under misc it says this: "The elog program makes it possible to submit logbook entries automatically by the system or from scripts. In some shift logbooks this feature is used to enter alarm messages automatically into the logbook. "

Ok what am trying to do is have all messages update (somehow) without the user entering each record. I want my alarm system to be able to keep-up2-date on the expirations, by simply updating the 'date' fields I have in the logbooks (JS). I am getting used to JavaScript, and have all of that working as far as the actual 'alarms' are concerned. But they are useless if the dates are stagnent (ie. not updateing at least once per day).

So can you refer me to the 'shift books' you reference above, so I can understand how to write the code necessary? I've spend much time searching the net on this and experimenting, so I did try to find out before I posted. I believe using a combination of the Elog Utility, with a dedicated 'start page' that is mostly JS, will be part of the solution...

Thanks soo much for your help and awesome creation! :)

John

    icon2.gif   Re: How to update date fields so 'alarms' work correctly., posted by Sebastian Schenk on Fri Mar 13 16:38:53 2020 

Dear John,

I am a user of the elog system and no developer, so no complete answer guaranteed.

The quote of the manual describes the case, if e.g. an hardware component discovers a failure and the connected PC makes an automatic (new) entry to the elog. Probably modifying an existing one.

I have small concerns on your solution. The description of your alarm system sounds the other ways around, as you are doing something, depending on the elog entries. Based on your statement on JS and dedicated start page, you want to do it on client-side and not on the server. Where I can see the issue, if there is not client, then there is no alarm. As you want to change the date of the entries, I believe, you want to reuse the same entries multiple (infinite?) times instead of creating new ones. The later would be the style of an logging software like elog.

As far as I know, the Date attribute is special and cannot be changed by submitting something to the elog server. as this would make "Restrict edit time" useless. You can try it with this in your config:
Subst on edit Date = $date
Making an entry and edit it afterwards. The entry time stays the same.
If you really want to use this attribute, you have to do some scripting to the actual saved .log files, but this is not intended as I believe.

What you can do, is using an alternative attribute like "MDate" with the config:
Subst MDate = $date
Subst on edit MDate = $date
This will update every time you edit the entry.
Then you probably want to add something like this to your config
List display = ID, MDate, Author, ...

Or "Update" using the duplicate function on the old entry, where you want to change the date, creating a new one with the same content.
Or "Update" using the reply function to create a new entry, referring to the old one.

I hope, I could help.
Best wishes,
Sebastian

John wrote:

Hi Stefan!

In the user manual under misc it says this: "The elog program makes it possible to submit logbook entries automatically by the system or from scripts. In some shift logbooks this feature is used to enter alarm messages automatically into the logbook. "

Ok what am trying to do is have all messages update (somehow) without the user entering each record. I want my alarm system to be able to keep-up2-date on the expirations, by simply updating the 'date' fields I have in the logbooks (JS). I am getting used to JavaScript, and have all of that working as far as the actual 'alarms' are concerned. But they are useless if the dates are stagnent (ie. not updateing at least once per day).

So can you refer me to the 'shift books' you reference above, so I can understand how to write the code necessary? I've spend much time searching the net on this and experimenting, so I did try to find out before I posted. I believe using a combination of the Elog Utility, with a dedicated 'start page' that is mostly JS, will be part of the solution...

Thanks soo much for your help and awesome creation! :)

John

 

    icon2.gif   Re: How to update date fields so 'alarms' work correctly., posted by John on Fri Mar 13 18:34:30 2020 

Hi Sebastian!

Thank you soo much for your kind response. You are correct in all of your assumptions as to what I want to do (or not do!). Everything should be on clients side, and I want the date to be updated in each record, daily, or hourly, in order to allow the 'alarm' system I created to be able to give notice (a pop up ,or whatever) when the time as passed, for whatever time/date the user set the alarm for.

I believe this has been asked in general in the past and  suggetions were to have the data updated in onther program (spreadsheet) or whatever, as you implied, by changing the database directly (log files). This is not the way I want to do, even though I realize it would accomplish this task. I want to just use Elog and probably JS.

I will try your ideas and when I am done (successful or not!) I will report my findings back here :)

John

Sebastian Schenk wrote:

Dear John,

I am a user of the elog system and no developer, so no complete answer guaranteed.

The quote of the manual describes the case, if e.g. an hardware component discovers a failure and the connected PC makes an automatic (new) entry to the elog. Probably modifying an existing one.

I have small concerns on your solution. The description of your alarm system sounds the other ways around, as you are doing something, depending on the elog entries. Based on your statement on JS and dedicated start page, you want to do it on client-side and not on the server. Where I can see the issue, if there is not client, then there is no alarm. As you want to change the date of the entries, I believe, you want to reuse the same entries multiple (infinite?) times instead of creating new ones. The later would be the style of an logging software like elog.

As far as I know, the Date attribute is special and cannot be changed by submitting something to the elog server. as this would make "Restrict edit time" useless. You can try it with this in your config:
Subst on edit Date = $date
Making an entry and edit it afterwards. The entry time stays the same.
If you really want to use this attribute, you have to do some scripting to the actual saved .log files, but this is not intended as I believe.

What you can do, is using an alternative attribute like "MDate" with the config:
Subst MDate = $date
Subst on edit MDate = $date
This will update every time you edit the entry.
Then you probably want to add something like this to your config
List display = ID, MDate, Author, ...

Or "Update" using the duplicate function on the old entry, where you want to change the date, creating a new one with the same content.
Or "Update" using the reply function to create a new entry, referring to the old one.

I hope, I could help.
Best wishes,
Sebastian

John wrote:

Hi Stefan!

In the user manual under misc it says this: "The elog program makes it possible to submit logbook entries automatically by the system or from scripts. In some shift logbooks this feature is used to enter alarm messages automatically into the logbook. "

Ok what am trying to do is have all messages update (somehow) without the user entering each record. I want my alarm system to be able to keep-up2-date on the expirations, by simply updating the 'date' fields I have in the logbooks (JS). I am getting used to JavaScript, and have all of that working as far as the actual 'alarms' are concerned. But they are useless if the dates are stagnent (ie. not updateing at least once per day).

So can you refer me to the 'shift books' you reference above, so I can understand how to write the code necessary? I've spend much time searching the net on this and experimenting, so I did try to find out before I posted. I believe using a combination of the Elog Utility, with a dedicated 'start page' that is mostly JS, will be part of the solution...

Thanks soo much for your help and awesome creation! :)

John

 

 

icon5.gif   How to change name of record Id from $@MID@$., posted by John on Wed Jul 22 18:11:56 2020 

Hi Everyone,

I tried using this $@MID@$ in JS as a variable and cannot doit. I researched a little and found no answer on special character usage. If anyone knows, please lemme know. I also tried breifly in Elogd to change it to something like just MID, but need a better editor as  (Kate) is not saving the program back in correct iso (character) format. So I thought I'd pose the question in the meanwhile.

Thanks, John

    icon2.gif   Re: How to change name of record Id from $@MID@$., posted by Stefan Ritt on Wed Jul 22 19:10:08 2020 

No idea what you are talking about. $@MID@$ is used in the database files to indicate the start of a new message. It is not used on any elog web page. If you want to put the message ID on your web page, you should use the variable "$message id" as written in the documentation. You say JS, where is your JS running? You wrote a JS program to work on the raw elog database files? Or you wrote an extension to run in your browse? You have to be a bit clearer.

Stefan

John wrote:

Hi Everyone,

I tried using this $@MID@$ in JS as a variable and cannot doit. I researched a little and found no answer on special character usage. If anyone knows, please lemme know. I also tried breifly in Elogd to change it to something like just MID, but need a better editor as  (Kate) is not saving the program back in correct iso (character) format. So I thought I'd pose the question in the meanwhile.

Thanks, John

 

icon5.gif   How to lock a specific entry?, posted by Manoel Couder on Tue Sep 14 17:48:52 2021 

Hi All,

I am using elog to track technical changes in an experiment but also to log what experimentalist are doing during an experiment. For the latter, I would like to be able to lock those entries from being further edited after the expertiment if finished. Is there a way to do that?

Thanks,

Manoel

    icon2.gif   Re: How to lock a specific entry?, posted by Stefan Ritt on Tue Sep 14 18:18:03 2021 

You can either lock all entries or none. So I would propose you set up two logbooks, one for technical changes which is not locked and one for what experimentalists are doing which is locked. Locking can be done a certain time after an entry has been made (like 1h, 1d, 1 month etc.). Or you simply make the logbook read-only.

Stefan

Manoel Couder wrote:

Hi All,

I am using elog to track technical changes in an experiment but also to log what experimentalist are doing during an experiment. For the latter, I would like to be able to lock those entries from being further edited after the expertiment if finished. Is there a way to do that?

Thanks,

Manoel

 

ELOG V3.1.5-3fb85fa6