I am attempting to automate some work we are doing. We work on fire alarm systems, and prior to testing we have to demonstrate what will happen in the program prior to testing. So if we hit this smoke detector this will be the result.
I am a relatively new coder.
The panel programming is in a text file that has consistent delimiters, but there are a couple items that are giving me some trouble.
[OC13_ALARM_STATUS_LED]
ALARM '*OC13*':
FAST '*_STATLED5';
[OC13_EWSD_WARNING_STATUS_LED]
ALARM '*OC13*EWSDL*':
FAST '*_STATLED6',
LEDOFF '*_STATLED5';
[OC13_TROUBLE_STATUS_LED]
TROUBLE '*OC13*':
FAST '*_STATLED7';
{***DISABLE BUTTONS***}
[0138_DIS_ACT]
SWITCH 'OC4_0138_SW1_DIS_ACT':
FAST 'OC4_0138_LED129_DIS_ACT';
[DIS_BELL]
MONITOR 'AND_0138_DIS_BELL':
DISABLE AUD '*_OC12_BELL*',
STEADY 'OC4_0138_LED129_DIS_ACT',
STEADY 'OC4_0138_LED131_DIS_BELL';
[DIS_OC12_ELEV]
MONITOR 'AND_0138_DIS_OC12_ELEV':
DISABLE NSO '*_OC12_RLY_*_ELEV*',
DISABLE NSO '*_OC12_REDCAP_*_ELEV*',
STEADY 'OC4_0138_LED129_DIS_ACT',
STEADY 'OC4_0138_LED133_DIS_OC12_ELEV';
The brackets are the name of the rule, the items on the left of the colon are the inputs, the right side is the outputs. We have a table that has all of the devices. What I want to do is parse this text file making a table with the rules. Then I intend to make a select query using this data to show when this input is activated, this rule runs, and these outputs will activate.
The curly braces are notes that are randomly inserted throughout the file as needed, which is what is throwing me off. It makes the data somewhat non standard. Also there being some with multiple outputs and others with only one.
Thanks Stack.