Skip to content

Commit

Permalink
* clean up configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
MRIIOT committed Mar 29, 2023
1 parent 2f7bb1c commit f905690
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 103 deletions.
8 changes: 4 additions & 4 deletions examples/docker/agent.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WorkerThreads = 1

Adapters {
Adapter_1 {
Device = *
Device = f_sim
Host = fanuc_driver
Port = 7878
FilterDuplicates = true
Expand All @@ -42,17 +42,17 @@ Ruby {

Files {
schemas {
Path = ../schemas
Path = /etc/mtconnect/schemas
Location = /schemas/
}

styles {
Path = ../styles
Path = /etc/mtconnect/styles
Location = /styles/
}

Favicon {
Path = ../styles/favicon.ico
Path = /etc/mtconnect/styles/favicon.ico
Location = /favicon.ico
}
}
Expand Down
95 changes: 47 additions & 48 deletions examples/docker/config.system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ system:
ShdrMessage p+`_alarm` `UNAVAILABLE`;
## conditions ##
ShdrConditionNormal p+`_alm_all` null null;
ShdrConditionNormal p+`_alm_comms` null null;
ShdrConditionNormal p+`_alm_logic` null null;
ShdrConditionNormal p+`_alm_motion` null null;
ShdrConditionNormal p+`_alm_system` null null;
ShdrConditionNormal p+`_alm_axes` null null;
ShdrConditionNormal p+`_alm_spindles` null null;
ShdrConditionNormal p+`_alm_all` null null;
else;
## variables ##
m = array.map data.alarms `message`;
Expand Down Expand Up @@ -440,73 +440,68 @@ system:
ShdrConditionFaultIf p+`_alm_system` f_system null null;
ShdrConditionFaultIf p+`_alm_axes` f_axes null null;
ShdrConditionFaultIf p+`_alm_spindles` f_spindles null null;
ShdrConditionFaultIf p+`_alm_all` ((data.alarms | array.size) > 0) null null;
end;
l99.driver.fanuc.veneers.AlarmsSeriesStateful, fanuc: >-
## get path number ##
p = device+`_p`+observation.marker[0].number;
if (array.size data.alarms) == 0;
## events ##
ShdrMessage p+`_alarm` `UNAVAILABLE`;
## conditions ##
ShdrConditionNormal p+`_alm_all` null null;
ShdrConditionNormal p+`_alm_comms` null null;
ShdrConditionNormal p+`_alm_logic` null null;
ShdrConditionNormal p+`_alm_motion` null null;
ShdrConditionNormal p+`_alm_system` null null;
ShdrConditionNormal p+`_alm_axes` null null;
ShdrConditionNormal p+`_alm_spindles` null null;
else;
## functions ##
## filter alarms ##
func whereAlarmType (typeArray);
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
end;
## functions ##
## filter alarms of type ##
func whereAlarmType (typeArray);
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
end;
func whereAlarmNotType (typeArray);
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
end;
## filter alarms of not type ##
func whereAlarmNotType (typeArray);
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
end;
func whereAlarmHasAxis;
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
end;
## filter alarms that have an axis ##
func whereAlarmHasAxis;
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
end;
## process alarms ##
func setConditions (dataItem, alarmArray);
## process alarms ##
func setConditions (dataItem, alarmArray);
if (array.size alarmArray) > 0;
for alarm in alarmArray;
ShdrConditionFaultIf dataItem alarm.is_triggered alarm.id alarm.message;
end;
else;
ShdrConditionNormal dataItem null null;
end;
end;
## variables ##
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
triggeredMessages = array.map triggeredObjects `message`;
## variables ##
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
triggeredMessages = array.map triggeredObjects `message`;
## events ##
## events ##
if (array.size triggeredObjects) > 0;
ShdrMessage p+`_alarm` (array.join triggeredMessages `;`);
## conditions ##
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
setConditions p+`_alm_axes` whereAlarmHasAxis;
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
else;
ShdrMessage p+`_alarm` `UNAVAILABLE`;
end;
## conditions ##
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
setConditions p+`_alm_axes` whereAlarmHasAxis;
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
ShdrConditionFaultIf p+`_alm_all` ((triggeredObjects | array.size) > 0) null null;
l99.driver.fanuc.veneers.OpMsgs, fanuc: >-
## get path number ##
p = device+`_p`+observation.marker[0].number;
if (array.size data.messages) == 0;
## events ##
ShdrMessage p+`_message` `UNAVAILABLE`;
## events ##
if (array.size data.messages) > 0;
messages = array.map data.messages `message`;
ShdrMessage p+`_message` (array.join messages `;`);
else;
## variables ##
m = array.map data.messages `message`;
## events ##
ShdrMessage p+`_message` (array.join m `;`);
ShdrMessage p+`_message` `UNAVAILABLE`;
end;
l99.driver.fanuc.veneers.OpMsgsStateful, fanuc: >-
## get path number ##
Expand All @@ -521,7 +516,11 @@ system:
triggeredMessages = array.map triggeredObjects `message`;
## events ##
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
if (array.size triggeredObjects) > 0;
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
else;
ShdrMessage p+`_message` `UNAVAILABLE`;
end;
end;
l99.driver.fanuc.veneers.AxisData, fanuc: >-
## get path and axis name ##
Expand Down
2 changes: 1 addition & 1 deletion examples/windows/agent.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WorkerThreads = 1

Adapters {
Adapter_1 {
Device = *
Device = f_sim
Host = 127.0.0.1
Port = 7878
FilterDuplicates = true
Expand Down
2 changes: 1 addition & 1 deletion examples/windows/config.machines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ machines:
l99.driver.fanuc.collectors.Alarms, fanuc:
stateful: !!bool true
l99.driver.fanuc.collectors.Messages, fanuc:
stateful: !!bool false
stateful: !!bool true

##
## sparkplubg example
Expand Down
97 changes: 48 additions & 49 deletions examples/windows/config.system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ system:
ShdrMessage p+`_alarm` `UNAVAILABLE`;
## conditions ##
ShdrConditionNormal p+`_alm_all` null null;
ShdrConditionNormal p+`_alm_comms` null null;
ShdrConditionNormal p+`_alm_logic` null null;
ShdrConditionNormal p+`_alm_motion` null null;
ShdrConditionNormal p+`_alm_system` null null;
ShdrConditionNormal p+`_alm_axes` null null;
ShdrConditionNormal p+`_alm_spindles` null null;
ShdrConditionNormal p+`_alm_all` null null;
else;
## variables ##
m = array.map data.alarms `message`;
Expand Down Expand Up @@ -440,73 +440,68 @@ system:
ShdrConditionFaultIf p+`_alm_system` f_system null null;
ShdrConditionFaultIf p+`_alm_axes` f_axes null null;
ShdrConditionFaultIf p+`_alm_spindles` f_spindles null null;
ShdrConditionFaultIf p+`_alm_all` ((data.alarms | array.size) > 0) null null;
end;
l99.driver.fanuc.veneers.AlarmsSeriesStateful, fanuc: >-
## get path number ##
p = device+`_p`+observation.marker[0].number;
if (array.size data.alarms) == 0;
## events ##
ShdrMessage p+`_alarm` `UNAVAILABLE`;
## conditions ##
ShdrConditionNormal p+`_alm_all` null null;
ShdrConditionNormal p+`_alm_comms` null null;
ShdrConditionNormal p+`_alm_logic` null null;
ShdrConditionNormal p+`_alm_motion` null null;
ShdrConditionNormal p+`_alm_system` null null;
ShdrConditionNormal p+`_alm_axes` null null;
ShdrConditionNormal p+`_alm_spindles` null null;
else;
## functions ##
## filter alarms ##
func whereAlarmType (typeArray);
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
end;
## functions ##
## filter alarms of type ##
func whereAlarmType (typeArray);
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
end;
func whereAlarmNotType (typeArray);
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
end;
## filter alarms of not type ##
func whereAlarmNotType (typeArray);
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
end;
func whereAlarmHasAxis;
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
end;
## filter alarms that have an axis ##
func whereAlarmHasAxis;
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
end;
## process alarms ##
func setConditions (dataItem, alarmArray);
## process alarms ##
func setConditions (dataItem, alarmArray);
if (array.size alarmArray) > 0;
for alarm in alarmArray;
ShdrConditionFaultIf dataItem alarm.is_triggered alarm.id alarm.message;
end;
else;
ShdrConditionNormal dataItem null null;
end;
end;
## variables ##
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
triggeredMessages = array.map triggeredObjects `message`;
## variables ##
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
triggeredMessages = array.map triggeredObjects `message`;
## events ##
## events ##
if (array.size triggeredObjects) > 0;
ShdrMessage p+`_alarm` (array.join triggeredMessages `;`);
## conditions ##
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
setConditions p+`_alm_axes` whereAlarmHasAxis;
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
else;
ShdrMessage p+`_alarm` `UNAVAILABLE`;
end;
## conditions ##
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
setConditions p+`_alm_axes` whereAlarmHasAxis;
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
ShdrConditionFaultIf p+`_alm_all` ((triggeredObjects | array.size) > 0) null null;
l99.driver.fanuc.veneers.OpMsgs, fanuc: >-
## get path number ##
p = device+`_p`+observation.marker[0].number;
if (array.size data.messages) == 0;
## events ##
ShdrMessage p+`_message` `UNAVAILABLE`;
else;
## variables ##
m = array.map data.messages `message`;
## events ##
ShdrMessage p+`_message` (array.join m `;`);
## events ##
if (array.size data.messages) > 0;
messages = array.map data.messages `message`;
ShdrMessage p+`_message` (array.join messages `;`);
else;
ShdrMessage p+`_message` `UNAVAILABLE`;
end;
l99.driver.fanuc.veneers.OpMsgsStateful, fanuc: >-
## get path number ##
Expand All @@ -521,7 +516,11 @@ system:
triggeredMessages = array.map triggeredObjects `message`;
## events ##
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
if (array.size triggeredObjects) > 0;
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
else;
ShdrMessage p+`_message` `UNAVAILABLE`;
end;
end;
l99.driver.fanuc.veneers.AxisData, fanuc: >-
## get path and axis name ##
Expand Down

0 comments on commit f905690

Please sign in to comment.