Skip to content
Snippets Groups Projects
Commit f3d99362 authored by René Schöne's avatar René Schöne
Browse files

finished renaming

parent a4d93663
No related branches found
No related tags found
1 merge request!11Resolve "Add processing frequency option for items"
Pipeline #9861 passed
...@@ -87,7 +87,7 @@ Comment = "//" [^\n\r]+ ...@@ -87,7 +87,7 @@ Comment = "//" [^\n\r]+
"incoming" { return sym(Terminals.INCOMING); } "incoming" { return sym(Terminals.INCOMING); }
"items" { return sym(Terminals.ITEMS); } "items" { return sym(Terminals.ITEMS); }
"itemType" { return sym(Terminals.ITEM_TYPE); } "itemType" { return sym(Terminals.ITEM_TYPE); }
"FrequencySetting" { return sym(Terminals.ITEM_PERFORMANCE); } "FrequencySetting" { return sym(Terminals.FREQUENCY_SETTING); }
"performance" { return sym(Terminals.PERFORMANCE); } "performance" { return sym(Terminals.PERFORMANCE); }
"procFreq" { return sym(Terminals.PROCESS_FREQUENCY); } "procFreq" { return sym(Terminals.PROCESS_FREQUENCY); }
"label" { return sym(Terminals.LABEL); } "label" { return sym(Terminals.LABEL); }
......
...@@ -41,7 +41,7 @@ Root goal = ...@@ -41,7 +41,7 @@ Root goal =
| influx_root.ir goal.r {: r.setInfluxRoot(ir); return r; :} | influx_root.ir goal.r {: r.setInfluxRoot(ir); return r; :}
| machine_learning_root.ml goal.r {: r.setMachineLearningRoot(ml); return r; :} | machine_learning_root.ml goal.r {: r.setMachineLearningRoot(ml); return r; :}
| rule.rule goal.r {: r.addRule(rule); return r; :} | rule.rule goal.r {: r.addRule(rule); return r; :}
| item_performance.ip goal.r {: r.addFrequencySetting(ip); return r; :} | frequency_setting.ip goal.r {: r.addFrequencySetting(ip); return r; :}
| thing.t {: return eph.createRoot(t); :} | thing.t {: return eph.createRoot(t); :}
| item.i {: return eph.createRoot(); :} | item.i {: return eph.createRoot(); :}
| group.g {: return eph.createRoot(g); :} | group.g {: return eph.createRoot(g); :}
...@@ -54,7 +54,7 @@ Root goal = ...@@ -54,7 +54,7 @@ Root goal =
| influx_root.ir {: return eph.createRoot(ir); :} | influx_root.ir {: return eph.createRoot(ir); :}
| machine_learning_root.ml {: return eph.createRoot(ml); :} | machine_learning_root.ml {: return eph.createRoot(ml); :}
| rule.rule {: return eph.createRoot(rule); :} | rule.rule {: return eph.createRoot(rule); :}
| item_performance.ip {: return eph.createRoot(ip); :} | frequency_setting.ip {: return eph.createRoot(ip); :}
; ;
%left RB_ROUND; %left RB_ROUND;
...@@ -137,14 +137,14 @@ Item item_body = ...@@ -137,14 +137,14 @@ Item item_body =
| STATE EQUALS TEXT.n item_body.i {: i.setStateFromString(n); return i; :} | STATE EQUALS TEXT.n item_body.i {: i.setStateFromString(n); return i; :}
| TOPIC EQUALS TEXT.n item_body.i {: return eph.setTopic(i, n); :} | TOPIC EQUALS TEXT.n item_body.i {: return eph.setTopic(i, n); :}
| CATEGORY EQUALS TEXT.n item_body.i {: return eph.setCategory(i, n); :} | CATEGORY EQUALS TEXT.n item_body.i {: return eph.setCategory(i, n); :}
| PERFORMANCE EQUALS item_performance_ref.ip item_body.i {: i.setFrequencySetting(ip); return i; :} | PERFORMANCE EQUALS frequency_setting_ref.ip item_body.i {: i.setFrequencySetting(ip); return i; :}
| META_DATA EQUALS string_map.md item_body.i | META_DATA EQUALS string_map.md item_body.i
{: return eph.setMetaData(i, md); :} {: return eph.setMetaData(i, md); :}
| {: return eph.createItem(); :} | {: return eph.createItem(); :}
; ;
Item item_ref = TEXT.n {: return Item.createRef(n); :}; Item item_ref = TEXT.n {: return Item.createRef(n); :};
FrequencySetting item_performance_ref = TEXT.n {: return FrequencySetting.createRef(n); :}; FrequencySetting frequency_setting_ref = TEXT.n {: return FrequencySetting.createRef(n); :};
Group group = Group group =
GROUP COLON group_body.gb SEMICOLON {: return gb; :} GROUP COLON group_body.gb SEMICOLON {: return gb; :}
...@@ -160,7 +160,7 @@ Group group_body = ...@@ -160,7 +160,7 @@ Group group_body =
| AGGREGATION EQUALS TEXT.n group_body.g {: return eph.setSimpleAggregationFunction(g, n); :} | AGGREGATION EQUALS TEXT.n group_body.g {: return eph.setSimpleAggregationFunction(g, n); :}
| AGGREGATION EQUALS TEXT.n round_string_list.params group_body.g | AGGREGATION EQUALS TEXT.n round_string_list.params group_body.g
{: return eph.setParameterizedAggregationFunction(g, n, params); :} {: return eph.setParameterizedAggregationFunction(g, n, params); :}
| PERFORMANCE EQUALS item_performance_ref.ip group_body.g {: g.setFrequencySetting(ip); return g; :} | PERFORMANCE EQUALS frequency_setting_ref.ip group_body.g {: g.setFrequencySetting(ip); return g; :}
| {: return new Group(); :} | {: return new Group(); :}
; ;
...@@ -369,13 +369,13 @@ IntegerKeyMap integer_map_body = ...@@ -369,13 +369,13 @@ IntegerKeyMap integer_map_body =
:} :}
; ;
FrequencySetting item_performance = FrequencySetting frequency_setting =
ITEM_PERFORMANCE COLON item_performance_body.ipb SEMICOLON {: return ipb; :} FREQUENCY_SETTING COLON frequency_setting_body.ipb SEMICOLON {: return ipb; :}
; ;
// FrequencySetting: id="" procFreq="" persFreq=""; // FrequencySetting: id="" procFreq="" persFreq="";
FrequencySetting item_performance_body = FrequencySetting frequency_setting_body =
ID EQUALS TEXT.n item_performance_body.ip {: return eph.setID(ip, n); :} ID EQUALS TEXT.n frequency_setting_body.ip {: return eph.setID(ip, n); :}
| PROCESS_FREQUENCY EQUALS TEXT.n item_performance_body.ip {: ip.setEventProcessingFrequency(Double.parseDouble(n)); return ip; :} | PROCESS_FREQUENCY EQUALS TEXT.n frequency_setting_body.ip {: ip.setEventProcessingFrequency(Double.parseDouble(n)); return ip; :}
| {: return new FrequencySetting(); :} | {: return new FrequencySetting(); :}
; ;
...@@ -917,14 +917,14 @@ public class RulesTest { ...@@ -917,14 +917,14 @@ public class RulesTest {
} }
@Test @Test
public void testItemPerformance() { public void testFrequencySetting() {
TestUtils.ModelAndItem mai = createModelAndItem(0); TestUtils.ModelAndItem mai = createModelAndItem(0);
NumberItem numberItem = mai.item; NumberItem numberItem = mai.item;
ItemPerformance itemPerformance = new ItemPerformance(); FrequencySetting itemPerformance = new FrequencySetting();
itemPerformance.setEventProcessingFrequency(10); itemPerformance.setEventProcessingFrequency(10);
numberItem.setItemPerformance(itemPerformance); numberItem.setFrequencySetting(itemPerformance);
Rule rule = new Rule(); Rule rule = new Rule();
CountingAction counter = new CountingAction(); CountingAction counter = new CountingAction();
...@@ -932,15 +932,15 @@ public class RulesTest { ...@@ -932,15 +932,15 @@ public class RulesTest {
rule.activateFor(numberItem); rule.activateFor(numberItem);
numberItem.setState(1); numberItem.setState(1);
numberItem.setState(2); numberItem.setState(2);
assertEquals(1, counter.get(numberItem), "Action was triggered although ItemPerformance too small"); assertEquals(1, counter.get(numberItem), "Action was triggered although FrequencySetting too small");
counter.reset(); counter.reset();
waitMillis(100); waitMillis(100);
numberItem.setState(3); numberItem.setState(3);
assertEquals(1, counter.get(numberItem), "Action wasn't triggered although frequency ItemPerformance is small enough"); assertEquals(1, counter.get(numberItem), "Action wasn't triggered although frequency FrequencySetting is small enough");
counter.reset(); counter.reset();
numberItem.setState(4); numberItem.setState(4);
numberItem.setState(5); numberItem.setState(5);
assertEquals(0, counter.get(numberItem), "Action was triggered although ItemPerformance too small"); assertEquals(0, counter.get(numberItem), "Action was triggered although FrequencySetting too small");
counter.reset(); counter.reset();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment