hb offline not so eager
This commit is contained in:
parent
c33f2b8f0c
commit
c185b895a6
@ -36,10 +36,15 @@ public class Calc {
|
|||||||
expression = parser.parseExpression(ruleExpression);
|
expression = parser.parseExpression(ruleExpression);
|
||||||
rs = expression.getValue(stdContext, String.class);
|
rs = expression.getValue(stdContext, String.class);
|
||||||
System.out.println(rs);
|
System.out.println(rs);
|
||||||
ruleExpression = "#totalPower * 0.03";
|
ruleExpression = "#totalPower - (0.03% * 2%)";
|
||||||
expression = parser.parseExpression(ruleExpression);
|
// expression = parser.parseExpression(ruleExpression);
|
||||||
rs = expression.getValue(stdContext, String.class);
|
// rs = expression.getValue(stdContext, String.class);
|
||||||
System.out.println(rs);
|
// System.out.println(rs);
|
||||||
|
String[] split = ruleExpression.split("[()*/\\-+?]");
|
||||||
|
for (String splitValue : split) {
|
||||||
|
System.out.println(splitValue);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void test(String s, double x) {
|
private static void test(String s, double x) {
|
||||||
@ -254,7 +259,7 @@ class Parser extends Object {
|
|||||||
*/
|
*/
|
||||||
enum Symbol {
|
enum Symbol {
|
||||||
PLUS('+'), MINUS('-'), STAR('*'), SLASH('/'),
|
PLUS('+'), MINUS('-'), STAR('*'), SLASH('/'),
|
||||||
OPEN('('), CLOSE(')'), COMMA(','),
|
OPEN('('), CLOSE(')'), COMMA(','), PERCENT('%'),
|
||||||
END(StreamTokenizer.TT_EOF),
|
END(StreamTokenizer.TT_EOF),
|
||||||
WORD(StreamTokenizer.TT_WORD),
|
WORD(StreamTokenizer.TT_WORD),
|
||||||
NUMBER(StreamTokenizer.TT_NUMBER);
|
NUMBER(StreamTokenizer.TT_NUMBER);
|
||||||
|
|||||||
@ -34,6 +34,7 @@ public class HBCheckTask {
|
|||||||
Long hbtime = (Long) cacheGun.get("hbtime");
|
Long hbtime = (Long) cacheGun.get("hbtime");
|
||||||
hbtime = hbtime == null ? 0 : hbtime;
|
hbtime = hbtime == null ? 0 : hbtime;
|
||||||
if ((now - hbtime) > 75000) {
|
if ((now - hbtime) > 75000) {
|
||||||
|
if (!DISCONNECTED.equals(cacheGun.get("status"))) {
|
||||||
cacheGun.put("statusInt", OFF_LINE);
|
cacheGun.put("statusInt", OFF_LINE);
|
||||||
cacheGun.put("status", DISCONNECTED);
|
cacheGun.put("status", DISCONNECTED);
|
||||||
REDIS.setCacheMap(gunkey, cacheGun);
|
REDIS.setCacheMap(gunkey, cacheGun);
|
||||||
@ -49,5 +50,6 @@ public class HBCheckTask {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user