Skip to content

Commit f905690

Browse files
committed
* clean up configurations
1 parent 2f7bb1c commit f905690

File tree

5 files changed

+101
-103
lines changed

5 files changed

+101
-103
lines changed

examples/docker/agent.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WorkerThreads = 1
1919

2020
Adapters {
2121
Adapter_1 {
22-
Device = *
22+
Device = f_sim
2323
Host = fanuc_driver
2424
Port = 7878
2525
FilterDuplicates = true
@@ -42,17 +42,17 @@ Ruby {
4242

4343
Files {
4444
schemas {
45-
Path = ../schemas
45+
Path = /etc/mtconnect/schemas
4646
Location = /schemas/
4747
}
4848

4949
styles {
50-
Path = ../styles
50+
Path = /etc/mtconnect/styles
5151
Location = /styles/
5252
}
5353

5454
Favicon {
55-
Path = ../styles/favicon.ico
55+
Path = /etc/mtconnect/styles/favicon.ico
5656
Location = /favicon.ico
5757
}
5858
}

examples/docker/config.system.yml

Lines changed: 47 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,13 @@ system:
406406
ShdrMessage p+`_alarm` `UNAVAILABLE`;
407407
408408
## conditions ##
409-
ShdrConditionNormal p+`_alm_all` null null;
410409
ShdrConditionNormal p+`_alm_comms` null null;
411410
ShdrConditionNormal p+`_alm_logic` null null;
412411
ShdrConditionNormal p+`_alm_motion` null null;
413412
ShdrConditionNormal p+`_alm_system` null null;
414413
ShdrConditionNormal p+`_alm_axes` null null;
415414
ShdrConditionNormal p+`_alm_spindles` null null;
415+
ShdrConditionNormal p+`_alm_all` null null;
416416
else;
417417
## variables ##
418418
m = array.map data.alarms `message`;
@@ -440,73 +440,68 @@ system:
440440
ShdrConditionFaultIf p+`_alm_system` f_system null null;
441441
ShdrConditionFaultIf p+`_alm_axes` f_axes null null;
442442
ShdrConditionFaultIf p+`_alm_spindles` f_spindles null null;
443+
ShdrConditionFaultIf p+`_alm_all` ((data.alarms | array.size) > 0) null null;
443444
end;
444445
l99.driver.fanuc.veneers.AlarmsSeriesStateful, fanuc: >-
445446
## get path number ##
446447
p = device+`_p`+observation.marker[0].number;
447448
448-
if (array.size data.alarms) == 0;
449-
## events ##
450-
ShdrMessage p+`_alarm` `UNAVAILABLE`;
451-
452-
## conditions ##
453-
ShdrConditionNormal p+`_alm_all` null null;
454-
ShdrConditionNormal p+`_alm_comms` null null;
455-
ShdrConditionNormal p+`_alm_logic` null null;
456-
ShdrConditionNormal p+`_alm_motion` null null;
457-
ShdrConditionNormal p+`_alm_system` null null;
458-
ShdrConditionNormal p+`_alm_axes` null null;
459-
ShdrConditionNormal p+`_alm_spindles` null null;
460-
else;
461-
## functions ##
462-
## filter alarms ##
463-
func whereAlarmType (typeArray);
464-
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
465-
end;
449+
## functions ##
450+
## filter alarms of type ##
451+
func whereAlarmType (typeArray);
452+
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
453+
end;
466454
467-
func whereAlarmNotType (typeArray);
468-
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
469-
end;
455+
## filter alarms of not type ##
456+
func whereAlarmNotType (typeArray);
457+
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
458+
end;
470459
471-
func whereAlarmHasAxis;
472-
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
473-
end;
460+
## filter alarms that have an axis ##
461+
func whereAlarmHasAxis;
462+
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
463+
end;
474464
475-
## process alarms ##
476-
func setConditions (dataItem, alarmArray);
465+
## process alarms ##
466+
func setConditions (dataItem, alarmArray);
467+
if (array.size alarmArray) > 0;
477468
for alarm in alarmArray;
478469
ShdrConditionFaultIf dataItem alarm.is_triggered alarm.id alarm.message;
479470
end;
471+
else;
472+
ShdrConditionNormal dataItem null null;
480473
end;
474+
end;
481475
482-
## variables ##
483-
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
484-
triggeredMessages = array.map triggeredObjects `message`;
476+
## variables ##
477+
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
478+
triggeredMessages = array.map triggeredObjects `message`;
485479
486-
## events ##
480+
## events ##
481+
if (array.size triggeredObjects) > 0;
487482
ShdrMessage p+`_alarm` (array.join triggeredMessages `;`);
488-
489-
## conditions ##
490-
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
491-
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
492-
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
493-
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
494-
setConditions p+`_alm_axes` whereAlarmHasAxis;
495-
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
483+
else;
484+
ShdrMessage p+`_alarm` `UNAVAILABLE`;
496485
end;
486+
487+
## conditions ##
488+
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
489+
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
490+
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
491+
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
492+
setConditions p+`_alm_axes` whereAlarmHasAxis;
493+
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
494+
ShdrConditionFaultIf p+`_alm_all` ((triggeredObjects | array.size) > 0) null null;
497495
l99.driver.fanuc.veneers.OpMsgs, fanuc: >-
498496
## get path number ##
499497
p = device+`_p`+observation.marker[0].number;
500498
501-
if (array.size data.messages) == 0;
502-
## events ##
503-
ShdrMessage p+`_message` `UNAVAILABLE`;
499+
## events ##
500+
if (array.size data.messages) > 0;
501+
messages = array.map data.messages `message`;
502+
ShdrMessage p+`_message` (array.join messages `;`);
504503
else;
505-
## variables ##
506-
m = array.map data.messages `message`;
507-
508-
## events ##
509-
ShdrMessage p+`_message` (array.join m `;`);
504+
ShdrMessage p+`_message` `UNAVAILABLE`;
510505
end;
511506
l99.driver.fanuc.veneers.OpMsgsStateful, fanuc: >-
512507
## get path number ##
@@ -521,7 +516,11 @@ system:
521516
triggeredMessages = array.map triggeredObjects `message`;
522517
523518
## events ##
524-
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
519+
if (array.size triggeredObjects) > 0;
520+
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
521+
else;
522+
ShdrMessage p+`_message` `UNAVAILABLE`;
523+
end;
525524
end;
526525
l99.driver.fanuc.veneers.AxisData, fanuc: >-
527526
## get path and axis name ##

examples/windows/agent.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ WorkerThreads = 1
1919

2020
Adapters {
2121
Adapter_1 {
22-
Device = *
22+
Device = f_sim
2323
Host = 127.0.0.1
2424
Port = 7878
2525
FilterDuplicates = true

examples/windows/config.machines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ machines:
253253
l99.driver.fanuc.collectors.Alarms, fanuc:
254254
stateful: !!bool true
255255
l99.driver.fanuc.collectors.Messages, fanuc:
256-
stateful: !!bool false
256+
stateful: !!bool true
257257

258258
##
259259
## sparkplubg example

examples/windows/config.system.yml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,13 @@ system:
406406
ShdrMessage p+`_alarm` `UNAVAILABLE`;
407407
408408
## conditions ##
409-
ShdrConditionNormal p+`_alm_all` null null;
410409
ShdrConditionNormal p+`_alm_comms` null null;
411410
ShdrConditionNormal p+`_alm_logic` null null;
412411
ShdrConditionNormal p+`_alm_motion` null null;
413412
ShdrConditionNormal p+`_alm_system` null null;
414413
ShdrConditionNormal p+`_alm_axes` null null;
415414
ShdrConditionNormal p+`_alm_spindles` null null;
415+
ShdrConditionNormal p+`_alm_all` null null;
416416
else;
417417
## variables ##
418418
m = array.map data.alarms `message`;
@@ -440,73 +440,68 @@ system:
440440
ShdrConditionFaultIf p+`_alm_system` f_system null null;
441441
ShdrConditionFaultIf p+`_alm_axes` f_axes null null;
442442
ShdrConditionFaultIf p+`_alm_spindles` f_spindles null null;
443+
ShdrConditionFaultIf p+`_alm_all` ((data.alarms | array.size) > 0) null null;
443444
end;
444445
l99.driver.fanuc.veneers.AlarmsSeriesStateful, fanuc: >-
445446
## get path number ##
446447
p = device+`_p`+observation.marker[0].number;
447448
448-
if (array.size data.alarms) == 0;
449-
## events ##
450-
ShdrMessage p+`_alarm` `UNAVAILABLE`;
451-
452-
## conditions ##
453-
ShdrConditionNormal p+`_alm_all` null null;
454-
ShdrConditionNormal p+`_alm_comms` null null;
455-
ShdrConditionNormal p+`_alm_logic` null null;
456-
ShdrConditionNormal p+`_alm_motion` null null;
457-
ShdrConditionNormal p+`_alm_system` null null;
458-
ShdrConditionNormal p+`_alm_axes` null null;
459-
ShdrConditionNormal p+`_alm_spindles` null null;
460-
else;
461-
## functions ##
462-
## filter alarms ##
463-
func whereAlarmType (typeArray);
464-
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
465-
end;
449+
## functions ##
450+
## filter alarms of type ##
451+
func whereAlarmType (typeArray);
452+
ret array.filter data.alarms @(do; ret array.contains typeArray $0.type; end);
453+
end;
466454
467-
func whereAlarmNotType (typeArray);
468-
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
469-
end;
455+
## filter alarms of not type ##
456+
func whereAlarmNotType (typeArray);
457+
ret array.filter data.alarms @(do; ret !array.contains typeArray $0.type; end);
458+
end;
470459
471-
func whereAlarmHasAxis;
472-
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
473-
end;
460+
## filter alarms that have an axis ##
461+
func whereAlarmHasAxis;
462+
ret array.filter data.alarms @(do; ret $0.axis_code > 0; end);
463+
end;
474464
475-
## process alarms ##
476-
func setConditions (dataItem, alarmArray);
465+
## process alarms ##
466+
func setConditions (dataItem, alarmArray);
467+
if (array.size alarmArray) > 0;
477468
for alarm in alarmArray;
478469
ShdrConditionFaultIf dataItem alarm.is_triggered alarm.id alarm.message;
479470
end;
471+
else;
472+
ShdrConditionNormal dataItem null null;
480473
end;
474+
end;
481475
482-
## variables ##
483-
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
484-
triggeredMessages = array.map triggeredObjects `message`;
476+
## variables ##
477+
triggeredObjects = array.filter data.alarms @(do; ret $0.is_triggered; end);
478+
triggeredMessages = array.map triggeredObjects `message`;
485479
486-
## events ##
480+
## events ##
481+
if (array.size triggeredObjects) > 0;
487482
ShdrMessage p+`_alarm` (array.join triggeredMessages `;`);
488-
489-
## conditions ##
490-
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
491-
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
492-
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
493-
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
494-
setConditions p+`_alm_axes` whereAlarmHasAxis;
495-
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
483+
else;
484+
ShdrMessage p+`_alarm` `UNAVAILABLE`;
496485
end;
486+
487+
## conditions ##
488+
setConditions p+`_alm_comms` (whereAlarmType [`IO`,`SR`]);
489+
setConditions p+`_alm_logic` (whereAlarmType [`SW`,`PC`]);
490+
setConditions p+`_alm_motion` (whereAlarmType [`PS`,`MC`,`BG`]);
491+
setConditions p+`_alm_system` (whereAlarmNotType [`IO`,`SR`,`SW`,`PC`,`PS`,`MC`,`BG`,`SP`]);
492+
setConditions p+`_alm_axes` whereAlarmHasAxis;
493+
setConditions p+`_alm_spindles` (whereAlarmType [`SP`]);
494+
ShdrConditionFaultIf p+`_alm_all` ((triggeredObjects | array.size) > 0) null null;
497495
l99.driver.fanuc.veneers.OpMsgs, fanuc: >-
498496
## get path number ##
499497
p = device+`_p`+observation.marker[0].number;
500-
501-
if (array.size data.messages) == 0;
502-
## events ##
503-
ShdrMessage p+`_message` `UNAVAILABLE`;
504-
else;
505-
## variables ##
506-
m = array.map data.messages `message`;
507498
508-
## events ##
509-
ShdrMessage p+`_message` (array.join m `;`);
499+
## events ##
500+
if (array.size data.messages) > 0;
501+
messages = array.map data.messages `message`;
502+
ShdrMessage p+`_message` (array.join messages `;`);
503+
else;
504+
ShdrMessage p+`_message` `UNAVAILABLE`;
510505
end;
511506
l99.driver.fanuc.veneers.OpMsgsStateful, fanuc: >-
512507
## get path number ##
@@ -521,7 +516,11 @@ system:
521516
triggeredMessages = array.map triggeredObjects `message`;
522517
523518
## events ##
524-
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
519+
if (array.size triggeredObjects) > 0;
520+
ShdrMessage p+`_message` (array.join triggeredMessages `;`);
521+
else;
522+
ShdrMessage p+`_message` `UNAVAILABLE`;
523+
end;
525524
end;
526525
l99.driver.fanuc.veneers.AxisData, fanuc: >-
527526
## get path and axis name ##

0 commit comments

Comments
 (0)