mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-22 18:26:30 +00:00
Merge pull request #15263 from gemu2015/scripter_update
fix swb(), goole charts time axis
This commit is contained in:
commit
c66c67aa6b
@ -3983,7 +3983,6 @@ extern char *SML_GetSVal(uint32_t index);
|
|||||||
}
|
}
|
||||||
if (!strncmp(lp, "swb(", 4)) {
|
if (!strncmp(lp, "swb(", 4)) {
|
||||||
lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0);
|
lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0);
|
||||||
fvar = -1;
|
|
||||||
if (glob_script_mem.sp) {
|
if (glob_script_mem.sp) {
|
||||||
glob_script_mem.sp->write((uint8_t)fvar);
|
glob_script_mem.sp->write((uint8_t)fvar);
|
||||||
fvar = 0;
|
fvar = 0;
|
||||||
@ -8923,12 +8922,19 @@ exgc:
|
|||||||
|
|
||||||
int16_t divflg = 1;
|
int16_t divflg = 1;
|
||||||
int16_t todflg = -1;
|
int16_t todflg = -1;
|
||||||
|
uint8_t hmflg = 0;
|
||||||
if (!strncmp(label, "cnt", 3)) {
|
if (!strncmp(label, "cnt", 3)) {
|
||||||
char *cp = &label[3];
|
char *cp = &label[3];
|
||||||
|
if (*cp == 'h') {
|
||||||
|
hmflg = 1;
|
||||||
|
cp++;
|
||||||
|
}
|
||||||
//todflg=atoi(&label[3]);
|
//todflg=atoi(&label[3]);
|
||||||
todflg = strtol(cp, &cp, 10);
|
todflg = strtol(cp, &cp, 10);
|
||||||
|
if (!hmflg) {
|
||||||
if (todflg >= entries) todflg = entries - 1;
|
if (todflg >= entries) todflg = entries - 1;
|
||||||
if (todflg < 0) todflg = 0;
|
if (todflg < 0) todflg = 0;
|
||||||
|
}
|
||||||
if (*cp=='/') {
|
if (*cp=='/') {
|
||||||
cp++;
|
cp++;
|
||||||
divflg = strtol(cp, &cp, 10);
|
divflg = strtol(cp, &cp, 10);
|
||||||
@ -8957,9 +8963,15 @@ exgc:
|
|||||||
if (todflg >= 0) {
|
if (todflg >= 0) {
|
||||||
sprintf(lbl, "%d:%02d", todflg / divflg, (todflg % divflg) * (60 / divflg) );
|
sprintf(lbl, "%d:%02d", todflg / divflg, (todflg % divflg) * (60 / divflg) );
|
||||||
todflg++;
|
todflg++;
|
||||||
|
if (hmflg == 0) {
|
||||||
if (todflg >= entries) {
|
if (todflg >= entries) {
|
||||||
todflg = 0;
|
todflg = 0;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ((todflg / divflg) >= 24) {
|
||||||
|
todflg = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (todflg == -1) {
|
if (todflg == -1) {
|
||||||
GetTextIndexed(lbl, sizeof(lbl), aind / divflg, label);
|
GetTextIndexed(lbl, sizeof(lbl), aind / divflg, label);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user