PEARL Procedures
rev-distro-3.0.0-0-gfa24916-dirty
Igor procedures for the analysis of PEARL data
|
interface for writing ELOG entries with Igor graphs as attachment. More...
Go to the source code of this file.
Namespaces | |
PearlElog | |
interface for writing ELOG entries with Igor graphs as attachment. | |
Functions | |
variable | pearl_elog (string logbook) |
main function to initialize ELOG and to open an ELOG panel. More... | |
static variable | IgorBeforeNewHook (string igorApplicationNameStr) |
save preferences and recent values before Igor opens a new experiment. More... | |
static variable | IgorQuitHook (string igorApplicationNameStr) |
save preferences and recent values before Igor quits. More... | |
static variable | AfterFileOpenHook (variable refNum, string file, string pathName, string type, string creator, variable kind) |
initialize the package and reload preferences after an experiment is loaded. More... | |
static dfr | get_elog_df (string name, variable category) |
get the package, logbook, or template datafolder. More... | |
static variable | init_package (variable clean=defaultValue) |
initialize the package data folder. More... | |
variable | elog_init_pearl_templates () |
setup PEARL template logbooks. More... | |
static variable | init_volatile_vars () |
initialize volatile variables. More... | |
variable | elog_create_logbook (string name, string template=defaultValue) |
create a new logbook. More... | |
variable | elog_config (string elog_path=defaultValue, string hostname=defaultValue, variable port=defaultValue, string subdir=defaultValue) |
set global module configuration parameters More... | |
variable | elog_login (string logbook, string username, string password) |
set username and password for login to a logbook More... | |
variable | elog_logout (string logbook) |
clear username and password of a logbook or all logbooks. More... | |
static variable | save_prefs () |
save persistent package data to the preferences file. More... | |
static variable | load_prefs () |
load persistent package data from the preferences file. More... | |
static string | list_logbooks (variable templates=defaultValue) |
get a list of configured logbooks or templates. More... | |
variable | elog_validate_attributes (string logbook, string attributes) |
validate attributes More... | |
variable | elog_create_entry (string logbook, string attributes, string message, variable encoding=defaultValue, string graphs=defaultValue, variable replyto=defaultValue) |
create a new entry in ELOG More... | |
variable | elog_add_attachment (string logbook, variable id, string graphs) |
add one or more graphs to an existing ELOG entry More... | |
static string | prepare_command_line (string logbook) |
format the ELOG command and essential address arguments. More... | |
static string | format_url (string logbook) |
format the URL for display to the user More... | |
static string | prepare_graph_attachments (string graphs) |
prepare screenshots of graph windows for attachments More... | |
static string | get_timestamp (string sep) |
static string | create_message_file (string message) |
save the message to a temporary text file More... | |
static string | create_graph_file (string graphname, variable fileindex) |
save a graph to a temporary graphics file More... | |
static string | create_cmd_file (string cmd) |
write the command line to a file. More... | |
static string | get_log_path () |
static variable | cleanup_temp_files () |
delete temporary files created by the ELOG module. More... | |
static variable | parse_result () |
parse the result file from an elog invokation. More... | |
string | elog_prompt_logbook () |
prompt to open or create a logbook More... | |
variable | elog_prompt_login (string logbook) |
prompt the user for login to a logbook More... | |
string | PearlElogPanel (string logbook) |
open a new panel for submitting data to ELOG. More... | |
static variable | elog_panel_hook (WMWinHookStruct *s) |
static variable | update_attach_items (string logbook) |
update the list of attachments More... | |
static variable | move_attach_item (string logbook, variable item, variable distance) |
move an attachment item in the list of attachments More... | |
static variable | bp_attach_updown (WMButtonAction *ba) |
button procedure for the attachment up and down buttons More... | |
static variable | bp_submit (WMButtonAction *ba) |
button procedure for the Submit and Reply buttons More... | |
static variable | bp_attach_top (WMButtonAction *ba) |
select top graph window for attachment More... | |
static variable | bp_attach_allnone (WMButtonAction *ba) |
select/deselect all graph windows for attachment More... | |
static variable | bp_attach (WMButtonAction *ba) |
static variable | bp_save_graphs (WMButtonAction *ba) |
static variable | bp_clear (WMButtonAction *ba) |
static variable | bp_login (WMButtonAction *ba) |
static variable | bp_logout (WMButtonAction *ba) |
static string | get_default_panel_name () |
static string | get_panel_attributes (string windowname) |
get a list of attributes from the fields of the ELOG panel. More... | |
static string | set_panel_attributes (string windowname, string attributes, variable clear=defaultValue) |
set the fields of the ELOG panel More... | |
static string | get_panel_message (string windowname) |
get the message field of the ELOG panel More... | |
static string | set_panel_message (string windowname, string message) |
set the message field of the ELOG panel More... | |
static string | get_panel_graphs (string windowname) |
get the names of the graphs selected for attachment More... | |
static string | set_panel_graphs (string windowname, string graphs) |
update selection of graphs for attachment More... | |
Variables | |
static const string | package_name = "pearl_elog" |
static const string | package_path = "root:packages:pearl_elog:" |
static const variable | kdfRoot = 0 |
static const variable | kdfVolatile = 1 |
static const variable | kdfPersistent = 2 |
static const variable | kdfTemplates = 3 |
static const string | elog_success_msg = "Message successfully transmitted" |
static const string | elog_parse_id = "ID=%u" |
static const variable | kAttachColSel = 0 |
static const variable | kAttachColTitle = 1 |
static const variable | kAttachColName = 2 |
interface for writing ELOG entries with Igor graphs as attachment.
the functions in this module support the following ELOG features:
usage:
elog command line
* elog -h <hostname> [-p port] [-d subdir] * Location where elogd is running * -l logbook Name of logbook * -s Use SSL for communication * [-v] For verbose output * [-w password] Write password defined on server * [-u username password] User name and password * [-f <attachment>] Up to 50 attachments * -a <attribute>=<value> Up to 50 attributes * [-r <id>] Reply to existing message * [-q] Quote original text on reply * [-e <id>] Edit existing message * [-x] Suppress email notification * [-n 0|1|2] Encoding: 0:ELcode,1:plain,2:HTML * -m <textfile>] | <text> *
Definition in file pearl-elog.ipf.
|
static |
initialize the package and reload preferences after an experiment is loaded.
Definition at line 144 of file pearl-elog.ipf.
|
static |
Definition at line 1636 of file pearl-elog.ipf.
|
static |
select/deselect all graph windows for attachment
Definition at line 1615 of file pearl-elog.ipf.
|
static |
select top graph window for attachment
Definition at line 1599 of file pearl-elog.ipf.
|
static |
button procedure for the attachment up and down buttons
Definition at line 1520 of file pearl-elog.ipf.
|
static |
Definition at line 1697 of file pearl-elog.ipf.
|
static |
Definition at line 1713 of file pearl-elog.ipf.
|
static |
Definition at line 1731 of file pearl-elog.ipf.
|
static |
Definition at line 1669 of file pearl-elog.ipf.
|
static |
button procedure for the Submit and Reply buttons
Definition at line 1552 of file pearl-elog.ipf.
|
static |
delete temporary files created by the ELOG module.
this deletes all temporary graph files that are referenced by the volatile temp_graph_files list. temp_graph_files is a semicolon-delimited string. items are added by create_graph_file().
this function should be called before a new experiment is loaded or igor quits.
Definition at line 1116 of file pearl-elog.ipf.
|
static |
write the command line to a file.
the command script changes the working directory to the Temporary directory. it also deletes a previous elog.log file.
Definition at line 1060 of file pearl-elog.ipf.
|
static |
save a graph to a temporary graphics file
the file is saved to the Temporary directory returned by igor's SpecialDirPath function. the file name contains a time stamp and the specified file index to make it unique. the function returns the name of the file (excluding path!)
the full path is added to the temp_graph_files global list. a hook function will delete the files listed there when igor quits.
graphname | object name of the graph to save. |
fileindex | incrememtal index of the file within one submission. the file name is made unique by a time stamp and this file index. submissions within the same second must have a unique file index. |
Definition at line 1024 of file pearl-elog.ipf.
|
static |
save the message to a temporary text file
the file is saved to the Temporary directory returned by igor's SpecialDirPath function under the file name "elog_temp_message.txt". the function returns the name of the file (excluding path!)
message | text message to save to the file. |
Definition at line 983 of file pearl-elog.ipf.
variable elog_add_attachment | ( | string | logbook, |
variable | id, | ||
string | graphs | ||
) |
add one or more graphs to an existing ELOG entry
logbook | name of the target logbook |
id | identification number of the existing entry |
graphs | names of graph windows to be added as attachments, semicolon separated |
Definition at line 793 of file pearl-elog.ipf.
variable elog_config | ( | string | elog_path = defaultValue , |
string | hostname = defaultValue , |
||
variable | port = defaultValue , |
||
string | subdir = defaultValue |
||
) |
set global module configuration parameters
Definition at line 474 of file pearl-elog.ipf.
variable elog_create_entry | ( | string | logbook, |
string | attributes, | ||
string | message, | ||
variable | encoding = defaultValue , |
||
string | graphs = defaultValue , |
||
variable | replyto = defaultValue |
||
) |
create a new entry in ELOG
this is the main function to create a new entry in a logbook.
logbook | name of the target logbook. |
attributes | key=value list of attributes, semicolon separated. |
message | free text part of the entry. |
encoding | encoding of message, 0:ELcode, 1:plain (default), 2:HTML. |
graphs | names of graph windows to be added as attachments, semicolon separated. |
replyto | existing message ID (> 1) to follow up on. 0 or default: start new thread. |
Definition at line 686 of file pearl-elog.ipf.
variable elog_create_logbook | ( | string | name, |
string | template = defaultValue |
||
) |
create a new logbook.
create a new empty logbook or duplicate from a template.
name | name of the new logbook. if the logbook exists, the existing logbook folder is killed and replaced by a new one. this may fail if a window is still open. |
template | name of the template. if empty string, a new empty logbook is created. |
Definition at line 415 of file pearl-elog.ipf.
variable elog_init_pearl_templates | ( | ) |
setup PEARL template logbooks.
template logbooks for PEARL.
Definition at line 263 of file pearl-elog.ipf.
variable elog_login | ( | string | logbook, |
string | username, | ||
string | password | ||
) |
set username and password for login to a logbook
the username and password are stored (in plain text) in global strings under the selected logbook folder. this is necessary for sending data to the ELOG server.
call elog_logout() to clear the password variables and to avoid unintended use of your credentials.
logbook | name of the target logbook. |
Definition at line 514 of file pearl-elog.ipf.
variable elog_logout | ( | string | logbook | ) |
clear username and password of a logbook or all logbooks.
the username and password are stored (in plain text) in global strings under the selected logbook folder. this function resets the username and password strings.
logbook | name of the target logbook. if empty, the passwords of all logbooks are cleared. |
Definition at line 534 of file pearl-elog.ipf.
|
static |
Definition at line 1396 of file pearl-elog.ipf.
string elog_prompt_logbook | ( | ) |
prompt to open or create a logbook
Definition at line 1185 of file pearl-elog.ipf.
variable elog_prompt_login | ( | string | logbook | ) |
prompt the user for login to a logbook
Definition at line 1215 of file pearl-elog.ipf.
variable elog_validate_attributes | ( | string | logbook, |
string | attributes | ||
) |
validate attributes
Definition at line 654 of file pearl-elog.ipf.
|
static |
format the URL for display to the user
logbook | name of the target logbook |
Definition at line 903 of file pearl-elog.ipf.
|
static |
Definition at line 1748 of file pearl-elog.ipf.
|
static |
get the package, logbook, or template datafolder.
name | name of logbook or template, or empty string for respective parent folder. |
category | parameter category:
|
Definition at line 171 of file pearl-elog.ipf.
|
static |
Definition at line 1096 of file pearl-elog.ipf.
|
static |
get a list of attributes from the fields of the ELOG panel.
windowname | window name of the ELOG panel if empty, use default name "PearlElogPanel" |
"key1=value1;key2=value2"
. Definition at line 1761 of file pearl-elog.ipf.
|
static |
get the names of the graphs selected for attachment
windowname | panel window name |
Definition at line 1927 of file pearl-elog.ipf.
|
static |
get the message field of the ELOG panel
windowname | window name of the ELOG panel if empty, use default name "PearlElogPanel" |
Definition at line 1881 of file pearl-elog.ipf.
|
static |
Definition at line 959 of file pearl-elog.ipf.
|
static |
save preferences and recent values before Igor opens a new experiment.
Definition at line 128 of file pearl-elog.ipf.
|
static |
save preferences and recent values before Igor quits.
Definition at line 136 of file pearl-elog.ipf.
|
static |
initialize the package data folder.
the data folder is initialized with a default, local configuration without any logbooks. the server configuration should be set in the preferences.
clean | decides what to do if the package configuration exists.
|
Definition at line 218 of file pearl-elog.ipf.
|
static |
initialize volatile variables.
create and initialize all volatile variables for the configured notebooks. values of existing variables are not changed.
this function must be called after new logbooks have been configured, specifically by elog_create_logbook() and load_prefs().
Definition at line 341 of file pearl-elog.ipf.
|
static |
get a list of configured logbooks or templates.
this is list of data folder names under persistent:logbooks (or persistent:templates). the function does not check whether the folders contain valid data.
templates | select whether logbooks (0, default) or templates (1) are returned. |
Definition at line 619 of file pearl-elog.ipf.
|
static |
load persistent package data from the preferences file.
the preferences file is an Igor packed experiment file in a special preferences folder
Definition at line 585 of file pearl-elog.ipf.
|
static |
move an attachment item in the list of attachments
Definition at line 1496 of file pearl-elog.ipf.
|
static |
parse the result file from an elog invokation.
Definition at line 1142 of file pearl-elog.ipf.
variable pearl_elog | ( | string | logbook | ) |
main function to initialize ELOG and to open an ELOG panel.
this function takes care of all necessary initialization, configuration, and preferences. if a panel exists, it will be moved to the front.
logbook | name of the logbook if empty, the user is prompted to select or create a logbook by elog_prompt_logbook(). |
Definition at line 98 of file pearl-elog.ipf.
string PearlElogPanel | ( | string | logbook | ) |
open a new panel for submitting data to ELOG.
this function creates only the panel but not the necessary data folders. call init_package() and load_prefs() once before creating panels.
logbook | name of the target logbook |
Definition at line 1242 of file pearl-elog.ipf.
|
static |
format the ELOG command and essential address arguments.
the following arguments are included (from global variables) if applicable: host name, port, SSL, sub-dir, username, password the result string does not include leading or trailing space
logbook | name of the target logbook |
Definition at line 854 of file pearl-elog.ipf.
|
static |
prepare screenshots of graph windows for attachments
prepares the attachment files from Igor graph windows and returns the arguments to the elog command to attach the files. file names are returned without path. the result string does not include leading or trailing space.
graphs | names of graph windows to be added as attachments, semicolon separated |
Definition at line 940 of file pearl-elog.ipf.
|
static |
save persistent package data to the preferences file.
saves everything under the persistent folder of the package.
Definition at line 565 of file pearl-elog.ipf.
|
static |
set the fields of the ELOG panel
windowname | window name of the ELOG panel if empty, use default name "PearlElogPanel" |
attributes | list of attributes to set (format "key1=value1;key2=value2") |
clear | what to do if a key is missing in attributes?
|
Definition at line 1808 of file pearl-elog.ipf.
|
static |
update selection of graphs for attachment
windowname | panel window name. looks for default panel if empty. |
graphs | semicolon-separated list of names of graph windows to select for attachment. |
Definition at line 1967 of file pearl-elog.ipf.
|
static |
set the message field of the ELOG panel
windowname | window name of the ELOG panel if empty, use default name "PearlElogPanel" |
message | message text that can be passed to the Notebook operation. |
Definition at line 1907 of file pearl-elog.ipf.
|
static |
update the list of attachments
Definition at line 1435 of file pearl-elog.ipf.
|
static |
Definition at line 1135 of file pearl-elog.ipf.
|
static |
Definition at line 1134 of file pearl-elog.ipf.
|
static |
Definition at line 1432 of file pearl-elog.ipf.
|
static |
Definition at line 1430 of file pearl-elog.ipf.
|
static |
Definition at line 1431 of file pearl-elog.ipf.
|
static |
Definition at line 156 of file pearl-elog.ipf.
|
static |
Definition at line 154 of file pearl-elog.ipf.
|
static |
Definition at line 157 of file pearl-elog.ipf.
|
static |
Definition at line 155 of file pearl-elog.ipf.
|
static |
Definition at line 86 of file pearl-elog.ipf.
|
static |
Definition at line 87 of file pearl-elog.ipf.