Lines Matching refs:agd
132 static void agdReset(struct AccelGoodData *agd) {
133 agd->nx = agd->nxb = 0;
134 agd->ny = agd->nyb = 0;
135 agd->nz = agd->nzb = 0;
136 agd->nle = 0;
137 agd->acc_t = agd->acc_tt = 0;
138 agd->e_x = agd->e_y = agd->e_z = 0;
142 static void accelGoodDataInit(struct AccelGoodData *agd, uint32_t fx,
145 memset(agd, 0, sizeof(struct AccelGoodData));
146 agd->nfx = fx;
147 agd->nfxb = fxb;
148 agd->nfy = fy;
149 agd->nfyb = fyb;
150 agd->nfz = fz;
151 agd->nfzb = fzb;
152 agd->nfle = fle;
153 agd->var_t = 0;
154 agd->mean_t = 0;
161 accelGoodDataInit(&acc->agd, fx, fxb, fy, fyb, fz, fzb, fle);
303 if (PHI < asd->mean_x && ac1->agd.nx < ac1->agd.nfx) {
304 ac1->agd.nx += 1;
305 ac1->agd.acc_t += temp;
306 ac1->agd.acc_tt += temp * temp;
310 if (PHIb > asd->mean_x && ac1->agd.nxb < ac1->agd.nfxb) {
311 ac1->agd.nxb += 1;
312 ac1->agd.acc_t += temp;
313 ac1->agd.acc_tt += temp * temp;
317 if (PHI < asd->mean_y && ac1->agd.ny < ac1->agd.nfy) {
318 ac1->agd.ny += 1;
319 ac1->agd.acc_t += temp;
320 ac1->agd.acc_tt += temp * temp;
324 if (PHIb > asd->mean_y && ac1->agd.nyb < ac1->agd.nfyb) {
325 ac1->agd.nyb += 1;
326 ac1->agd.acc_t += temp;
327 ac1->agd.acc_tt += temp * temp;
331 if (PHIZ < asd->mean_z && ac1->agd.nz < ac1->agd.nfz) {
332 ac1->agd.nz += 1;
333 ac1->agd.acc_t += temp;
334 ac1->agd.acc_tt += temp * temp;
338 if (PHIZb > asd->mean_z && ac1->agd.nzb < ac1->agd.nfzb) {
339 ac1->agd.nzb += 1;
340 ac1->agd.acc_t += temp;
341 ac1->agd.acc_tt += temp * temp;
347 ac1->agd.nle < ac1->agd.nfle) {
348 ac1->agd.nle += 1;
349 ac1->agd.acc_t += temp;
350 ac1->agd.acc_tt += temp * temp;
354 if (ac1->agd.nx == ac1->agd.nfx && ac1->agd.nxb == ac1->agd.nfxb &&
355 ac1->agd.ny == ac1->agd.nfy && ac1->agd.nyb == ac1->agd.nfyb &&
356 ac1->agd.nz == ac1->agd.nfz && ac1->agd.nzb == ac1->agd.nfzb) {
359 agdReset(&ac1->agd);
386 ac1->agd.var_t =
387 (ac1->agd.acc_tt - (ac1->agd.acc_t * ac1->agd.acc_t) * inv) * inv;
388 ac1->agd.mean_t = ac1->agd.acc_t * inv;
394 if (ac1->agd.nx > ac1->agd.nfx || ac1->agd.nxb > ac1->agd.nfxb ||
395 ac1->agd.ny > ac1->agd.nfy || ac1->agd.nyb > ac1->agd.nfyb ||
396 ac1->agd.nz > ac1->agd.nfz || ac1->agd.nzb > ac1->agd.nfzb) {
397 agdReset(&ac1->agd);
406 static int accEigenTest(struct KasaFit *akf, struct AccelGoodData *agd) {
434 agd->e_x = eigenvals.x;
435 agd->e_y = eigenvals.y;
436 agd->e_z = eigenvals.z;
533 &acc->ac1[temp_gate].agd)) {
538 acc->average_temperature_celsius = acc->ac1[temp_gate].agd.mean_t;
552 acc->adf.e_x[acc->adf.n_o] = acc->ac1[temp_gate].agd.e_x;
553 acc->adf.e_y[acc->adf.n_o] = acc->ac1[temp_gate].agd.e_y;
554 acc->adf.e_z[acc->adf.n_o] = acc->ac1[temp_gate].agd.e_z;
555 acc->adf.var_t[acc->adf.n_o] = acc->ac1[temp_gate].agd.var_t;
556 acc->adf.mean_t[acc->adf.n_o] = acc->ac1[temp_gate].agd.mean_t;
569 agdReset(&acc->ac1[temp_gate].agd);
752 (unsigned)acc->ac1[0].agd.nx, (unsigned)acc->ac1[0].agd.nxb,
753 (unsigned)acc->ac1[0].agd.ny, (unsigned)acc->ac1[0].agd.nyb,
754 (unsigned)acc->ac1[0].agd.nz, (unsigned)acc->ac1[0].agd.nzb,
755 (unsigned)acc->ac1[0].agd.nle, (unsigned)acc->ac1[0].akf.nsamples);
761 (unsigned)acc->ac1[1].agd.nx, (unsigned)acc->ac1[1].agd.nxb,
762 (unsigned)acc->ac1[1].agd.ny, (unsigned)acc->ac1[1].agd.nyb,
763 (unsigned)acc->ac1[1].agd.nz, (unsigned)acc->ac1[1].agd.nzb,
764 (unsigned)acc->ac1[1].agd.nle, (unsigned)acc->ac1[1].akf.nsamples);