zmiana w modb_orno3.c i dodanie skryptu usuniecie_pola_highfluct.sh
This commit is contained in:
30
modb_orno3.c
30
modb_orno3.c
@@ -348,25 +348,21 @@ int influx_send_orno_batch(s_voltage *v, int v_ok, s_current *i, int i_ok,
|
||||
char batch[1024];
|
||||
int offset = 0;
|
||||
|
||||
if (v_ok) {
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"orno,device=orno,pomiar=voltage L1=%.2f,L2=%.2f,L3=%.2f\n", v->U1, v->U2, v->U3);
|
||||
}
|
||||
if (i_ok) {
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"orno,device=orno,pomiar=current L1=%.2f,L2=%.2f,L3=%.2f\n", i->I1, i->I2, i->I3);
|
||||
}
|
||||
if (p_ok) {
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"orno,device=orno,pomiar=power total=%.3f,L1=%.3f,L2=%.3f,L3=%.3f\n", p->P_Tot, p->P1, p->P2, p->P3);
|
||||
}
|
||||
if (w_ok) {
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"orno,device=orno,pomiar=energy total=%.3f,L1=%.3f,L2=%.3f,L3=%.3f\n", w->W_Tot, w->W1, w->W2, w->W3);
|
||||
}
|
||||
/* Line protocol format: measurement,tag=value field=value ... */
|
||||
/* New format groups data by phase with U, I, P, W fields */
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"energydb,device=orno,phase=L1 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
|
||||
"energydb,device=orno,phase=L2 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
|
||||
"energydb,device=orno,phase=L3 U=%.2f,I=%.2f,P=%.2f,W=%.2f\n"
|
||||
"energydb,device=orno,phase=total P=%.2f,W=%.2f\n",
|
||||
v->U1, i->I1, p->P1, w->W1,
|
||||
v->U2, i->I2, p->P2, w->W2,
|
||||
v->U3, i->I3, p->P3, w->W3,
|
||||
p->P_Tot, w->W_Tot);
|
||||
|
||||
if (f_ok) {
|
||||
offset += snprintf(batch + offset, sizeof(batch) - offset,
|
||||
"orno,device=orno,pomiar=frequency frequency=%.4f\n", f->Freq);
|
||||
"energydb,device=orno,frequency=Hz value=%.4f\n", f->Freq);
|
||||
}
|
||||
|
||||
if (offset == 0) return 0;
|
||||
|
||||
1
usuniecie_pola_highfluct.sh
Normal file
1
usuniecie_pola_highfluct.sh
Normal file
@@ -0,0 +1 @@
|
||||
influx delete --host "http://localhost:5086" --org "sic" --bucket "energydb" --token "BCIZ6kcCAVgpcwSfU0PBS7m0Zb6an93kuOtizbEtlXub-uaoYp4dmIQBQYaJCv8_KE4QYYZ08jxtpaZ3TUWP-Q==" --start 1970-01-01T00:00:00Z --stop $(date -u +"%Y-%m-%dT%H:%M:%SZ") --predicate '_fields="highfluct"'
|
||||
Reference in New Issue
Block a user